VTK
vtkRandomAttributeGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRandomAttributeGenerator.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 =========================================================================*/
52 #ifndef vtkRandomAttributeGenerator_h
53 #define vtkRandomAttributeGenerator_h
54 
55 #include "vtkFiltersGeneralModule.h" // For export macro
57 
58 class vtkDataSet;
60 
62 {
63 public:
66 
68  void PrintSelf(ostream& os, vtkIndent indent);
69 
71 
73  vtkSetMacro(DataType,int);
74  void SetDataTypeToBit() {this->SetDataType(VTK_BIT);}
75  void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);}
76  void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);}
77  void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);}
78  void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);}
79  void SetDataTypeToInt() {this->SetDataType(VTK_INT);}
80  void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);}
81  void SetDataTypeToLong() {this->SetDataType(VTK_LONG);}
82  void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);}
83  void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);}
84  void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);}
85  vtkGetMacro(DataType,int);
87 
89 
94  vtkSetClampMacro(NumberOfComponents,int,1,VTK_INT_MAX);
95  vtkGetMacro(NumberOfComponents,int);
97 
99 
102  vtkSetMacro(MinimumComponentValue,double);
103  vtkGetMacro(MinimumComponentValue,double);
104  void SetComponentRange (double minimumValue, double maximumValue)
105  {
106  this->SetMinimumComponentValue (minimumValue);
107  this->SetMaximumComponentValue (maximumValue);
108  }
110 
112 
115  vtkSetMacro(MaximumComponentValue,double);
116  vtkGetMacro(MaximumComponentValue,double);
118 
120 
125  vtkGetMacro(NumberOfTuples,vtkIdType);
127 
129 
131  vtkSetMacro(GeneratePointScalars,int);
132  vtkGetMacro(GeneratePointScalars,int);
133  vtkBooleanMacro(GeneratePointScalars,int);
135 
137 
139  vtkSetMacro(GeneratePointVectors,int);
140  vtkGetMacro(GeneratePointVectors,int);
141  vtkBooleanMacro(GeneratePointVectors,int);
143 
145 
147  vtkSetMacro(GeneratePointNormals,int);
148  vtkGetMacro(GeneratePointNormals,int);
149  vtkBooleanMacro(GeneratePointNormals,int);
151 
153 
155  vtkSetMacro(GeneratePointTensors,int);
156  vtkGetMacro(GeneratePointTensors,int);
157  vtkBooleanMacro(GeneratePointTensors,int);
159 
161 
164  vtkSetMacro(GeneratePointTCoords,int);
165  vtkGetMacro(GeneratePointTCoords,int);
166  vtkBooleanMacro(GeneratePointTCoords,int);
168 
170 
172  vtkSetMacro(GeneratePointArray,int);
173  vtkGetMacro(GeneratePointArray,int);
174  vtkBooleanMacro(GeneratePointArray,int);
176 
178 
180  vtkSetMacro(GenerateCellScalars,int);
181  vtkGetMacro(GenerateCellScalars,int);
182  vtkBooleanMacro(GenerateCellScalars,int);
184 
186 
188  vtkSetMacro(GenerateCellVectors,int);
189  vtkGetMacro(GenerateCellVectors,int);
190  vtkBooleanMacro(GenerateCellVectors,int);
192 
194 
196  vtkSetMacro(GenerateCellNormals,int);
197  vtkGetMacro(GenerateCellNormals,int);
198  vtkBooleanMacro(GenerateCellNormals,int);
200 
202 
204  vtkSetMacro(GenerateCellTensors,int);
205  vtkGetMacro(GenerateCellTensors,int);
206  vtkBooleanMacro(GenerateCellTensors,int);
208 
210 
213  vtkSetMacro(GenerateCellTCoords,int);
214  vtkGetMacro(GenerateCellTCoords,int);
215  vtkBooleanMacro(GenerateCellTCoords,int);
217 
219 
221  vtkSetMacro(GenerateCellArray,int);
222  vtkGetMacro(GenerateCellArray,int);
223  vtkBooleanMacro(GenerateCellArray,int);
225 
227 
229  vtkSetMacro(GenerateFieldArray,int);
230  vtkGetMacro(GenerateFieldArray,int);
231  vtkBooleanMacro(GenerateFieldArray,int);
233 
235 
237  vtkSetMacro(AttributesConstantPerBlock,bool);
238  vtkGetMacro(AttributesConstantPerBlock,bool);
239  vtkBooleanMacro(AttributesConstantPerBlock,bool);
241 
242 
244 
250  {
251  this->GeneratePointScalarsOn();
252  this->GeneratePointVectorsOn();
253  this->GeneratePointNormalsOn();
254  this->GeneratePointTCoordsOn();
255  this->GeneratePointTensorsOn();
256  this->GeneratePointArrayOn();
257  }
259  {
260  this->GeneratePointScalarsOff();
261  this->GeneratePointVectorsOff();
262  this->GeneratePointNormalsOff();
263  this->GeneratePointTCoordsOff();
264  this->GeneratePointTensorsOff();
265  this->GeneratePointArrayOff();
266  }
268  {
269  this->GenerateCellScalarsOn();
270  this->GenerateCellVectorsOn();
271  this->GenerateCellNormalsOn();
272  this->GenerateCellTCoordsOn();
273  this->GenerateCellTensorsOn();
274  this->GenerateCellArrayOn();
275  }
277  {
278  this->GenerateCellScalarsOff();
279  this->GenerateCellVectorsOff();
280  this->GenerateCellNormalsOff();
281  this->GenerateCellTCoordsOff();
282  this->GenerateCellTensorsOff();
283  this->GenerateCellArrayOff();
284  }
286  {
287  this->GenerateAllPointDataOn();
288  this->GenerateAllCellDataOn();
289  this->GenerateFieldArrayOn();
290  }
292  {
293  this->GenerateAllPointDataOff();
294  this->GenerateAllCellDataOff();
295  this->GenerateFieldArrayOff();
296  }
298 
299 protected:
302 
306 
307  int DataType;
312 
319 
326 
329 
330  // Helper functions
331  vtkDataArray *GenerateData(int dataType, vtkIdType numTuples, int numComp,
332  int minComp, int maxComp, double min, double max);
335  template <class T>
337  vtkIdType numTuples,
338  int numComp,
339  int minComp,
340  int maxComp,
341  double min,
342  double max);
343 
344 
345 private:
346  vtkRandomAttributeGenerator(const vtkRandomAttributeGenerator&); // Not implemented.
347  void operator=(const vtkRandomAttributeGenerator&); // Not implemented.
348 };
349 
350 #endif
vtkRandomAttributeGenerator::~vtkRandomAttributeGenerator
~vtkRandomAttributeGenerator()
Definition: vtkRandomAttributeGenerator.h:301
vtkRandomAttributeGenerator::SetDataTypeToUnsignedInt
void SetDataTypeToUnsignedInt()
Definition: vtkRandomAttributeGenerator.h:80
vtkRandomAttributeGenerator::GeneratePointArray
int GeneratePointArray
Definition: vtkRandomAttributeGenerator.h:318
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkPassInputTypeAlgorithm.h
vtkRandomAttributeGenerator::GeneratePointTensors
int GeneratePointTensors
Definition: vtkRandomAttributeGenerator.h:317
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkRandomAttributeGenerator::GenerateData
vtkDataArray * GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max)
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:32
vtkRandomAttributeGenerator::GenerateCellNormals
int GenerateCellNormals
Definition: vtkRandomAttributeGenerator.h:322
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:30
vtkRandomAttributeGenerator::SetDataTypeToFloat
void SetDataTypeToFloat()
Definition: vtkRandomAttributeGenerator.h:83
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkRandomAttributeGenerator::GenerateAllCellDataOff
void GenerateAllCellDataOff()
Definition: vtkRandomAttributeGenerator.h:276
vtkRandomAttributeGenerator::SetDataTypeToShort
void SetDataTypeToShort()
Definition: vtkRandomAttributeGenerator.h:77
vtkRandomAttributeGenerator::GeneratePointNormals
int GeneratePointNormals
Definition: vtkRandomAttributeGenerator.h:315
vtkRandomAttributeGenerator::GenerateRandomTuples
void GenerateRandomTuples(T *data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max)
vtkRandomAttributeGenerator::GeneratePointVectors
int GeneratePointVectors
Definition: vtkRandomAttributeGenerator.h:314
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkRandomAttributeGenerator::GenerateCellScalars
int GenerateCellScalars
Definition: vtkRandomAttributeGenerator.h:320
vtkRandomAttributeGenerator::SetDataTypeToDouble
void SetDataTypeToDouble()
Definition: vtkRandomAttributeGenerator.h:84
vtkRandomAttributeGenerator::MaximumComponentValue
double MaximumComponentValue
Definition: vtkRandomAttributeGenerator.h:311
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:51
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkRandomAttributeGenerator::SetDataTypeToUnsignedChar
void SetDataTypeToUnsignedChar()
Definition: vtkRandomAttributeGenerator.h:76
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkFiltersGeneralModule.h
vtkRandomAttributeGenerator::MinimumComponentValue
double MinimumComponentValue
Definition: vtkRandomAttributeGenerator.h:310
vtkRandomAttributeGenerator::GenerateCellTensors
int GenerateCellTensors
Definition: vtkRandomAttributeGenerator.h:324
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:26
vtkRandomAttributeGenerator::RequestData
int RequestData(vtkCompositeDataSet *input, vtkCompositeDataSet *output)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkRandomAttributeGenerator::GeneratePointTCoords
int GeneratePointTCoords
Definition: vtkRandomAttributeGenerator.h:316
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:35
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:36
vtkRandomAttributeGenerator::DataType
int DataType
Definition: vtkRandomAttributeGenerator.h:307
vtkRandomAttributeGenerator::vtkRandomAttributeGenerator
vtkRandomAttributeGenerator()
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
VTKFILTERSGENERAL_EXPORT
#define VTKFILTERSGENERAL_EXPORT
Definition: vtkFiltersGeneralModule.h:15
vtkRandomAttributeGenerator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:33
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkRandomAttributeGenerator::SetDataTypeToUnsignedShort
void SetDataTypeToUnsignedShort()
Definition: vtkRandomAttributeGenerator.h:78
vtkRandomAttributeGenerator::GenerateAllDataOn
void GenerateAllDataOn()
Definition: vtkRandomAttributeGenerator.h:285
vtkRandomAttributeGenerator::NumberOfComponents
int NumberOfComponents
Definition: vtkRandomAttributeGenerator.h:308
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkRandomAttributeGenerator::SetDataTypeToBit
void SetDataTypeToBit()
Definition: vtkRandomAttributeGenerator.h:74
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:34
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkRandomAttributeGenerator
generate and create random data attributes
Definition: vtkRandomAttributeGenerator.h:62
vtkRandomAttributeGenerator::GenerateCellTCoords
int GenerateCellTCoords
Definition: vtkRandomAttributeGenerator.h:323
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkRandomAttributeGenerator::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkRandomAttributeGenerator::GenerateAllCellDataOn
void GenerateAllCellDataOn()
Definition: vtkRandomAttributeGenerator.h:267
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:29
vtkRandomAttributeGenerator::SetDataTypeToUnsignedLong
void SetDataTypeToUnsignedLong()
Definition: vtkRandomAttributeGenerator.h:82
vtkRandomAttributeGenerator::GenerateAllPointDataOn
void GenerateAllPointDataOn()
Definition: vtkRandomAttributeGenerator.h:249
vtkRandomAttributeGenerator::GenerateAllPointDataOff
void GenerateAllPointDataOff()
Definition: vtkRandomAttributeGenerator.h:258
vtkRandomAttributeGenerator::AttributesConstantPerBlock
bool AttributesConstantPerBlock
Definition: vtkRandomAttributeGenerator.h:328
vtkRandomAttributeGenerator::GenerateAllDataOff
void GenerateAllDataOff()
Definition: vtkRandomAttributeGenerator.h:291
vtkRandomAttributeGenerator::SetComponentRange
void SetComponentRange(double minimumValue, double maximumValue)
Definition: vtkRandomAttributeGenerator.h:104
vtkRandomAttributeGenerator::SetDataTypeToChar
void SetDataTypeToChar()
Definition: vtkRandomAttributeGenerator.h:75
VTK_BIT
#define VTK_BIT
Definition: vtkType.h:25
VTK_INT
#define VTK_INT
Definition: vtkType.h:31
vtkRandomAttributeGenerator::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkRandomAttributeGenerator::New
static vtkRandomAttributeGenerator * New()
vtkRandomAttributeGenerator::GeneratePointScalars
int GeneratePointScalars
Definition: vtkRandomAttributeGenerator.h:313
vtkRandomAttributeGenerator::NumberOfTuples
vtkIdType NumberOfTuples
Definition: vtkRandomAttributeGenerator.h:309
vtkPassInputTypeAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPassInputTypeAlgorithm.h:50
vtkRandomAttributeGenerator::RequestData
int RequestData(vtkDataSet *input, vtkDataSet *output)
vtkRandomAttributeGenerator::SetDataTypeToLong
void SetDataTypeToLong()
Definition: vtkRandomAttributeGenerator.h:81
vtkRandomAttributeGenerator::GenerateFieldArray
int GenerateFieldArray
Definition: vtkRandomAttributeGenerator.h:327
vtkRandomAttributeGenerator::GenerateCellVectors
int GenerateCellVectors
Definition: vtkRandomAttributeGenerator.h:321
vtkRandomAttributeGenerator::GenerateCellArray
int GenerateCellArray
Definition: vtkRandomAttributeGenerator.h:325
vtkRandomAttributeGenerator::SetDataTypeToInt
void SetDataTypeToInt()
Definition: vtkRandomAttributeGenerator.h:79