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

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

#include <ash/morton.h>

List of all members.

Public Types

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

Public Member Functions

Constructors/Destructors

We use the default destructor.

 PCoordXY ()
 Default constructor.
 PCoordXY (PCoordXY const &p)
 Copy constructor.
template<typename V >
 PCoordXY (PCoordXY< V > const &p)
 Copy constructor for other sizes.
 PCoordXY (value_type val)
 Constructor from the underlying value_type.
 PCoordXY (morton_type const &m)
 MortonXY conversion constructor.
 PCoordXY (value_type cx, value_type cy)
 Constructor from x,y.
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 y-coordinate.
}; 

Detailed Description

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

A coordinate packed for fast conversion to and from MortonXY.

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

The size of U is equal to the total size of the object. Half of the bits are dedicated to the X component, half to the Y component. This should be the primary coordinate type you use in conjunction with a 2D hashgrid.

Examples:
omp_example/main.cpp.

Member Typedef Documentation

template<typename U = size_t>
typedef impl::pcoord_masks<value_type, DIM_2D> ash::PCoordXY< U >::mask

The mask set associated with this type.

template<typename U = size_t>
typedef MortonXY<value_type> ash::PCoordXY< U >::morton_type

The morton type this converts to.

template<typename U = size_t>
typedef U ash::PCoordXY< 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 or y in bits.

D 

The dimensions.


Constructor & Destructor Documentation

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

Default constructor.

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

Copy constructor.

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

Copy constructor for other sizes.

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

Constructor from the underlying value_type.

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

MortonXY conversion constructor.

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

Constructor from x,y.

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

Member Data Documentation

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

The x-coordinate.

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

The y-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