DGtal
0.6.devel
|
#include <Morton.h>
Public Types | |
typedef THashKey | HashKey |
typedef TPoint | Point |
typedef Point::Coordinate | Coordinate |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((CUnsignedInteger< THashKey >)) | |
BOOST_CONCEPT_ASSERT ((CInteger< Coordinate >)) | |
Morton () | |
void | interleaveBits (const Point &aPoint, HashKey &output) const |
HashKey | keyFromCoordinates (const std::size_t treeDepth, const Point &coordinates) const |
void | coordinatesFromKey (const HashKey key, Point &coordinates) const |
HashKey | parentKey (const HashKey key) const |
void | brotherKeys (const HashKey key, HashKey *result) const |
void | childrenKeys (const HashKey key, HashKey *result) const |
Static Public Attributes | |
static const Dimension | dimension = Point::dimension |
Aim: Implements the binary Morton code construction in nD.
Description of template class 'Morton'
Given a point in nD \((x_1,\ldots, x_n)\), a Morton code consists in interleaving bits of \(x_i\) coordinate values (plus a prefix for the HashTree construction.
Main methods in this class are keyFromCoordinates to generate a key and CoordinatesFromKey to generate a point from a code.
THashKey | type to store the morton code (should have enough capacity to store the interleaved binary word). |
TPoint | type of points. |
typedef Point::Coordinate DGtal::Morton< THashKey, TPoint >::Coordinate |
typedef THashKey DGtal::Morton< THashKey, TPoint >::HashKey |
typedef TPoint DGtal::Morton< THashKey, TPoint >::Point |
DGtal::Morton< HashKey, Point >::Morton | ( | ) |
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT | ( | (CUnsignedInteger< THashKey >) | ) |
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT | ( | (CInteger< Coordinate >) | ) |
void DGtal::Morton< HashKey, Point >::brotherKeys | ( | const HashKey | key, |
HashKey * | result | ||
) | const |
Computes the brother keys (ie the keys having the same parent) of the key passed in parameter.
key | The key. |
result | Will contain the resulting brother keys. |
void DGtal::Morton< HashKey, Point >::childrenKeys | ( | const HashKey | key, |
HashKey * | result | ||
) | const |
Computes the children keys of the key passed in parameter.
key | The key. |
result | Will contain the resulting children keys. |
Definition at line 82 of file Morton.ih.
Referenced by DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::blendChildren(), DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::checkIntegrity(), DGtal::Display2DFactory::drawImageRecursive(), DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::printTree(), and DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::recursiveRemoveNode().
void DGtal::Morton< HashKey, Point >::coordinatesFromKey | ( | const HashKey | key, |
Point & | coordinates | ||
) | const |
Computes the coordinates correspponding to a key.
key | The key. |
coordinates | Will contain the resulting coordinates. |
Definition at line 115 of file Morton.ih.
void DGtal::Morton< HashKey, Point >::interleaveBits | ( | const Point & | aPoint, |
HashKey & | output | ||
) | const |
Interleave the bits of the nbIn inputs.
input | an array of the nbIn values to mix in. |
output | The result |
Definition at line 48 of file Morton.ih.
HashKey DGtal::Morton< HashKey, Point >::keyFromCoordinates | ( | const std::size_t | treeDepth, |
const Point & | coordinates | ||
) | const |
Returns the key corresponding to the coordinates passed in the parameters.
treeDepth | The depth at which the coordinates are to be read (usualy corresponds to the deepest leave). |
coordinates | An array containing the coordinates to convert into a key. |
Definition at line 65 of file Morton.ih.
|
inline |
|
static |
Definition at line 82 of file Morton.h.
Referenced by DGtal::Morton< HashKey, Point >::parentKey().