DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Morton.h
1
16
17
#pragma once
18
30
31
#if defined(Morton_RECURSES)
32
#error Recursive header files inclusion detected in Morton.h
33
#else
// defined(Morton_RECURSES)
35
#define Morton_RECURSES
36
37
#if !defined Morton_h
39
#define Morton_h
40
42
// Inclusions
43
#include <iostream>
44
#include <boost/array.hpp>
45
#include "DGtal/base/Common.h"
46
#include "DGtal/kernel/PointVector.h"
47
#include "DGtal/kernel/CUnsignedNumber.h"
48
#include "DGtal/kernel/CIntegralNumber.h"
49
#include "DGtal/kernel/CInteger.h"
50
51
#include "DGtal/base/Bits.h"
53
54
namespace
DGtal
55
{
56
58
// template class Morton
76
template
<
typename
THashKey,
typename
TPo
int
>
77
class
Morton
78
{
79
public
:
80
typedef
THashKey
HashKey
;
81
typedef
TPoint
Point
;
82
typedef
typename
Point::Coordinate
Coordinate
;
83
84
BOOST_CONCEPT_ASSERT
((
concepts::CUnsignedNumber<THashKey>
));
85
BOOST_CONCEPT_ASSERT
((
concepts::CIntegralNumber<THashKey>
));
86
BOOST_CONCEPT_ASSERT
((
concepts::CInteger<Coordinate>
));
87
88
BOOST_STATIC_CONSTANT
(
Dimension
, dimension = TPoint::dimension);
89
94
Morton
();
95
101
void
interleaveBits
(
const
Point
&
aPoint
,
HashKey
&
output
)
const
;
102
103
113
HashKey
keyFromCoordinates
(
const
std::size_t treeDepth,
const
Point
& coordinates)
const
;
114
121
void
coordinatesFromKey
(
const
HashKey
key,
Point
& coordinates)
const
;
122
128
inline
HashKey
parentKey
(
const
HashKey
key)
const
129
{
130
return
key >> dimension;
131
}
132
140
void
brotherKeys
(
const
HashKey
key,
HashKey
* result )
const
;
141
142
149
void
childrenKeys
(
const
HashKey
key,
HashKey
* result )
const
;
150
151
private
:
152
154
//boost::array< HashKey,LOG2<sizeof(HashKey)*8>::VALUE> myDilateMasks;
155
//boost::array< HashKey,LOG2<sizeof(HashKey)*8>::VALUE> myContractMasks;
156
};
157
}
// namespace DGtal
158
159
160
// //
163
// Includes inline functions
164
#include "DGtal/images/Morton.ih"
165
166
#endif
// !defined Morton_h
167
168
#undef Morton_RECURSES
169
#endif
// else defined(Morton_RECURSES)
DGtal::Morton::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(Dimension, dimension=TPoint::dimension)
DGtal::Morton::Morton
Morton()
DGtal::Morton::interleaveBits
void interleaveBits(const Point &aPoint, HashKey &output) const
DGtal::Morton::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CInteger< Coordinate >))
DGtal::Morton::childrenKeys
void childrenKeys(const HashKey key, HashKey *result) const
DGtal::Morton::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CIntegralNumber< THashKey >))
DGtal::Morton::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CUnsignedNumber< THashKey >))
DGtal::Morton::coordinatesFromKey
void coordinatesFromKey(const HashKey key, Point &coordinates) const
DGtal::Morton::Point
TPoint Point
Definition
Morton.h:81
DGtal::Morton::keyFromCoordinates
HashKey keyFromCoordinates(const std::size_t treeDepth, const Point &coordinates) const
DGtal::Morton::brotherKeys
void brotherKeys(const HashKey key, HashKey *result) const
DGtal::Morton::Coordinate
Point::Coordinate Coordinate
Definition
Morton.h:82
DGtal::Morton::HashKey
THashKey HashKey
Definition
Morton.h:80
DGtal::Morton::parentKey
HashKey parentKey(const HashKey key) const
Definition
Morton.h:128
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::Dimension
DGtal::uint32_t Dimension
Definition
Common.h:119
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition
CInteger.h:88
DGtal::concepts::CIntegralNumber
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
Definition
CIntegralNumber.h:102
DGtal::concepts::CUnsignedNumber
Aim: Concept checking for Unsigned numbers. Models of this concept should be listed in NumberTraits c...
Definition
CUnsignedNumber.h:95
output
AxisDomainSplitter< Domain >::SplitDomainsInfo output
Definition
testDomainSplitter.cpp:110
aPoint
const Point aPoint(3, 4)
src
DGtal
images
Morton.h
Generated on
for DGtal by
1.18.0