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 
124  vtkSetClampMacro(NumberOfTuples,vtkIdType,0,VTK_INT_MAX);
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);
333  int RequestData(vtkDataSet *input, vtkDataSet *output);
335  template <class T>
336  void GenerateRandomTuples(T *data,
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
#define VTK_UNSIGNED_INT
Definition: vtkType.h:32
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:30
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
#define VTK_INT_MAX
Definition: vtkType.h:132
int vtkIdType
Definition: vtkType.h:275
#define VTK_DOUBLE
Definition: vtkType.h:36
#define VTK_FLOAT
Definition: vtkType.h:35
virtual int FillInputPortInformation(int port, vtkInformation *info)
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
#define VTK_SHORT
Definition: vtkType.h:29
#define VTK_CHAR
Definition: vtkType.h:26
#define VTK_LONG
Definition: vtkType.h:33
#define VTKFILTERSGENERAL_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
#define VTK_BIT
Definition: vtkType.h:25
Store zero or more vtkInformation instances.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:34
generate and create random data attributes
void SetComponentRange(double minimumValue, double maximumValue)
#define VTK_INT
Definition: vtkType.h:31
#define max(a, b)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkPassInputTypeAlgorithm * New()