29 #ifndef OCT_NODE_INCLUDED
30 #define OCT_NODE_INCLUDED
36 #define NEW_OCTNODE_CODE 1
40 template<
class NodeData >
45 unsigned long long _depthAndOffset;
47 const OctNode* __faceNeighbor(
int dir ,
int off )
const;
48 const OctNode* __edgeNeighbor(
int o ,
const int i[2] ,
const int idx[2] )
const;
49 OctNode* __faceNeighbor(
int dir ,
int off ,
int forceChildren );
50 OctNode* __edgeNeighbor(
int o ,
const int i[2] ,
const int idx[2] ,
int forceChildren);
73 static inline int Depth(
const long long& index );
110 int write(
const char* fileName )
const;
112 int read(
const char* fileName );
115 template<
unsigned int W
idth >
122 template<
unsigned int W
idth >
130 template<
unsigned int LeftRadius ,
unsigned int RightRadius >
135 static const int Width = LeftRadius + RightRadius + 1;
141 int depth(
void )
const {
return _depth; }
150 template<
unsigned int LeftRadius ,
unsigned int RightRadius >
155 static const int Width = LeftRadius + RightRadius + 1;
161 int depth(
void )
const {
return _depth; }
173 #include "Octree.inl"
OctNode< NodeData >::template ConstNeighbors< LeftRadius+RightRadius+1 > & getNeighbors(const OctNode *node)
void getNeighbors(const OctNode *node, ConstNeighbors< _LeftRadius+_RightRadius+1 > &neighbors)
ConstNeighbors< Width > * neighbors
ConstNeighborKey(const ConstNeighborKey &key)
NeighborKey(const NeighborKey &key)
void getNeighbors(OctNode *node, Neighbors< _LeftRadius+_RightRadius+1 > &neighbors)
OctNode< NodeData >::template Neighbors< LeftRadius+RightRadius+1 > & getNeighbors(OctNode *node)
Neighbors< Width > * neighbors
bool getChildNeighbors(int cIdx, int d, Neighbors< Width > &childNeighbors) const
bool getChildNeighbors(Point3D< Real > p, int d, Neighbors< Width > &childNeighbors) const
OctNode * nextBranch(OctNode *current)
const OctNode * nextNode(const OctNode *currentNode=NULL) const
void setFullDepth(int maxDepth)
static int CornerIndex(const Point3D< Real > ¢er, const Point3D< Real > &p)
const OctNode * edgeNeighbor(int edgeIndex) const
const OctNode * faceNeighbor(int faceIndex) const
size_t leaves(void) const
int write(FILE *fp) const
void printLeaves(void) const
OctNode * nextNode(OctNode *currentNode=NULL)
OctNode * edgeNeighbor(int edgeIndex, int forceChildren=0)
static const int OffsetShift2
OctNode * cornerNeighbor(int cornerIndex, int forceChildren=0)
void centerAndWidth(Point3D< Real > ¢er, Real &width) const
int read(const char *fileName)
void depthAndOffset(int &depth, int offset[3]) const
const OctNode * prevBranch(const OctNode *current) const
void centerIndex(int maxDepth, int index[3]) const
static int UseAllocator(void)
static const int OffsetShift
const OctNode * cornerNeighbor(int cornerIndex) const
static const int OffsetMask
static int Depth(const long long &index)
OctNode * prevBranch(OctNode *current)
void startAndWidth(Point3D< Real > &start, Real &width) const
OctNode * faceNeighbor(int faceIndex, int forceChildren=0)
void centerIndex(int index[3]) const
static const int DepthMask
static const int OffsetShift1
const OctNode * nextBranch(const OctNode *current) const
void printRange(void) const
int width(int maxDepth) const
OctNode * nextLeaf(OctNode *currentLeaf=NULL)
size_t maxDepthLeaves(int maxDepth) const
static const int DepthShift
static void StartAndWidth(const long long &index, Point3D< Real > &start, Real &width)
int write(const char *fileName) const
bool isInside(Point3D< Real > p) const
static void CenterAndWidth(const long long &index, Point3D< Real > ¢er, Real &width)
static const int OffsetShift3
const OctNode * root(void) const
static Allocator< OctNode > NodeAllocator
static void DepthAndOffset(const long long &index, int &depth, int offset[3])
const OctNode * nextLeaf(const OctNode *currentLeaf=NULL) const
static unsigned long long Index(int depth, const int offset[3])
static void Index(int depth, const int offset[3], short &d, short off[3])
static void SetAllocator(int blockSize)
const OctNode * neighbors[Width][Width][Width]
OctNode * neighbors[Width][Width][Width]