1 #ifndef vtkLabelHierarchyPrivate_h
2 #define vtkLabelHierarchyPrivate_h
6 #include "octree/octree"
71 if (0 == this->Hierarchy)
73 vtkGenericWarningMacro(
"error: NULL this->Hierarchy in PriorityComparator" );
79 vtkGenericWarningMacro(
"error: NULL this->Hierarchy->GetImplementation() in PriorityComparator" );
87 class LabelSet :
public std::multiset<vtkIdType,PriorityComparator>
95 for (
int i = 0; i < 3; ++ i )
106 for (
int i = 0; i < 3; ++ i )
117 for (
int i = 0; i < 3; ++ i )
127 std::multiset<vtkIdType,PriorityComparator>::operator = ( rhs );
130 for (
int i = 0; i < 3; ++ i )
146 this->insert( anchor );
201 for (
int i = 0; i < 3; ++ i )
203 this->
Center[i] = center[i];
210 double sz2 = this->Size / 2.;
212 for (
int i = 0; i <
self->num_children(); ++ i )
214 for (
int j = 0; j < 2; ++ j )
216 x[j] = this->
Center[j] + ( ( i & (1<<j) ) ? 0.5 : -0.5 ) * sz2 ;
219 (*self)[i].value().SetGeometry( x, sz2 );
225 double sz2 = this->Size / 2.;
227 for (
int i = 0; i <
self->num_children(); ++ i )
229 for (
int j = 0; j < 3; ++ j )
231 x[j] = this->
Center[j] + ( ( i & (1<<j) ) ? 0.5 : -0.5 ) * sz2 ;
233 (*self)[i].value().SetGeometry( x, sz2 );
239 self->add_children( emptyNode );
240 this->SetChildGeometry(
self );
245 self->add_children( emptyNode );
246 this->SetChildGeometry(
self );
249 #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)
double GetTuple1(vtkIdType tupleIdx)
These methods are included as convenience for the wrappers.
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
octree< LabelSet > HierarchyType3
void RecursiveNodeDivide(HierarchyCursor2 &cursor)
virtual vtkDataArray * GetPriorities()
Set/get the array specifying the importance (priority) of each label.
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