VTK  9.0.1
vtkHyperTreeGridNonOrientedSuperCursorLight.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridNonOrientedSuperCursorLight.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 vtkHyperTreeGridNonOrientedSuperCursorLight_h
39 #define vtkHyperTreeGridNonOrientedSuperCursorLight_h
40 
41 #include "vtkCommonDataModelModule.h" // For export macro
42 #include "vtkObject.h"
43 #include "vtkSmartPointer.h" // Used internally
44 
45 #include "vtkHyperTreeGridLevelEntry.h" // Used internally
46 
47 #include <cassert> // Used internally
48 #include <vector> // std::vector
49 
50 class vtkHyperTree;
51 class vtkHyperTreeGrid;
53 
54 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursorLight : 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 
168  void GetBounds(double bounds[6]);
169 
174  void GetPoint(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 
203  void ToChild(unsigned char);
204 
210  void ToRoot();
211 
217  void ToParent();
218 
222  unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
223 
228 protected:
233 
238 
243 
247  // JB vtkNew< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor;
249 
254  std::vector<unsigned int> FirstNonValidEntryByLevel;
255  std::vector<vtkHyperTreeGridLevelEntry> Entries;
256 
262  std::vector<unsigned int> ReferenceEntries;
263 
267  unsigned int GetIndiceEntry(unsigned int icursor)
268  {
269  assert("pre: icursor != IndiceCentralCursor" && icursor != this->IndiceCentralCursor);
270  assert("pre: valid_icursor" && icursor < this->NumberOfCursors);
271  if (icursor > this->IndiceCentralCursor)
272  {
273  assert("pre: valid_icursor" &&
274  0 <= long(this->FirstCurrentNeighboorReferenceEntry + icursor) - 1 &&
275  long(this->FirstCurrentNeighboorReferenceEntry + icursor) - 1 <
276  long(this->ReferenceEntries.size()));
277  assert("pre: valid_icursor" &&
278  this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor - 1] <
279  this->Entries.size());
280  return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor - 1];
281  }
282  else
283  {
284  assert("pre: valid_icursor" &&
285  this->FirstCurrentNeighboorReferenceEntry + icursor < this->ReferenceEntries.size());
286  assert("pre: valid_icursor" &&
287  this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor] <
288  this->Entries.size());
289  return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor];
290  }
291  }
292 
296  unsigned int GetIndicePreviousEntry(unsigned int icursor)
297  {
298  assert("pre: icursor != IndiceCentralCursor" && icursor != IndiceCentralCursor);
299  assert("pre: valid_icursor" && icursor < this->NumberOfCursors);
300  if (icursor > this->IndiceCentralCursor)
301  {
302  assert("pre: valid_icursor" &&
303  0 <=
304  long(this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor) -
305  1 &&
306  long(this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor) -
307  1 <
308  long(this->ReferenceEntries.size()));
309  assert("pre: valid_icursor" &&
310  this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
311  (this->NumberOfCursors - 1) + icursor - 1] < this->Entries.size());
312  return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
313  (this->NumberOfCursors - 1) + icursor - 1];
314  }
315  else
316  {
317  assert("pre: valid_icursor" &&
318  this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor <
319  this->ReferenceEntries.size());
320  assert("pre: valid_icursor" &&
321  this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
322  (this->NumberOfCursors - 1) + icursor] < this->Entries.size());
323  return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
324  (this->NumberOfCursors - 1) + icursor];
325  }
326  }
327 
331  unsigned int IndiceCentralCursor;
332 
333  // Number of cursors in supercursor
334  unsigned int NumberOfCursors;
335 
336  // Super cursor traversal table to go retrieve the parent index for each cursor
337  // of the child node. There are f^d * NumberOfCursors entries in the table.
338  const unsigned int* ChildCursorToParentCursorTable;
339 
340  // Super cursor traversal table to go retrieve the child index for each cursor
341  // of the child node. There are f^d * NumberOfCursors entries in the table.
342  const unsigned int* ChildCursorToChildTable;
343 
344 private:
347  void operator=(const vtkHyperTreeGridNonOrientedSuperCursorLight&) = delete;
348 };
349 
350 #endif
vtkHyperTreeGridNonOrientedSuperCursorLight::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:57
vtkHyperTreeGridNonOrientedSuperCursorLight::SubdivideLeaf
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
vtkHyperTreeGridNonOrientedSuperCursorLight::SetGlobalIndexStart
void SetGlobalIndexStart(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetVertexId
vtkIdType GetVertexId(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::ToRoot
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTreeGridNonOrientedSuperCursorLight::vtkHyperTreeGridNonOrientedSuperCursorLight
vtkHyperTreeGridNonOrientedSuperCursorLight()
JB Peut etre reporter les services GetCursor present dans la version non Light ?
vtkHyperTreeGridNonOrientedSuperCursorLight::CentralCursor
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:248
vtkHyperTreeGridNonOrientedSuperCursorLight::~vtkHyperTreeGridNonOrientedSuperCursorLight
~vtkHyperTreeGridNonOrientedSuperCursorLight() override
Destructor.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetNumberOfChildren
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkHyperTreeGridNonOrientedSuperCursorLight::ToChild
void ToChild(unsigned char)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridNonOrientedSuperCursorLight::ChildCursorToChildTable
const unsigned int * ChildCursorToChildTable
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:342
vtkHyperTreeGridNonOrientedSuperCursorLight::GetLevel
unsigned int GetLevel(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::GetPoint
void GetPoint(double point[3])
JB Coordonnees du centre de la maille En light, information non disponible sur les voisins.
vtkHyperTreeGridNonOrientedSuperCursorLight::SetMask
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetOrigin
double * GetOrigin()
JB.
vtkHyperTreeGridNonOrientedSuperCursorLight::IsRoot
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridNonOrientedSuperCursorLight::GetVertexId
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetInformation
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
JB.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkHyperTreeGridNonOrientedSuperCursorLight::GetTree
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetIndiceEntry
unsigned int GetIndiceEntry(unsigned int icursor)
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:267
vtkHyperTreeGridNonOrientedSuperCursorLight::IndiceCentralCursor
unsigned int IndiceCentralCursor
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:331
vtkHyperTreeGridNonOrientedSuperCursorLight::NumberOfCursors
unsigned int NumberOfCursors
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:334
vtkHyperTreeGridNonOrientedSuperCursorLight::FirstCurrentNeighboorReferenceEntry
unsigned int FirstCurrentNeighboorReferenceEntry
JB La derniere reference valide pour decrire tous les voisins.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:261
vtkHyperTreeGridNonOrientedSuperCursorLight::ReferenceEntries
std::vector< unsigned int > ReferenceEntries
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:262
vtkHyperTreeGridNonOrientedSuperCursorLight::GetTree
vtkHyperTree * GetTree(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::Clone
virtual vtkHyperTreeGridNonOrientedSuperCursorLight * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridNonOrientedSuperCursorLight::HasTree
bool HasTree()
Return if a Tree pointing exist.
vtkX3D::level
@ level
Definition: vtkX3D.h:401
vtkHyperTreeGridNonOrientedSuperCursorLight::GetNumberOfCursors
unsigned int GetNumberOfCursors()
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:222
vtkHyperTreeGridNonOrientedSuperCursorLight::IsLeaf
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkHyperTreeGridNonOrientedSuperCursorLight::IsMasked
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetBounds
void GetBounds(double bounds[6])
JB Coordonnees de la boite englobante En light, information non disponible sur les voisins.
vtkHyperTreeGridNonOrientedSuperCursorLight::Initialize
virtual void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)=0
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedSuperCursorLight::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridNonOrientedSuperCursorLight
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:55
vtkHyperTreeGridNonOrientedSuperCursorLight::GetSize
double * GetSize()
vtkHyperTreeGridNonOrientedSuperCursorLight::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::SetMask
void SetMask(unsigned int icursor, bool state)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkHyperTreeGridNonOrientedSuperCursorLight::GetGrid
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
vtkHyperTreeGridNonOrientedSuperCursorLight::Entries
std::vector< vtkHyperTreeGridLevelEntry > Entries
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:255
vtkSmartPointer.h
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:179
vtkHyperTreeGridNonOrientedSuperCursorLight::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex(unsigned int icursor)
JB Return the global index (relative to the grid) of the neighboor icursor current vertex in the tree...
vtkHyperTreeGridNonOrientedSuperCursorLight::ToParent
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTreeGridNonOrientedSuperCursorLight::Grid
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:242
vtkObject.h
vtkHyperTreeGridLevelEntry.h
vtkHyperTreeGridNonOrientedSuperCursorLight::IsLeaf
bool IsLeaf(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::GetIndicePreviousEntry
unsigned int GetIndicePreviousEntry(unsigned int icursor)
JB La valeur precedente.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:296
vtkHyperTreeGridNonOrientedSuperCursorLight::HasTree
bool HasTree(unsigned int icursor)
JB Return if a Tree pointing exist.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetDimension
unsigned char GetDimension()
Return the dimension of the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::IsMasked
bool IsMasked(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::ChildCursorToParentCursorTable
const unsigned int * ChildCursorToParentCursorTable
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:338
vtkHyperTreeGridNonOrientedSuperCursorLight::GetLevel
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkHyperTreeGridNonOrientedSuperCursorLight::CurrentFirstNonValidEntryByLevel
unsigned int CurrentFirstNonValidEntryByLevel
JB Hyper tree grid to which the cursor is attached.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:253
vtkHyperTreeGridNonOrientedSuperCursorLight::FirstNonValidEntryByLevel
std::vector< unsigned int > FirstNonValidEntryByLevel
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:254
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:97