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=========================================================================*/
49#ifndef vtkHyperTreeGridSource_h
50#define vtkHyperTreeGridSource_h
51
52#include "vtkFiltersSourcesModule.h" // For export macro
54
55#include <string> // STL Header
56#include <map> // STL Header
57#include <vector> // STL Header
58
59class vtkDataArray;
60class vtkBitArray;
63class vtkQuadric;
64
65class VTKFILTERSSOURCES_EXPORT vtkHyperTreeGridSource : public vtkHyperTreeGridAlgorithm
66{
67public:
69 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70
72
77 unsigned int GetMaximumLevel();
78
84 void SetMaximumLevel( unsigned int levels );
85
87
90 vtkSetVector3Macro(Origin, double);
91 vtkGetVector3Macro(Origin, double);
93
95
98 vtkSetVector3Macro(GridScale, double);
99 vtkGetVector3Macro(GridScale, double);
101
103
106 vtkSetVector3Macro(GridSize, unsigned int);
107 vtkGetVector3Macro(GridSize, unsigned int);
109
111
115 vtkSetMacro(TransposedRootIndexing, bool);
116 vtkGetMacro(TransposedRootIndexing, bool);
120
122
125 vtkSetClampMacro(BranchFactor, unsigned int, 2, 3);
126 vtkGetMacro(BranchFactor, unsigned int);
128
130
133 vtkSetClampMacro(Dimension, unsigned int, 2, 3);
134 vtkGetMacro(Dimension, unsigned int);
136
138
143 vtkSetMacro(UseDescriptor, bool);
144 vtkGetMacro(UseDescriptor, bool);
145 vtkBooleanMacro(UseDescriptor, bool);
147
149
154 vtkSetMacro(UseMaterialMask, bool);
155 vtkGetMacro(UseMaterialMask, bool);
156 vtkBooleanMacro(UseMaterialMask, bool);
158
160
163 vtkSetStringMacro(Descriptor);
164 vtkGetStringMacro(Descriptor);
166
168
171 vtkSetStringMacro(MaterialMask);
172 vtkGetStringMacro(MaterialMask);
174
176
180 vtkGetObjectMacro( DescriptorBits, vtkBitArray );
182
187
189
193 vtkGetObjectMacro( MaterialMaskBits, vtkBitArray );
195
197
200 virtual void SetQuadric( vtkQuadric* );
201 vtkGetObjectMacro(Quadric, vtkQuadric);
203
205
208 void SetQuadricCoefficients( double[10] );
209 void GetQuadricCoefficients( double[10] );
212
216 vtkMTimeType GetMTime() VTK_OVERRIDE;
217
219
222 vtkBitArray* ConvertDescriptorStringToBitArray( const std::string& );
223 vtkBitArray* ConvertMaterialMaskStringToBitArray( const std::string& );
225
226protected:
228 ~vtkHyperTreeGridSource() VTK_OVERRIDE;
229
230 int RequestInformation ( vtkInformation*,
232 vtkInformationVector* ) VTK_OVERRIDE;
233
234 int RequestData( vtkInformation*,
236 vtkInformationVector* ) VTK_OVERRIDE;
237
241 int InitializeFromStringDescriptor();
242
246 int InitializeFromBitsDescriptor();
247
251 void InitTreeFromDescriptor( vtkHyperTreeCursor* cursor,
252 int treeIdx,
253 int idx[3] );
254
258 void SubdivideFromStringDescriptor( vtkHyperTreeCursor* cursor,
259 unsigned int level,
260 int treeIdx,
261 int childIdx,
262 int idx[3],
263 int parentPos );
264
268 void SubdivideFromBitsDescriptor( vtkHyperTreeCursor* cursor,
269 unsigned int level,
270 int treeIdx,
271 int childIdx,
272 int idx[3],
273 int parentPos );
274
278 void SubdivideFromQuadric( vtkHyperTreeCursor* cursor,
279 unsigned int level,
280 int treeIdx,
281 const int idx[3],
282 double origin[3],
283 double size[3] );
284
288 double EvaluateQuadric( double[3] );
289
290 double Origin[3];
291 double GridScale[3];
292 unsigned int GridSize[3];
293 bool TransposedRootIndexing;
294 unsigned int MaximumLevel;
295 unsigned int Dimension;
296 unsigned int BranchFactor;
297 unsigned int BlockSize;
298 bool UseDescriptor;
299 bool UseMaterialMask;
300
301 vtkDataArray* XCoordinates;
302 vtkDataArray* YCoordinates;
303 vtkDataArray* ZCoordinates;
304
305 char* Descriptor;
306 char* MaterialMask;
307 std::vector<std::string> LevelDescriptors;
308 std::vector<std::string> LevelMaterialMasks;
309
310 vtkBitArray* DescriptorBits;
311 vtkBitArray* MaterialMaskBits;
312 std::vector<vtkIdType> LevelBitsIndex;
313 std::vector<vtkIdType> LevelBitsIndexCnt;
314
315 vtkIdTypeArray* LevelZeroMaterialIndex;
316 std::map<vtkIdType, vtkIdType> LevelZeroMaterialMap;
317
318 std::vector<int> LevelCounters;
319
320 vtkQuadric* Quadric;
321
323
324private:
325 vtkHyperTreeGridSource(const vtkHyperTreeGridSource&) VTK_DELETE_FUNCTION;
326 void operator=(const vtkHyperTreeGridSource&) VTK_DELETE_FUNCTION;
327};
328
329#endif
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:37
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
Objects that can traverse hypertree nodes.
Superclass for algorithms that produce a hyper tree grid as output.
Create a synthetic grid of hypertrees.
virtual void SetQuadric(vtkQuadric *)
Set/Get the quadric function.
virtual void SetMaterialMaskBits(vtkBitArray *)
Set/Get the bitarray used as a material mask.
static vtkHyperTreeGridSource * New()
vtkMTimeType GetMTime() override
Override GetMTime because we delegate to a vtkQuadric.
virtual void SetLevelZeroMaterialIndex(vtkIdTypeArray *)
Set the index array used to as a material mask.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int GetMaximumLevel()
Return the maximum number of levels of the hypertree.
double * GetQuadricCoefficients()
void SetMaximumLevel(unsigned int levels)
Set the maximum number of levels of the hypertree.
void GetQuadricCoefficients(double[10])
void SetQuadricCoefficients(double[10])
Helpers to set/get the 10 coefficients of the quadric function.
virtual void SetDescriptorBits(vtkBitArray *)
Set/Get the bitarray used to describe the grid.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
dynamic, self-adjusting array of vtkIdType
abstract interface for implicit functions
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
evaluate implicit quadric function
Definition: vtkQuadric.h:37
@ vector
Definition: vtkX3D.h:237
@ level
Definition: vtkX3D.h:395
@ size
Definition: vtkX3D.h:253
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
int vtkIdType
Definition: vtkType.h:287
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248