VTK  9.1.20211230
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 -------------------------------------------------------------------------*/
61 #ifndef vtkLabelHierarchy_h
62 #define vtkLabelHierarchy_h
63 
64 #include "vtkPointSet.h"
65 #include "vtkRenderingLabelModule.h" // For export macro
66 
67 class vtkAbstractArray;
68 class vtkCamera;
70 class vtkCoordinate;
71 class vtkDataArray;
72 class vtkIntArray;
74 class vtkPoints;
75 class vtkPolyData;
76 class vtkRenderer;
77 class vtkTextProperty;
78 
79 class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchy : public vtkPointSet
80 {
81 public:
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
89  void SetPoints(vtkPoints*) override;
90 
94  virtual void ComputeHierarchy();
95 
97 
101  vtkSetMacro(TargetLabelCount, int);
102  vtkGetMacro(TargetLabelCount, int);
104 
106 
109  vtkSetMacro(MaximumDepth, int);
110  vtkGetMacro(MaximumDepth, int);
112 
117  {
121  FRUSTUM
122  };
123 
125 
128  virtual void SetTextProperty(vtkTextProperty* tprop);
129  vtkGetObjectMacro(TextProperty, vtkTextProperty);
131 
133 
136  virtual void SetPriorities(vtkDataArray* arr);
137  vtkGetObjectMacro(Priorities, vtkDataArray);
139 
141 
144  virtual void SetLabels(vtkAbstractArray* arr);
145  vtkGetObjectMacro(Labels, vtkAbstractArray);
147 
149 
152  virtual void SetOrientations(vtkDataArray* arr);
153  vtkGetObjectMacro(Orientations, vtkDataArray);
155 
157 
160  virtual void SetIconIndices(vtkIntArray* arr);
161  vtkGetObjectMacro(IconIndices, vtkIntArray);
163 
165 
168  virtual void SetSizes(vtkDataArray* arr);
169  vtkGetObjectMacro(Sizes, vtkDataArray);
171 
173 
176  virtual void SetBoundedSizes(vtkDataArray* arr);
177  vtkGetObjectMacro(BoundedSizes, vtkDataArray);
179 
193  double frustumPlanes[24], bool positionsAsNormals, float bucketSize[2]);
194 
205  void GetDiscreteNodeCoordinatesFromWorldPoint(int ijk[3], double pt[3], int level);
206 
218  static bool GetPathForNodalCoordinates(int* path, int ijk[3], int level);
219 
221 
225  using vtkDataSet::GetCell;
227  void GetCell(vtkIdType, vtkGenericCell*) override;
228  int GetCellType(vtkIdType) override;
231  vtkIdType FindCell(double*, vtkCell*, vtkIdType, double, int&, double*, double*) override;
233  double*, vtkCell*, vtkGenericCell*, vtkIdType, double, int&, double*, double*) override;
234  int GetMaxCellSize() override;
236 
237  class Implementation;
238  Implementation* GetImplementation() { return this->Impl; }
239 
241 
244  vtkGetObjectMacro(CenterPts, vtkPoints);
246 
248 
253  vtkGetObjectMacro(CoincidentPoints, vtkCoincidentPoints);
255 
257 
263  double frustumPlanes[24], vtkRenderer* ren, vtkCoordinate* anchorTransform);
265 
266 protected:
268  ~vtkLabelHierarchy() override;
269 
281 
283 
284  friend class vtkLabelHierarchyFrustumIterator;
285  friend class vtkLabelHierarchyFullSortIterator;
286  friend class implementation;
287 
288 private:
289  vtkLabelHierarchy(const vtkLabelHierarchy&) = delete;
290  void operator=(const vtkLabelHierarchy&) = delete;
291 };
292 
293 #endif // vtkLabelHierarchy_h
Abstract superclass for all arrays.
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
abstract class to specify cell behavior
Definition: vtkCell.h:147
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:159
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:140
a simple class to control print indentation
Definition: vtkIndent.h:113
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:149
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 methdos 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:106
represent and manipulate 3D points
Definition: vtkPoints.h:143
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:194
abstract specification for renderers
Definition: vtkRenderer.h:182
represent text properties.
@ level
Definition: vtkX3D.h:401
@ type
Definition: vtkX3D.h:522
int vtkIdType
Definition: vtkType.h:332
#define VTK_NEWINSTANCE