![]() |
OpenVDB 14.0.0
|
Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord. More...
#include <nanovdb/math/Math.h>
Public Types | |
| using | ValueType = int32_t |
| using | IndexType = uint32_t |
Public Member Functions | |
| __hostdev__ constexpr | Coord () noexcept |
| Initialize all coordinates to zero. | |
| __hostdev__ constexpr | Coord (ValueType n) noexcept |
| Initializes all coordinates to the given signed integer. | |
| __hostdev__ constexpr | Coord (ValueType i, ValueType j, ValueType k) noexcept |
| Initializes coordinate to the given signed integers. | |
| __hostdev__ constexpr | Coord (ValueType *ptr) noexcept |
| Read three signed integers from ptr (no bounds check). | |
| __hostdev__ constexpr int32_t | x () const noexcept |
| Named component accessors (x = mVec[0], y = mVec[1], z = mVec[2]). | |
| __hostdev__ constexpr int32_t | y () const noexcept |
| __hostdev__ constexpr int32_t | z () const noexcept |
| __hostdev__ constexpr int32_t & | x () noexcept |
| __hostdev__ constexpr int32_t & | y () noexcept |
| __hostdev__ constexpr int32_t & | z () noexcept |
| __hostdev__ constexpr const ValueType & | operator[] (IndexType i) const noexcept |
| Return a const reference to the given Coord component. | |
| __hostdev__ constexpr ValueType & | operator[] (IndexType i) noexcept |
| Return a non-const reference to the given Coord component. | |
| template<typename CoordT> | |
| __hostdev__ constexpr Coord & | operator= (const CoordT &other) noexcept |
| Assignment operator that works with openvdb::Coord. | |
| __hostdev__ constexpr Coord | operator& (IndexType n) const noexcept |
| Return a new instance with coordinates masked by the given unsigned integer. | |
| __hostdev__ constexpr Coord | operator<< (IndexType n) const noexcept |
| Return a new instance with coordinates left-shifted by the given unsigned integer. | |
| __hostdev__ constexpr Coord | operator>> (IndexType n) const noexcept |
| Return a new instance with coordinates right-shifted by the given unsigned integer. | |
| __hostdev__ constexpr bool | operator< (const Coord &rhs) const noexcept |
| Return true if this Coord is lexicographically less than the given Coord. | |
| __hostdev__ constexpr bool | operator<= (const Coord &rhs) const noexcept |
| Return true if this Coord is lexicographically less or equal to the given Coord. | |
| __hostdev__ constexpr bool | operator> (const Coord &rhs) const noexcept |
| Return true if this Coord is lexicographically greater than the given Coord. | |
| __hostdev__ constexpr bool | operator>= (const Coord &rhs) const noexcept |
| Return true if this Coord is lexicographically greater or equal to the given Coord. | |
| __hostdev__ constexpr bool | operator== (const Coord &rhs) const noexcept |
| Return true iff every component matches rhs. | |
| __hostdev__ constexpr bool | operator!= (const Coord &rhs) const noexcept |
| Return true iff any component differs from rhs. | |
| __hostdev__ constexpr Coord & | operator&= (int n) noexcept |
| In-place component-wise bitwise AND with the given mask. | |
| __hostdev__ constexpr Coord & | operator<<= (uint32_t n) noexcept |
| In-place left-shift of every component by n bits. | |
| __hostdev__ constexpr Coord & | operator>>= (uint32_t n) noexcept |
| In-place right-shift of every component by n bits. | |
| __hostdev__ constexpr Coord & | operator+= (int n) noexcept |
| Add a scalar to every component in place. | |
| __hostdev__ constexpr Coord | operator+ (const Coord &rhs) const noexcept |
| Component-wise sum of two coordinates. | |
| __hostdev__ constexpr Coord | operator- (const Coord &rhs) const noexcept |
| Component-wise difference of two coordinates. | |
| __hostdev__ constexpr Coord | operator- () const noexcept |
| Component-wise negation. | |
| __hostdev__ constexpr Coord & | operator+= (const Coord &rhs) noexcept |
| In-place component-wise addition with another coordinate. | |
| __hostdev__ constexpr Coord & | operator-= (const Coord &rhs) noexcept |
| In-place component-wise subtraction with another coordinate. | |
| __hostdev__ constexpr Coord & | minComponent (const Coord &other) noexcept |
| Perform a component-wise minimum with the other Coord. | |
| __hostdev__ constexpr Coord & | maxComponent (const Coord &other) noexcept |
| Perform a component-wise maximum with the other Coord. | |
| __hostdev__ constexpr Coord | offsetBy (ValueType dx, ValueType dy, ValueType dz) const noexcept |
Return a new Coord offset component-by-component by (dx, dy, dz). | |
| __hostdev__ constexpr Coord | offsetBy (ValueType n) const noexcept |
Return a new Coord offset by the same scalar n in every component. | |
| template<int Log2N = 3 + 4 + 5> | |
| __hostdev__ constexpr uint32_t | hash () const noexcept |
| Return a hash key derived from the existing coordinates. | |
| __hostdev__ constexpr uint8_t | octant () const noexcept |
| Return the octant of this Coord. | |
| __hostdev__ constexpr Vec3< float > | asVec3s () const noexcept |
| Return a single precision floating-point vector of this coordinate. | |
| __hostdev__ constexpr Vec3< double > | asVec3d () const noexcept |
| Return a double precision floating-point vector of this coordinate. | |
| __hostdev__ constexpr Coord | round () const noexcept |
Identity (Coord is already integer); provided so generic code can call .round() uniformly on Coord and Vec3<T>. | |
Static Public Member Functions | |
| static __hostdev__ constexpr Coord | max () noexcept |
Largest representable Coord (all components = INT32_MAX). | |
| static __hostdev__ constexpr Coord | min () noexcept |
Smallest representable Coord (all components = INT32_MIN). | |
| static __hostdev__ constexpr size_t | memUsage () noexcept |
Byte size of a Coord (always 12 on a 32-bit int32_t platform). | |
| static __hostdev__ constexpr bool | lessThan (const Coord &a, const Coord &b) noexcept |
| template<typename Vec3T> | |
| static __hostdev__ Coord | Floor (const Vec3T &xyz) noexcept |
| Return the largest integer coordinates that are not greater than xyz (node centered conversion). | |
Signed (i, j, k) 32-bit integer coordinate class, similar to openvdb::math::Coord.
| using IndexType = uint32_t |
| using ValueType = int32_t |
|
inlineconstexprnoexcept |
Initialize all coordinates to zero.
|
inlineexplicitconstexprnoexcept |
Initializes all coordinates to the given signed integer.
|
inlineconstexprnoexcept |
Initializes coordinate to the given signed integers.
|
inlineconstexprnoexcept |
Read three signed integers from ptr (no bounds check).
|
inlinenodiscardconstexprnoexcept |
Return a double precision floating-point vector of this coordinate.
|
inlinenodiscardconstexprnoexcept |
Return a single precision floating-point vector of this coordinate.
|
inlinestaticnodiscardnoexcept |
Return the largest integer coordinates that are not greater than xyz (node centered conversion).
|
inlinenodiscardconstexprnoexcept |
Return a hash key derived from the existing coordinates.
The hash function is originally taken from the SIGGRAPH paper: "VDB: High-resolution sparse volumes with dynamic topology" and the prime numbers are modified based on the ACM Transactions on Graphics paper: "Real-time 3D reconstruction at scale using voxel hashing" (the second number had a typo!)
|
inlinestaticnodiscardconstexprnoexcept |
Return true if any of the components of a are smaller than the corresponding components of b.
|
inlinestaticnodiscardconstexprnoexcept |
Largest representable Coord (all components = INT32_MAX).
|
inlineconstexprnoexcept |
Perform a component-wise maximum with the other Coord.
|
inlinestaticnodiscardconstexprnoexcept |
Byte size of a Coord (always 12 on a 32-bit int32_t platform).
|
inlinestaticnodiscardconstexprnoexcept |
Smallest representable Coord (all components = INT32_MIN).
|
inlineconstexprnoexcept |
Perform a component-wise minimum with the other Coord.
|
inlinenodiscardconstexprnoexcept |
Return the octant of this Coord.
|
inlinenodiscardconstexprnoexcept |
Return a new Coord offset component-by-component by (dx, dy, dz).
|
inlinenodiscardconstexprnoexcept |
Return a new Coord offset by the same scalar n in every component.
|
inlinenodiscardconstexprnoexcept |
Return true iff any component differs from rhs.
|
inlinenodiscardconstexprnoexcept |
Return a new instance with coordinates masked by the given unsigned integer.
|
inlineconstexprnoexcept |
In-place component-wise bitwise AND with the given mask.
|
inlinenodiscardconstexprnoexcept |
Component-wise sum of two coordinates.
|
inlineconstexprnoexcept |
In-place component-wise addition with another coordinate.
|
inlineconstexprnoexcept |
Add a scalar to every component in place.
|
inlinenodiscardconstexprnoexcept |
Component-wise negation.
|
inlinenodiscardconstexprnoexcept |
Component-wise difference of two coordinates.
|
inlineconstexprnoexcept |
In-place component-wise subtraction with another coordinate.
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Return a new instance with coordinates left-shifted by the given unsigned integer.
|
inlineconstexprnoexcept |
In-place left-shift of every component by n bits.
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
Assignment operator that works with openvdb::Coord.
|
inlinenodiscardconstexprnoexcept |
Return true iff every component matches rhs.
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Return a new instance with coordinates right-shifted by the given unsigned integer.
|
inlineconstexprnoexcept |
In-place right-shift of every component by n bits.
|
inlineconstexprnoexcept |
Return a const reference to the given Coord component.
|
inlineconstexprnoexcept |
Return a non-const reference to the given Coord component.
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
Named component accessors (x = mVec[0], y = mVec[1], z = mVec[2]).
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |