VTK  9.3.1
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.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
33 #ifndef vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor_h
34 #define vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor_h
35 
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkObject.h"
38 
39 #include "vtkHyperTreeGridGeometryUnlimitedLevelEntry.h" // cache for historic
40 #include "vtkHyperTreeGridTools.h" // for HasTree
41 #include "vtkSmartPointer.h" // Used internally
42 #include <memory> // std::shared_ptr
43 #include <vector> // std::vector
44 
45 VTK_ABI_NAMESPACE_BEGIN
46 class vtkHyperTree;
47 class vtkHyperTreeGrid;
51 
53  : public vtkObject
54 {
55 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
60  void Dump(ostream& os);
61 
62  // JB TODO 102018 On autorise le ToParent que jusqu'à ce que Level soit celui de la creation...
63  // mais sans toRoot ? Une variante... qui serait utile aussi au niveau des SC
64 
70 
74  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
75 
79  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
81 
85  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
86  double* origin);
87 
92 
94 
97  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
99 
101 
104  vtkHyperTree* GetTree() const { return this->Tree; }
106 
110  vtkIdType GetVertexId();
111 
116  vtkIdType GetGlobalNodeIndex();
117 
122  unsigned char GetDimension();
123 
128  unsigned char GetNumberOfChildren();
129 
133  void SetGlobalIndexStart(vtkIdType index);
134 
138  void SetGlobalIndexFromLocal(vtkIdType index);
139 
143  double* GetOrigin();
144  double* GetSize();
145 
149  void GetBounds(double bounds[6]);
150  void GetPoint(double point[3]);
151 
156  void SetMask(bool state);
157 
161  bool IsMasked();
162 
167  bool IsLeaf();
168 
173  bool IsRealLeaf();
174 
179  bool IsVirtualLeaf();
180 
184  bool IsRoot();
185 
189  unsigned int GetLevel();
190  unsigned int GetLastRealLevel();
191 
199  void ToChild(unsigned char ichild);
200 
206  void ToRoot();
207 
213  void ToParent();
214 
219  vtkSmartPointer<vtkHyperTreeGridOrientedGeometryCursor> GetHyperTreeGridOrientedGeometryCursor(
220  vtkHyperTreeGrid* grid);
221 
227  GetHyperTreeGridNonOrientedGeometryCursor(vtkHyperTreeGrid* grid);
228 
229 protected:
235 
241 
246 
251 
255  std::shared_ptr<vtkHyperTreeGridScales> Scales;
256 
260  unsigned int Level;
261 
266 
267  // Hyper tree grid to which the cursor is attached
268  std::vector<vtkHyperTreeGridGeometryUnlimitedLevelEntry> Entries;
269 
270 private:
273  void operator=(const vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor&) = delete;
274 };
275 VTK_ABI_NAMESPACE_END
276 #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.
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:315
a simple class to control print indentation
Definition: vtkIndent.h:28
Cursor cache data with coordinates and level info.
vtkHyperTreeGrid * Grid
Reference sur l'hyper tree grid parcouru actuellement.
std::vector< vtkHyperTreeGridGeometryUnlimitedLevelEntry > Entries
void GetPoint(int i, int j, int k, double pnt[3])
A data object structured as a tree.
Definition: vtkHyperTree.h:168
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
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...
std::shared_ptr< vtkHyperTreeGridScales > Scales
Storage of pre-computed per-level cell scales.