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 
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);
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 
207 
209 
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] );
232 
236  vtkMTimeType GetMTime() override;
237 
239 
245 
246 protected:
249 
252  vtkInformationVector* ) override;
253 
256  vtkInformationVector* ) override;
257 
259 
264  vtkDataObject* ) override;
265 
272 
277 
282  vtkHyperTreeCursor* cursor,
283  int treeIdx,
284  int idx[3] );
285 
290  vtkHyperTreeCursor* cursor,
291  unsigned int level,
292  int treeIdx,
293  int childIdx,
294  int idx[3],
295  int parentPos );
296 
301  vtkHyperTreeCursor* cursor,
302  unsigned int level,
303  int treeIdx,
304  int childIdx,
305  int idx[3],
306  int parentPos );
307 
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::SetDescriptorBits
virtual void SetDescriptorBits(vtkBitArray *)
Set/Get the bitarray used to describe the grid.
vtkHyperTreeGridSource::New
static vtkHyperTreeGridSource * New()
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:42
vtkHyperTreeGridSource
Create a synthetic grid of hypertrees.
Definition: vtkHyperTreeGridSource.h:66
vtkHyperTreeGridSource::InitializeFromStringDescriptor
int InitializeFromStringDescriptor(int *extent)
Initialize grid from descriptor string when it is to be used.
vtkHyperTreeGridSource::LevelZeroMaterialIndex
vtkIdTypeArray * LevelZeroMaterialIndex
Definition: vtkHyperTreeGridSource.h:351
vtkHyperTreeGridSource::SubdivideFromStringDescriptor
void SubdivideFromStringDescriptor(vtkHyperTreeGrid *output, vtkHyperTreeCursor *cursor, unsigned int level, int treeIdx, int childIdx, int idx[3], int parentPos)
Subdivide grid from descriptor string when it is to be used.
vtkHyperTreeGridAlgorithm.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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:37
vtkHyperTreeGridSource::DescriptorBits
vtkBitArray * DescriptorBits
Definition: vtkHyperTreeGridSource.h:346
vtkHyperTreeGridSource::LevelBitsIndex
std::vector< vtkIdType > LevelBitsIndex
Definition: vtkHyperTreeGridSource.h:348
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:61
vtkHyperTreeGridSource::XCoordinates
vtkDataArray * XCoordinates
Definition: vtkHyperTreeGridSource.h:337
vtkHyperTreeGridSource::InitializeFromBitsDescriptor
int InitializeFromBitsDescriptor()
Initialize grid from bit array descriptors when it is to be used.
vtkHyperTreeGridSource::EvaluateQuadric
double EvaluateQuadric(double[3])
Evaluate quadric at given point coordinates.
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkHyperTreeGridSource::SetIndexingModeToIJK
void SetIndexingModeToIJK()
vtkHyperTreeGridSource::InitTreeFromDescriptor
void InitTreeFromDescriptor(vtkHyperTreeGrid *output, vtkHyperTreeCursor *cursor, int treeIdx, int idx[3])
Initialize tree grid from descriptor and call subdivide if needed.
vtkHyperTreeGridSource::SetMaximumLevel
void SetMaximumLevel(unsigned int levels)
Set the maximum number of levels of the hypertrees.
vtkHyperTreeGridSource::ConvertDescriptorStringToBitArray
vtkBitArray * ConvertDescriptorStringToBitArray(const std::string &)
Helpers to convert string descriptors & mask to bit arrays.
vtkHyperTreeCursor
Objects for depth-first traversal HyperTrees.
Definition: vtkHyperTreeCursor.h:43
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkHyperTreeGridSource::SubdivideFromQuadric
void SubdivideFromQuadric(vtkHyperTreeGrid *output, vtkHyperTreeCursor *cursor, unsigned int level, int treeIdx, const int idx[3], double origin[3], double size[3])
Subdivide grid from quadric when descriptor is not used.
vtkHyperTreeGridSource::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkHyperTreeGridSource::YCoordinates
vtkDataArray * YCoordinates
Definition: vtkHyperTreeGridSource.h:338
vtkHyperTreeGridSource::~vtkHyperTreeGridSource
~vtkHyperTreeGridSource() override
vtkHyperTreeGridSource::ProcessTrees
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to process individual trees in the grid.
vtkHyperTreeGridSource::GetMaximumLevel
unsigned int GetMaximumLevel()
Return the maximum number of levels of the hypertree.
vtkHyperTreeGridSource::UseDescriptor
bool UseDescriptor
Definition: vtkHyperTreeGridSource.h:333
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkHyperTreeGridSource::SetLevelZeroMaterialIndex
virtual void SetLevelZeroMaterialIndex(vtkIdTypeArray *)
Set the index array used to as a material mask.
vtkHyperTreeGridSource::ConvertMaterialMaskStringToBitArray
vtkBitArray * ConvertMaterialMaskStringToBitArray(const std::string &)
vtkHyperTreeGridSource::GenerateInterfaceFields
bool GenerateInterfaceFields
Definition: vtkHyperTreeGridSource.h:335
vtkHyperTreeGridSource::SetMaterialMaskBits
virtual void SetMaterialMaskBits(vtkBitArray *)
Set/Get the bitarray used as a material mask.
vtkHyperTreeGridSource::LevelCounters
std::vector< int > LevelCounters
Definition: vtkHyperTreeGridSource.h:354
vtkHyperTreeGridSource::MaterialMask
char * MaterialMask
Definition: vtkHyperTreeGridSource.h:342
vtkHyperTreeGridSource::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkHyperTreeGridSource::vtkHyperTreeGridSource
vtkHyperTreeGridSource()
vtkHyperTreeGridSource::SetQuadricCoefficients
void SetQuadricCoefficients(double[10])
Helpers to set/get the 10 coefficients of the quadric function.
vtkHyperTreeGridSource::FillOutputPortInformation
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::string
@ 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
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkHyperTreeGridSource::UseMaterialMask
bool UseMaterialMask
Definition: vtkHyperTreeGridSource.h:334
vtkHyperTreeGridSource::LevelMaterialMasks
std::vector< std::string > LevelMaterialMasks
Definition: vtkHyperTreeGridSource.h:344
vtkHyperTreeGridSource::GetQuadricCoefficients
void GetQuadricCoefficients(double[10])
vtkHyperTreeGridSource::LevelBitsIndexCnt
std::vector< vtkIdType > LevelBitsIndexCnt
Definition: vtkHyperTreeGridSource.h:349
vtkHyperTreeGridSource::MaterialMaskBits
vtkBitArray * MaterialMaskBits
Definition: vtkHyperTreeGridSource.h:347
vtkHyperTreeGridSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridSource::SetQuadric
virtual void SetQuadric(vtkQuadric *)
Set/Get the quadric function.
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:37
vtkHyperTreeGridSource::SetIndexingModeToKJI
void SetIndexingModeToKJI()
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkHyperTreeGridAlgorithm
Superclass for algorithms that produce a hyper tree grid as output.
Definition: vtkHyperTreeGridAlgorithm.h:47
vtkHyperTreeGridSource::GetMTime
vtkMTimeType GetMTime() override
Override GetMTime because we delegate to a vtkQuadric.
vtkHyperTreeGridSource::GetQuadricCoefficients
double * GetQuadricCoefficients()
vtkHyperTreeGridSource::SetOrientation
virtual void SetOrientation(unsigned int)
Set/Get the orientation of the grid (in 1D and 2D)
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:71
vtkHyperTreeGridSource::Orientation
unsigned int Orientation
Definition: vtkHyperTreeGridSource.h:330
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkHyperTreeGridSource::SubdivideFromBitsDescriptor
void SubdivideFromBitsDescriptor(vtkHyperTreeGrid *output, vtkHyperTreeCursor *cursor, unsigned int level, int treeIdx, int childIdx, int idx[3], int parentPos)
Subdivide grid from descriptor string when it is to be used.