VTK  9.3.1
vtkHyperTreeGridNonOrientedSuperCursor.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
30 #ifndef vtkHyperTreeGridNonOrientedSuperCursor_h
31 #define vtkHyperTreeGridNonOrientedSuperCursor_h
32 
33 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkObject.h"
35 #include "vtkSmartPointer.h" // Used internally
36 
37 #include "vtkHyperTreeGridGeometryLevelEntry.h" // Used Internally
38 
39 #include <vector> // For std::vector
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkHyperTree;
43 class vtkHyperTreeGrid;
46 
47 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursor : public vtkObject
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
58 
63  virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
64 
66 
69  vtkHyperTreeGrid* GetGrid();
71 
73 
76  bool HasTree();
78 
82  bool HasTree(unsigned int icursor);
83 
85 
88  vtkHyperTree* GetTree();
89  vtkHyperTree* GetTree(unsigned int icursor);
91 
95  vtkIdType GetVertexId();
96  vtkIdType GetVertexId(unsigned int icursor);
97 
102  vtkIdType GetGlobalNodeIndex();
103 
108  vtkIdType GetGlobalNodeIndex(unsigned int icursor);
109 
113  vtkHyperTree* GetInformation(
114  unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
115 
120  unsigned char GetDimension();
121 
126  unsigned char GetNumberOfChildren();
127 
131  void SetGlobalIndexStart(vtkIdType index);
132 
136  void SetGlobalIndexFromLocal(vtkIdType index);
137 
141  double* GetOrigin();
142  double* GetSize();
143 
148  void SetMask(bool state);
149  void SetMask(unsigned int icursor, bool state);
150 
154  bool IsMasked();
155  bool IsMasked(unsigned int icursor);
156 
160  void GetBounds(double bounds[6]);
161  void GetBounds(unsigned int icursor, double bounds[6]);
162 
166  void GetPoint(double point[3]);
167  void GetPoint(unsigned int icursor, double point[3]);
168 
172  bool IsLeaf();
173  bool IsLeaf(unsigned int icursor);
174 
178  void SubdivideLeaf();
179 
183  bool IsRoot();
184 
188  unsigned int GetLevel();
189  unsigned int GetLevel(unsigned int icursor);
190 
198  void ToChild(unsigned char ichild);
199 
205  void ToRoot();
206 
212  void ToParent();
213 
217  unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
218 
225  unsigned int icursor);
226 
233  unsigned int icursor);
234 
235 protected:
240 
245 
250 
254  // JB vtkNew< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor;
256 
261  std::vector<unsigned int> FirstNonValidEntryByLevel;
262  std::vector<vtkHyperTreeGridGeometryLevelEntry> Entries;
263 
269  std::vector<unsigned int> ReferenceEntries;
270 
274  unsigned int GetIndiceEntry(unsigned int icursor);
275 
279  unsigned int GetIndicePreviousEntry(unsigned int icursor);
280 
284  unsigned int IndiceCentralCursor;
285 
286  // Number of cursors in supercursor
287  unsigned int NumberOfCursors;
288 
289  // Super cursor traversal table to go retrieve the parent index for each cursor
290  // of the child node. There are f^d * NumberOfCursors entries in the table.
291  const unsigned int* ChildCursorToParentCursorTable;
292 
293  // Super cursor traversal table to go retrieve the child index for each cursor
294  // of the child node. There are f^d * NumberOfCursors entries in the table.
295  const unsigned int* ChildCursorToChildTable;
296 
297 private:
299  void operator=(const vtkHyperTreeGridNonOrientedSuperCursor&) = delete;
300 };
301 
302 VTK_ABI_NAMESPACE_END
303 #endif
void GetBounds(T a, double bds[6])
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
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.
std::vector< vtkHyperTreeGridGeometryLevelEntry > Entries
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:315
unsigned int FirstCurrentNeighboorReferenceEntry
JB La derniere reference valide pour decrire tous les voisins.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
JB.
a simple class to control print indentation
Definition: vtkIndent.h:28
void GetPoint(int i, int j, int k, double pnt[3])
A data object structured as a tree.
Definition: vtkHyperTree.h:168
bool HasTree(const T &e)
unsigned int CurrentFirstNonValidEntryByLevel
JB Hyper tree grid to which the cursor is attached.