3 #ifndef vtkLabelHierarchyPrivate_h
4 #define vtkLabelHierarchyPrivate_h
8 #include "octree/octree"
13 VTK_ABI_NAMESPACE_BEGIN
64 if (
nullptr == this->Hierarchy)
66 vtkGenericWarningMacro(
"error: NULL this->Hierarchy in PriorityComparator");
72 vtkGenericWarningMacro(
73 "error: NULL this->Hierarchy->GetImplementation() in PriorityComparator");
81 class LabelSet :
public std::multiset<vtkIdType, PriorityComparator>
89 for (
int i = 0; i < 3; ++i)
100 for (
int i = 0; i < 3; ++i)
110 for (
int i = 0; i < 3; ++i)
120 std::multiset<vtkIdType, PriorityComparator>::operator=(rhs);
123 for (
int i = 0; i < 3; ++i)
139 this->insert(anchor);
196 for (
int i = 0; i < 3; ++i)
198 this->
Center[i] = center[i];
204 octree<LabelSet, 2>::octree_node_pointer
self)
206 double sz2 = this->Size / 2.;
208 for (
int i = 0; i <
self->num_children(); ++i)
210 for (
int j = 0; j < 2; ++j)
212 x[j] = this->
Center[j] + ((i & (1 << j)) ? 0.5 : -0.5) * sz2;
215 (*self)[i].value().SetGeometry(x, sz2);
220 octree<LabelSet, 3>::octree_node_pointer
self)
222 double sz2 = this->Size / 2.;
224 for (
int i = 0; i <
self->num_children(); ++i)
226 for (
int j = 0; j < 3; ++j)
228 x[j] = this->
Center[j] + ((i & (1 << j)) ? 0.5 : -0.5) * sz2;
230 (*self)[i].value().SetGeometry(x, sz2);
235 octree<LabelSet, 2>::octree_node_pointer
self,
LabelSet& emptyNode)
237 self->add_children(emptyNode);
238 this->SetChildGeometry(
self);
242 octree<LabelSet, 3>::octree_node_pointer
self,
LabelSet& emptyNode)
244 self->add_children(emptyNode);
245 this->SetChildGeometry(
self);
248 VTK_ABI_NAMESPACE_END
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
~PriorityComparator()=default
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)
bool operator()(const vtkIdType &a, const vtkIdType &b) const
record modification and/or execution time
vtkIdType GetTotalAnchorCount() const
void DropAnchor3(vtkIdType anchor)
void BinAnchorsToLevel(int level)
void SetGeometry(const double center[3], double length)
octree< LabelSet, 2 >::iterator HierarchyIterator2
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)
octree< LabelSet, 2 >::cursor HierarchyCursor2
void SmudgeAnchor2(HierarchyCursor2 &cursor, vtkIdType anchor, double *x)
vtkLabelHierarchy * Hierarchy
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
octree< LabelSet, 2 > HierarchyType2
void DropAnchor2(vtkIdType anchor)
Implementation * GetImplementation()
PriorityComparator(vtkLabelHierarchy *h)
vtkTimeStamp HierarchyTime