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 =========================================================================*/
47 #ifndef vtkHyperTreeGridSource_h
48 #define vtkHyperTreeGridSource_h
49 
50 #include "vtkFiltersSourcesModule.h" // For export macro
52 
53 #include <string> // STL Header
54 #include <map> // STL Header
55 #include <vector> // STL Header
56 
57 class vtkBitArray;
58 class vtkDataArray;
59 class vtkHyperTreeCursor;
60 class vtkIdTypeArray;
62 class vtkHyperTreeGrid;
63 class vtkQuadric;
64 
65 class VTKFILTERSSOURCES_EXPORT vtkHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
71  static vtkHyperTreeGridSource* New();
72 
77  unsigned int GetMaximumLevel();
78 
85  void SetMaximumLevel( unsigned int levels );
86 
88 
91  vtkSetVector3Macro(Origin, double);
92  vtkGetVector3Macro(Origin, double);
94 
96 
99  vtkSetVector3Macro(GridScale, double);
100  vtkGetVector3Macro(GridScale, double);
102 
104 
107  vtkSetVector3Macro(GridSize, unsigned int);
108  vtkGetVector3Macro(GridSize, unsigned int);
110 
112 
116  vtkSetMacro(TransposedRootIndexing, bool);
117  vtkGetMacro(TransposedRootIndexing, bool);
118  void SetIndexingModeToKJI();
119  void SetIndexingModeToIJK();
121 
123 
126  vtkSetClampMacro(Dimension, unsigned int, 1, 3);
127  vtkGetMacro(Dimension, unsigned int);
129 
131 
134  virtual void SetOrientation(unsigned int);
135  vtkGetMacro(Orientation, unsigned int);
137 
139 
142  vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
143  vtkGetMacro(BranchFactor, unsigned int);
145 
147 
152  vtkSetMacro(UseDescriptor, bool);
153  vtkGetMacro(UseDescriptor, bool);
154  vtkBooleanMacro(UseDescriptor, bool);
156 
158 
163  vtkSetMacro(UseMaterialMask, bool);
164  vtkGetMacro(UseMaterialMask, bool);
165  vtkBooleanMacro(UseMaterialMask, bool);
167 
169 
174  vtkSetMacro(GenerateInterfaceFields, bool);
175  vtkGetMacro(GenerateInterfaceFields, bool);
176  vtkBooleanMacro(GenerateInterfaceFields, bool);
178 
180 
183  vtkSetStringMacro(Descriptor);
184  vtkGetStringMacro(Descriptor);
186 
188 
191  vtkSetStringMacro(MaterialMask);
192  vtkGetStringMacro(MaterialMask);
194 
196 
199  virtual void SetDescriptorBits( vtkBitArray* );
200  vtkGetObjectMacro( DescriptorBits, vtkBitArray );
202 
206  virtual void SetLevelZeroMaterialIndex( vtkIdTypeArray* );
207 
209 
212  virtual void SetMaterialMaskBits( vtkBitArray* );
213  vtkGetObjectMacro( MaterialMaskBits, vtkBitArray );
215 
217 
220  virtual void SetQuadric( vtkQuadric* );
221  vtkGetObjectMacro(Quadric, vtkQuadric);
223 
225 
228  void SetQuadricCoefficients( double[10] );
229  void GetQuadricCoefficients( double[10] );
230  double* GetQuadricCoefficients();
232 
236  vtkMTimeType GetMTime() override;
237 
239 
242  vtkBitArray* ConvertDescriptorStringToBitArray( const std::string& );
243  vtkBitArray* ConvertMaterialMaskStringToBitArray( const std::string& );
245 
246 protected:
248  ~vtkHyperTreeGridSource() override;
249 
252  vtkInformationVector* ) override;
253 
256  vtkInformationVector* ) override;
257 
258  int FillOutputPortInformation( int, vtkInformation* ) override;
259 
264  vtkDataObject* ) override;
265 
271  int InitializeFromStringDescriptor(int* extent);
272 
276  int InitializeFromBitsDescriptor();
277 
281  void InitTreeFromDescriptor( vtkHyperTreeGrid* output,
282  vtkHyperTreeCursor* cursor,
283  int treeIdx,
284  int idx[3] );
285 
289  void SubdivideFromStringDescriptor( vtkHyperTreeGrid* output,
290  vtkHyperTreeCursor* cursor,
291  unsigned int level,
292  int treeIdx,
293  int childIdx,
294  int idx[3],
295  int parentPos );
296 
300  void SubdivideFromBitsDescriptor( vtkHyperTreeGrid* output,
301  vtkHyperTreeCursor* cursor,
302  unsigned int level,
303  int treeIdx,
304  int childIdx,
305  int idx[3],
306  int parentPos );
307 
311  void SubdivideFromQuadric( vtkHyperTreeGrid* output,
312  vtkHyperTreeCursor* cursor,
313  unsigned int level,
314  int treeIdx,
315  const int idx[3],
316  double origin[3],
317  double size[3] );
318 
322  double EvaluateQuadric( double[3] );
323 
324  double Origin[3];
325  double GridScale[3];
326  unsigned int GridSize[3];
328  unsigned int MaximumLevel;
329  unsigned int Dimension;
330  unsigned int Orientation;
331  unsigned int BranchFactor;
332  unsigned int BlockSize;
336 
340 
341  char* Descriptor;
343  std::vector<std::string> LevelDescriptors;
344  std::vector<std::string> LevelMaterialMasks;
345 
348  std::vector<vtkIdType> LevelBitsIndex;
349  std::vector<vtkIdType> LevelBitsIndexCnt;
350 
352  std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
353 
354  std::vector<int> LevelCounters;
355 
357 
359 
360 private:
362  void operator=(const vtkHyperTreeGridSource&) = delete;
363 };
364 
365 #endif
abstract interface for implicit functions
Create a synthetic grid of hypertrees.
std::vector< vtkIdType > LevelBitsIndexCnt
int FillOutputPortInformation(int, vtkInformation *) override
Define default input and output port types.
Store vtkAlgorithm input/output information.
std::map< vtkIdType, vtkIdType > LevelZeroMaterialMap
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
std::vector< std::string > LevelDescriptors
vtkIdTypeArray * LevelZeroMaterialIndex
dynamic, self-adjusting array of vtkIdType
Objects for depth-first traversal HyperTrees.
std::vector< vtkIdType > LevelBitsIndex
a simple class to control print indentation
Definition: vtkIndent.h:39
evaluate implicit quadric function
Definition: vtkQuadric.h:36
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:54
virtual vtkMTimeType GetMTime()
Return this object&#39;s modified time.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
std::vector< std::string > LevelMaterialMasks
Superclass for algorithms that produce a hyper tree grid as output.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
std::vector< int > LevelCounters
general representation of visualization data
Definition: vtkDataObject.h:64
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...