VTK  9.3.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
27 #ifndef vtkHyperTreeGridOrientedGeometryCursor_h
28 #define vtkHyperTreeGridOrientedGeometryCursor_h
29 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
32 #include "vtkHyperTreeGridTools.h" // for HasTree
33 #include "vtkObject.h"
34 
35 #include <memory> // For std::shared_ptr
36 #include <vector> // For std::vector
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkHyperTree;
40 class vtkHyperTreeGrid;
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridOrientedGeometryCursor : public vtkObject
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  void Dump(ostream& os);
51 
57 
61  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
62 
66  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
68 
72  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
73  double* origin);
74 
78  void Initialize(vtkHyperTreeGridOrientedGeometryCursor* cursor);
79 
81 
84  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
86 
88 
91  vtkHyperTree* GetTree() const { return this->Tree; }
93 
97  vtkIdType GetVertexId();
98 
103  vtkIdType GetGlobalNodeIndex();
104 
109  unsigned char GetDimension();
110 
115  unsigned char GetNumberOfChildren();
116 
120  void SetGlobalIndexStart(vtkIdType index);
121 
125  void SetGlobalIndexFromLocal(vtkIdType index);
126 
130  double* GetOrigin();
131  double* GetSize();
132 
136  void GetBounds(double bounds[6]);
137  void GetPoint(double point[3]);
138 
143  void SetMask(bool state);
144 
148  bool IsMasked();
149 
153  bool IsLeaf();
154 
158  void SubdivideLeaf();
159 
163  bool IsRoot();
164 
168  unsigned int GetLevel();
169 
177  void ToChild(unsigned char ichild);
178 
179 protected:
185 
191 
196 
201 
205  std::shared_ptr<vtkHyperTreeGridScales> Scales;
206 
210  unsigned int Level;
211 
212  // Hyper tree grid to which the cursor is attached
214 
215 private:
217  void operator=(const vtkHyperTreeGridOrientedGeometryCursor&) = delete;
218 };
219 VTK_ABI_NAMESPACE_END
220 #endif
void GetBounds(T a, double bds[6])
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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:315
bool HasTree() const
Return if a Tree pointing exist.
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
a simple class to control print indentation
Definition: vtkIndent.h:28
std::shared_ptr< vtkHyperTreeGridScales > Scales
JB 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:168
A specifalized type of vtkHyperTreeGrid for the case when root cells have uniform sizes in each direc...
bool HasTree(const T &e)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...