VTK  9.1.0
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 =========================================================================*/
64 #ifndef vtkHyperTreeGridSource_h
65 #define vtkHyperTreeGridSource_h
66 
67 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_0_0
68 #include "vtkFiltersSourcesModule.h" // For export macro
70 
71 #include <map> // STL Header
72 #include <string> // STL Header
73 #include <vector> // STL Header
74 
75 class vtkBitArray;
76 class vtkDataArray;
78 class vtkIdTypeArray;
80 class vtkHyperTreeGrid;
81 class vtkQuadric;
82 
83 class VTKFILTERSSOURCES_EXPORT vtkHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
84 {
85 public:
87  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
90 
91  // @deprecated Replaced by GetMaxDepth() as of VTK 9
92  VTK_DEPRECATED_IN_9_0_0("Use vtkHyperTreeGridSource::GetMaxDepth")
93  unsigned int GetMaximumLevel();
94 
95  // @deprecated Replaced by SetMaxDepth() as of VTK 9
97  void SetMaximumLevel(unsigned int levels);
98 
103  unsigned int GetMaxDepth();
104 
111  void SetMaxDepth(unsigned int levels);
112 
114 
117  vtkSetVector3Macro(Origin, double);
118  vtkGetVector3Macro(Origin, double);
120 
122 
125  vtkSetVector3Macro(GridScale, double);
126  vtkGetVector3Macro(GridScale, double);
127  void SetGridScale(double scale) { this->SetGridScale(scale, scale, scale); }
129 
131 
134  void SetDimensions(const unsigned int* dims);
135  void SetDimensions(unsigned int, unsigned int, unsigned int);
136  vtkGetVector3Macro(Dimensions, unsigned int);
138 
140 
144  vtkSetMacro(TransposedRootIndexing, bool);
145  vtkGetMacro(TransposedRootIndexing, bool);
149 
151 
154  vtkGetMacro(Orientation, unsigned int);
156 
158 
161  vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
162  vtkGetMacro(BranchFactor, unsigned int);
164 
166 
171  vtkSetMacro(UseDescriptor, bool);
172  vtkGetMacro(UseDescriptor, bool);
173  vtkBooleanMacro(UseDescriptor, bool);
175 
177 
182  vtkSetMacro(UseMask, bool);
183  vtkGetMacro(UseMask, bool);
184  vtkBooleanMacro(UseMask, bool);
186 
188 
193  vtkSetMacro(GenerateInterfaceFields, bool);
194  vtkGetMacro(GenerateInterfaceFields, bool);
195  vtkBooleanMacro(GenerateInterfaceFields, bool);
197 
199 
202  vtkSetStringMacro(Descriptor);
203  vtkGetStringMacro(Descriptor);
205 
207 
210  vtkSetStringMacro(Mask);
211  vtkGetStringMacro(Mask);
213 
215 
219  vtkGetObjectMacro(DescriptorBits, vtkBitArray);
221 
226 
228 
231  virtual void SetMaskBits(vtkBitArray*);
232  vtkGetObjectMacro(MaskBits, vtkBitArray);
234 
236 
239  virtual void SetQuadric(vtkQuadric*);
240  vtkGetObjectMacro(Quadric, vtkQuadric);
242 
244 
247  void SetQuadricCoefficients(double[10]);
248  void GetQuadricCoefficients(double[10]);
251 
255  vtkMTimeType GetMTime() override;
256 
258 
264 
265 protected:
268 
270 
272 
274 
279 
284 
289 
294  vtkHyperTreeGrid* output, vtkHyperTreeGridNonOrientedCursor* cursor, int treeIdx, int idx[3]);
295 
300  vtkHyperTreeGridNonOrientedCursor* cursor, unsigned int level, int treeIdx, int childIdx,
301  int idx[3], int parentPos);
302 
307  vtkHyperTreeGridNonOrientedCursor* cursor, unsigned int level, int treeIdx, int childIdx,
308  int idx[3], int parentPos);
309 
314  unsigned int level, int treeIdx, const int idx[3], double origin[3], double size[3]);
315 
319  double EvaluateQuadric(double[3]);
320 
321  double Origin[3];
322  double GridScale[3];
323  unsigned int Dimension;
324 
325 protected:
326  unsigned int Dimensions[3];
328  unsigned int MaxDepth;
329 
330  unsigned int Orientation;
331  unsigned int BranchFactor;
332  unsigned int BlockSize;
334  bool UseMask;
336 
340 
341  char* Descriptor;
342  char* Mask;
343  std::vector<std::string> LevelDescriptors;
344  std::vector<std::string> LevelMasks;
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::SetMaskBits
virtual void SetMaskBits(vtkBitArray *)
Set/Get the bitarray used as a material mask.
vtkHyperTreeGridSource::ZCoordinates
vtkDataArray * ZCoordinates
Definition: vtkHyperTreeGridSource.h:339
vtkHyperTreeGridSource::ConvertMaskStringToBitArray
vtkBitArray * ConvertMaskStringToBitArray(const std::string &)
Helpers to convert string descriptors & mask to bit arrays.
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
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkHyperTreeGridSource::OutputHTG
vtkHyperTreeGrid * OutputHTG
Definition: vtkHyperTreeGridSource.h:358
vtkHyperTreeGridSource::UseMask
bool UseMask
Definition: vtkHyperTreeGridSource.h:334
vtkHyperTreeGridSource::LevelDescriptors
std::vector< std::string > LevelDescriptors
Definition: vtkHyperTreeGridSource.h:343
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkHyperTreeGridSource
Create a synthetic grid of hypertrees.
Definition: vtkHyperTreeGridSource.h:84
vtkHyperTreeGridSource::LevelZeroMaterialIndex
vtkIdTypeArray * LevelZeroMaterialIndex
Definition: vtkHyperTreeGridSource.h:351
vtkHyperTreeGridSource::MaxDepth
unsigned int MaxDepth
Definition: vtkHyperTreeGridSource.h:328
vtkHyperTreeGridAlgorithm.h
vtkHyperTreeGridNonOrientedCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedCursor.h:51
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkHyperTreeGridSource::BranchFactor
unsigned int BranchFactor
Definition: vtkHyperTreeGridSource.h:331
vtkHyperTreeGridSource::SubdivideFromQuadric
void SubdivideFromQuadric(vtkHyperTreeGrid *output, vtkHyperTreeGridNonOrientedCursor *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::Descriptor
char * Descriptor
Definition: vtkHyperTreeGridSource.h:341
vtkHyperTreeGridSource::TransposedRootIndexing
bool TransposedRootIndexing
Definition: vtkHyperTreeGridSource.h:327
vtkQuadric
evaluate implicit quadric function
Definition: vtkQuadric.h:120
vtkHyperTreeGridSource::DescriptorBits
vtkBitArray * DescriptorBits
Definition: vtkHyperTreeGridSource.h:346
vtkHyperTreeGridSource::InitializeFromStringDescriptor
int InitializeFromStringDescriptor()
Initialize grid from descriptor string when it is to be used.
vtkHyperTreeGridSource::SubdivideFromStringDescriptor
void SubdivideFromStringDescriptor(vtkHyperTreeGrid *output, vtkHyperTreeGridNonOrientedCursor *cursor, unsigned int level, int treeIdx, int childIdx, int idx[3], int parentPos)
Subdivide grid from descriptor string when it is to be used.
vtkHyperTreeGridSource::InitTreeFromDescriptor
void InitTreeFromDescriptor(vtkHyperTreeGrid *output, vtkHyperTreeGridNonOrientedCursor *cursor, int treeIdx, int idx[3])
Initialize tree grid from descriptor and call subdivide if needed.
vtkHyperTreeGridSource::Mask
char * Mask
Definition: vtkHyperTreeGridSource.h:342
vtkHyperTreeGridSource::LevelBitsIndex
std::vector< vtkIdType > LevelBitsIndex
Definition: vtkHyperTreeGridSource.h:348
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:80
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:401
vtkHyperTreeGridSource::SetIndexingModeToIJK
void SetIndexingModeToIJK()
Specify whether indexing mode of grid root cells must be transposed to x-axis first,...
vtkHyperTreeGridSource::ConvertDescriptorStringToBitArray
vtkBitArray * ConvertDescriptorStringToBitArray(const std::string &)
Helpers to convert string descriptors & mask to bit arrays.
vtkHyperTreeGridSource::SubdivideFromBitsDescriptor
void SubdivideFromBitsDescriptor(vtkHyperTreeGrid *output, vtkHyperTreeGridNonOrientedCursor *cursor, unsigned int level, int treeIdx, int childIdx, int idx[3], int parentPos)
Subdivide grid from descriptor string when it is to be used.
vtkHyperTreeGridSource::SetDimensions
void SetDimensions(unsigned int, unsigned int, unsigned int)
Set/Get the number of root cells + 1 in each dimension of the grid.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkHyperTreeGridSource::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
VTK_DEPRECATED_IN_9_0_0
#define VTK_DEPRECATED_IN_9_0_0(reason)
Definition: vtkDeprecation.h:126
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::UseDescriptor
bool UseDescriptor
Definition: vtkHyperTreeGridSource.h:333
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkHyperTreeGridSource::SetLevelZeroMaterialIndex
virtual void SetLevelZeroMaterialIndex(vtkIdTypeArray *)
Set the index array used to as a material mask.
vtkHyperTreeGridSource::GenerateInterfaceFields
bool GenerateInterfaceFields
Definition: vtkHyperTreeGridSource.h:335
vtkHyperTreeGridSource::LevelCounters
std::vector< int > LevelCounters
Definition: vtkHyperTreeGridSource.h:354
vtkHyperTreeGridSource::SetDimensions
void SetDimensions(const unsigned int *dims)
Set/Get the number of root cells + 1 in each dimension of the grid.
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
Define default input and output port types.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::string
@ string
Definition: vtkX3D.h:496
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:323
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:145
vtkDeprecation.h
vtkHyperTreeGridSource::SetGridScale
void SetGridScale(double scale)
Set/Get the scale to be applied to root cells in each dimension of the grid.
Definition: vtkHyperTreeGridSource.h:127
vtkHyperTreeGridSource::GetQuadricCoefficients
void GetQuadricCoefficients(double[10])
Helpers to set/get the 10 coefficients of the quadric function.
vtkHyperTreeGridSource::LevelMasks
std::vector< std::string > LevelMasks
Definition: vtkHyperTreeGridSource.h:344
vtkHyperTreeGridSource::LevelBitsIndexCnt
std::vector< vtkIdType > LevelBitsIndexCnt
Definition: vtkHyperTreeGridSource.h:349
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:34
vtkHyperTreeGridSource::SetIndexingModeToKJI
void SetIndexingModeToKJI()
Specify whether indexing mode of grid root cells must be transposed to x-axis first,...
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkHyperTreeGridAlgorithm
Superclass for algorithms that produce a hyper tree grid as output.
Definition: vtkHyperTreeGridAlgorithm.h:48
vtkHyperTreeGridSource::MaskBits
vtkBitArray * MaskBits
Definition: vtkHyperTreeGridSource.h:347
vtkHyperTreeGridSource::GetMTime
vtkMTimeType GetMTime() override
Override GetMTime because we delegate to a vtkQuadric.
vtkHyperTreeGridSource::GetQuadricCoefficients
double * GetQuadricCoefficients()
Helpers to set/get the 10 coefficients of the quadric function.
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:96
vtkHyperTreeGridSource::Orientation
unsigned int Orientation
Definition: vtkHyperTreeGridSource.h:330
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287