VTK  9.2.6
vtkHyperTreeGridNonOrientedGeometryCursor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridNonOrientedGeometryCursor.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 =========================================================================*/
42 #ifndef vtkHyperTreeGridNonOrientedGeometryCursor_h
43 #define vtkHyperTreeGridNonOrientedGeometryCursor_h
44 
45 #include "vtkCommonDataModelModule.h" // For export macro
46 #include "vtkObject.h"
47 
48 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
49 #include "vtkHyperTreeGridTools.h" // for HasTree
50 #include "vtkSmartPointer.h" // Used internally
51 #include <memory> // std::shared_ptr
52 #include <vector> // std::vector
53 
54 class vtkHyperTree;
55 class vtkHyperTreeGrid;
58 
59 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedGeometryCursor : public vtkObject
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
66  void Dump(ostream& os);
67 
68  // JB TODO 102018 On autorise le ToParent que jusqu'à ce que Level soit celui de la creation...
69  // mais sans toRoot ? Une variante... qui serait utile aussi au niveau des SC
70 
76 
80  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
81 
85  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
87 
91  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
92  double* origin);
93 
97  void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor* cursor);
98 
100 
103  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
105 
107 
110  vtkHyperTree* GetTree() const { return this->Tree; }
112 
116  vtkIdType GetVertexId();
117 
122  vtkIdType GetGlobalNodeIndex();
123 
128  unsigned char GetDimension();
129 
134  unsigned char GetNumberOfChildren();
135 
139  void SetGlobalIndexStart(vtkIdType index);
140 
144  void SetGlobalIndexFromLocal(vtkIdType index);
145 
149  double* GetOrigin();
150  double* GetSize();
151 
155  void GetBounds(double bounds[6]);
156  void GetPoint(double point[3]);
157 
162  void SetMask(bool state);
163 
167  bool IsMasked();
168 
172  bool IsLeaf();
173 
177  void SubdivideLeaf();
178 
182  bool IsRoot();
183 
187  unsigned int GetLevel();
188 
196  void ToChild(unsigned char ichild);
197 
203  void ToRoot();
204 
210  void ToParent();
211 
216  vtkSmartPointer<vtkHyperTreeGridOrientedGeometryCursor> GetHyperTreeGridOrientedGeometryCursor(
217  vtkHyperTreeGrid* grid);
218 
219 protected:
225 
231 
236 
241 
245  std::shared_ptr<vtkHyperTreeGridScales> Scales;
246 
250  unsigned int Level;
251 
256 
257  // Hyper tree grid to which the cursor is attached
258  std::vector<vtkHyperTreeGridGeometryEntry> Entries;
259 
260 private:
263  void operator=(const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
264 };
265 #endif
void GetBounds(T a, double bds[6])
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
abstract base class for most VTK objects
Definition: vtkObject.h:62
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.
bool HasTree() const
Return if a Tree pointing exist.
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:32
int vtkIdType
Definition: vtkType.h:332
void GetPoint(const int i, const int j, const int k, double pnt[3])
a simple class to control print indentation
Definition: vtkIndent.h:39
std::shared_ptr< vtkHyperTreeGridScales > Scales
JB Storage of pre-computed per-level cell scales.
A data object structured as a tree.
Definition: vtkHyperTree.h:179
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
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...