VTK  9.3.20240328
vtkLabelHierarchy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
48 #ifndef vtkLabelHierarchy_h
49 #define vtkLabelHierarchy_h
50 
51 #include "vtkPointSet.h"
52 #include "vtkRenderingLabelModule.h" // For export macro
53 
54 VTK_ABI_NAMESPACE_BEGIN
55 class vtkAbstractArray;
56 class vtkCamera;
58 class vtkCoordinate;
59 class vtkDataArray;
60 class vtkIntArray;
62 class vtkPoints;
63 class vtkPolyData;
64 class vtkRenderer;
65 class vtkTextProperty;
66 
67 class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchy : public vtkPointSet
68 {
69 public:
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
77  void SetPoints(vtkPoints*) override;
78 
82  virtual void ComputeHierarchy();
83 
85 
89  vtkSetMacro(TargetLabelCount, int);
90  vtkGetMacro(TargetLabelCount, int);
92 
94 
97  vtkSetMacro(MaximumDepth, int);
98  vtkGetMacro(MaximumDepth, int);
100 
105  {
109  FRUSTUM
110  };
111 
113 
116  virtual void SetTextProperty(vtkTextProperty* tprop);
117  vtkGetObjectMacro(TextProperty, vtkTextProperty);
119 
121 
124  virtual void SetPriorities(vtkDataArray* arr);
125  vtkGetObjectMacro(Priorities, vtkDataArray);
127 
129 
132  virtual void SetLabels(vtkAbstractArray* arr);
133  vtkGetObjectMacro(Labels, vtkAbstractArray);
135 
137 
140  virtual void SetOrientations(vtkDataArray* arr);
141  vtkGetObjectMacro(Orientations, vtkDataArray);
143 
145 
148  virtual void SetIconIndices(vtkIntArray* arr);
149  vtkGetObjectMacro(IconIndices, vtkIntArray);
151 
153 
156  virtual void SetSizes(vtkDataArray* arr);
157  vtkGetObjectMacro(Sizes, vtkDataArray);
159 
161 
164  virtual void SetBoundedSizes(vtkDataArray* arr);
165  vtkGetObjectMacro(BoundedSizes, vtkDataArray);
167 
181  double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2]);
182 
193  void GetDiscreteNodeCoordinatesFromWorldPoint(int ijk[3], double pt[3], int level);
194 
206  static bool GetPathForNodalCoordinates(int* path, int ijk[3], int level);
207 
209 
213  using vtkDataSet::GetCell;
215  void GetCell(vtkIdType, vtkGenericCell*) override;
216  int GetCellType(vtkIdType) override;
219  vtkIdType FindCell(double*, vtkCell*, vtkIdType, double, int&, double*, double*) override;
221  double*, vtkCell*, vtkGenericCell*, vtkIdType, double, int&, double*, double*) override;
222  int GetMaxCellSize() override;
224 
225  class Implementation;
226  Implementation* GetImplementation() { return this->Impl; }
227 
229 
232  vtkGetObjectMacro(CenterPts, vtkPoints);
234 
236 
241  vtkGetObjectMacro(CoincidentPoints, vtkCoincidentPoints);
243 
245 
251  double frustumPlanes[24], vtkRenderer* ren, vtkCoordinate* anchorTransform);
253 
254 protected:
256  ~vtkLabelHierarchy() override;
257 
269 
271 
272  friend class vtkLabelHierarchyFrustumIterator;
273  friend class vtkLabelHierarchyFullSortIterator;
274  friend class implementation;
275 
276 private:
277  vtkLabelHierarchy(const vtkLabelHierarchy&) = delete;
278  void operator=(const vtkLabelHierarchy&) = delete;
279 };
280 
281 VTK_ABI_NAMESPACE_END
282 #endif // vtkLabelHierarchy_h
Abstract superclass for all arrays.
a virtual camera for 3D rendering
Definition: vtkCamera.h:150
abstract class to specify cell behavior
Definition: vtkCell.h:130
contains an octree of labels
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:132
a simple class to control print indentation
Definition: vtkIndent.h:108
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:144
iterator over vtkLabelHierarchy
contains an octree of labels
void GetCellPoints(vtkIdType, vtkIdList *) override
Inherited members (from vtkDataSet)
virtual void SetPriorities(vtkDataArray *arr)
Set/get the array specifying the importance (priority) of each label.
static bool GetPathForNodalCoordinates(int *path, int ijk[3], int level)
Given a level of the tree and ijk coordinates in a lattice, compute a path down the tree to reach the...
vtkDataArray * Priorities
virtual void SetBoundedSizes(vtkDataArray *arr)
Set/get the array specifying the maximum width and height in world coordinates of each label.
virtual void SetTextProperty(vtkTextProperty *tprop)
The default text property assigned to labels in this hierarchy.
Implementation * GetImplementation()
Implementation * Impl
virtual void SetOrientations(vtkDataArray *arr)
Set/get the array specifying the orientation of each label.
void GetCell(vtkIdType, vtkGenericCell *) override
Inherited members (from vtkDataSet)
IteratorType
Enumeration of iterator types.
virtual void SetIconIndices(vtkIntArray *arr)
Set/get the array specifying the icon index of each label.
vtkIdType FindCell(double *, vtkCell *, vtkIdType, double, int &, double *, double *) override
Inherited members (from vtkDataSet)
vtkDataArray * Sizes
vtkIdType FindCell(double *, vtkCell *, vtkGenericCell *, vtkIdType, double, int &, double *, double *) override
Inherited members (from vtkDataSet)
int GetMaxCellSize() override
Inherited members (from vtkDataSet)
int GetCellType(vtkIdType) override
Inherited members (from vtkDataSet)
virtual void SetLabels(vtkAbstractArray *arr)
Set/get the array specifying the text of each label.
vtkTextProperty * TextProperty
vtkCoincidentPoints * CoincidentPoints
vtkIdType GetNumberOfCells() override
Inherited members (from vtkDataSet)
virtual void SetSizes(vtkDataArray *arr)
Set/get the array specifying the size of each label.
static void GetAnchorFrustumPlanes(double frustumPlanes[24], vtkRenderer *ren, vtkCoordinate *anchorTransform)
Compute frustum for quickly excluding labels from rendering that are outside the visible region.
vtkDataArray * BoundedSizes
void SetPoints(vtkPoints *) override
Override SetPoints so we can reset the hierarchy when the points change.
virtual void ComputeHierarchy()
Fill the hierarchy with the input labels.
~vtkLabelHierarchy() override
vtkAbstractArray * Labels
vtkIntArray * IconIndices
vtkDataArray * Orientations
void GetDiscreteNodeCoordinatesFromWorldPoint(int ijk[3], double pt[3], int level)
Given a depth in the hierarchy (level) and a point pt in world space, compute ijk.
vtkLabelHierarchyIterator * NewIterator(int type, vtkRenderer *ren, vtkCamera *cam, double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2])
Returns an iterator for this data object.
vtkCell * GetCell(vtkIdType) override
Inherited members (from vtkDataSet)
static vtkLabelHierarchy * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
void GetPointCells(vtkIdType, vtkIdList *) override
Inherited members (from vtkDataSet)
concrete class for storing a set of points
Definition: vtkPointSet.h:97
represent and manipulate 3D points
Definition: vtkPoints.h:138
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
abstract specification for renderers
Definition: vtkRenderer.h:171
represent text properties.
@ level
Definition: vtkX3D.h:395
@ type
Definition: vtkX3D.h:516
int vtkIdType
Definition: vtkType.h:315
#define VTK_NEWINSTANCE