VTK
vtkHyperTreeGridSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridSource.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 notice for more information.
13 
14 =========================================================================*/
27  The top level of the tree is not considered a grid level
28  NB: For ease of legibility, white spaces are allowed and ignored.
29 
30  @par Thanks:
31  This class was written by Philippe Pebay and Joachim Pouderoux,
32  Kitware 2013
33  This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
34 
35  @par Examples:
36  @ref c2_vtk_e_vtkHyperTreeGridSource "vtkHyperTreeGridSource (Examples)"
37 
38  @par Tests:
39  @ref c2_vtk_t_vtkHyperTreeGridSource "vtkHyperTreeGridSource (Tests)"
40 */
41 
42 #ifndef vtkHyperTreeGridSource_h
43 #define vtkHyperTreeGridSource_h
44 
45 #include "vtkFiltersSourcesModule.h" // For export macro
47 
48 #include <string> // STL Header
49 #include <map> // STL Header
50 #include <vector> // STL Header
51 
52 class vtkDataArray;
53 class vtkBitArray;
55 class vtkHyperTreeGrid;
56 class vtkQuadric;
57 
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
65 
68  unsigned int GetMaximumLevel();
69 
72  void SetMaximumLevel( unsigned int levels );
73 
75 
76  vtkSetVector3Macro(Origin, double);
77  vtkGetVector3Macro(Origin, double);
79 
81 
83  vtkSetVector3Macro(GridScale, double);
84  vtkGetVector3Macro(GridScale, double);
86 
88 
89  vtkSetVector3Macro(GridSize, unsigned int);
90  vtkGetVector3Macro(GridSize, unsigned int);
92 
94 
97  vtkSetMacro(TransposedRootIndexing, bool);
98  vtkGetMacro(TransposedRootIndexing, bool);
102 
104 
105  vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
106  vtkGetMacro(BranchFactor, unsigned int);
108 
110 
111  vtkSetClampMacro(Dimension, unsigned int, 2, 3);
112  vtkGetMacro(Dimension, unsigned int);
114 
116 
118  vtkSetMacro(UseDescriptor, bool);
119  vtkGetMacro(UseDescriptor, bool);
120  vtkBooleanMacro(UseDescriptor, bool);
122 
124 
126  vtkSetMacro(UseMaterialMask, bool);
127  vtkGetMacro(UseMaterialMask, bool);
128  vtkBooleanMacro(UseMaterialMask, bool);
130 
132 
133  vtkSetStringMacro(Descriptor);
134  vtkGetStringMacro(Descriptor);
136 
138 
139  vtkSetStringMacro(MaterialMask);
140  vtkGetStringMacro(MaterialMask);
142 
144 
145  virtual void SetDescriptorBits( vtkBitArray* );
146  vtkGetObjectMacro( DescriptorBits, vtkBitArray );
148 
151 
153 
155  vtkGetObjectMacro( MaterialMaskBits, vtkBitArray );
157 
159 
160  virtual void SetQuadric( vtkQuadric* );
163 
165 
166  void SetQuadricCoefficients( double[10] );
167  void GetQuadricCoefficients( double[10] );
170 
172  unsigned long GetMTime();
173 
175 
179 
180 protected:
183 
187 
191 
194 
197 
199 
201  int treeIdx,
202  int idx[3] );
204 
206 
208  unsigned int level,
209  int treeIdx,
210  int childIdx,
211  int idx[3],
212  int parentPos );
214 
216 
218  unsigned int level,
219  int treeIdx,
220  int childIdx,
221  int idx[3],
222  int parentPos );
224 
226 
228  unsigned int level,
229  int treeIdx,
230  const int idx[3],
231  double origin[3],
232  double size[3] );
234 
236  double EvaluateQuadric( double[3] );
237 
238  double Origin[3];
239  double GridScale[3];
240  unsigned int GridSize[3];
242  unsigned int MaximumLevel;
243  unsigned int Dimension;
244  unsigned int BranchFactor;
245  unsigned int BlockSize;
248 
252 
253  char* Descriptor;
255  std::vector<std::string> LevelDescriptors;
256  std::vector<std::string> LevelMaterialMasks;
257 
260  std::vector<vtkIdType> LevelBitsIndex;
261  std::vector<vtkIdType> LevelBitsIndexCnt;
262 
264  std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
265 
266  std::vector<int> LevelCounters;
267 
269 
271 
272 private:
273  vtkHyperTreeGridSource(const vtkHyperTreeGridSource&); // Not implemented.
274  void operator=(const vtkHyperTreeGridSource&); // Not implemented.
275 };
276 
277 #endif
vtkHyperTreeGridSource::ZCoordinates
vtkDataArray * ZCoordinates
Definition: vtkHyperTreeGridSource.h:251
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkHyperTreeGridSource::SetDescriptorBits
virtual void SetDescriptorBits(vtkBitArray *)
vtkHyperTreeGridSource::New
static vtkHyperTreeGridSource * New()
vtkHyperTreeGridSource::LevelZeroMaterialMap
std::map< vtkIdType, vtkIdType > LevelZeroMaterialMap
Definition: vtkHyperTreeGridSource.h:264
vtkgl::ref
GLenum GLint ref
Definition: vtkgl.h:11980
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkHyperTreeGridSource::MaximumLevel
unsigned int MaximumLevel
Definition: vtkHyperTreeGridSource.h:242
vtkHyperTreeGridSource::LevelDescriptors
std::vector< std::string > LevelDescriptors
Definition: vtkHyperTreeGridSource.h:255
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkHyperTreeGridSource::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkHyperTreeGridSource
Create a synthetic grid of hypertrees.
Definition: vtkHyperTreeGridSource.h:59
vtkHyperTreeGridSource::LevelZeroMaterialIndex
vtkIdTypeArray * LevelZeroMaterialIndex
Definition: vtkHyperTreeGridSource.h:263
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkHyperTreeGridSource::SubdivideFromBitsDescriptor
void SubdivideFromBitsDescriptor(vtkHyperTreeCursor *cursor, unsigned int level, int treeIdx, int childIdx, int idx[3], int parentPos)
vtkFiltersSourcesModule.h
vtkHyperTreeGridAlgorithm.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkHyperTreeGridSource::BranchFactor
unsigned int BranchFactor
Definition: vtkHyperTreeGridSource.h:244
vtkHyperTreeGridSource::Descriptor
char * Descriptor
Definition: vtkHyperTreeGridSource.h:253
vtkgl::in
GLuint in
Definition: vtkgl.h:16905
vtkHyperTreeGridSource::TransposedRootIndexing
bool TransposedRootIndexing
Definition: vtkHyperTreeGridSource.h:241
vtkQuadric
evaluate implicit quadric function
Definition: vtkQuadric.h:36
vtkHyperTreeGridSource::DescriptorBits
vtkBitArray * DescriptorBits
Definition: vtkHyperTreeGridSource.h:258
vtkHyperTreeGridSource::InitializeFromStringDescriptor
int InitializeFromStringDescriptor()
vtkHyperTreeGridSource::LevelBitsIndex
std::vector< vtkIdType > LevelBitsIndex
Definition: vtkHyperTreeGridSource.h:260
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:58
vtkHyperTreeGridSource::XCoordinates
vtkDataArray * XCoordinates
Definition: vtkHyperTreeGridSource.h:249
vtkHyperTreeGridSource::GetMTime
unsigned long GetMTime()
vtkHyperTreeGridSource::InitializeFromBitsDescriptor
int InitializeFromBitsDescriptor()
vtkHyperTreeGridSource::EvaluateQuadric
double EvaluateQuadric(double[3])
vtkHyperTreeGridSource::SetIndexingModeToIJK
void SetIndexingModeToIJK()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkHyperTreeGridSource::SetMaximumLevel
void SetMaximumLevel(unsigned int levels)
VTKFILTERSSOURCES_EXPORT
#define VTKFILTERSSOURCES_EXPORT
Definition: vtkFiltersSourcesModule.h:15
vtkHyperTreeGridSource::ConvertDescriptorStringToBitArray
vtkBitArray * ConvertDescriptorStringToBitArray(const std::string &)
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkHyperTreeGridSource::SubdivideFromQuadric
void SubdivideFromQuadric(vtkHyperTreeCursor *cursor, unsigned int level, int treeIdx, const int idx[3], double origin[3], double size[3])
vtkHyperTreeCursor
Objects that can traverse hypertree nodes.
Definition: vtkHyperTreeCursor.h:57
vtkHyperTreeGridSource::SubdivideFromStringDescriptor
void SubdivideFromStringDescriptor(vtkHyperTreeCursor *cursor, unsigned int level, int treeIdx, int childIdx, int idx[3], int parentPos)
Thanks
The top level of the tree is not considered a grid level white spaces are allowed and ignored par Thanks
Definition: vtkHyperTreeGridSource.h:31
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkHyperTreeGridSource::YCoordinates
vtkDataArray * YCoordinates
Definition: vtkHyperTreeGridSource.h:250
vtkHyperTreeGridSource::GetMaximumLevel
unsigned int GetMaximumLevel()
vtkHyperTreeGridSource::UseDescriptor
bool UseDescriptor
Definition: vtkHyperTreeGridSource.h:246
vtkgl::top
GLdouble GLdouble GLdouble GLdouble top
Definition: vtkgl.h:18180
vtkHyperTreeGridSource::SetLevelZeroMaterialIndex
virtual void SetLevelZeroMaterialIndex(vtkIdTypeArray *)
vtkHyperTreeGridSource::ConvertMaterialMaskStringToBitArray
vtkBitArray * ConvertMaterialMaskStringToBitArray(const std::string &)
vtkHyperTreeGridSource::InitTreeFromDescriptor
void InitTreeFromDescriptor(vtkHyperTreeCursor *cursor, int treeIdx, int idx[3])
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkHyperTreeGridSource::SetMaterialMaskBits
virtual void SetMaterialMaskBits(vtkBitArray *)
vtkHyperTreeGridSource::LevelCounters
std::vector< int > LevelCounters
Definition: vtkHyperTreeGridSource.h:266
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkHyperTreeGridSource::MaterialMask
char * MaterialMask
Definition: vtkHyperTreeGridSource.h:254
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkHyperTreeGridSource::vtkHyperTreeGridSource
vtkHyperTreeGridSource()
vtkHyperTreeGridSource::SetQuadricCoefficients
void SetQuadricCoefficients(double[10])
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkHyperTreeGridSource::BlockSize
unsigned int BlockSize
Definition: vtkHyperTreeGridSource.h:245
vtkHyperTreeGridSource::Quadric
vtkQuadric * Quadric
Definition: vtkHyperTreeGridSource.h:268
vtkHyperTreeGridSource::Dimension
unsigned int Dimension
Definition: vtkHyperTreeGridSource.h:243
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:49
vtkHyperTreeGridSource::UseMaterialMask
bool UseMaterialMask
Definition: vtkHyperTreeGridSource.h:247
vtkHyperTreeGridSource::LevelMaterialMasks
std::vector< std::string > LevelMaterialMasks
Definition: vtkHyperTreeGridSource.h:256
vtkHyperTreeGridSource::GetQuadricCoefficients
void GetQuadricCoefficients(double[10])
vtkHyperTreeGridSource::LevelBitsIndexCnt
std::vector< vtkIdType > LevelBitsIndexCnt
Definition: vtkHyperTreeGridSource.h:261
vtkHyperTreeGridSource::MaterialMaskBits
vtkBitArray * MaterialMaskBits
Definition: vtkHyperTreeGridSource.h:259
vtkHyperTreeGridSource::SetQuadric
virtual void SetQuadric(vtkQuadric *)
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
vtkHyperTreeGridSource::SetIndexingModeToKJI
void SetIndexingModeToKJI()
vtkHyperTreeGridSource::Output
vtkHyperTreeGrid * Output
Definition: vtkHyperTreeGridSource.h:270
vtkHyperTreeGridSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
NB
The top level of the tree is not considered a grid level NB
Definition: vtkHyperTreeGridSource.h:28
vtkgl::by
GLbyte by
Definition: vtkgl.h:15577
vtkHyperTreeGridAlgorithm
Superclass for algorithms that produce a hyper tree grid as output.
Definition: vtkHyperTreeGridAlgorithm.h:46
vtkgl::string
GLsizei const GLchar ** string
Definition: vtkgl.h:12011
vtkHyperTreeGridSource::GetQuadricCoefficients
double * GetQuadricCoefficients()
vtkHyperTreeGridSource::~vtkHyperTreeGridSource
~vtkHyperTreeGridSource()
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:68
vtkHyperTreeGridSource::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843