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 =========================================================================*/
43 #ifndef vtkHyperTreeGridSource_h
44 #define vtkHyperTreeGridSource_h
45 
46 #include "vtkFiltersSourcesModule.h" // For export macro
48 
49 #include <string> // STL Header
50 #include <map> // STL Header
51 #include <vector> // STL Header
52 
53 class vtkDataArray;
54 class vtkBitArray;
56 class vtkHyperTreeGrid;
57 class vtkQuadric;
58 
59 class VTKFILTERSSOURCES_EXPORT vtkHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
64 
65  static vtkHyperTreeGridSource* New();
66 
71  unsigned int GetMaximumLevel();
72 
78  void SetMaximumLevel( unsigned int levels );
79 
81 
84  vtkSetVector3Macro(Origin, double);
85  vtkGetVector3Macro(Origin, double);
87 
89 
92  vtkSetVector3Macro(GridScale, double);
93  vtkGetVector3Macro(GridScale, double);
95 
97 
100  vtkSetVector3Macro(GridSize, unsigned int);
101  vtkGetVector3Macro(GridSize, unsigned int);
103 
105 
109  vtkSetMacro(TransposedRootIndexing, bool);
110  vtkGetMacro(TransposedRootIndexing, bool);
111  void SetIndexingModeToKJI();
112  void SetIndexingModeToIJK();
114 
116 
119  vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
120  vtkGetMacro(BranchFactor, unsigned int);
122 
124 
127  vtkSetClampMacro(Dimension, unsigned int, 2, 3);
128  vtkGetMacro(Dimension, unsigned int);
130 
132 
137  vtkSetMacro(UseDescriptor, bool);
138  vtkGetMacro(UseDescriptor, bool);
139  vtkBooleanMacro(UseDescriptor, bool);
141 
143 
148  vtkSetMacro(UseMaterialMask, bool);
149  vtkGetMacro(UseMaterialMask, bool);
150  vtkBooleanMacro(UseMaterialMask, bool);
152 
154 
157  vtkSetStringMacro(Descriptor);
158  vtkGetStringMacro(Descriptor);
160 
162 
165  vtkSetStringMacro(MaterialMask);
166  vtkGetStringMacro(MaterialMask);
168 
170 
173  virtual void SetDescriptorBits( vtkBitArray* );
174  vtkGetObjectMacro( DescriptorBits, vtkBitArray );
176 
180  virtual void SetLevelZeroMaterialIndex( vtkIdTypeArray* );
181 
183 
186  virtual void SetMaterialMaskBits( vtkBitArray* );
187  vtkGetObjectMacro( MaterialMaskBits, vtkBitArray );
189 
191 
194  virtual void SetQuadric( vtkQuadric* );
195  vtkGetObjectMacro(Quadric, vtkQuadric);
197 
199 
202  void SetQuadricCoefficients( double[10] );
203  void GetQuadricCoefficients( double[10] );
204  double* GetQuadricCoefficients();
206 
210  vtkMTimeType GetMTime() VTK_OVERRIDE;
211 
213 
216  vtkBitArray* ConvertDescriptorStringToBitArray( const std::string& );
217  vtkBitArray* ConvertMaterialMaskStringToBitArray( const std::string& );
219 
220 protected:
222  ~vtkHyperTreeGridSource() VTK_OVERRIDE;
223 
224  int RequestInformation ( vtkInformation*,
226  vtkInformationVector* ) VTK_OVERRIDE;
227 
228  int RequestData( vtkInformation*,
230  vtkInformationVector* ) VTK_OVERRIDE;
231 
235  int InitializeFromStringDescriptor();
236 
240  int InitializeFromBitsDescriptor();
241 
245  void InitTreeFromDescriptor( vtkHyperTreeCursor* cursor,
246  int treeIdx,
247  int idx[3] );
248 
252  void SubdivideFromStringDescriptor( vtkHyperTreeCursor* cursor,
253  unsigned int level,
254  int treeIdx,
255  int childIdx,
256  int idx[3],
257  int parentPos );
258 
262  void SubdivideFromBitsDescriptor( vtkHyperTreeCursor* cursor,
263  unsigned int level,
264  int treeIdx,
265  int childIdx,
266  int idx[3],
267  int parentPos );
268 
272  void SubdivideFromQuadric( vtkHyperTreeCursor* cursor,
273  unsigned int level,
274  int treeIdx,
275  const int idx[3],
276  double origin[3],
277  double size[3] );
278 
282  double EvaluateQuadric( double[3] );
283 
284  double Origin[3];
285  double GridScale[3];
286  unsigned int GridSize[3];
287  bool TransposedRootIndexing;
288  unsigned int MaximumLevel;
289  unsigned int Dimension;
290  unsigned int BranchFactor;
291  unsigned int BlockSize;
292  bool UseDescriptor;
293  bool UseMaterialMask;
294 
295  vtkDataArray* XCoordinates;
296  vtkDataArray* YCoordinates;
297  vtkDataArray* ZCoordinates;
298 
299  char* Descriptor;
300  char* MaterialMask;
301  std::vector<std::string> LevelDescriptors;
302  std::vector<std::string> LevelMaterialMasks;
303 
304  vtkBitArray* DescriptorBits;
305  vtkBitArray* MaterialMaskBits;
306  std::vector<vtkIdType> LevelBitsIndex;
307  std::vector<vtkIdType> LevelBitsIndexCnt;
308 
309  vtkIdTypeArray* LevelZeroMaterialIndex;
310  std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
311 
312  std::vector<int> LevelCounters;
313 
314  vtkQuadric* Quadric;
315 
317 
318 private:
319  vtkHyperTreeGridSource(const vtkHyperTreeGridSource&) VTK_DELETE_FUNCTION;
320  void operator=(const vtkHyperTreeGridSource&) VTK_DELETE_FUNCTION;
321 };
322 
323 #endif
abstract interface for implicit functions
Create a synthetic grid of hypertrees.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:345
Objects that can traverse hypertree nodes.
a simple class to control print indentation
Definition: vtkIndent.h:33
evaluate implicit quadric function
Definition: vtkQuadric.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual vtkMTimeType GetMTime()
Return this object&#39;s modified time.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:33
Superclass for algorithms that produce a hyper tree grid as output.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.