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 =========================================================================*/
49 #ifndef __vtkRandomAttributeGenerator_h
50 #define __vtkRandomAttributeGenerator_h
51 
52 #include "vtkDataSetAlgorithm.h"
53 
55 {
56 public:
59 
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
66  vtkSetMacro(DataType,int);
67  void SetDataTypeToBit() {this->SetDataType(VTK_BIT);}
68  void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);}
69  void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);}
70  void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);}
71  void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);}
72  void SetDataTypeToInt() {this->SetDataType(VTK_INT);}
73  void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);}
74  void SetDataTypeToLong() {this->SetDataType(VTK_LONG);}
75  void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);}
76  void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);}
77  void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);}
78  vtkGetMacro(DataType,int);
80 
82 
87  vtkSetClampMacro(NumberOfComponents,int,1,VTK_LARGE_INTEGER);
88  vtkGetMacro(NumberOfComponents,int);
90 
92 
95  vtkSetMacro(MinimumComponentValue,double);
96  vtkGetMacro(MinimumComponentValue,double);
98 
100 
103  vtkSetMacro(MaximumComponentValue,double);
104  vtkGetMacro(MaximumComponentValue,double);
106 
108 
112  vtkSetClampMacro(NumberOfTuples,vtkIdType,0,VTK_LARGE_INTEGER);
113  vtkGetMacro(NumberOfTuples,vtkIdType);
115 
117 
119  vtkSetMacro(GeneratePointScalars,int);
120  vtkGetMacro(GeneratePointScalars,int);
121  vtkBooleanMacro(GeneratePointScalars,int);
123 
125 
127  vtkSetMacro(GeneratePointVectors,int);
128  vtkGetMacro(GeneratePointVectors,int);
129  vtkBooleanMacro(GeneratePointVectors,int);
131 
133 
135  vtkSetMacro(GeneratePointNormals,int);
136  vtkGetMacro(GeneratePointNormals,int);
137  vtkBooleanMacro(GeneratePointNormals,int);
139 
141 
143  vtkSetMacro(GeneratePointTensors,int);
144  vtkGetMacro(GeneratePointTensors,int);
145  vtkBooleanMacro(GeneratePointTensors,int);
147 
149 
152  vtkSetMacro(GeneratePointTCoords,int);
153  vtkGetMacro(GeneratePointTCoords,int);
154  vtkBooleanMacro(GeneratePointTCoords,int);
156 
158 
160  vtkSetMacro(GeneratePointArray,int);
161  vtkGetMacro(GeneratePointArray,int);
162  vtkBooleanMacro(GeneratePointArray,int);
164 
166 
168  vtkSetMacro(GenerateCellScalars,int);
169  vtkGetMacro(GenerateCellScalars,int);
170  vtkBooleanMacro(GenerateCellScalars,int);
172 
174 
176  vtkSetMacro(GenerateCellVectors,int);
177  vtkGetMacro(GenerateCellVectors,int);
178  vtkBooleanMacro(GenerateCellVectors,int);
180 
182 
184  vtkSetMacro(GenerateCellNormals,int);
185  vtkGetMacro(GenerateCellNormals,int);
186  vtkBooleanMacro(GenerateCellNormals,int);
188 
190 
192  vtkSetMacro(GenerateCellTensors,int);
193  vtkGetMacro(GenerateCellTensors,int);
194  vtkBooleanMacro(GenerateCellTensors,int);
196 
198 
201  vtkSetMacro(GenerateCellTCoords,int);
202  vtkGetMacro(GenerateCellTCoords,int);
203  vtkBooleanMacro(GenerateCellTCoords,int);
205 
207 
209  vtkSetMacro(GenerateCellArray,int);
210  vtkGetMacro(GenerateCellArray,int);
211  vtkBooleanMacro(GenerateCellArray,int);
213 
215 
217  vtkSetMacro(GenerateFieldArray,int);
218  vtkGetMacro(GenerateFieldArray,int);
219  vtkBooleanMacro(GenerateFieldArray,int);
221 
223 
229  {
230  this->GeneratePointScalarsOn();
231  this->GeneratePointVectorsOn();
232  this->GeneratePointNormalsOn();
233  this->GeneratePointTCoordsOn();
234  this->GeneratePointTensorsOn();
235  this->GeneratePointArrayOn();
236  }
238  {
239  this->GeneratePointScalarsOff();
240  this->GeneratePointVectorsOff();
241  this->GeneratePointNormalsOff();
242  this->GeneratePointTCoordsOff();
243  this->GeneratePointTensorsOff();
244  this->GeneratePointArrayOff();
245  }
247  {
248  this->GenerateCellScalarsOn();
249  this->GenerateCellVectorsOn();
250  this->GenerateCellNormalsOn();
251  this->GenerateCellTCoordsOn();
252  this->GenerateCellTensorsOn();
253  this->GenerateCellArrayOn();
254  }
256  {
257  this->GenerateCellScalarsOff();
258  this->GenerateCellVectorsOff();
259  this->GenerateCellNormalsOff();
260  this->GenerateCellTCoordsOff();
261  this->GenerateCellTensorsOff();
262  this->GenerateCellArrayOff();
263  }
265  {
266  this->GenerateAllPointDataOn();
267  this->GenerateAllCellDataOn();
268  this->GenerateFieldArrayOn();
269  }
271  {
272  this->GenerateAllPointDataOff();
273  this->GenerateAllCellDataOff();
274  this->GenerateFieldArrayOff();
275  }
277 
278 protected:
281 
283 
284  int DataType;
289 
296 
303 
305 
306  // Helper functions
307  vtkDataArray *GenerateData(int dataType, vtkIdType numTuples, int numComp,
308  int minComp, int maxComp, double min, double max);
309 
310 private:
311  vtkRandomAttributeGenerator(const vtkRandomAttributeGenerator&); // Not implemented.
312  void operator=(const vtkRandomAttributeGenerator&); // Not implemented.
313 };
314 
315 #endif