VTK  9.0.3
vtkHyperTreeGridNonOrientedSuperCursor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridNonOrientedSuperCursor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright Nonice for more information.
13 
14 =========================================================================*/
38 #ifndef vtkHyperTreeGridNonOrientedSuperCursor_h
39 #define vtkHyperTreeGridNonOrientedSuperCursor_h
40 
41 #include "vtkCommonDataModelModule.h" // For export macro
42 #include "vtkObject.h"
43 #include "vtkSmartPointer.h" // Used internally
44 
45 #include "vtkHyperTreeGridGeometryLevelEntry.h" // Used Internally
46 
47 #include <vector> // For std::vector
48 
49 class vtkHyperTree;
50 class vtkHyperTreeGrid;
53 
54 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursor : public vtkObject
55 {
56 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
65 
70  virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
71 
73 
78 
80 
83  bool HasTree();
85 
89  bool HasTree(unsigned int icursor);
90 
92 
96  vtkHyperTree* GetTree(unsigned int icursor);
98 
103  vtkIdType GetVertexId(unsigned int icursor);
104 
110 
115  vtkIdType GetGlobalNodeIndex(unsigned int icursor);
116 
121  unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
122 
127  unsigned char GetDimension();
128 
133  unsigned char GetNumberOfChildren();
134 
139 
144 
148  double* GetOrigin();
149  double* GetSize();
150 
155  void SetMask(bool state);
156  void SetMask(unsigned int icursor, bool state);
157 
161  bool IsMasked();
162  bool IsMasked(unsigned int icursor);
163 
167  void GetBounds(double bounds[6]);
168  void GetBounds(unsigned int icursor, double bounds[6]);
169 
173  void GetPoint(double point[3]);
174  void GetPoint(unsigned int icursor, double point[3]);
175 
179  bool IsLeaf();
180  bool IsLeaf(unsigned int icursor);
181 
186 
190  bool IsRoot();
191 
195  unsigned int GetLevel();
196  unsigned int GetLevel(unsigned int icursor);
197 
205  void ToChild(unsigned char ichild);
206 
212  void ToRoot();
213 
219  void ToParent();
220 
224  unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
225 
232  unsigned int icursor);
233 
240  unsigned int icursor);
241 
242 protected:
247 
252 
257 
261  // JB vtkNew< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor;
263 
268  std::vector<unsigned int> FirstNonValidEntryByLevel;
269  std::vector<vtkHyperTreeGridGeometryLevelEntry> Entries;
270 
276  std::vector<unsigned int> ReferenceEntries;
277 
281  unsigned int GetIndiceEntry(unsigned int icursor);
282 
286  unsigned int GetIndicePreviousEntry(unsigned int icursor);
287 
291  unsigned int IndiceCentralCursor;
292 
293  // Number of cursors in supercursor
294  unsigned int NumberOfCursors;
295 
296  // Super cursor traversal table to go retrieve the parent index for each cursor
297  // of the child node. There are f^d * NumberOfCursors entries in the table.
298  const unsigned int* ChildCursorToParentCursorTable;
299 
300  // Super cursor traversal table to go retrieve the child index for each cursor
301  // of the child node. There are f^d * NumberOfCursors entries in the table.
302  const unsigned int* ChildCursorToChildTable;
303 
304 private:
306  void operator=(const vtkHyperTreeGridNonOrientedSuperCursor&) = delete;
307 };
308 
309 #endif
vtkHyperTree * GetTree(unsigned int icursor)
void GetBounds(double bounds[6])
JB Coordonnees de la boite englobante.
bool IsLeaf(unsigned int icursor)
void GetPoint(unsigned int icursor, double point[3])
bool IsMasked()
Determine whether blanking mask is empty or not.
std::vector< vtkHyperTreeGridGeometryLevelEntry > Entries
bool IsLeaf()
Is the cursor pointing to a leaf?
~vtkHyperTreeGridNonOrientedSuperCursor() override
Destructor.
bool IsMasked(unsigned int icursor)
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
void GetPoint(double point[3])
JB Coordonnees du centre de la maille.
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
JB.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
bool HasTree()
Return if a Tree pointing exist.
vtkHyperTreeGridNonOrientedSuperCursor()
Constructor.
virtual vtkHyperTreeGridNonOrientedSuperCursor * Clone()
Create a copy of ‘this’.
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
unsigned int CurrentFirstNonValidEntryByLevel
JB Hyper tree grid to which the cursor is attached.
unsigned int GetIndicePreviousEntry(unsigned int icursor)
JB La valeur precedente.
bool IsRoot()
Is the cursor at tree root?
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
unsigned int FirstCurrentNeighboorReferenceEntry
JB La derniere reference valide pour decrire tous les voisins.
unsigned int GetLevel(unsigned int icursor)
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
unsigned char GetDimension()
Return the dimension of the tree.
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
bool HasTree(unsigned int icursor)
JB Return if a Tree pointing exist.
vtkIdType GetGlobalNodeIndex(unsigned int icursor)
JB Return the global index (relative to the grid) of the neighboor icursor current vertex in the tree...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)=0
Initialize cursor at root of given tree index in grid.
void SetGlobalIndexStart(vtkIdType index)
JB.
unsigned int GetIndiceEntry(unsigned int icursor)
JB.
void SetMask(unsigned int icursor, bool state)
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
vtkIdType GetVertexId(unsigned int icursor)
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
JB.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetNonOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
void GetBounds(unsigned int icursor, double bounds[6])
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
A data object structured as a tree.
Definition: vtkHyperTree.h:179
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:54
Hold a reference to a vtkObjectBase instance.
@ point
Definition: vtkX3D.h:242
@ level
Definition: vtkX3D.h:401
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:338