VTK  9.3.20240327
vtkLabelHierarchyIterator.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
12 #ifndef vtkLabelHierarchyIterator_h
13 #define vtkLabelHierarchyIterator_h
14 
15 #include "vtkObject.h"
16 #include "vtkRenderingLabelModule.h" // For export macro
17 #include "vtkStdString.h" // for std string
18 
19 VTK_ABI_NAMESPACE_BEGIN
20 class vtkIdTypeArray;
21 class vtkLabelHierarchy;
22 class vtkPolyData;
23 
24 class VTKRENDERINGLABEL_EXPORT vtkLabelHierarchyIterator : public vtkObject
25 {
26 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
36  virtual void Begin(vtkIdTypeArray*) {}
37 
41  virtual void Next() {}
42 
46  virtual bool IsAtEnd() { return true; }
47 
51  virtual void GetPoint(double x[3]);
52 
56  virtual void GetSize(double sz[2]);
57 
61  virtual void GetBoundedSize(double sz[2]);
62 
66  virtual int GetType();
67 
72 
76  virtual double GetOrientation();
77 
81  virtual vtkIdType GetLabelId() { return -1; }
82 
84 
87  vtkGetObjectMacro(Hierarchy, vtkLabelHierarchy);
89 
95 
102  virtual void GetNodeGeometry(double ctr[3], double& size) = 0;
103 
109  virtual void BoxNode();
110 
116  virtual void BoxAllNodes(vtkPolyData*);
117 
119 
125  vtkSetMacro(AllBounds, int);
126  vtkGetMacro(AllBounds, int);
128 
129 protected:
132 
133  void BoxNodeInternal3(const double* ctr, double sz);
134  void BoxNodeInternal2(const double* ctr, double sz);
135 
140 
143  double BoundsFactor;
146 
147 private:
149  void operator=(const vtkLabelHierarchyIterator&) = delete;
150 };
151 
152 VTK_ABI_NAMESPACE_END
153 #endif // vtkLabelHierarchyIterator_h
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:108
iterator over vtkLabelHierarchy
virtual void Next()
Advance the iterator.
virtual void SetTraversedBounds(vtkPolyData *)
Sets a polydata to fill with geometry representing the bounding boxes of the traversed octree nodes.
virtual void SetHierarchy(vtkLabelHierarchy *h)
The hierarchy being traversed by this iterator.
virtual void GetPoint(double x[3])
Retrieves the current label location.
virtual void BoxNode()
Add a representation to TraversedBounds for the current octree node.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkStdString GetLabel()
Retrieves the current label string.
virtual void GetNodeGeometry(double ctr[3], double &size)=0
Retrieve the coordinates of the center of the current hierarchy node and the size of the node.
virtual bool IsAtEnd()
Returns true if the iterator is at the end.
virtual vtkIdType GetLabelId()
Retrieves the current label id.
virtual void Begin(vtkIdTypeArray *)
Initializes the iterator.
virtual void BoxAllNodes(vtkPolyData *)
Add a representation for all existing octree nodes to the specified polydata.
virtual void GetBoundedSize(double sz[2])
Retrieves the current label maximum width in world coordinates.
~vtkLabelHierarchyIterator() override
virtual int GetType()
Retrieves the current label type.
void BoxNodeInternal3(const double *ctr, double sz)
virtual void GetSize(double sz[2])
Retrieves the current label size.
virtual double GetOrientation()
Retrieves the current label orientation.
void BoxNodeInternal2(const double *ctr, double sz)
contains an octree of labels
abstract base class for most VTK objects
Definition: vtkObject.h:161
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
Computes the portion of a dataset which is inside a selection.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
@ size
Definition: vtkX3D.h:253
int vtkIdType
Definition: vtkType.h:315