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 =========================================================================*/
53 #ifndef vtkRandomAttributeGenerator_h
54 #define vtkRandomAttributeGenerator_h
55 
56 #include "vtkFiltersGeneralModule.h" // For export macro
58 
59 class vtkDataSet;
61 
62 class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkPassInputTypeAlgorithm
63 {
64 public:
69 
71  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
72 
74 
78  vtkSetMacro(DataType,int);
79  void SetDataTypeToBit() {this->SetDataType(VTK_BIT);}
80  void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);}
81  void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);}
82  void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);}
83  void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);}
84  void SetDataTypeToInt() {this->SetDataType(VTK_INT);}
85  void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);}
86  void SetDataTypeToLong() {this->SetDataType(VTK_LONG);}
87  void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);}
88  void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);}
89  void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);}
90  vtkGetMacro(DataType,int);
92 
94 
100  vtkSetClampMacro(NumberOfComponents,int,1,VTK_INT_MAX);
101  vtkGetMacro(NumberOfComponents,int);
103 
105 
110  vtkSetMacro(MinimumComponentValue,double);
111  vtkGetMacro(MinimumComponentValue,double);
112  void SetComponentRange (double minimumValue, double maximumValue)
113  {
114  this->SetMinimumComponentValue (minimumValue);
115  this->SetMaximumComponentValue (maximumValue);
116  }
118 
120 
125  vtkSetMacro(MaximumComponentValue,double);
126  vtkGetMacro(MaximumComponentValue,double);
128 
130 
135  vtkSetClampMacro(NumberOfTuples,vtkIdType,0,VTK_INT_MAX);
136  vtkGetMacro(NumberOfTuples,vtkIdType);
138 
140 
144  vtkSetMacro(GeneratePointScalars,int);
145  vtkGetMacro(GeneratePointScalars,int);
146  vtkBooleanMacro(GeneratePointScalars,int);
148 
150 
154  vtkSetMacro(GeneratePointVectors,int);
155  vtkGetMacro(GeneratePointVectors,int);
156  vtkBooleanMacro(GeneratePointVectors,int);
158 
160 
164  vtkSetMacro(GeneratePointNormals,int);
165  vtkGetMacro(GeneratePointNormals,int);
166  vtkBooleanMacro(GeneratePointNormals,int);
168 
170 
174  vtkSetMacro(GeneratePointTensors,int);
175  vtkGetMacro(GeneratePointTensors,int);
176  vtkBooleanMacro(GeneratePointTensors,int);
178 
180 
185  vtkSetMacro(GeneratePointTCoords,int);
186  vtkGetMacro(GeneratePointTCoords,int);
187  vtkBooleanMacro(GeneratePointTCoords,int);
189 
191 
195  vtkSetMacro(GeneratePointArray,int);
196  vtkGetMacro(GeneratePointArray,int);
197  vtkBooleanMacro(GeneratePointArray,int);
199 
201 
205  vtkSetMacro(GenerateCellScalars,int);
206  vtkGetMacro(GenerateCellScalars,int);
207  vtkBooleanMacro(GenerateCellScalars,int);
209 
211 
215  vtkSetMacro(GenerateCellVectors,int);
216  vtkGetMacro(GenerateCellVectors,int);
217  vtkBooleanMacro(GenerateCellVectors,int);
219 
221 
225  vtkSetMacro(GenerateCellNormals,int);
226  vtkGetMacro(GenerateCellNormals,int);
227  vtkBooleanMacro(GenerateCellNormals,int);
229 
231 
235  vtkSetMacro(GenerateCellTensors,int);
236  vtkGetMacro(GenerateCellTensors,int);
237  vtkBooleanMacro(GenerateCellTensors,int);
239 
241 
246  vtkSetMacro(GenerateCellTCoords,int);
247  vtkGetMacro(GenerateCellTCoords,int);
248  vtkBooleanMacro(GenerateCellTCoords,int);
250 
252 
256  vtkSetMacro(GenerateCellArray,int);
257  vtkGetMacro(GenerateCellArray,int);
258  vtkBooleanMacro(GenerateCellArray,int);
260 
262 
266  vtkSetMacro(GenerateFieldArray,int);
267  vtkGetMacro(GenerateFieldArray,int);
268  vtkBooleanMacro(GenerateFieldArray,int);
270 
272 
277  vtkSetMacro(AttributesConstantPerBlock,bool);
278  vtkGetMacro(AttributesConstantPerBlock,bool);
279  vtkBooleanMacro(AttributesConstantPerBlock,bool);
281 
282 
284 
291  {
292  this->GeneratePointScalarsOn();
293  this->GeneratePointVectorsOn();
294  this->GeneratePointNormalsOn();
295  this->GeneratePointTCoordsOn();
296  this->GeneratePointTensorsOn();
297  this->GeneratePointArrayOn();
298  }
300  {
301  this->GeneratePointScalarsOff();
302  this->GeneratePointVectorsOff();
303  this->GeneratePointNormalsOff();
304  this->GeneratePointTCoordsOff();
305  this->GeneratePointTensorsOff();
306  this->GeneratePointArrayOff();
307  }
309  {
310  this->GenerateCellScalarsOn();
311  this->GenerateCellVectorsOn();
312  this->GenerateCellNormalsOn();
313  this->GenerateCellTCoordsOn();
314  this->GenerateCellTensorsOn();
315  this->GenerateCellArrayOn();
316  }
318  {
319  this->GenerateCellScalarsOff();
320  this->GenerateCellVectorsOff();
321  this->GenerateCellNormalsOff();
322  this->GenerateCellTCoordsOff();
323  this->GenerateCellTensorsOff();
324  this->GenerateCellArrayOff();
325  }
327  {
328  this->GenerateAllPointDataOn();
329  this->GenerateAllCellDataOn();
330  this->GenerateFieldArrayOn();
331  }
333  {
334  this->GenerateAllPointDataOff();
335  this->GenerateAllCellDataOff();
336  this->GenerateFieldArrayOff();
337  }
339 
340 protected:
343 
345  vtkInformationVector *) VTK_OVERRIDE;
347 
348  int DataType;
353 
360 
367 
370 
371  // Helper functions
372  vtkDataArray *GenerateData(int dataType, vtkIdType numTuples, int numComp,
373  int minComp, int maxComp, double min, double max);
374  int RequestData(vtkDataSet *input, vtkDataSet *output);
376  template <class T>
378  vtkIdType numTuples,
379  int numComp,
380  int minComp,
381  int maxComp,
382  double min,
383  double max);
384 
385 
386 private:
387  vtkRandomAttributeGenerator(const vtkRandomAttributeGenerator&) VTK_DELETE_FUNCTION;
388  void operator=(const vtkRandomAttributeGenerator&) VTK_DELETE_FUNCTION;
389 };
390 
391 #endif
vtkRandomAttributeGenerator::SetDataTypeToUnsignedInt
void SetDataTypeToUnsignedInt()
Definition: vtkRandomAttributeGenerator.h:85
vtkRandomAttributeGenerator::GeneratePointArray
int GeneratePointArray
Definition: vtkRandomAttributeGenerator.h:359
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:153
vtkPassInputTypeAlgorithm.h
vtkRandomAttributeGenerator::GeneratePointTensors
int GeneratePointTensors
Definition: vtkRandomAttributeGenerator.h:358
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkRandomAttributeGenerator::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
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:55
vtkRandomAttributeGenerator::GenerateCellNormals
int GenerateCellNormals
Definition: vtkRandomAttributeGenerator.h:363
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkRandomAttributeGenerator::SetDataTypeToFloat
void SetDataTypeToFloat()
Definition: vtkRandomAttributeGenerator.h:88
vtkRandomAttributeGenerator::GenerateAllCellDataOff
void GenerateAllCellDataOff()
Definition: vtkRandomAttributeGenerator.h:317
vtkRandomAttributeGenerator::SetDataTypeToShort
void SetDataTypeToShort()
Definition: vtkRandomAttributeGenerator.h:82
vtkRandomAttributeGenerator::GeneratePointNormals
int GeneratePointNormals
Definition: vtkRandomAttributeGenerator.h:356
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:355
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkRandomAttributeGenerator::GenerateCellScalars
int GenerateCellScalars
Definition: vtkRandomAttributeGenerator.h:361
vtkRandomAttributeGenerator::SetDataTypeToDouble
void SetDataTypeToDouble()
Definition: vtkRandomAttributeGenerator.h:89
vtkRandomAttributeGenerator::MaximumComponentValue
double MaximumComponentValue
Definition: vtkRandomAttributeGenerator.h:352
vtkRandomAttributeGenerator::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:52
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkRandomAttributeGenerator::SetDataTypeToUnsignedChar
void SetDataTypeToUnsignedChar()
Definition: vtkRandomAttributeGenerator.h:81
vtkRandomAttributeGenerator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRandomAttributeGenerator::MinimumComponentValue
double MinimumComponentValue
Definition: vtkRandomAttributeGenerator.h:351
vtkRandomAttributeGenerator::GenerateCellTensors
int GenerateCellTensors
Definition: vtkRandomAttributeGenerator.h:365
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:49
vtkRandomAttributeGenerator::RequestData
int RequestData(vtkCompositeDataSet *input, vtkCompositeDataSet *output)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkRandomAttributeGenerator::GeneratePointTCoords
int GeneratePointTCoords
Definition: vtkRandomAttributeGenerator.h:357
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
vtkRandomAttributeGenerator::DataType
int DataType
Definition: vtkRandomAttributeGenerator.h:348
vtkRandomAttributeGenerator::vtkRandomAttributeGenerator
vtkRandomAttributeGenerator()
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:56
vtkRandomAttributeGenerator::~vtkRandomAttributeGenerator
~vtkRandomAttributeGenerator() override
Definition: vtkRandomAttributeGenerator.h:342
vtkRandomAttributeGenerator::SetDataTypeToUnsignedShort
void SetDataTypeToUnsignedShort()
Definition: vtkRandomAttributeGenerator.h:83
vtkRandomAttributeGenerator::GenerateAllDataOn
void GenerateAllDataOn()
Definition: vtkRandomAttributeGenerator.h:326
vtkRandomAttributeGenerator::NumberOfComponents
int NumberOfComponents
Definition: vtkRandomAttributeGenerator.h:349
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkRandomAttributeGenerator::SetDataTypeToBit
void SetDataTypeToBit()
Definition: vtkRandomAttributeGenerator.h:79
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkRandomAttributeGenerator
generate and create random data attributes
Definition: vtkRandomAttributeGenerator.h:63
vtkRandomAttributeGenerator::GenerateCellTCoords
int GenerateCellTCoords
Definition: vtkRandomAttributeGenerator.h:364
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkRandomAttributeGenerator::GenerateAllCellDataOn
void GenerateAllCellDataOn()
Definition: vtkRandomAttributeGenerator.h:308
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:52
vtkRandomAttributeGenerator::SetDataTypeToUnsignedLong
void SetDataTypeToUnsignedLong()
Definition: vtkRandomAttributeGenerator.h:87
vtkRandomAttributeGenerator::GenerateAllPointDataOn
void GenerateAllPointDataOn()
Convenience methods for generating data: all data, all point data, or all cell data.
Definition: vtkRandomAttributeGenerator.h:290
vtkRandomAttributeGenerator::GenerateAllPointDataOff
void GenerateAllPointDataOff()
Definition: vtkRandomAttributeGenerator.h:299
vtkRandomAttributeGenerator::AttributesConstantPerBlock
bool AttributesConstantPerBlock
Definition: vtkRandomAttributeGenerator.h:369
vtkRandomAttributeGenerator::GenerateAllDataOff
void GenerateAllDataOff()
Definition: vtkRandomAttributeGenerator.h:332
vtkRandomAttributeGenerator::SetComponentRange
void SetComponentRange(double minimumValue, double maximumValue)
Definition: vtkRandomAttributeGenerator.h:112
vtkRandomAttributeGenerator::SetDataTypeToChar
void SetDataTypeToChar()
Definition: vtkRandomAttributeGenerator.h:80
VTK_BIT
#define VTK_BIT
Definition: vtkType.h:48
VTK_INT
#define VTK_INT
Definition: vtkType.h:54
vtkRandomAttributeGenerator::New
static vtkRandomAttributeGenerator * New()
Create instance with minimum speed 0.0, maximum speed 1.0.
vtkRandomAttributeGenerator::GeneratePointScalars
int GeneratePointScalars
Definition: vtkRandomAttributeGenerator.h:354
vtkRandomAttributeGenerator::NumberOfTuples
vtkIdType NumberOfTuples
Definition: vtkRandomAttributeGenerator.h:350
vtkPassInputTypeAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPassInputTypeAlgorithm.h:51
vtkRandomAttributeGenerator::RequestData
int RequestData(vtkDataSet *input, vtkDataSet *output)
vtkRandomAttributeGenerator::SetDataTypeToLong
void SetDataTypeToLong()
Definition: vtkRandomAttributeGenerator.h:86
vtkRandomAttributeGenerator::GenerateFieldArray
int GenerateFieldArray
Definition: vtkRandomAttributeGenerator.h:368
vtkRandomAttributeGenerator::GenerateCellVectors
int GenerateCellVectors
Definition: vtkRandomAttributeGenerator.h:362
vtkRandomAttributeGenerator::GenerateCellArray
int GenerateCellArray
Definition: vtkRandomAttributeGenerator.h:366
vtkRandomAttributeGenerator::SetDataTypeToInt
void SetDataTypeToInt()
Definition: vtkRandomAttributeGenerator.h:84