OpenVDB  2.3.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Coord Class Reference

Signed (x, y, z) 32-bit integer coordinates. More...

#include <Coord.h>

Public Types

typedef int32_t Int32
 
typedef uint32_t Index32
 
typedef Vec3< Int32 > Vec3i
 
typedef Vec3< Index32 > Vec3I
 
typedef Int32 ValueType
 
typedef std::numeric_limits
< ValueType > 
Limits
 

Public Member Functions

 Coord ()
 
 Coord (Int32 xyz)
 
 Coord (Int32 x, Int32 y, Int32 z)
 
 Coord (const Vec3i &v)
 
 Coord (const Vec3I &v)
 
 Coord (const Int32 *v)
 
Coord & reset (Int32 x, Int32 y, Int32 z)
 
Coord & reset (Int32 xyz)
 
Coord & setX (Int32 x)
 
Coord & setY (Int32 y)
 
Coord & setZ (Int32 z)
 
Coord & offset (Int32 dx, Int32 dy, Int32 dz)
 
Coord & offset (Int32 n)
 
Coord offsetBy (Int32 dx, Int32 dy, Int32 dz) const
 
Coord offsetBy (Int32 n) const
 
Coord & operator+= (const Coord &rhs)
 
Coord & operator-= (const Coord &rhs)
 
Coord operator+ (const Coord &rhs) const
 
Coord operator- (const Coord &rhs) const
 
Coord operator- () const
 
Coord operator>> (size_t n) const
 
Coord operator<< (size_t n) const
 
Coord & operator<<= (size_t n)
 
Coord & operator>>= (size_t n)
 
Coord operator& (Int32 n) const
 
Coord operator| (Int32 n) const
 
Coord & operator&= (Int32 n)
 
Coord & operator|= (Int32 n)
 
Int32 x () const
 
Int32 y () const
 
Int32 z () const
 
Int32 operator[] (size_t i) const
 
Int32 & x ()
 
Int32 & y ()
 
Int32 & z ()
 
Int32 & operator[] (size_t i)
 
const Int32 * asPointer () const
 
Int32 * asPointer ()
 
Vec3d asVec3d () const
 
Vec3s asVec3s () const
 
Vec3i asVec3i () const
 
Vec3I asVec3I () const
 
void asXYZ (Int32 &x, Int32 &y, Int32 &z) const
 
bool operator== (const Coord &rhs) const
 
bool operator!= (const Coord &rhs) const
 
bool operator< (const Coord &rhs) const
 Lexicographic less than. More...
 
bool operator<= (const Coord &rhs) const
 Lexicographic less than or equal to. More...
 
bool operator> (const Coord &rhs) const
 Lexicographic greater than. More...
 
bool operator>= (const Coord &rhs) const
 Lexicographic greater than or equal to. More...
 
void minComponent (const Coord &other)
 Perform a component-wise minimum with the other Coord. More...
 
void maxComponent (const Coord &other)
 Perform a component-wise maximum with the other Coord. More...
 
size_t minIndex () const
 Return the index (0, 1 or 2) with the smallest value. More...
 
size_t maxIndex () const
 Return the index (0, 1 or 2) with the largest value. More...
 
void read (std::istream &is)
 
void write (std::ostream &os) const
 

Static Public Member Functions

static const Coord & min ()
 Return the smallest possible coordinate. More...
 
static const Coord & max ()
 Return the largest possible coordinate. More...
 
template<typename T >
static Coord round (const Vec3< T > &xyz)
 Return xyz rounded to the closest integer coordinates (cell centered conversion). More...
 
template<typename T >
static Coord floor (const Vec3< T > &xyz)
 Return the largest integer coordinates that are not greater than xyz (node centered conversion). More...
 
template<typename T >
static Coord ceil (const Vec3< T > &xyz)
 Return the largest integer coordinates that are not greater than xyz+1 (node centered conversion). More...
 
static Coord minComponent (const Coord &lhs, const Coord &rhs)
 Return the component-wise minimum of the two Coords. More...
 
static Coord maxComponent (const Coord &lhs, const Coord &rhs)
 Return the component-wise maximum of the two Coords. More...
 
static bool lessThan (const Coord &a, const Coord &b)
 

Detailed Description

Signed (x, y, z) 32-bit integer coordinates.

Member Typedef Documentation

