VTK  9.3.20240425
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
54VTK_ABI_NAMESPACE_BEGIN
56class vtkCamera;
58class vtkCoordinate;
59class vtkDataArray;
60class vtkIntArray;
62class vtkPoints;
63class vtkPolyData;
64class vtkRenderer;
65class vtkTextProperty;
66
67class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchy : public vtkPointSet
68{
69public:
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
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
254protected:
257
269
271
272 friend class vtkLabelHierarchyFrustumIterator;
273 friend class vtkLabelHierarchyFullSortIterator;
274 friend class implementation;
275
276private:
277 vtkLabelHierarchy(const vtkLabelHierarchy&) = delete;
278 void operator=(const vtkLabelHierarchy&) = delete;
279};
280
281VTK_ABI_NAMESPACE_END
282#endif // vtkLabelHierarchy_h
Abstract superclass for all arrays.
a virtual camera for 3D rendering
Definition vtkCamera.h:151
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
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:133
a simple class to control print indentation
Definition vtkIndent.h:108
dynamic, self-adjusting array of int
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.
vtkLabelHierarchyIterator * NewIterator(int type, vtkRenderer *ren, vtkCamera *cam, double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2])
Returns an iterator for this data object.
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)
vtkIdType FindCell(double *, vtkCell *, vtkGenericCell *, vtkIdType, double, int &, double *, double *) override
Inherited members (from vtkDataSet)
vtkCell * GetCell(vtkIdType) 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
static vtkLabelHierarchy * New()
vtkDataArray * Orientations
Implementation * GetImplementation()
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetPointCells(vtkIdType, vtkIdList *) override
Inherited members (from vtkDataSet)
concrete class for storing a set of points
Definition vtkPointSet.h:98
represent and manipulate 3D points
Definition vtkPoints.h:139
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract specification for renderers
represent text properties.
int vtkIdType
Definition vtkType.h:315
#define VTK_NEWINSTANCE