VTK: Common/DataModel/vtkHyperTreeGridNonOrientedSuperCursorLight.h Source File

| VTK 9.3.1

vtkHyperTreeGridNonOrientedSuperCursorLight.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
26 #ifndef vtkHyperTreeGridNonOrientedSuperCursorLight_h
27 #define vtkHyperTreeGridNonOrientedSuperCursorLight_h
28
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkObject.h"
31 #include "vtkSmartPointer.h" // Used internally
32
33 #include "vtkHyperTreeGridLevelEntry.h" // Used internally
34
35 #include <cassert> // Used internally
36 #include <vector> // std::vector
37
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkHyperTree;
40 class vtkHyperTreeGrid;
41 class vtkHyperTreeGridNonOrientedGeometryCursor;
42
43 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursorLight : public vtkObject
44 {
45 public:
46 vtkTypeMacro(vtkHyperTreeGridNonOrientedSuperCursorLight, vtkObject);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
53 virtual vtkHyperTreeGridNonOrientedSuperCursorLight* Clone();
54
59 virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
60
62
65 vtkHyperTreeGrid* GetGrid();
67
69
72 bool HasTree();
74
78 bool HasTree(unsigned int icursor);
79
81
84 vtkHyperTree* GetTree();
85 vtkHyperTree* GetTree(unsigned int icursor);
87
91 vtkIdType GetVertexId();
92 vtkIdType GetVertexId(unsigned int icursor);
93
98 vtkIdType GetGlobalNodeIndex();
99
104 vtkIdType GetGlobalNodeIndex(unsigned int icursor);
105
109 vtkHyperTree* GetInformation(
110 unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
111
116 unsigned char GetDimension();
117
122 unsigned char GetNumberOfChildren();
123
127 void SetGlobalIndexStart(vtkIdType index);
128
132 void SetGlobalIndexFromLocal(vtkIdType index);
133
137 double* GetOrigin();
138 double* GetSize();
139
144 void SetMask(bool state);
145 void SetMask(unsigned int icursor, bool state);
146
150 bool IsMasked();
151 bool IsMasked(unsigned int icursor);
152
157 void GetBounds(double bounds[6]);
158
163 void GetPoint(double point[3]);
164
168 bool IsLeaf();
169 bool IsLeaf(unsigned int icursor);
170
174 void SubdivideLeaf();
175
179 bool IsRoot();
180
184 unsigned int GetLevel();
185 unsigned int GetLevel(unsigned int icursor);
186
192 void ToChild(unsigned char);
193
199 void ToRoot();
200
206 void ToParent();
207
211 unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
212
217 protected:
221 vtkHyperTreeGridNonOrientedSuperCursorLight();
222
226 ~vtkHyperTreeGridNonOrientedSuperCursorLight() override;
227
231 vtkHyperTreeGrid* Grid;
232
236 // JB vtkNew< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor;
237 vtkSmartPointer<vtkHyperTreeGridNonOrientedGeometryCursor> CentralCursor;
238
242 unsigned int CurrentFirstNonValidEntryByLevel;
243 std::vector<unsigned int> FirstNonValidEntryByLevel;
244 std::vector<vtkHyperTreeGridLevelEntry> Entries;
245
250 unsigned int FirstCurrentNeighboorReferenceEntry;
251 std::vector<unsigned int> ReferenceEntries;
252
256 unsigned int GetIndiceEntry(unsigned int icursor)
257 {
258 assert("pre: icursor != IndiceCentralCursor" && icursor != this->IndiceCentralCursor);
259 assert("pre: valid_icursor" && icursor < this->NumberOfCursors);
260 if (icursor > this->IndiceCentralCursor)
261 {
262 assert("pre: valid_icursor" &&
263 0 <= long(this->FirstCurrentNeighboorReferenceEntry + icursor) - 1 &&
264 long(this->FirstCurrentNeighboorReferenceEntry + icursor) - 1 <
265 long(this->ReferenceEntries.size()));
266 assert("pre: valid_icursor" &&
267 this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor - 1] <
268 this->Entries.size());
269 return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor - 1];
270 }
271 else
272 {
273 assert("pre: valid_icursor" &&
274 this->FirstCurrentNeighboorReferenceEntry + icursor < this->ReferenceEntries.size());
275 assert("pre: valid_icursor" &&
276 this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor] <
277 this->Entries.size());
278 return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + icursor];
279 }
280 }
281
285 unsigned int GetIndicePreviousEntry(unsigned int icursor)
286 {
287 assert("pre: icursor != IndiceCentralCursor" && icursor != IndiceCentralCursor);
288 assert("pre: valid_icursor" && icursor < this->NumberOfCursors);
289 if (icursor > this->IndiceCentralCursor)
290 {
291 assert("pre: valid_icursor" &&
292 0 <=
293 long(this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor) -
294 1 &&
295 long(this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor) -
296 1 <
297 long(this->ReferenceEntries.size()));
298 assert("pre: valid_icursor" &&
299 this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
300 (this->NumberOfCursors - 1) + icursor - 1] < this->Entries.size());
301 return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
302 (this->NumberOfCursors - 1) + icursor - 1];
303 }
304 else
305 {
306 assert("pre: valid_icursor" &&
307 this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor <
308 this->ReferenceEntries.size());
309 assert("pre: valid_icursor" &&
310 this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
311 (this->NumberOfCursors - 1) + icursor] < this->Entries.size());
312 return this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
313 (this->NumberOfCursors - 1) + icursor];
314 }
315 }
316
320 unsigned int IndiceCentralCursor;
321
322 // Number of cursors in supercursor
323 unsigned int NumberOfCursors;
324
325 // Super cursor traversal table to go retrieve the parent index for each cursor
326 // of the child node. There are f^d * NumberOfCursors entries in the table.
327 const unsigned int* ChildCursorToParentCursorTable;
328
329 // Super cursor traversal table to go retrieve the child index for each cursor
330 // of the child node. There are f^d * NumberOfCursors entries in the table.
331 const unsigned int* ChildCursorToChildTable;
332
333 private:
334 vtkHyperTreeGridNonOrientedSuperCursorLight(
335 const vtkHyperTreeGridNonOrientedSuperCursorLight&) = delete;
336 void operator=(const vtkHyperTreeGridNonOrientedSuperCursorLight&) = delete;
337 };
338
339 VTK_ABI_NAMESPACE_END
340 #endif
vtkHyperTreeGridNonOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:52
vtkHyperTreeGridNonOrientedSuperCursorLight
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:44
vtkHyperTreeGridNonOrientedSuperCursorLight::GetBounds
void GetBounds(double bounds[6])
JB Coordonnees de la boite englobante En light, information non disponible sur les voisins.
vtkHyperTreeGridNonOrientedSuperCursorLight::CentralCursor
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:237
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::GetTree
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
vtkHyperTreeGridNonOrientedSuperCursorLight::SubdivideLeaf
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
vtkHyperTreeGridNonOrientedSuperCursorLight::IsLeaf
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkHyperTreeGridNonOrientedSuperCursorLight::Entries
std::vector< vtkHyperTreeGridLevelEntry > Entries
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:244
vtkHyperTreeGridNonOrientedSuperCursorLight::IndiceCentralCursor
unsigned int IndiceCentralCursor
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:320
vtkHyperTreeGridNonOrientedSuperCursorLight::SetMask
void SetMask(unsigned int icursor, bool state)
vtkHyperTreeGridNonOrientedSuperCursorLight::~vtkHyperTreeGridNonOrientedSuperCursorLight
~vtkHyperTreeGridNonOrientedSuperCursorLight() override
Destructor.
vtkHyperTreeGridNonOrientedSuperCursorLight::NumberOfCursors
unsigned int NumberOfCursors
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:323
vtkHyperTreeGridNonOrientedSuperCursorLight::vtkHyperTreeGridNonOrientedSuperCursorLight
vtkHyperTreeGridNonOrientedSuperCursorLight()
JB Peut etre reporter les services GetCursor present dans la version non Light ?
vtkHyperTreeGridNonOrientedSuperCursorLight::ChildCursorToChildTable
const unsigned int * ChildCursorToChildTable
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:331
vtkHyperTreeGridNonOrientedSuperCursorLight::IsRoot
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridNonOrientedSuperCursorLight::GetSize
double * GetSize()
vtkHyperTreeGridNonOrientedSuperCursorLight::GetPoint
void GetPoint(double point[3])
JB Coordonnees du centre de la maille En light, information non disponible sur les voisins.
vtkHyperTreeGridNonOrientedSuperCursorLight::ChildCursorToParentCursorTable
const unsigned int * ChildCursorToParentCursorTable
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:327
vtkHyperTreeGridNonOrientedSuperCursorLight::GetDimension
unsigned char GetDimension()
Return the dimension of the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetVertexId
vtkIdType GetVertexId(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::FirstCurrentNeighboorReferenceEntry
unsigned int FirstCurrentNeighboorReferenceEntry
JB La derniere reference valide pour decrire tous les voisins.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:250
vtkHyperTreeGridNonOrientedSuperCursorLight::GetNumberOfChildren
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetIndicePreviousEntry
unsigned int GetIndicePreviousEntry(unsigned int icursor)
JB La valeur precedente.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:285
vtkHyperTreeGridNonOrientedSuperCursorLight::ToParent
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetLevel
unsigned int GetLevel(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::IsMasked
bool IsMasked(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::Grid
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:231
vtkHyperTreeGridNonOrientedSuperCursorLight::GetGrid
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
vtkHyperTreeGridNonOrientedSuperCursorLight::Initialize
virtual void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)=0
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetVertexId
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkHyperTreeGridNonOrientedSuperCursorLight::ToRoot
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetTree
vtkHyperTree * GetTree(unsigned int icursor)
Set the hyper tree to which the cursor is pointing.
vtkHyperTreeGridNonOrientedSuperCursorLight::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetIndiceEntry
unsigned int GetIndiceEntry(unsigned int icursor)
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:256
vtkHyperTreeGridNonOrientedSuperCursorLight::IsMasked
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTreeGridNonOrientedSuperCursorLight::FirstNonValidEntryByLevel
std::vector< unsigned int > FirstNonValidEntryByLevel
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:243
vtkHyperTreeGridNonOrientedSuperCursorLight::GetOrigin
double * GetOrigin()
JB.
vtkHyperTreeGridNonOrientedSuperCursorLight::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetLevel
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
vtkHyperTreeGridNonOrientedSuperCursorLight::Clone
virtual vtkHyperTreeGridNonOrientedSuperCursorLight * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridNonOrientedSuperCursorLight::IsLeaf
bool IsLeaf(unsigned int icursor)
vtkHyperTreeGridNonOrientedSuperCursorLight::GetNumberOfCursors
unsigned int GetNumberOfCursors()
JB.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:211
vtkHyperTreeGridNonOrientedSuperCursorLight::SetMask
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGridNonOrientedSuperCursorLight::GetInformation
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
JB.
vtkHyperTreeGridNonOrientedSuperCursorLight::HasTree
bool HasTree()
Return if a Tree pointing exist.
vtkHyperTreeGridNonOrientedSuperCursorLight::SetGlobalIndexStart
void SetGlobalIndexStart(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedSuperCursorLight::HasTree
bool HasTree(unsigned int icursor)
JB Return if a Tree pointing exist.
vtkHyperTreeGridNonOrientedSuperCursorLight::CurrentFirstNonValidEntryByLevel
unsigned int CurrentFirstNonValidEntryByLevel
JB Hyper tree grid to which the cursor is attached.
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:242
vtkHyperTreeGridNonOrientedSuperCursorLight::ToChild
void ToChild(unsigned char)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridNonOrientedSuperCursorLight::ReferenceEntries
std::vector< unsigned int > ReferenceEntries
Definition: vtkHyperTreeGridNonOrientedSuperCursorLight.h:251
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:91
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:169
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor >
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkHyperTreeGridLevelEntry.h
vtkObject.h
vtkSmartPointer.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315