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 
70 class vtkAbstractArray;
71 class vtkCamera;
73 class vtkCoordinate;
74 class vtkDataArray;
75 class vtkIntArray;
77 class vtkPoints;
78 class vtkPolyData;
79 class vtkRenderer;
80 class vtkTextProperty;
81 
82 class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchy : public vtkPointSet
83 {
84 public:
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 
228  using vtkDataSet::GetCell;
230  void GetCell(vtkIdType, vtkGenericCell*) override;
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 
269 protected:
271  ~vtkLabelHierarchy() override;
272 
284 
286 
287  friend class vtkLabelHierarchyFrustumIterator;
288  friend class vtkLabelHierarchyFullSortIterator;
289  friend class implementation;
290 
291 private:
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:161
abstract class to specify cell behavior
Definition: vtkCell.h:150
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:165
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:143
a simple class to control print indentation
Definition: vtkIndent.h:119
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:155
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:109
represent and manipulate 3D points
Definition: vtkPoints.h:149
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
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