1 #ifndef vtkLabelHierarchyPrivate_h 2 #define vtkLabelHierarchyPrivate_h 7 #include "octree/octree" 72 if (0 == this->Hierarchy)
88 class LabelSet :
public std::multiset<vtkIdType,PriorityComparator>
94 this->TotalAnchors = 0;
96 for (
int i = 0; i < 3; ++ i )
106 this->Size = src.
Size;
107 for (
int i = 0; i < 3; ++ i )
116 this->TotalAnchors = 0;
118 for (
int i = 0; i < 3; ++ i )
128 std::multiset<vtkIdType,PriorityComparator>::operator = ( rhs );
130 this->Size = rhs.
Size;
131 for (
int i = 0; i < 3; ++ i )
140 void SetGeometry(
const double center[3],
double length );
141 void SetChildGeometry( octree<LabelSet,2>::octree_node_pointer
self );
142 void SetChildGeometry( octree<LabelSet,3>::octree_node_pointer
self );
143 void AddChildren( octree<LabelSet,2>::octree_node_pointer
self,
LabelSet& emptyNode );
144 void AddChildren( octree<LabelSet,3>::octree_node_pointer
self,
LabelSet& emptyNode );
147 this->insert( anchor );
148 ++ this->TotalAnchors;
202 for (
int i = 0; i < 3; ++ i )
204 this->
Center[i] = center[i];
211 double sz2 = this->Size / 2.;
213 for (
int i = 0; i <
self->num_children(); ++ i )
215 for (
int j = 0; j < 2; ++ j )
217 x[j] = this->
Center[j] + ( ( i & (1<<j) ) ? 0.5 : -0.5 ) * sz2 ;
220 (*self)[i].value().SetGeometry( x, sz2 );
226 double sz2 = this->Size / 2.;
228 for (
int i = 0; i <
self->num_children(); ++ i )
230 for (
int j = 0; j < 3; ++ j )
232 x[j] = this->
Center[j] + ( ( i & (1<<j) ) ? 0.5 : -0.5 ) * sz2 ;
234 (*self)[i].value().SetGeometry( x, sz2 );
240 self->add_children( emptyNode );
241 this->SetChildGeometry(
self );
246 self->add_children( emptyNode );
247 this->SetChildGeometry(
self );
250 #endif // vtkLabelHierarchyPrivate_h void PrepareSortedAnchors(LabelSet &anchors)
void AddChildren(octree< LabelSet, 2 >::octree_node_pointer self, LabelSet &emptyNode)
static vtkLabelHierarchy * Current
void DemoteAnchors(int level)
void Insert(vtkIdType anchor)
vtkIdType GetLocalAnchorCount() const
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
octree< LabelSet, 2 >::iterator HierarchyIterator2
void DropAnchor3(vtkIdType anchor)
void BinAnchorsToLevel(int level)
void SetGeometry(const double center[3], double length)
HierarchyType3 * Hierarchy3
void SmudgeAnchor3(HierarchyCursor3 &cursor, vtkIdType anchor, double *x)
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)
vtkIdType GetTotalAnchorCount() const
bool operator()(const vtkIdType &a, const vtkIdType &b)
void SmudgeAnchor2(HierarchyCursor2 &cursor, vtkIdType anchor, double *x)
vtkLabelHierarchy * Hierarchy
octree< LabelSet, 2 > HierarchyType2
LabelSet(const LabelSet &src)
const double * GetCenter() 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
void DropAnchor2(vtkIdType anchor)
Implementation * GetImplementation()
PriorityComparator(vtkLabelHierarchy *h)
vtkTimeStamp HierarchyTime
octree< LabelSet, 2 >::cursor HierarchyCursor2