OpenVDB 14.0.0
Loading...
Searching...
No Matches
BBox< Vec3T, true > Struct Template Reference

Partial template specialization for floating point coordinate types. More...

#include <nanovdb/math/Math.h>

Public Types

using Vec3Type = Vec3T
using ValueType = typename Vec3T::ValueType
using BaseT = BaseBBox<Vec3T>

Public Member Functions

__hostdev__ constexpr BBox () noexcept
 Default construction sets BBox to an empty bbox.
__hostdev__ constexpr BBox (const Vec3T &min, const Vec3T &max) noexcept
 Construct from explicit min / max corners.
__hostdev__ constexpr BBox (const Coord &min, const Coord &max) noexcept
 Convert an integer Coord box into this floating-point box.
__hostdev__ constexpr BBox (const BaseBBox< Coord > &bbox) noexcept
 Construct from a BaseBBox<Coord>; delegates to the (min, max) ctor.
__hostdev__ constexpr bool empty () const noexcept
 Return true if this bounding box is empty (max <= min in any axis).
__hostdev__ constexpr operator bool () const noexcept
 Convert to bool: true iff this bounding box has positive volume.
__hostdev__ constexpr Vec3T dim () const noexcept
 Return max - min when non-empty, else the zero vector.
__hostdev__ constexpr bool isInside (const Vec3T &p) const noexcept
 Return true iff p is strictly inside the box (open interval — min is exclusive, max is exclusive).
__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 const Vec3T & min () const noexcept
 Const accessor for the min corner.
__hostdev__ constexpr Vec3T & max () noexcept
 Mutable accessor for the max 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.

Static Public Member Functions

static __hostdev__ constexpr BBox createCube (const Coord &min, typename Coord::ValueType dim) noexcept
 Return a cube-shaped BBox with min corner min and edge length dim.

Public Attributes

Vec3T mCoord [2]

Detailed Description

template<typename Vec3T>
struct nanovdb::math::BBox< Vec3T, true >

Partial template specialization for floating point coordinate types.

Note
Min is inclusive and max is exclusive. If min = max the dimension of the bounding box is zero and therefore it is also empty.

Member Typedef Documentation

◆ BaseT

template<typename Vec3T>
using BaseT = BaseBBox<Vec3T>

◆ ValueType

template<typename Vec3T>
using ValueType = typename Vec3T::ValueType

◆ Vec3Type

template<typename Vec3T>
using Vec3Type = Vec3T

Constructor & Destructor Documentation

◆ BBox() [1/4]

template<typename Vec3T>
__hostdev__ constexpr BBox ( )
inlineconstexprnoexcept

Default construction sets BBox to an empty bbox.

◆ BBox() [2/4]

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

Construct from explicit min / max corners.

◆ BBox() [3/4]

template<typename Vec3T>
__hostdev__ constexpr BBox ( const Coord & min,
const Coord & max )
inlineconstexprnoexcept

Convert an integer Coord box into this floating-point box.

Note
max is exclusive in the floating-point convention, so the integer max corner is incremented by 1 before conversion.

◆ BBox() [4/4]

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

Construct from a BaseBBox<Coord>; delegates to the (min, max) ctor.

Member Function Documentation

◆ createCube()

template<typename Vec3T>
__hostdev__ constexpr BBox createCube ( const Coord & min,
typename Coord::ValueType dim )
inlinestaticnodiscardconstexprnoexcept

Return a cube-shaped BBox with min corner min and edge length dim.

◆ dim()

template<typename Vec3T>
__hostdev__ constexpr Vec3T dim ( ) const
inlinenodiscardconstexprnoexcept

Return max - min when non-empty, else the zero vector.

◆ empty()

template<typename Vec3T>
__hostdev__ constexpr bool empty ( ) const
inlinenodiscardconstexprnoexcept

Return true if this bounding box is empty (max <= min in any axis).

◆ expand() [1/2]

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

Expand this bounding box to enclose the given bounding box.

◆ expand() [2/2]

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

Expand this bounding box to enclose point xyz.

◆ intersect()

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

Intersect this bounding box with the given bounding box.

◆ isInside()

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

Return true iff p is strictly inside the box (open interval — min is exclusive, max is exclusive).

◆ max() [1/2]

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

Const accessor for the max corner.

◆ max() [2/2]

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

Mutable accessor for the max corner.

◆ min() [1/2]

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

Const accessor for the min corner.

◆ min() [2/2]

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

Mutable accessor for the min corner.

◆ operator bool()

template<typename Vec3T>
__hostdev__ constexpr operator bool ( ) const
inlinenodiscardconstexprnoexcept

Convert to bool: true iff this bounding box has positive volume.

◆ operator!=()

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

Inequality on the two corner points.

◆ operator==()

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

Equality on the two corner points.

◆ operator[]() [1/2]

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

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

◆ operator[]() [2/2]

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

Mutable variant of operator[].

◆ translate()

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

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

Member Data Documentation

◆ mCoord

template<typename Vec3T>
Vec3T mCoord[2]