1#ifndef vtkLabelHierarchyPrivate_h
2#define vtkLabelHierarchyPrivate_h
6#include "octree/octree"
61 if (
nullptr == this->Hierarchy)
63 vtkGenericWarningMacro(
"error: NULL this->Hierarchy in PriorityComparator");
69 vtkGenericWarningMacro(
70 "error: NULL this->Hierarchy->GetImplementation() in PriorityComparator");
78 class LabelSet :
public std::multiset<vtkIdType, PriorityComparator>
86 for (
int i = 0; i < 3; ++i)
97 for (
int i = 0; i < 3; ++i)
108 for (
int i = 0; i < 3; ++i)
118 std::multiset<vtkIdType, PriorityComparator>::operator=(rhs);
121 for (
int i = 0; i < 3; ++i)
130 void SetGeometry(
const double center[3],
double length);
137 this->insert(anchor);
192 const double center[3],
double length)
194 for (
int i = 0; i < 3; ++i)
196 this->
Center[i] = center[i];
202 octree<LabelSet, 2>::octree_node_pointer self)
204 double sz2 = this->Size / 2.;
206 for (
int i = 0; i < self->num_children(); ++i)
208 for (
int j = 0; j < 2; ++j)
210 x[j] = this->
Center[j] + ((i & (1 << j)) ? 0.5 : -0.5) * sz2;
213 (*self)[i].value().SetGeometry(x, sz2);
218 octree<LabelSet, 3>::octree_node_pointer self)
220 double sz2 = this->Size / 2.;
222 for (
int i = 0; i < self->num_children(); ++i)
224 for (
int j = 0; j < 3; ++j)
226 x[j] = this->
Center[j] + ((i & (1 << j)) ? 0.5 : -0.5) * sz2;
228 (*self)[i].value().SetGeometry(x, sz2);
233 octree<LabelSet, 2>::octree_node_pointer self,
LabelSet& emptyNode)
235 self->add_children(emptyNode);
236 this->SetChildGeometry(self);
240 octree<LabelSet, 3>::octree_node_pointer self,
LabelSet& emptyNode)
242 self->add_children(emptyNode);
243 this->SetChildGeometry(self);
abstract superclass for arrays of numeric data
double GetTuple1(vtkIdType tupleIdx)
These methods are included as convenience for the wrappers.
vtkFrustumSelector is a vtkSelector that selects elements based on whether they are inside or interse...
LabelSet(const LabelSet &src)
void Insert(vtkIdType anchor)
void AddChildren(octree< LabelSet, 2 >::octree_node_pointer self, LabelSet &emptyNode)
LabelSet(vtkLabelHierarchy *hierarchy)
vtkIdType GetTotalAnchorCount() const
LabelSet & operator=(const LabelSet &rhs)
const double * GetCenter() const
void SetChildGeometry(octree< LabelSet, 2 >::octree_node_pointer self)
void SetGeometry(const double center[3], double length)
vtkIdType GetLocalAnchorCount() const
HierarchyType3 * Hierarchy3
vtkTimeStamp HierarchyTime
void SmudgeAnchor3(HierarchyCursor3 &cursor, vtkIdType anchor, double *x)
void DemoteAnchors(int level)
void SmudgeAnchor2(HierarchyCursor2 &cursor, vtkIdType anchor, double *x)
octree< LabelSet, 2 > HierarchyType2
bool ComparePriorities(vtkIdType a, vtkIdType b)
octree< LabelSet > HierarchyType3
octree< LabelSet, 2 >::cursor HierarchyCursor2
void DropAnchor3(vtkIdType anchor)
void FillHierarchyRoot(LabelSet &anchors)
HierarchyType2 * Hierarchy2
void RecursiveNodeDivide(HierarchyCursor2 &cursor)
HierarchyType3::size_type ActualDepth
void DropAnchor2(vtkIdType anchor)
void RecursiveNodeDivide(HierarchyCursor3 &cursor)
octree< LabelSet >::cursor HierarchyCursor3
void PrepareSortedAnchors(LabelSet &anchors)
octree< LabelSet >::iterator HierarchyIterator3
octree< LabelSet, 2 >::iterator HierarchyIterator2
static vtkLabelHierarchy * Current
void BinAnchorsToLevel(int level)
contains an octree of labels
Implementation * GetImplementation()
virtual vtkDataArray * GetPriorities()
Set/get the array specifying the importance (priority) of each label.
record modification and/or execution time
PriorityComparator(vtkLabelHierarchy *h)
~PriorityComparator()=default
bool operator()(const vtkIdType &a, const vtkIdType &b) const
PriorityComparator(const PriorityComparator &src)
vtkLabelHierarchy * Hierarchy
PriorityComparator & operator=(const PriorityComparator &rhs)