![]() |
OpenVDB 14.0.0
|
Signed (i, j) 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 | Coord2 () noexcept |
| Initialize all coordinates to zero. | |
| __hostdev__ constexpr | Coord2 (ValueType n) noexcept |
| Initializes all coordinates to the given signed integer. | |
| __hostdev__ constexpr | Coord2 (ValueType i, ValueType j) noexcept |
| Initializes coordinate to the given signed integers. | |
| __hostdev__ constexpr | Coord2 (ValueType *ptr) noexcept |
| Read two signed integers from ptr (no bounds check). | |
| __hostdev__ constexpr int32_t | x () const noexcept |
| Named component accessors (x = mVec[0], y = mVec[1]). | |
| __hostdev__ constexpr int32_t | y () const noexcept |
| __hostdev__ constexpr int32_t & | x () noexcept |
| __hostdev__ constexpr int32_t & | y () 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 Coord2 & | operator= (const CoordT &other) noexcept |
| Assignment operator that works with openvdb::Coord. | |
| __hostdev__ constexpr Coord2 | operator& (IndexType n) const noexcept |
| Return a new instance with coordinates masked by the given unsigned integer. | |
| __hostdev__ constexpr Coord2 | operator<< (IndexType n) const noexcept |
| Return a new instance with coordinates left-shifted by the given unsigned integer. | |
| __hostdev__ constexpr Coord2 | operator>> (IndexType n) const noexcept |
| Return a new instance with coordinates right-shifted by the given unsigned integer. | |
| __hostdev__ constexpr bool | operator< (const Coord2 &rhs) const noexcept |
| Return true if this Coord is lexicographically less than the given Coord. | |
| __hostdev__ constexpr bool | operator<= (const Coord2 &rhs) const noexcept |
| Return true if this Coord is lexicographically less or equal to the given Coord. | |
| __hostdev__ constexpr bool | operator> (const Coord2 &rhs) const noexcept |
| Return true if this Coord is lexicographically greater than the given Coord. | |
| __hostdev__ constexpr bool | operator>= (const Coord2 &rhs) const noexcept |
| Return true if this Coord is lexicographically greater or equal to the given Coord. | |
| __hostdev__ constexpr bool | operator== (const Coord2 &rhs) const noexcept |
| Return true iff every component matches rhs. | |
| __hostdev__ constexpr bool | operator!= (const Coord2 &rhs) const noexcept |
| Return true iff any component differs from rhs. | |
| __hostdev__ constexpr Coord2 & | operator&= (int n) noexcept |
| In-place component-wise bitwise AND with the given mask. | |
| __hostdev__ constexpr Coord2 & | operator<<= (uint32_t n) noexcept |
| In-place left-shift of every component by n bits. | |
| __hostdev__ constexpr Coord2 & | operator>>= (uint32_t n) noexcept |
| In-place right-shift of every component by n bits. | |
| __hostdev__ constexpr Coord2 & | operator+= (int n) noexcept |
| Add a scalar to every component in place. | |
| __hostdev__ constexpr Coord2 | operator+ (const Coord2 &rhs) const noexcept |
| Component-wise sum of two coordinates. | |
| __hostdev__ constexpr Coord2 | operator- (const Coord2 &rhs) const noexcept |
| Component-wise difference of two coordinates. | |
| __hostdev__ constexpr Coord2 | operator- () const noexcept |
| Component-wise negation. | |
| __hostdev__ constexpr Coord2 & | operator+= (const Coord2 &rhs) noexcept |
| In-place component-wise addition with another coordinate. | |
| __hostdev__ constexpr Coord2 & | operator-= (const Coord2 &rhs) noexcept |
| In-place component-wise subtraction with another coordinate. | |
| __hostdev__ constexpr Coord2 & | minComponent (const Coord2 &other) noexcept |
| Perform a component-wise minimum with the other Coord. | |
| __hostdev__ constexpr Coord2 & | maxComponent (const Coord2 &other) noexcept |
| Perform a component-wise maximum with the other Coord. | |
| __hostdev__ constexpr Coord2 | offsetBy (ValueType dx, ValueType dy) const noexcept |
Return a new Coord2 offset component-by-component by (dx, dy). | |
| __hostdev__ constexpr Coord2 | offsetBy (ValueType n) const noexcept |
Return a new Coord2 offset by the same scalar n in both components. | |
| __hostdev__ constexpr Vec2< float > | asVec2s () const noexcept |
| Return a single precision floating-point vector of this coordinate. | |
| __hostdev__ constexpr Vec2< double > | asVec2d () const noexcept |
| Return a double precision floating-point vector of this coordinate. | |
| __hostdev__ constexpr Coord2 | round () const noexcept |
Identity (Coord2 is already integer); provided so generic code can call .round() uniformly on Coord2 and Vec2<T>. | |
Static Public Member Functions | |
| static __hostdev__ constexpr Coord2 | max () noexcept |
Largest representable Coord2 (all components = INT32_MAX). | |
| static __hostdev__ constexpr Coord2 | min () noexcept |
Smallest representable Coord2 (all components = INT32_MIN). | |
| static __hostdev__ constexpr size_t | memUsage () noexcept |
Byte size of a Coord2 (always 8 on a 32-bit int32_t platform). | |
| static __hostdev__ constexpr bool | lessThan (const Coord2 &a, const Coord2 &b) noexcept |
| template<typename Vec2T> | |
| static __hostdev__ Coord2 | Floor (const Vec2T &xy) noexcept |
| Return the largest integer coordinates that are not greater than xyz (node centered conversion). | |
Signed (i, j) 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 two 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).
|
inlinestaticnodiscardconstexprnoexcept |
Return true if any of the components of a are smaller than the corresponding components of b.
|
inlinestaticnodiscardconstexprnoexcept |
Largest representable Coord2 (all components = INT32_MAX).
|
inlineconstexprnoexcept |
Perform a component-wise maximum with the other Coord.
|
inlinestaticnodiscardconstexprnoexcept |
Byte size of a Coord2 (always 8 on a 32-bit int32_t platform).
|
inlinestaticnodiscardconstexprnoexcept |
Smallest representable Coord2 (all components = INT32_MIN).
|
inlineconstexprnoexcept |
Perform a component-wise minimum with the other Coord.
|
inlinenodiscardconstexprnoexcept |
Return a new Coord2 offset component-by-component by (dx, dy).
|
inlinenodiscardconstexprnoexcept |
Return a new Coord2 offset by the same scalar n in both components.
|
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]).
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |