VTK  9.4.20241224
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
54
55VTK_ABI_NAMESPACE_BEGIN
57class vtkCamera;
59class vtkCoordinate;
60class vtkDataArray;
61class vtkIntArray;
63class vtkPoints;
64class vtkPolyData;
65class vtkRenderer;
66class vtkTextProperty;
67
68class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabelHierarchy : public vtkPointSet
69{
70public:
73 void PrintSelf(ostream& os, vtkIndent indent) override;
74
78 void SetPoints(vtkPoints*) override;
79
83 virtual void ComputeHierarchy();
84
86
90 vtkSetMacro(TargetLabelCount, int);
91 vtkGetMacro(TargetLabelCount, int);
93
95
98 vtkSetMacro(MaximumDepth, int);
99 vtkGetMacro(MaximumDepth, int);
101
106 {
110 FRUSTUM
111 };
112
114
117 virtual void SetTextProperty(vtkTextProperty* tprop);
118 vtkGetObjectMacro(TextProperty, vtkTextProperty);
120
122
125 virtual void SetPriorities(vtkDataArray* arr);
126 vtkGetObjectMacro(Priorities, vtkDataArray);
128
130
133 virtual void SetLabels(vtkAbstractArray* arr);
134 vtkGetObjectMacro(Labels, vtkAbstractArray);
136
138
141 virtual void SetOrientations(vtkDataArray* arr);
142 vtkGetObjectMacro(Orientations, vtkDataArray);
144
146
149 virtual void SetIconIndices(vtkIntArray* arr);
150 vtkGetObjectMacro(IconIndices, vtkIntArray);
152
154
157 virtual void SetSizes(vtkDataArray* arr);
158 vtkGetObjectMacro(Sizes, vtkDataArray);
160
162
165 virtual void SetBoundedSizes(vtkDataArray* arr);
166 vtkGetObjectMacro(BoundedSizes, vtkDataArray);
168
182 double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2]);
183
194 void GetDiscreteNodeCoordinatesFromWorldPoint(int ijk[3], double pt[3], int level);
195
207 static bool GetPathForNodalCoordinates(int* path, int ijk[3], int level);
208
210
217 int GetCellType(vtkIdType) override;
221 vtkIdType FindCell(double*, vtkCell*, vtkIdType, double, int&, double*, double*) override;
223 double*, vtkCell*, vtkGenericCell*, vtkIdType, double, int&, double*, double*) override;
224 int GetMaxCellSize() override;
226
227 class Implementation;
228 Implementation* GetImplementation() { return this->Impl; }
229
231
234 vtkGetObjectMacro(CenterPts, vtkPoints);
236
238
243 vtkGetObjectMacro(CoincidentPoints, vtkCoincidentPoints);
245
247
253 double frustumPlanes[24], vtkRenderer* ren, vtkCoordinate* anchorTransform);
255
256protected:
259
271
273
274 friend class vtkLabelHierarchyFrustumIterator;
275 friend class vtkLabelHierarchyFullSortIterator;
276 friend class implementation;
277
278private:
279 vtkLabelHierarchy(const vtkLabelHierarchy&) = delete;
280 void operator=(const vtkLabelHierarchy&) = delete;
281};
282
283VTK_ABI_NAMESPACE_END
284#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.
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
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_MARSHALAUTO
#define VTK_NEWINSTANCE