DGtal  1.5.beta
DGtal::Morton< THashKey, TPoint > Class Template Reference

Aim: Implements the binary Morton code construction in nD. More...

#include <DGtal/images/Morton.h>

Inheritance diagram for DGtal::Morton< THashKey, TPoint >:
[legend]

Public Types

typedef THashKey HashKey
 
typedef TPoint Point
 
typedef Point::Coordinate Coordinate
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnsignedNumber< THashKey >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CIntegralNumber< THashKey >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CInteger< Coordinate >))
 
 BOOST_STATIC_CONSTANT (Dimension, dimension=TPoint::dimension)
 
 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
 

Detailed Description

template<typename THashKey, typename TPoint>
class DGtal::Morton< THashKey, TPoint >

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.

Template Parameters
THashKeytype to store the morton code (should have enough capacity to store the interleaved binary word).
TPointtype of points.
See also
testImageContainerByHashTree.cpp

Definition at line 77 of file Morton.h.

Member Typedef Documentation

◆ Coordinate

template<typename THashKey , typename TPoint >
typedef Point::Coordinate DGtal::Morton< THashKey, TPoint >::Coordinate

Definition at line 82 of file Morton.h.

◆ HashKey

template<typename THashKey , typename TPoint >
typedef THashKey DGtal::Morton< THashKey, TPoint >::HashKey

Definition at line 80 of file Morton.h.

◆ Point

template<typename THashKey , typename TPoint >
typedef TPoint DGtal::Morton< THashKey, TPoint >::Point

Definition at line 81 of file Morton.h.

Constructor & Destructor Documentation

◆ Morton()

template<typename THashKey , typename TPoint >
DGtal::Morton< THashKey, TPoint >::Morton ( )

Constructor

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/3]

template<typename THashKey , typename TPoint >
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< Coordinate >)  )

◆ BOOST_CONCEPT_ASSERT() [2/3]

template<typename THashKey , typename TPoint >
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT ( (concepts::CIntegralNumber< THashKey >)  )

◆ BOOST_CONCEPT_ASSERT() [3/3]

template<typename THashKey , typename TPoint >
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT ( (concepts::CUnsignedNumber< THashKey >)  )

◆ BOOST_STATIC_CONSTANT()

template<typename THashKey , typename TPoint >
DGtal::Morton< THashKey, TPoint >::BOOST_STATIC_CONSTANT ( Dimension  ,
dimension  = TPoint::dimension 
)

◆ brotherKeys()

template<typename THashKey , typename TPoint >
void DGtal::Morton< THashKey, TPoint >::brotherKeys ( const HashKey  key,
HashKey result 
) const

Computes the brother keys (ie the keys having the same parent) of the key passed in parameter.

Parameters
keyThe key.
resultWill contain the resulting brother keys.

◆ childrenKeys()

template<typename THashKey , typename TPoint >
void DGtal::Morton< THashKey, TPoint >::childrenKeys ( const HashKey  key,
HashKey result 
) const

Computes the children keys of the key passed in parameter.

Parameters
keyThe key.
resultWill contain the resulting children keys.

Referenced by testMorton().

◆ coordinatesFromKey()

template<typename THashKey , typename TPoint >
void DGtal::Morton< THashKey, TPoint >::coordinatesFromKey ( const HashKey  key,
Point coordinates 
) const

Computes the coordinates correspponding to a key.

Parameters
keyThe key.
coordinatesWill contain the resulting coordinates.

Referenced by testMorton().

◆ interleaveBits()

template<typename THashKey , typename TPoint >
void DGtal::Morton< THashKey, TPoint >::interleaveBits ( const Point aPoint,
HashKey output 
) const

Interleave the bits of the nbIn inputs.

Parameters
aPointan array of the nbIn values to mix in.
outputThe result

Referenced by testMorton().

◆ keyFromCoordinates()

template<typename THashKey , typename TPoint >
HashKey DGtal::Morton< THashKey, TPoint >::keyFromCoordinates ( const std::size_t  treeDepth,
const Point coordinates 
) const

Returns the key corresponding to the coordinates passed in the parameters.

Parameters
treeDepthThe depth at which the coordinates are to be read (usualy corresponds to the deepest leave).
coordinatesAn array containing the coordinates to convert into a key.

Referenced by testMorton().

◆ parentKey()

template<typename THashKey , typename TPoint >
HashKey DGtal::Morton< THashKey, TPoint >::parentKey ( const HashKey  key) const
inline

Returns the parent key of a key passed in parameter.

Parameters
keyThe key.

Definition at line 128 of file Morton.h.

129  {
130  return key >> dimension;
131  }

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