1 #ifndef vtkLabelHierarchyPrivate_h
2 #define vtkLabelHierarchyPrivate_h
7 #include "octree/octree"
72 if (0 == this->Hierarchy)
74 vtkGenericWarningMacro(
"error: NULL this->Hierarchy in PriorityComparator" );
80 vtkGenericWarningMacro(
"error: NULL this->Hierarchy->GetImplementation() in PriorityComparator" );
88 class LabelSet :
public std::multiset<vtkIdType,PriorityComparator>
96 for (
int i = 0; i < 3; ++ i )
107 for (
int i = 0; i < 3; ++ i )
118 for (
int i = 0; i < 3; ++ i )
128 std::multiset<vtkIdType,PriorityComparator>::operator = ( rhs );
131 for (
int i = 0; i < 3; ++ i )
147 this->insert( anchor );
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
LabelSet & operator=(const LabelSet &rhs)
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)
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
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)
const double * GetCenter() const
HierarchyType2 * Hierarchy2
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
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
void DropAnchor2(vtkIdType anchor)
Implementation * GetImplementation()
PriorityComparator(vtkLabelHierarchy *h)
vtkTimeStamp HierarchyTime
octree< LabelSet, 2 >::cursor HierarchyCursor2