1 #ifndef vtkLabelHierarchyPrivate_h 2 #define vtkLabelHierarchyPrivate_h 7 #include "octree/octree" 79 if (0 == this->Hierarchy)
95 class LabelSet :
public std::multiset<vtkIdType,PriorityComparator>
101 this->TotalAnchors = 0;
103 for (
int i = 0; i < 3; ++ i )
113 this->Size = src.
Size;
114 for (
int i = 0; i < 3; ++ i )
123 this->TotalAnchors = 0;
125 for (
int i = 0; i < 3; ++ i )
135 std::multiset<vtkIdType,PriorityComparator>::operator = ( rhs );
137 this->Size = rhs.
Size;
138 for (
int i = 0; i < 3; ++ i )
147 void SetGeometry(
const double center[3],
double length );
148 void SetChildGeometry( octree<LabelSet,2>::octree_node_pointer
self );
149 void SetChildGeometry( octree<LabelSet,3>::octree_node_pointer
self );
150 void AddChildren( octree<LabelSet,2>::octree_node_pointer
self,
LabelSet& emptyNode );
151 void AddChildren( octree<LabelSet,3>::octree_node_pointer
self,
LabelSet& emptyNode );
154 this->insert( anchor );
155 ++ this->TotalAnchors;
209 for (
int i = 0; i < 3; ++ i )
211 this->
Center[i] = center[i];
218 double sz2 = this->Size / 2.;
220 for (
int i = 0; i <
self->num_children(); ++ i )
222 for (
int j = 0; j < 2; ++ j )
224 x[j] = this->
Center[j] + ( ( i & (1<<j) ) ? 0.5 : -0.5 ) * sz2 ;
227 (*self)[i].value().SetGeometry( x, sz2 );
233 double sz2 = this->Size / 2.;
235 for (
int i = 0; i <
self->num_children(); ++ i )
237 for (
int j = 0; j < 3; ++ j )
239 x[j] = this->
Center[j] + ( ( i & (1<<j) ) ? 0.5 : -0.5 ) * sz2 ;
241 (*self)[i].value().SetGeometry( x, sz2 );
247 self->add_children( emptyNode );
248 this->SetChildGeometry(
self );
253 self->add_children( emptyNode );
254 this->SetChildGeometry(
self );
257 #endif // vtkLabelHierarchyPrivate_h
void PrepareSortedAnchors(LabelSet &anchors)
void AddChildren(octree< LabelSet, 2 >::octree_node_pointer self, LabelSet &emptyNode)
GLboolean GLboolean GLboolean b
static vtkLabelHierarchy * Current
void DemoteAnchors(int level)
void Insert(vtkIdType anchor)
void FillHierarchyRoot(LabelSet &anchors)
PriorityComparator(const PriorityComparator &src)
LabelSet(vtkLabelHierarchy *hierarchy)
HierarchyType3::size_type ActualDepth
bool ComparePriorities(vtkIdType a, vtkIdType b)
record modification and/or execution time
vtkIdType GetTotalAnchorCount() const
GLuint GLsizei GLsizei * length
octree< LabelSet, 2 >::iterator HierarchyIterator2
void DropAnchor3(vtkIdType anchor)
void BinAnchorsToLevel(int level)
void SetGeometry(const double center[3], double length)
GLint GLint GLint GLint GLint x
HierarchyType3 * Hierarchy3
void SmudgeAnchor3(HierarchyCursor3 &cursor, vtkIdType anchor, double *x)
const double * GetCenter() const
HierarchyType2 * Hierarchy2
#define vtkGenericWarningMacro(x)
PriorityComparator & operator=(const PriorityComparator &rhs)
abstract superclass for arrays of numeric data
void SetChildGeometry(octree< LabelSet, 2 >::octree_node_pointer self)
bool operator()(const vtkIdType &a, const vtkIdType &b)
void SmudgeAnchor2(HierarchyCursor2 &cursor, vtkIdType anchor, double *x)
vtkLabelHierarchy * Hierarchy
GLboolean GLboolean GLboolean GLboolean a
octree< LabelSet, 2 > HierarchyType2
LabelSet(const LabelSet &src)
vtkIdType GetLocalAnchorCount() const
double GetTuple1(vtkIdType i)
octree< LabelSet > HierarchyType3
void RecursiveNodeDivide(HierarchyCursor2 &cursor)
virtual vtkDataArray * GetPriorities()
contains an octree of labels
octree< LabelSet >::iterator HierarchyIterator3
octree< LabelSet >::cursor HierarchyCursor3
GLfloat GLfloat GLfloat GLfloat h
void DropAnchor2(vtkIdType anchor)
Implementation * GetImplementation()
PriorityComparator(vtkLabelHierarchy *h)
vtkTimeStamp HierarchyTime
const GLuint const GLclampf * priorities
octree< LabelSet, 2 >::cursor HierarchyCursor2