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
vtkHyperTreeGridSource::ZCoordinates
vtkDataArray * ZCoordinates
Definition: vtkHyperTreeGridSource.h:339
vtkHyperTreeGridSource::LevelZeroMaterialMap
std::map< vtkIdType, vtkIdType > LevelZeroMaterialMap
Definition: vtkHyperTreeGridSource.h:352
vtkHyperTreeGridSource::OutputHTG
vtkHyperTreeGrid * OutputHTG
Definition: vtkHyperTreeGridSource.h:358
vtkHyperTreeGridSource::MaximumLevel
unsigned int MaximumLevel
Definition: vtkHyperTreeGridSource.h:328
vtkHyperTreeGridSource::LevelDescriptors
std::vector< std::string > LevelDescriptors
Definition: vtkHyperTreeGridSource.h:343
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkHyperTreeGridSource
Create a synthetic grid of hypertrees.
Definition: vtkHyperTreeGridSource.h:65
vtkHyperTreeGridSource::LevelZeroMaterialIndex
vtkIdTypeArray * LevelZeroMaterialIndex
Definition: vtkHyperTreeGridSource.h:351
vtkHyperTreeGridAlgorithm::ProcessTrees
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...
vtkHyperTreeGridAlgorithm.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkHyperTreeGridSource::BranchFactor
unsigned int BranchFactor
Definition: vtkHyperTreeGridSource.h:331
vtkHyperTreeGridSource::Descriptor
char * Descriptor
Definition: vtkHyperTreeGridSource.h:341
vtkHyperTreeGridSource::TransposedRootIndexing
bool TransposedRootIndexing
Definition: vtkHyperTreeGridSource.h:327
vtkQuadric
evaluate implicit quadric function
Definition: vtkQuadric.h:36
vtkHyperTreeGridSource::DescriptorBits
vtkBitArray * DescriptorBits
Definition: vtkHyperTreeGridSource.h:346
vtkHyperTreeGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridSource::LevelBitsIndex
std::vector< vtkIdType > LevelBitsIndex
Definition: vtkHyperTreeGridSource.h:348
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkHyperTreeGridSource::XCoordinates
vtkDataArray * XCoordinates
Definition: vtkHyperTreeGridSource.h:337
vtkX3D::level
Definition: vtkX3D.h:395
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkHyperTreeCursor
Objects for depth-first traversal HyperTrees.
Definition: vtkHyperTreeCursor.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkHyperTreeGridSource::YCoordinates
vtkDataArray * YCoordinates
Definition: vtkHyperTreeGridSource.h:338
vtkHyperTreeGridSource::UseDescriptor
bool UseDescriptor
Definition: vtkHyperTreeGridSource.h:333
vtkX3D::size
Definition: vtkX3D.h:253
vtkHyperTreeGridSource::GenerateInterfaceFields
bool GenerateInterfaceFields
Definition: vtkHyperTreeGridSource.h:335
vtkHyperTreeGridSource::LevelCounters
std::vector< int > LevelCounters
Definition: vtkHyperTreeGridSource.h:354
vtkHyperTreeGridSource::MaterialMask
char * MaterialMask
Definition: vtkHyperTreeGridSource.h:342
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkHyperTreeGridAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkX3D::string
Definition: vtkX3D.h:490
vtkHyperTreeGridSource::BlockSize
unsigned int BlockSize
Definition: vtkHyperTreeGridSource.h:332
vtkHyperTreeGridSource::Quadric
vtkQuadric * Quadric
Definition: vtkHyperTreeGridSource.h:356
vtkHyperTreeGridSource::Dimension
unsigned int Dimension
Definition: vtkHyperTreeGridSource.h:329
vtkHyperTreeGridAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkHyperTreeGridSource::UseMaterialMask
bool UseMaterialMask
Definition: vtkHyperTreeGridSource.h:334
vtkHyperTreeGridSource::LevelMaterialMasks
std::vector< std::string > LevelMaterialMasks
Definition: vtkHyperTreeGridSource.h:344
vtkHyperTreeGridSource::LevelBitsIndexCnt
std::vector< vtkIdType > LevelBitsIndexCnt
Definition: vtkHyperTreeGridSource.h:349
vtkHyperTreeGridSource::MaterialMaskBits
vtkBitArray * MaterialMaskBits
Definition: vtkHyperTreeGridSource.h:347
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
vtkX3D::extent
Definition: vtkX3D.h:345
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkHyperTreeGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkHyperTreeGridAlgorithm
Superclass for algorithms that produce a hyper tree grid as output.
Definition: vtkHyperTreeGridAlgorithm.h:46
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:70
vtkHyperTreeGridSource::Orientation
unsigned int Orientation
Definition: vtkHyperTreeGridSource.h:330
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302