32 #if defined(ImageContainerByHashTree_RECURSES)
33 #error Recursive header files inclusion detected in ImageContainerByHashTree.h
34 #else // defined(ImageContainerByHashTree_RECURSES)
36 #define ImageContainerByHashTree_RECURSES
38 #if !defined ImageContainerByHashTree_h
40 #define ImageContainerByHashTree_h
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/CLabel.h"
47 #include "DGtal/base/ConstRangeAdapter.h"
48 #include "DGtal/images/DefaultConstImageRange.h"
49 #include "DGtal/images/DefaultImageRange.h"
51 #include "DGtal/kernel/domains/CDomain.h"
52 #include "DGtal/kernel/domains/HyperRectDomain.h"
53 #include "DGtal/kernel/SpaceND.h"
54 #include "DGtal/base/Bits.h"
55 #include "DGtal/images/Morton.h"
56 #include "DGtal/images/SetValueIterator.h"
57 #include "DGtal/io/Color.h"
58 #include "DGtal/base/ExpressionTemplates.h"
63 namespace experimental
127 template <
typename TDomain,
typename TValue,
typename THashKey =
typename DGtal::u
int64_t >
193 const unsigned int depth,
194 const Value defaultValue);
217 const Value defaultValue);
236 const unsigned int hashKeySize = 3,
440 void printState(std::ostream& out,
bool displayKeys =
false)
const;
500 unsigned int getNbNodes(
unsigned int intermediateKey)
const;
609 template <
typename C>
705 n->getObject() = object;
709 n =
new Node(
object, key);
729 if (iter->
getKey() == key)
826 template<
typename TDomain,
typename TValue,
typename THashKey >
830 object.selfDisplay( out);
840 #include "DGtal/images/ImageContainerByHashTree.ih"
845 #endif // !defined ImageContainerByHashTree_h
847 #undef ImageContainerByHashTree_RECURSES
848 #endif // else defined(ImageContainerByHashTree_RECURSES)
unsigned int getDepth() const
Value get(const HashKey key) const
Value blendChildren(HashKey key) const
Built-in iterator on an HashTree. This iterator visits all node in the tree.
Space::Dimension Dimension
BOOST_STATIC_ASSERT((boost::is_same< Domain, HyperRectDomain< typename Domain::Space > >::value))
domain should be rectangular
Domain::Dimension Dimension
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Value reverseGet(const HashKey key) const
bool operator!=(const Iterator &it)
std::string className() const
Value operator()(const HashKey key) const
Aim: The traits class for all models of Cinteger.
void printInfo(std::ostream &out) const
int * getCoordinatesFromKey(HashKey key) const
const Self & container() const
unsigned int getMaxCollisions() const
bool checkIntegrity(HashKey key=ROOT_KEY, bool leafAbove=false) const
ImageContainerByHashTree(const unsigned int hashKeySize, const unsigned int depth, const Value defaultValue)
Model of CImageContainer implementing the association key<->Value using a hash tree....
Node * getNode(const HashKey key) const
double getAverageCollisions() const
unsigned int dim(const Vector &z)
ConstRange constRange() const
void printTree(HashKey key, std::ostream &out, bool displayKeys) const
const Node **& data() const noexcept
DefaultImageRange< Self > Range
Aim: model of CConstBidirectionalRangeFromPoint that adapts the domain of an image in order to iterat...
POW< 2, dimension > PowHelper
void printInternalState(std::ostream &out, unsigned int nbBits=0) const
Aim: model of CConstBidirectionalRangeFromPoint and CBidirectionalRangeWithWritableIteratorFromPoint ...
unsigned int getNbEmptyLists() const
Aim: This concept represents a digital domain, i.e. a non mutable subset of points of the given digit...
Morton< HashKey, Point > myMorton
The morton code computer.
DGtal is the top-level namespace which contains all DGtal functions and types.
bool isKeyValid(HashKey key) const
void printState(std::ostream &out, bool displayKeys=false) const
Aim: implements an output iterator, which is able to write values in an underlying image,...
ImageContainerByHashTree< TDomain, TValue, THashKey > Self
SetValueIterator< Self > OutputIterator
output iterator
Aim: Implements the binary Morton code construction in nD.
HashKey getKey(const Point &aPoint) const
unsigned int getKeyDepth(HashKey key) const
bool operator==(const Iterator &it)
DefaultConstImageRange< Self > ConstRange
std::ostream & operator<<(std::ostream &out, const ImageContainerByHashTree< TDomain, TValue, THashKey > &object)
BOOST_CONCEPT_ASSERT((concepts::CDomain< TDomain >))
domain
BOOST_STATIC_CONSTANT(Dimension, dimension=Domain::dimension)
static constants
Iterator(Node **data, unsigned int position, unsigned int arraySize)
Aim: Define the concept of DGtal labels. Models of CLabel can be default-constructible,...
void setDepth(unsigned int depth)
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
void recursiveRemoveNode(HashKey key, unsigned int nbRecursions)
void recursiveDraw(HashKey key, const double p1[2], const double len, Board2D &board, const C &cmap) const
HashKey myPreComputedIntermediateMask
unsigned int myCurrentCell
const Domain & domain() const
Node * addNode(const Value object, const HashKey key)
bool removeNode(HashKey key)
Value upwardGet(const HashKey key) const
void selfDisplay(std::ostream &out) const
HashKey getIntermediateKey(const HashKey key) const
Node(Value aValue, HashKey key)
unsigned int getSpanSize() const
unsigned int getNbNodes() const
void setValue(const HashKey key, const Value object)