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
59class vtkDataSet;
61
62class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkPassInputTypeAlgorithm
63{
64public:
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);}
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
340protected:
343
345 vtkInformationVector *) VTK_OVERRIDE;
347
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
386private:
388 void operator=(const vtkRandomAttributeGenerator&) VTK_DELETE_FUNCTION;
389};
390
391#endif
abstract superclass for composite (multi-block or AMR) datasets
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce output of the same type as input.
generate and create random data attributes
int RequestData(vtkDataSet *input, vtkDataSet *output)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkRandomAttributeGenerator * New()
Create instance with minimum speed 0.0, maximum speed 1.0.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkDataArray * GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max)
int RequestData(vtkCompositeDataSet *input, vtkCompositeDataSet *output)
void GenerateRandomTuples(T *data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetComponentRange(double minimumValue, double maximumValue)
void GenerateAllPointDataOn()
Convenience methods for generating data: all data, all point data, or all cell data.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ data
Definition: vtkX3D.h:315
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_SHORT
Definition: vtkType.h:52
int vtkIdType
Definition: vtkType.h:287
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
#define VTK_DOUBLE
Definition: vtkType.h:59
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
#define VTK_INT
Definition: vtkType.h:54
#define VTK_FLOAT
Definition: vtkType.h:58
#define VTK_CHAR
Definition: vtkType.h:49
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
#define VTK_BIT
Definition: vtkType.h:48
#define VTK_INT_MAX
Definition: vtkType.h:153
#define VTK_LONG
Definition: vtkType.h:56
#define max(a, b)