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 =========================================================================*/
50 #ifndef vtkHyperTreeGridSource_h
51 #define vtkHyperTreeGridSource_h
52 
53 #include "vtkFiltersSourcesModule.h" // For export macro
55 
56 #include <string> // STL Header
57 #include <map> // STL Header
58 #include <vector> // STL Header
59 
60 class vtkBitArray;
61 class vtkDataArray;
62 class vtkHyperTreeCursor;
63 class vtkIdTypeArray;
65 class vtkHyperTreeGrid;
66 class vtkQuadric;
67 
68 class VTKFILTERSSOURCES_EXPORT vtkHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
74  static vtkHyperTreeGridSource* New();
75 
80  unsigned int GetMaximumLevel();
81 
88  void SetMaximumLevel( unsigned int levels );
89 
91 
94  vtkSetVector3Macro(Origin, double);
95  vtkGetVector3Macro(Origin, double);
97 
99 
102  vtkSetVector3Macro(GridScale, double);
103  vtkGetVector3Macro(GridScale, double);
105 
107 
110  vtkSetVector3Macro(GridSize, unsigned int);
111  vtkGetVector3Macro(GridSize, unsigned int);
113 
115 
119  vtkSetMacro(TransposedRootIndexing, bool);
120  vtkGetMacro(TransposedRootIndexing, bool);
121  void SetIndexingModeToKJI();
122  void SetIndexingModeToIJK();
124 
126 
129  vtkSetClampMacro(Dimension, unsigned int, 1, 3);
130  vtkGetMacro(Dimension, unsigned int);
132 
134 
137  virtual void SetOrientation(unsigned int);
138  vtkGetMacro(Orientation, unsigned int);
140 
142 
145  vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
146  vtkGetMacro(BranchFactor, unsigned int);
148 
150 
155  vtkSetMacro(UseDescriptor, bool);
156  vtkGetMacro(UseDescriptor, bool);
157  vtkBooleanMacro(UseDescriptor, bool);
159 
161 
166  vtkSetMacro(UseMaterialMask, bool);
167  vtkGetMacro(UseMaterialMask, bool);
168  vtkBooleanMacro(UseMaterialMask, bool);
170 
172 
177  vtkSetMacro(GenerateInterfaceFields, bool);
178  vtkGetMacro(GenerateInterfaceFields, bool);
179  vtkBooleanMacro(GenerateInterfaceFields, bool);
181 
183 
186  vtkSetStringMacro(Descriptor);
187  vtkGetStringMacro(Descriptor);
189 
191 
194  vtkSetStringMacro(MaterialMask);
195  vtkGetStringMacro(MaterialMask);
197 
199 
202  virtual void SetDescriptorBits( vtkBitArray* );
203  vtkGetObjectMacro( DescriptorBits, vtkBitArray );
205 
209  virtual void SetLevelZeroMaterialIndex( vtkIdTypeArray* );
210 
212 
215  virtual void SetMaterialMaskBits( vtkBitArray* );
216  vtkGetObjectMacro( MaterialMaskBits, vtkBitArray );
218 
220 
223  virtual void SetQuadric( vtkQuadric* );
224  vtkGetObjectMacro(Quadric, vtkQuadric);
226 
228 
231  void SetQuadricCoefficients( double[10] );
232  void GetQuadricCoefficients( double[10] );
233  double* GetQuadricCoefficients();
235 
239  vtkMTimeType GetMTime() override;
240 
242 
245  vtkBitArray* ConvertDescriptorStringToBitArray( const std::string& );
246  vtkBitArray* ConvertMaterialMaskStringToBitArray( const std::string& );
248 
249 protected:
251  ~vtkHyperTreeGridSource() override;
252 
255  vtkInformationVector* ) override;
256 
259  vtkInformationVector* ) override;
260 
261  int FillOutputPortInformation( int, vtkInformation* ) override;
262 
267  vtkDataObject* ) override;
268 
272  int InitializeFromStringDescriptor();
273 
277  int InitializeFromBitsDescriptor();
278 
282  void InitTreeFromDescriptor( vtkHyperTreeGrid* output,
283  vtkHyperTreeCursor* cursor,
284  int treeIdx,
285  int idx[3] );
286 
290  void SubdivideFromStringDescriptor( vtkHyperTreeGrid* output,
291  vtkHyperTreeCursor* cursor,
292  unsigned int level,
293  int treeIdx,
294  int childIdx,
295  int idx[3],
296  int parentPos );
297 
301  void SubdivideFromBitsDescriptor( vtkHyperTreeGrid* output,
302  vtkHyperTreeCursor* cursor,
303  unsigned int level,
304  int treeIdx,
305  int childIdx,
306  int idx[3],
307  int parentPos );
308 
312  void SubdivideFromQuadric( vtkHyperTreeGrid* output,
313  vtkHyperTreeCursor* cursor,
314  unsigned int level,
315  int treeIdx,
316  const int idx[3],
317  double origin[3],
318  double size[3] );
319 
323  double EvaluateQuadric( double[3] );
324 
325  double Origin[3];
326  double GridScale[3];
327  unsigned int GridSize[3];
329  unsigned int MaximumLevel;
330  unsigned int Dimension;
331  unsigned int Orientation;
332  unsigned int BranchFactor;
333  unsigned int BlockSize;
337 
341 
342  char* Descriptor;
344  std::vector<std::string> LevelDescriptors;
345  std::vector<std::string> LevelMaterialMasks;
346 
349  std::vector<vtkIdType> LevelBitsIndex;
350  std::vector<vtkIdType> LevelBitsIndexCnt;
351 
353  std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
354 
355  std::vector<int> LevelCounters;
356 
358 
360 
361 private:
363  void operator=(const vtkHyperTreeGridSource&) = delete;
364 };
365 
366 #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:300
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'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.
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
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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...