typedef uint32_t Index32
typedef int32_t Int32
typedef std::numeric_limits<ValueType> Limits
typedef Int32 ValueType
typedef Vec3<Int32> Vec3i
typedef Vec3<Index32> Vec3I

Constructor & Destructor Documentation

Coord ( )
inline
Coord ( Int32  xyz)
inlineexplicit
Coord ( Int32  x,
Int32  y,
Int32  z 
)
inline
Coord ( const Vec3i &  v)
inlineexplicit
Coord ( const Vec3I &  v)
inlineexplicit
Coord ( const Int32 *  v)
inlineexplicit

Member Function Documentation

const Int32* asPointer ( ) const
inline
Int32* asPointer ( )
inline
Vec3d asVec3d ( ) const
inline
Vec3i asVec3i ( ) const
inline
Vec3I asVec3I ( ) const
inline
Vec3s asVec3s ( ) const
inline
void asXYZ ( Int32 &  x,
Int32 &  y,
Int32 &  z 
) const
inline
static Coord ceil ( const Vec3< T > &  xyz)
inlinestatic

Return the largest integer coordinates that are not greater than xyz+1 (node centered conversion).

static Coord floor ( const Vec3< T > &  xyz)
inlinestatic

Return the largest integer coordinates that are not greater than xyz (node centered conversion).

static bool lessThan ( const Coord &  a,
const Coord &  b 
)
inlinestatic
static const Coord& max ( )
inlinestatic

Return the largest possible coordinate.

void maxComponent ( const Coord &  other)
inline

Perform a component-wise maximum with the other Coord.

static Coord maxComponent ( const Coord &  lhs,
const Coord &  rhs 
)
inlinestatic

Return the component-wise maximum of the two Coords.

size_t maxIndex ( ) const
inline

Return the index (0, 1 or 2) with the largest value.

static const Coord& min ( )
inlinestatic

Return the smallest possible coordinate.

void minComponent ( const Coord &  other)
inline

Perform a component-wise minimum with the other Coord.

static Coord minComponent ( const Coord &  lhs,
const Coord &  rhs 
)
inlinestatic

Return the component-wise minimum of the two Coords.

size_t minIndex ( ) const
inline

Return the index (0, 1 or 2) with the smallest value.

Coord& offset ( Int32  dx,
Int32  dy,
Int32  dz 
)
inline
Coord& offset ( Int32  n)
inline
Coord offsetBy ( Int32  dx,
Int32  dy,
Int32  dz 
) const
inline
Coord offsetBy ( Int32  n) const
inline
bool operator!= ( const Coord &  rhs) const
inline
Coord operator& ( Int32  n) const
inline
Coord& operator&= ( Int32  n)
inline
Coord operator+ ( const Coord &  rhs) const
inline
Coord& operator+= ( const Coord &  rhs)
inline
Coord operator- ( const Coord &  rhs) const
inline
Coord operator- ( ) const
inline
Coord& operator-= ( const Coord &  rhs)
inline
bool operator< ( const Coord &  rhs) const
inline

Lexicographic less than.

Coord operator<< ( size_t  n) const
inline
Coord& operator<<= ( size_t  n)
inline
bool operator<= ( const Coord &  rhs) const
inline

Lexicographic less than or equal to.

bool operator== ( const Coord &  rhs) const
inline
bool operator> ( const Coord &  rhs) const
inline

Lexicographic greater than.

bool operator>= ( const Coord &  rhs) const
inline

Lexicographic greater than or equal to.

Coord operator>> ( size_t  n) const
inline
Coord& operator>>= ( size_t  n)
inline
Int32 operator[] ( size_t  i) const
inline
Int32& operator[] ( size_t  i)
inline
Coord operator| ( Int32  n) const
inline
Coord& operator|= ( Int32  n)
inline
void read ( std::istream &  is)
inline
Coord& reset ( Int32  x,
Int32  y,
Int32  z 
)
inline
Coord& reset ( Int32  xyz)
inline
static Coord round ( const Vec3< T > &  xyz)
inlinestatic

Return xyz rounded to the closest integer coordinates (cell centered conversion).

Coord& setX ( Int32  x)
inline
Coord& setY ( Int32  y)
inline
Coord& setZ ( Int32  z)
inline
void write ( std::ostream &  os) const
inline
Int32 x ( ) const
inline
Int32& x ( )
inline
Int32 y ( ) const
inline
Int32& y ( )
inline
Int32 z ( ) const
inline
Int32& z ( )
inline

The documentation for this class was generated from the following file: