VTK  9.7.1
vtkHyperTreeGridOrientedGeometryCursor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkHyperTreeGridOrientedGeometryCursor_h
27 #define vtkHyperTreeGridOrientedGeometryCursor_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
31 #include "vtkHyperTreeGridTools.h" // for HasTree
32 #include "vtkObject.h"
33 
34 #include <memory> // For std::shared_ptr
35 #include <vector> // For std::vector
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkHyperTree;
39 class vtkHyperTreeGrid;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridOrientedGeometryCursor : public vtkObject
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49  void Dump(ostream& os);
50 
56 
60  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
61 
63 
66  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
68  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
69  double* origin);
70  void Initialize(vtkHyperTreeGridOrientedGeometryCursor* cursor);
72 
74 
77  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
79 
81 
84  vtkHyperTree* GetTree() const { return this->Tree; }
86 
90  vtkIdType GetVertexId();
91 
96  vtkIdType GetGlobalNodeIndex();
97 
102  unsigned char GetDimension();
103 
108  unsigned char GetNumberOfChildren();
109 
110  void SetGlobalIndexStart(vtkIdType index);
111  void SetGlobalIndexFromLocal(vtkIdType index);
112 
113  double* GetOrigin();
114  double* GetSize();
115 
116  void GetBounds(double bounds[6]);
117  void GetPoint(double point[3]);
118 
123  void SetMask(bool state);
124 
128  bool IsMasked();
129 
133  bool IsLeaf();
134 
135  void SubdivideLeaf();
136 
140  bool IsRoot();
141 
145  unsigned int GetLevel();
146 
154  void ToChild(unsigned char ichild);
155 
156 protected:
161 
166 
171 
173 
177  std::shared_ptr<vtkHyperTreeGridScales> Scales;
178 
179  unsigned int Level;
180 
181  // Hyper tree grid to which the cursor is attached
183 
184 private:
186  void operator=(const vtkHyperTreeGridOrientedGeometryCursor&) = delete;
187 };
188 VTK_ABI_NAMESPACE_END
189 #endif
void GetBounds(T a, double bds[6])
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
GeometryEntry is a cache data for cursors requiring coordinates.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
int vtkIdType
Definition: vtkType.h:363
bool HasTree() const
Return if a Tree pointing exist.
vtkHyperTreeGrid * Grid
Reference to the HTG currently processed.
a simple class to control print indentation
Definition: vtkIndent.h:28
std::shared_ptr< vtkHyperTreeGridScales > Scales
Storage of pre-computed per-level cell scales.
void GetPoint(int i, int j, int k, double pnt[3])
A data object structured as a tree.
Definition: vtkHyperTree.h:170
Dynamic generation of scales for vtkHyperTree.
bool HasTree(const T &e)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...