Public Types | Public Attributes
ash::PCoordXYZ< U > Union Template Reference

A coordinate packed for fast conversion to and from MortonXYZ. More...

#include <ash/morton.h>

List of all members.

Public Types

enum  { BITS_PER_VAL = static_cast<uint8>(bitsizeof(value_type)/3), D = DIM_3D }
typedef U value_type
 The basic unsigned type underneath.
typedef value_type x_type
typedef value_type y_type
typedef value_type z_type
typedef impl::pcoord_masks
< value_type, DIM_3D
mask
 The mask set associated with this type.
typedef MortonXYZ< value_typemorton_type
 The morton type this converts to.

Public Member Functions

Constructors/Destructors

We use the default destructor.

 PCoordXYZ ()
 Default constructor.
 PCoordXYZ (PCoordXYZ const &p)
 Copy constructor.
template<typename V >
 PCoordXYZ (PCoordXYZ< V > const &p)
 Copy constructor for other sizes.
 PCoordXYZ (value_type val)
 Constructor from the underlying value_type.
 PCoordXYZ (morton_type const &m)
 MortonXYZ conversion constructor.
 PCoordXYZ (value_type cx, value_type cy, value_type cz)
 Constructor from x,y,z.
Cast Operators
 operator value_type & ()
 operator const value_type & () const

Public Attributes

struct {
   x_type   x: BITS_PER_VAL
 The x-coordinate.
   y_type   y: BITS_PER_VAL
 The x-coordinate.
   z_type   z: BITS_PER_VAL
 The z-coordinate.
   value_type   _e: static_cast<size_t>(bitsizeof(value_type)-BITS_PER_VAL*3)
 The remaining space.
}; 

Detailed Description

template<typename U = size_t>
union ash::PCoordXYZ< U >

A coordinate packed for fast conversion to and from MortonXYZ.

Concepts:
ash::pcoord
Template Parameters:
U[uint8|uint16|uint32|uint64] An unsigned type. Also defined as PCoordXYZ::value_type.

The size of U is equal to the total size of the object. One third of the total bits (rounded down) are dedicated to the X, Y, and Z components. This should be the primary coordinate type you use in conjunction with a 3D hashgrid.


Member Typedef Documentation

template<typename U = size_t>
typedef impl::pcoord_masks<value_type, DIM_3D> ash::PCoordXYZ< U >::mask

The mask set associated with this type.

template<typename U = size_t>
typedef MortonXYZ<value_type> ash::PCoordXYZ< U >::morton_type

The morton type this converts to.

template<typename U = size_t>
typedef U ash::PCoordXYZ< U >::value_type

The basic unsigned type underneath.


Member Enumeration Documentation

template<typename U = size_t>
anonymous enum
Enumerator:
BITS_PER_VAL 

The size of x, y or z in bits.

D 

The dimensions.


Constructor & Destructor Documentation

template<typename U = size_t>
ash::PCoordXYZ< U >::PCoordXYZ ( ) [inline]

Default constructor.

template<typename U = size_t>
ash::PCoordXYZ< U >::PCoordXYZ ( PCoordXYZ< U > const &  p) [inline]

Copy constructor.

Parameters:
pThe PCoordXYZ to copy.
template<typename U = size_t>
template<typename V >
ash::PCoordXYZ< U >::PCoordXYZ ( PCoordXYZ< V > const &  p) [inline, explicit]

Copy constructor for other sizes.

Parameters:
pThe PCoordXYZ<> to copy.
template<typename U = size_t>
ash::PCoordXYZ< U >::PCoordXYZ ( value_type  val) [inline, explicit]

Constructor from the underlying value_type.

Note:
Used mostly for static initialization.
template<typename U = size_t>
ash::PCoordXYZ< U >::PCoordXYZ ( morton_type const &  m) [inline]

MortonXYZ conversion constructor.

Note:
Just un-interleaves the bits.
template<typename U = size_t>
ash::PCoordXYZ< U >::PCoordXYZ ( value_type  cx,
value_type  cy,
value_type  cz 
) [inline]

Constructor from x,y,z.

Parameters:
cxThe x coordinate.
cyThe y coordinate.
czThe z coordinate.
Note:
Overflow errors are not detected.

Member Data Documentation

template<typename U = size_t>
value_type ash::PCoordXYZ< U >::_e

The remaining space.

template<typename U = size_t>
x_type ash::PCoordXYZ< U >::x

The x-coordinate.

template<typename U = size_t>
y_type ash::PCoordXYZ< U >::y

The x-coordinate.

template<typename U = size_t>
z_type ash::PCoordXYZ< U >::z

The z-coordinate.


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


© 2012   AshTL
Licensed under  AGPLv3
Hosted by  Get AshTL at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated by  doxygen 1.7.4