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 
268  int InitializeFromStringDescriptor(int* extent);
269 
273  int InitializeFromBitsDescriptor();
274 
278  void InitTreeFromDescriptor( vtkHyperTreeGrid* output,
279  vtkHyperTreeCursor* cursor,
280  int treeIdx,
281  int idx[3] );
282 
286  void SubdivideFromStringDescriptor( vtkHyperTreeGrid* output,
287  vtkHyperTreeCursor* cursor,
288  unsigned int level,
289  int treeIdx,
290  int childIdx,
291  int idx[3],
292  int parentPos );
293 
297  void SubdivideFromBitsDescriptor( vtkHyperTreeGrid* output,
298  vtkHyperTreeCursor* cursor,
299  unsigned int level,
300  int treeIdx,
301  int childIdx,
302  int idx[3],
303  int parentPos );
304 
308  void SubdivideFromQuadric( vtkHyperTreeGrid* output,
309  vtkHyperTreeCursor* cursor,
310  unsigned int level,
311  int treeIdx,
312  const int idx[3],
313  double origin[3],
314  double size[3] );
315 
319  double EvaluateQuadric( double[3] );
320 
321  double Origin[3];
322  double GridScale[3];
323  unsigned int GridSize[3];
325  unsigned int MaximumLevel;
326  unsigned int Dimension;
327  unsigned int Orientation;
328  unsigned int BranchFactor;
329  unsigned int BlockSize;
333 
337 
338  char* Descriptor;
340  std::vector<std::string> LevelDescriptors;
341  std::vector<std::string> LevelMaterialMasks;
342 
345  std::vector<vtkIdType> LevelBitsIndex;
346  std::vector<vtkIdType> LevelBitsIndexCnt;
347 
349  std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
350 
351  std::vector<int> LevelCounters;
352 
354 
356 
357 private:
359  void operator=(const vtkHyperTreeGridSource&) = delete;
360 };
361 
362 #endif
vtkHyperTreeGridSource::ZCoordinates
vtkDataArray * ZCoordinates
Definition: vtkHyperTreeGridSource.h:336
vtkHyperTreeGridSource::LevelZeroMaterialMap
std::map< vtkIdType, vtkIdType > LevelZeroMaterialMap
Definition: vtkHyperTreeGridSource.h:349
vtkHyperTreeGridSource::OutputHTG
vtkHyperTreeGrid * OutputHTG
Definition: vtkHyperTreeGridSource.h:355
vtkHyperTreeGridSource::MaximumLevel
unsigned int MaximumLevel
Definition: vtkHyperTreeGridSource.h:325
vtkHyperTreeGridSource::LevelDescriptors
std::vector< std::string > LevelDescriptors
Definition: vtkHyperTreeGridSource.h:340
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkHyperTreeGridSource
Create a synthetic grid of hypertrees.
Definition: vtkHyperTreeGridSource.h:62
vtkHyperTreeGridSource::LevelZeroMaterialIndex
vtkIdTypeArray * LevelZeroMaterialIndex
Definition: vtkHyperTreeGridSource.h:348
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:48
vtkHyperTreeGridSource::BranchFactor
unsigned int BranchFactor
Definition: vtkHyperTreeGridSource.h:328
vtkHyperTreeGridSource::Descriptor
char * Descriptor
Definition: vtkHyperTreeGridSource.h:338
vtkHyperTreeGridSource::TransposedRootIndexing
bool TransposedRootIndexing
Definition: vtkHyperTreeGridSource.h:324
vtkQuadric
evaluate implicit quadric function
Definition: vtkQuadric.h:30
vtkHyperTreeGridSource::DescriptorBits
vtkBitArray * DescriptorBits
Definition: vtkHyperTreeGridSource.h:343
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:345
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkHyperTreeGridSource::XCoordinates
vtkDataArray * XCoordinates
Definition: vtkHyperTreeGridSource.h:334
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:33
vtkHyperTreeGridSource::YCoordinates
vtkDataArray * YCoordinates
Definition: vtkHyperTreeGridSource.h:335
vtkHyperTreeGridSource::UseDescriptor
bool UseDescriptor
Definition: vtkHyperTreeGridSource.h:330
vtkX3D::size
Definition: vtkX3D.h:253
vtkHyperTreeGridSource::GenerateInterfaceFields
bool GenerateInterfaceFields
Definition: vtkHyperTreeGridSource.h:332
vtkHyperTreeGridSource::LevelCounters
std::vector< int > LevelCounters
Definition: vtkHyperTreeGridSource.h:351
vtkHyperTreeGridSource::MaterialMask
char * MaterialMask
Definition: vtkHyperTreeGridSource.h:339
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
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:329
vtkHyperTreeGridSource::Quadric
vtkQuadric * Quadric
Definition: vtkHyperTreeGridSource.h:353
vtkHyperTreeGridSource::Dimension
unsigned int Dimension
Definition: vtkHyperTreeGridSource.h:326
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:35
vtkHyperTreeGridSource::UseMaterialMask
bool UseMaterialMask
Definition: vtkHyperTreeGridSource.h:331
vtkHyperTreeGridSource::LevelMaterialMasks
std::vector< std::string > LevelMaterialMasks
Definition: vtkHyperTreeGridSource.h:341
vtkHyperTreeGridSource::LevelBitsIndexCnt
std::vector< vtkIdType > LevelBitsIndexCnt
Definition: vtkHyperTreeGridSource.h:346
vtkHyperTreeGridSource::MaterialMaskBits
vtkBitArray * MaterialMaskBits
Definition: vtkHyperTreeGridSource.h:344
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:33
vtkX3D::extent
Definition: vtkX3D.h:345
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
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:67
vtkHyperTreeGridSource::Orientation
unsigned int Orientation
Definition: vtkHyperTreeGridSource.h:327
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302