VTK  9.2.5
vtkLabelHierarchy.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkLabelHierarchy.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
64#ifndef vtkLabelHierarchy_h
65#define vtkLabelHierarchy_h
66
67#include "vtkPointSet.h"
68#include "vtkRenderingLabelModule.h" // For export macro
69
71class vtkCamera;
73class vtkCoordinate;
74class vtkDataArray;
75class vtkIntArray;
77class vtkPoints;
78class vtkPolyData;
79class vtkRenderer;
80class vtkTextProperty;
81
82class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchy : public vtkPointSet
83{
84public:
87 void PrintSelf(ostream& os, vtkIndent indent) override;
88
92 void SetPoints(vtkPoints*) override;
93
97 virtual void ComputeHierarchy();
98
100
104 vtkSetMacro(TargetLabelCount, int);
105 vtkGetMacro(TargetLabelCount, int);
107
109
112 vtkSetMacro(MaximumDepth, int);
113 vtkGetMacro(MaximumDepth, int);
115
120 {
124 FRUSTUM
125 };
126
128
131 virtual void SetTextProperty(vtkTextProperty* tprop);
132 vtkGetObjectMacro(TextProperty, vtkTextProperty);
134
136
139 virtual void SetPriorities(vtkDataArray* arr);
140 vtkGetObjectMacro(Priorities, vtkDataArray);
142
144
147 virtual void SetLabels(vtkAbstractArray* arr);
148 vtkGetObjectMacro(Labels, vtkAbstractArray);
150
152
155 virtual void SetOrientations(vtkDataArray* arr);
156 vtkGetObjectMacro(Orientations, vtkDataArray);
158
160
163 virtual void SetIconIndices(vtkIntArray* arr);
164 vtkGetObjectMacro(IconIndices, vtkIntArray);
166
168
171 virtual void SetSizes(vtkDataArray* arr);
172 vtkGetObjectMacro(Sizes, vtkDataArray);
174
176
179 virtual void SetBoundedSizes(vtkDataArray* arr);
180 vtkGetObjectMacro(BoundedSizes, vtkDataArray);
182
196 double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2]);
197
208 void GetDiscreteNodeCoordinatesFromWorldPoint(int ijk[3], double pt[3], int level);
209
221 static bool GetPathForNodalCoordinates(int* path, int ijk[3], int level);
222
224
231 int GetCellType(vtkIdType) override;
234 vtkIdType FindCell(double*, vtkCell*, vtkIdType, double, int&, double*, double*) override;
236 double*, vtkCell*, vtkGenericCell*, vtkIdType, double, int&, double*, double*) override;
237 int GetMaxCellSize() override;
239
240 class Implementation;
241 Implementation* GetImplementation() { return this->Impl; }
242
244
247 vtkGetObjectMacro(CenterPts, vtkPoints);
249
251
256 vtkGetObjectMacro(CoincidentPoints, vtkCoincidentPoints);
258
260
266 double frustumPlanes[24], vtkRenderer* ren, vtkCoordinate* anchorTransform);
268
269protected:
272
284
286
287 friend class vtkLabelHierarchyFrustumIterator;
288 friend class vtkLabelHierarchyFullSortIterator;
289 friend class implementation;
290
291private:
292 vtkLabelHierarchy(const vtkLabelHierarchy&) = delete;
293 void operator=(const vtkLabelHierarchy&) = delete;
294};
295
296#endif // vtkLabelHierarchy_h
Abstract superclass for all arrays.
a virtual camera for 3D rendering
Definition: vtkCamera.h:52
abstract class to specify cell behavior
Definition: vtkCell.h:61
contains an octree of labels
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:80
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:56
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:34
a simple class to control print indentation
Definition: vtkIndent.h:40
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
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)
vtkDataArray * Sizes
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
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:70
represent and manipulate 3D points
Definition: vtkPoints.h:40
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:91
abstract specification for renderers
Definition: vtkRenderer.h:73
represent text properties.
int vtkIdType
Definition: vtkType.h:332
#define VTK_NEWINSTANCE