00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00046 #ifndef __vtkRandomAttributeGenerator_h
00047 #define __vtkRandomAttributeGenerator_h
00048
00049 #include "vtkDataSetAlgorithm.h"
00050
00051 class VTK_GRAPHICS_EXPORT vtkRandomAttributeGenerator : public vtkDataSetAlgorithm
00052 {
00053 public:
00055 static vtkRandomAttributeGenerator *New();
00056
00057 vtkTypeRevisionMacro(vtkRandomAttributeGenerator,vtkDataSetAlgorithm);
00058 void PrintSelf(ostream& os, vtkIndent indent);
00059
00061
00063 vtkSetMacro(DataType,int);
00064 void SetDataTypeToBit() {this->SetDataType(VTK_BIT);}
00065 void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);}
00066 void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);}
00067 void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);}
00068 void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);}
00069 void SetDataTypeToInt() {this->SetDataType(VTK_INT);}
00070 void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);}
00071 void SetDataTypeToLong() {this->SetDataType(VTK_LONG);}
00072 void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);}
00073 void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);}
00074 void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);}
00075 vtkGetMacro(DataType,int);
00077
00079
00084 vtkSetClampMacro(NumberOfComponents,int,1,VTK_LARGE_INTEGER);
00085 vtkGetMacro(NumberOfComponents,int);
00087
00089
00092 vtkSetMacro(MinimumComponentValue,double);
00093 vtkGetMacro(MinimumComponentValue,double);
00095
00097
00100 vtkSetMacro(MaximumComponentValue,double);
00101 vtkGetMacro(MaximumComponentValue,double);
00103
00105
00109 vtkSetClampMacro(NumberOfTuples,vtkIdType,0,VTK_LARGE_INTEGER);
00110 vtkGetMacro(NumberOfTuples,vtkIdType);
00112
00114
00116 vtkSetMacro(GeneratePointScalars,int);
00117 vtkGetMacro(GeneratePointScalars,int);
00118 vtkBooleanMacro(GeneratePointScalars,int);
00120
00122
00124 vtkSetMacro(GeneratePointVectors,int);
00125 vtkGetMacro(GeneratePointVectors,int);
00126 vtkBooleanMacro(GeneratePointVectors,int);
00128
00130
00132 vtkSetMacro(GeneratePointNormals,int);
00133 vtkGetMacro(GeneratePointNormals,int);
00134 vtkBooleanMacro(GeneratePointNormals,int);
00136
00138
00140 vtkSetMacro(GeneratePointTensors,int);
00141 vtkGetMacro(GeneratePointTensors,int);
00142 vtkBooleanMacro(GeneratePointTensors,int);
00144
00146
00149 vtkSetMacro(GeneratePointTCoords,int);
00150 vtkGetMacro(GeneratePointTCoords,int);
00151 vtkBooleanMacro(GeneratePointTCoords,int);
00153
00155
00157 vtkSetMacro(GeneratePointArray,int);
00158 vtkGetMacro(GeneratePointArray,int);
00159 vtkBooleanMacro(GeneratePointArray,int);
00161
00163
00165 vtkSetMacro(GenerateCellScalars,int);
00166 vtkGetMacro(GenerateCellScalars,int);
00167 vtkBooleanMacro(GenerateCellScalars,int);
00169
00171
00173 vtkSetMacro(GenerateCellVectors,int);
00174 vtkGetMacro(GenerateCellVectors,int);
00175 vtkBooleanMacro(GenerateCellVectors,int);
00177
00179
00181 vtkSetMacro(GenerateCellNormals,int);
00182 vtkGetMacro(GenerateCellNormals,int);
00183 vtkBooleanMacro(GenerateCellNormals,int);
00185
00187
00189 vtkSetMacro(GenerateCellTensors,int);
00190 vtkGetMacro(GenerateCellTensors,int);
00191 vtkBooleanMacro(GenerateCellTensors,int);
00193
00195
00198 vtkSetMacro(GenerateCellTCoords,int);
00199 vtkGetMacro(GenerateCellTCoords,int);
00200 vtkBooleanMacro(GenerateCellTCoords,int);
00202
00204
00206 vtkSetMacro(GenerateCellArray,int);
00207 vtkGetMacro(GenerateCellArray,int);
00208 vtkBooleanMacro(GenerateCellArray,int);
00210
00212
00214 vtkSetMacro(GenerateFieldArray,int);
00215 vtkGetMacro(GenerateFieldArray,int);
00216 vtkBooleanMacro(GenerateFieldArray,int);
00218
00220
00225 void GenerateAllPointDataOn()
00226 {
00227 this->GeneratePointScalarsOn();
00228 this->GeneratePointVectorsOn();
00229 this->GeneratePointNormalsOn();
00230 this->GeneratePointTCoordsOn();
00231 this->GeneratePointTensorsOn();
00232 this->GeneratePointArrayOn();
00233 }
00234 void GenerateAllPointDataOff()
00235 {
00236 this->GeneratePointScalarsOff();
00237 this->GeneratePointVectorsOff();
00238 this->GeneratePointNormalsOff();
00239 this->GeneratePointTCoordsOff();
00240 this->GeneratePointTensorsOff();
00241 this->GeneratePointArrayOff();
00242 }
00243 void GenerateAllCellDataOn()
00244 {
00245 this->GenerateCellScalarsOn();
00246 this->GenerateCellVectorsOn();
00247 this->GenerateCellNormalsOn();
00248 this->GenerateCellTCoordsOn();
00249 this->GenerateCellTensorsOn();
00250 this->GenerateCellArrayOn();
00251 }
00252 void GenerateAllCellDataOff()
00253 {
00254 this->GenerateCellScalarsOff();
00255 this->GenerateCellVectorsOff();
00256 this->GenerateCellNormalsOff();
00257 this->GenerateCellTCoordsOff();
00258 this->GenerateCellTensorsOff();
00259 this->GenerateCellArrayOff();
00260 }
00261 void GenerateAllDataOn()
00262 {
00263 this->GenerateAllPointDataOn();
00264 this->GenerateAllCellDataOn();
00265 this->GenerateFieldArrayOn();
00266 }
00267 void GenerateAllDataOff()
00268 {
00269 this->GenerateAllPointDataOff();
00270 this->GenerateAllCellDataOff();
00271 this->GenerateFieldArrayOff();
00272 }
00274
00275 protected:
00276 vtkRandomAttributeGenerator();
00277 ~vtkRandomAttributeGenerator() {}
00278
00279 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00280
00281 int DataType;
00282 int NumberOfComponents;
00283 vtkIdType NumberOfTuples;
00284 double MinimumComponentValue;
00285 double MaximumComponentValue;
00286
00287 int GeneratePointScalars;
00288 int GeneratePointVectors;
00289 int GeneratePointNormals;
00290 int GeneratePointTCoords;
00291 int GeneratePointTensors;
00292 int GeneratePointArray;
00293
00294 int GenerateCellScalars;
00295 int GenerateCellVectors;
00296 int GenerateCellNormals;
00297 int GenerateCellTCoords;
00298 int GenerateCellTensors;
00299 int GenerateCellArray;
00300
00301 int GenerateFieldArray;
00302
00303
00304 vtkDataArray *GenerateData(int dataType, vtkIdType numTuples, int numComp,
00305 int minComp, int maxComp, double min, double max);
00306
00307 private:
00308 vtkRandomAttributeGenerator(const vtkRandomAttributeGenerator&);
00309 void operator=(const vtkRandomAttributeGenerator&);
00310 };
00311
00312 #endif