OpenVDB 14.0.0
Loading...
Searching...
No Matches
BaseBBox< Vec3T > Struct Template Reference

Common base for floating-point and integer bounding boxes; not constructible directly (only as a base of BBox). More...

#include <nanovdb/math/Math.h>

Public Member Functions

__hostdev__ constexpr bool operator== (const BaseBBox &rhs) const noexcept
 Equality on the two corner points.
__hostdev__ constexpr bool operator!= (const BaseBBox &rhs) const noexcept
 Inequality on the two corner points.
__hostdev__ constexpr const Vec3T & operator[] (int i) const noexcept
 Indexed corner access: i = 0 returns min, i = 1 returns max.
__hostdev__ constexpr Vec3T & operator[] (int i) noexcept
 Mutable variant of operator[].
__hostdev__ constexpr Vec3T & min () noexcept
 Mutable accessor for the min corner.
__hostdev__ constexpr Vec3T & max () noexcept
 Mutable accessor for the max corner.
__hostdev__ constexpr const Vec3T & min () const noexcept
 Const accessor for the min corner.
__hostdev__ constexpr const Vec3T & max () const noexcept
 Const accessor for the max corner.
__hostdev__ constexpr BaseBBox & translate (const Vec3T &xyz) noexcept
 Translate (rigid-shift) both corners by xyz; return *this.
__hostdev__ constexpr BaseBBox & expand (const Vec3T &xyz) noexcept
 Expand this bounding box to enclose point xyz.
__hostdev__ constexpr BaseBBox & expand (const BaseBBox &bbox) noexcept
 Expand this bounding box to enclose the given bounding box.
__hostdev__ constexpr BaseBBox & intersect (const BaseBBox &bbox) noexcept
 Intersect this bounding box with the given bounding box.
__hostdev__ constexpr bool isInside (const Vec3T &xyz) const noexcept
 Return true iff xyz lies in the closed box (each component satisfies min[i] <= xyz[i] <= max[i]).

Public Attributes

Vec3T mCoord [2]

Protected Member Functions

__hostdev__ constexpr BaseBBox () noexcept
 Default-construct (leaves corners uninitialized — derived classes supply a meaningful default).
__hostdev__ constexpr BaseBBox (const Vec3T &min, const Vec3T &max) noexcept
 Construct from min and max corners directly.

Detailed Description

template<typename Vec3T>
struct nanovdb::math::BaseBBox< Vec3T >

Common base for floating-point and integer bounding boxes; not constructible directly (only as a base of BBox).

Stores the closed-segment endpoints mCoord[0] (min corner) and mCoord[1] (max corner). Whether the box is "min-inclusive max-inclusive" or "min-inclusive max-exclusive" depends on the derived BBox specialization (integer vs floating point).

Constructor & Destructor Documentation

◆ BaseBBox() [1/2]

template<typename Vec3T>
__hostdev__ constexpr BaseBBox ( )
inlineconstexprprotectednoexcept

Default-construct (leaves corners uninitialized — derived classes supply a meaningful default).

◆ BaseBBox() [2/2]

template<typename Vec3T>
__hostdev__ constexpr BaseBBox ( const Vec3T & min,
const Vec3T & max )
inlineconstexprprotectednoexcept

Construct from min and max corners directly.

Member Function Documentation

◆ expand() [1/2]

template<typename Vec3T>
__hostdev__ constexpr BaseBBox & expand ( const BaseBBox< Vec3T > & bbox)
inlineconstexprnoexcept

Expand this bounding box to enclose the given bounding box.

◆ expand() [2/2]

template<typename Vec3T>
__hostdev__ constexpr BaseBBox & expand ( const Vec3T & xyz)
inlineconstexprnoexcept

Expand this bounding box to enclose point xyz.

◆ intersect()

template<typename Vec3T>
__hostdev__ constexpr BaseBBox & intersect ( const BaseBBox< Vec3T > & bbox)
inlineconstexprnoexcept

Intersect this bounding box with the given bounding box.

◆ isInside()

template<typename Vec3T>
__hostdev__ constexpr bool isInside ( const Vec3T & xyz) const
inlinenodiscardconstexprnoexcept

Return true iff xyz lies in the closed box (each component satisfies min[i] <= xyz[i] <= max[i]).

◆ max() [1/2]

template<typename Vec3T>
__hostdev__ constexpr const Vec3T & max ( ) const
inlineconstexprnoexcept

Const accessor for the max corner.

◆ max() [2/2]

template<typename Vec3T>
__hostdev__ constexpr Vec3T & max ( )
inlineconstexprnoexcept

Mutable accessor for the max corner.

◆ min() [1/2]

template<typename Vec3T>
__hostdev__ constexpr const Vec3T & min ( ) const
inlineconstexprnoexcept

Const accessor for the min corner.

◆ min() [2/2]

template<typename Vec3T>
__hostdev__ constexpr Vec3T & min ( )
inlineconstexprnoexcept

Mutable accessor for the min corner.

◆ operator!=()

template<typename Vec3T>
__hostdev__ constexpr bool operator!= ( const BaseBBox< Vec3T > & rhs) const
inlinenodiscardconstexprnoexcept

Inequality on the two corner points.

◆ operator==()

template<typename Vec3T>
__hostdev__ constexpr bool operator== ( const BaseBBox< Vec3T > & rhs) const
inlinenodiscardconstexprnoexcept

Equality on the two corner points.

◆ operator[]() [1/2]

template<typename Vec3T>
__hostdev__ constexpr const Vec3T & operator[] ( int i) const
inlineconstexprnoexcept

Indexed corner access: i = 0 returns min, i = 1 returns max.

◆ operator[]() [2/2]

template<typename Vec3T>
__hostdev__ constexpr Vec3T & operator[] ( int i)
inlineconstexprnoexcept

Mutable variant of operator[].

◆ translate()

template<typename Vec3T>
__hostdev__ constexpr BaseBBox & translate ( const Vec3T & xyz)
inlineconstexprnoexcept

Translate (rigid-shift) both corners by xyz; return *this.

Member Data Documentation

◆ mCoord

template<typename Vec3T>
Vec3T mCoord[2]