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 =========================================================================*/
44 #ifndef vtkHyperTreeGridSource_h
45 #define vtkHyperTreeGridSource_h
46 
47 #include "vtkFiltersSourcesModule.h" // For export macro
49 
50 #include <string> // STL Header
51 #include <map> // STL Header
52 #include <vector> // STL Header
53 
54 class vtkBitArray;
55 class vtkDataArray;
56 class vtkHyperTreeCursor;
57 class vtkIdTypeArray;
59 class vtkHyperTreeGrid;
60 class vtkQuadric;
61 
62 class VTKFILTERSSOURCES_EXPORT vtkHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
63 {
64 public:
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
68  static vtkHyperTreeGridSource* New();
69 
74  unsigned int GetMaximumLevel();
75 
82  void SetMaximumLevel( unsigned int levels );
83 
85 
88  vtkSetVector3Macro(Origin, double);
89  vtkGetVector3Macro(Origin, double);
91 
93 
96  vtkSetVector3Macro(GridScale, double);
97  vtkGetVector3Macro(GridScale, double);
99 
101 
104  vtkSetVector3Macro(GridSize, unsigned int);
105  vtkGetVector3Macro(GridSize, unsigned int);
107 
109 
113  vtkSetMacro(TransposedRootIndexing, bool);
114  vtkGetMacro(TransposedRootIndexing, bool);
115  void SetIndexingModeToKJI();
116  void SetIndexingModeToIJK();
118 
120 
123  vtkSetClampMacro(Dimension, unsigned int, 1, 3);
124  vtkGetMacro(Dimension, unsigned int);
126 
128 
131  virtual void SetOrientation(unsigned int);
132  vtkGetMacro(Orientation, unsigned int);
134 
136 
139  vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
140  vtkGetMacro(BranchFactor, unsigned int);
142 
144 
149  vtkSetMacro(UseDescriptor, bool);
150  vtkGetMacro(UseDescriptor, bool);
151  vtkBooleanMacro(UseDescriptor, bool);
153 
155 
160  vtkSetMacro(UseMaterialMask, bool);
161  vtkGetMacro(UseMaterialMask, bool);
162  vtkBooleanMacro(UseMaterialMask, bool);
164 
166 
171  vtkSetMacro(GenerateInterfaceFields, bool);
172  vtkGetMacro(GenerateInterfaceFields, bool);
173  vtkBooleanMacro(GenerateInterfaceFields, bool);
175 
177 
180  vtkSetStringMacro(Descriptor);
181  vtkGetStringMacro(Descriptor);
183 
185 
188  vtkSetStringMacro(MaterialMask);
189  vtkGetStringMacro(MaterialMask);
191 
193 
196  virtual void SetDescriptorBits( vtkBitArray* );
197  vtkGetObjectMacro( DescriptorBits, vtkBitArray );
199 
203  virtual void SetLevelZeroMaterialIndex( vtkIdTypeArray* );
204 
206 
209  virtual void SetMaterialMaskBits( vtkBitArray* );
210  vtkGetObjectMacro( MaterialMaskBits, vtkBitArray );
212 
214 
217  virtual void SetQuadric( vtkQuadric* );
218  vtkGetObjectMacro(Quadric, vtkQuadric);
220 
222 
225  void SetQuadricCoefficients( double[10] );
226  void GetQuadricCoefficients( double[10] );
227  double* GetQuadricCoefficients();
229 
233  vtkMTimeType GetMTime() override;
234 
236 
239  vtkBitArray* ConvertDescriptorStringToBitArray( const std::string& );
240  vtkBitArray* ConvertMaterialMaskStringToBitArray( const std::string& );
242 
243 protected:
245  ~vtkHyperTreeGridSource() override;
246 
249  vtkInformationVector* ) override;
250 
253  vtkInformationVector* ) override;
254 
255  int FillOutputPortInformation( int, vtkInformation* ) override;
256 
261  vtkDataObject* ) override;
262 
266  int InitializeFromStringDescriptor();
267 
271  int InitializeFromBitsDescriptor();
272 
276  void InitTreeFromDescriptor( vtkHyperTreeGrid* output,
277  vtkHyperTreeCursor* cursor,
278  int treeIdx,
279  int idx[3] );
280 
284  void SubdivideFromStringDescriptor( vtkHyperTreeGrid* output,
285  vtkHyperTreeCursor* cursor,
286  unsigned int level,
287  int treeIdx,
288  int childIdx,
289  int idx[3],
290  int parentPos );
291 
295  void SubdivideFromBitsDescriptor( vtkHyperTreeGrid* output,
296  vtkHyperTreeCursor* cursor,
297  unsigned int level,
298  int treeIdx,
299  int childIdx,
300  int idx[3],
301  int parentPos );
302 
306  void SubdivideFromQuadric( vtkHyperTreeGrid* output,
307  vtkHyperTreeCursor* cursor,
308  unsigned int level,
309  int treeIdx,
310  const int idx[3],
311  double origin[3],
312  double size[3] );
313 
317  double EvaluateQuadric( double[3] );
318 
319  double Origin[3];
320  double GridScale[3];
321  unsigned int GridSize[3];
323  unsigned int MaximumLevel;
324  unsigned int Dimension;
325  unsigned int Orientation;
326  unsigned int BranchFactor;
327  unsigned int BlockSize;
331 
335 
336  char* Descriptor;
338  std::vector<std::string> LevelDescriptors;
339  std::vector<std::string> LevelMaterialMasks;
340 
343  std::vector<vtkIdType> LevelBitsIndex;
344  std::vector<vtkIdType> LevelBitsIndexCnt;
345 
347  std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
348 
349  std::vector<int> LevelCounters;
350 
352 
354 
355 private:
357  void operator=(const vtkHyperTreeGridSource&) = delete;
358 };
359 
360 #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: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's modified time.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:33
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:58
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...