VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
49 #ifndef __vtkRandomAttributeGenerator_h
50 #define __vtkRandomAttributeGenerator_h
51 
52 #include "vtkFiltersGeneralModule.h" // For export macro
53 #include "vtkDataSetAlgorithm.h"
54 
55 class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkDataSetAlgorithm
56 {
57 public:
59  static vtkRandomAttributeGenerator *New();
60 
61  vtkTypeMacro(vtkRandomAttributeGenerator,vtkDataSetAlgorithm);
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
65 
67  vtkSetMacro(DataType,int);
68  void SetDataTypeToBit() {this->SetDataType(VTK_BIT);}
69  void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);}
70  void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);}
71  void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);}
72  void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);}
73  void SetDataTypeToInt() {this->SetDataType(VTK_INT);}
74  void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);}
75  void SetDataTypeToLong() {this->SetDataType(VTK_LONG);}
76  void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);}
77  void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);}
78  void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);}
79  vtkGetMacro(DataType,int);
81 
83 
88  vtkSetClampMacro(NumberOfComponents,int,1,VTK_INT_MAX);
89  vtkGetMacro(NumberOfComponents,int);
91 
93 
96  vtkSetMacro(MinimumComponentValue,double);
97  vtkGetMacro(MinimumComponentValue,double);
99 
101 
104  vtkSetMacro(MaximumComponentValue,double);
105  vtkGetMacro(MaximumComponentValue,double);
107 
109 
113  vtkSetClampMacro(NumberOfTuples,vtkIdType,0,VTK_INT_MAX);
114  vtkGetMacro(NumberOfTuples,vtkIdType);
116 
118 
120  vtkSetMacro(GeneratePointScalars,int);
121  vtkGetMacro(GeneratePointScalars,int);
122  vtkBooleanMacro(GeneratePointScalars,int);
124 
126 
128  vtkSetMacro(GeneratePointVectors,int);
129  vtkGetMacro(GeneratePointVectors,int);
130  vtkBooleanMacro(GeneratePointVectors,int);
132 
134 
136  vtkSetMacro(GeneratePointNormals,int);
137  vtkGetMacro(GeneratePointNormals,int);
138  vtkBooleanMacro(GeneratePointNormals,int);
140 
142 
144  vtkSetMacro(GeneratePointTensors,int);
145  vtkGetMacro(GeneratePointTensors,int);
146  vtkBooleanMacro(GeneratePointTensors,int);
148 
150 
153  vtkSetMacro(GeneratePointTCoords,int);
154  vtkGetMacro(GeneratePointTCoords,int);
155  vtkBooleanMacro(GeneratePointTCoords,int);
157 
159 
161  vtkSetMacro(GeneratePointArray,int);
162  vtkGetMacro(GeneratePointArray,int);
163  vtkBooleanMacro(GeneratePointArray,int);
165 
167 
169  vtkSetMacro(GenerateCellScalars,int);
170  vtkGetMacro(GenerateCellScalars,int);
171  vtkBooleanMacro(GenerateCellScalars,int);
173 
175 
177  vtkSetMacro(GenerateCellVectors,int);
178  vtkGetMacro(GenerateCellVectors,int);
179  vtkBooleanMacro(GenerateCellVectors,int);
181 
183 
185  vtkSetMacro(GenerateCellNormals,int);
186  vtkGetMacro(GenerateCellNormals,int);
187  vtkBooleanMacro(GenerateCellNormals,int);
189 
191 
193  vtkSetMacro(GenerateCellTensors,int);
194  vtkGetMacro(GenerateCellTensors,int);
195  vtkBooleanMacro(GenerateCellTensors,int);
197 
199 
202  vtkSetMacro(GenerateCellTCoords,int);
203  vtkGetMacro(GenerateCellTCoords,int);
204  vtkBooleanMacro(GenerateCellTCoords,int);
206 
208 
210  vtkSetMacro(GenerateCellArray,int);
211  vtkGetMacro(GenerateCellArray,int);
212  vtkBooleanMacro(GenerateCellArray,int);
214 
216 
218  vtkSetMacro(GenerateFieldArray,int);
219  vtkGetMacro(GenerateFieldArray,int);
220  vtkBooleanMacro(GenerateFieldArray,int);
222 
224 
230  {
231  this->GeneratePointScalarsOn();
232  this->GeneratePointVectorsOn();
233  this->GeneratePointNormalsOn();
234  this->GeneratePointTCoordsOn();
235  this->GeneratePointTensorsOn();
236  this->GeneratePointArrayOn();
237  }
239  {
240  this->GeneratePointScalarsOff();
241  this->GeneratePointVectorsOff();
242  this->GeneratePointNormalsOff();
243  this->GeneratePointTCoordsOff();
244  this->GeneratePointTensorsOff();
245  this->GeneratePointArrayOff();
246  }
248  {
249  this->GenerateCellScalarsOn();
250  this->GenerateCellVectorsOn();
251  this->GenerateCellNormalsOn();
252  this->GenerateCellTCoordsOn();
253  this->GenerateCellTensorsOn();
254  this->GenerateCellArrayOn();
255  }
257  {
258  this->GenerateCellScalarsOff();
259  this->GenerateCellVectorsOff();
260  this->GenerateCellNormalsOff();
261  this->GenerateCellTCoordsOff();
262  this->GenerateCellTensorsOff();
263  this->GenerateCellArrayOff();
264  }
266  {
267  this->GenerateAllPointDataOn();
268  this->GenerateAllCellDataOn();
269  this->GenerateFieldArrayOn();
270  }
272  {
273  this->GenerateAllPointDataOff();
274  this->GenerateAllCellDataOff();
275  this->GenerateFieldArrayOff();
276  }
278 
279 protected:
282 
283  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
284 
285  int DataType;
287  vtkIdType NumberOfTuples;
290 
297 
304 
306 
307  // Helper functions
308  vtkDataArray *GenerateData(int dataType, vtkIdType numTuples, int numComp,
309  int minComp, int maxComp, double min, double max);
310 
311 private:
312  vtkRandomAttributeGenerator(const vtkRandomAttributeGenerator&); // Not implemented.
313  void operator=(const vtkRandomAttributeGenerator&); // Not implemented.
314 };
315 
316 #endif
generate and create random data attributes