VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkRandomAttributeGenerator.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00049 #ifndef __vtkRandomAttributeGenerator_h 00050 #define __vtkRandomAttributeGenerator_h 00051 00052 #include "vtkFiltersGeneralModule.h" // For export macro 00053 #include "vtkDataSetAlgorithm.h" 00054 00055 class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkDataSetAlgorithm 00056 { 00057 public: 00059 static vtkRandomAttributeGenerator *New(); 00060 00061 vtkTypeMacro(vtkRandomAttributeGenerator,vtkDataSetAlgorithm); 00062 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 00067 vtkSetMacro(DataType,int); 00068 void SetDataTypeToBit() {this->SetDataType(VTK_BIT);} 00069 void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);} 00070 void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);} 00071 void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);} 00072 void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);} 00073 void SetDataTypeToInt() {this->SetDataType(VTK_INT);} 00074 void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);} 00075 void SetDataTypeToLong() {this->SetDataType(VTK_LONG);} 00076 void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);} 00077 void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);} 00078 void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);} 00079 vtkGetMacro(DataType,int); 00081 00083 00088 vtkSetClampMacro(NumberOfComponents,int,1,VTK_INT_MAX); 00089 vtkGetMacro(NumberOfComponents,int); 00091 00093 00096 vtkSetMacro(MinimumComponentValue,double); 00097 vtkGetMacro(MinimumComponentValue,double); 00099 00101 00104 vtkSetMacro(MaximumComponentValue,double); 00105 vtkGetMacro(MaximumComponentValue,double); 00107 00109 00113 vtkSetClampMacro(NumberOfTuples,vtkIdType,0,VTK_INT_MAX); 00114 vtkGetMacro(NumberOfTuples,vtkIdType); 00116 00118 00120 vtkSetMacro(GeneratePointScalars,int); 00121 vtkGetMacro(GeneratePointScalars,int); 00122 vtkBooleanMacro(GeneratePointScalars,int); 00124 00126 00128 vtkSetMacro(GeneratePointVectors,int); 00129 vtkGetMacro(GeneratePointVectors,int); 00130 vtkBooleanMacro(GeneratePointVectors,int); 00132 00134 00136 vtkSetMacro(GeneratePointNormals,int); 00137 vtkGetMacro(GeneratePointNormals,int); 00138 vtkBooleanMacro(GeneratePointNormals,int); 00140 00142 00144 vtkSetMacro(GeneratePointTensors,int); 00145 vtkGetMacro(GeneratePointTensors,int); 00146 vtkBooleanMacro(GeneratePointTensors,int); 00148 00150 00153 vtkSetMacro(GeneratePointTCoords,int); 00154 vtkGetMacro(GeneratePointTCoords,int); 00155 vtkBooleanMacro(GeneratePointTCoords,int); 00157 00159 00161 vtkSetMacro(GeneratePointArray,int); 00162 vtkGetMacro(GeneratePointArray,int); 00163 vtkBooleanMacro(GeneratePointArray,int); 00165 00167 00169 vtkSetMacro(GenerateCellScalars,int); 00170 vtkGetMacro(GenerateCellScalars,int); 00171 vtkBooleanMacro(GenerateCellScalars,int); 00173 00175 00177 vtkSetMacro(GenerateCellVectors,int); 00178 vtkGetMacro(GenerateCellVectors,int); 00179 vtkBooleanMacro(GenerateCellVectors,int); 00181 00183 00185 vtkSetMacro(GenerateCellNormals,int); 00186 vtkGetMacro(GenerateCellNormals,int); 00187 vtkBooleanMacro(GenerateCellNormals,int); 00189 00191 00193 vtkSetMacro(GenerateCellTensors,int); 00194 vtkGetMacro(GenerateCellTensors,int); 00195 vtkBooleanMacro(GenerateCellTensors,int); 00197 00199 00202 vtkSetMacro(GenerateCellTCoords,int); 00203 vtkGetMacro(GenerateCellTCoords,int); 00204 vtkBooleanMacro(GenerateCellTCoords,int); 00206 00208 00210 vtkSetMacro(GenerateCellArray,int); 00211 vtkGetMacro(GenerateCellArray,int); 00212 vtkBooleanMacro(GenerateCellArray,int); 00214 00216 00218 vtkSetMacro(GenerateFieldArray,int); 00219 vtkGetMacro(GenerateFieldArray,int); 00220 vtkBooleanMacro(GenerateFieldArray,int); 00222 00224 00229 void GenerateAllPointDataOn() 00230 { 00231 this->GeneratePointScalarsOn(); 00232 this->GeneratePointVectorsOn(); 00233 this->GeneratePointNormalsOn(); 00234 this->GeneratePointTCoordsOn(); 00235 this->GeneratePointTensorsOn(); 00236 this->GeneratePointArrayOn(); 00237 } 00238 void GenerateAllPointDataOff() 00239 { 00240 this->GeneratePointScalarsOff(); 00241 this->GeneratePointVectorsOff(); 00242 this->GeneratePointNormalsOff(); 00243 this->GeneratePointTCoordsOff(); 00244 this->GeneratePointTensorsOff(); 00245 this->GeneratePointArrayOff(); 00246 } 00247 void GenerateAllCellDataOn() 00248 { 00249 this->GenerateCellScalarsOn(); 00250 this->GenerateCellVectorsOn(); 00251 this->GenerateCellNormalsOn(); 00252 this->GenerateCellTCoordsOn(); 00253 this->GenerateCellTensorsOn(); 00254 this->GenerateCellArrayOn(); 00255 } 00256 void GenerateAllCellDataOff() 00257 { 00258 this->GenerateCellScalarsOff(); 00259 this->GenerateCellVectorsOff(); 00260 this->GenerateCellNormalsOff(); 00261 this->GenerateCellTCoordsOff(); 00262 this->GenerateCellTensorsOff(); 00263 this->GenerateCellArrayOff(); 00264 } 00265 void GenerateAllDataOn() 00266 { 00267 this->GenerateAllPointDataOn(); 00268 this->GenerateAllCellDataOn(); 00269 this->GenerateFieldArrayOn(); 00270 } 00271 void GenerateAllDataOff() 00272 { 00273 this->GenerateAllPointDataOff(); 00274 this->GenerateAllCellDataOff(); 00275 this->GenerateFieldArrayOff(); 00276 } 00278 00279 protected: 00280 vtkRandomAttributeGenerator(); 00281 ~vtkRandomAttributeGenerator() {} 00282 00283 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00284 00285 int DataType; 00286 int NumberOfComponents; 00287 vtkIdType NumberOfTuples; 00288 double MinimumComponentValue; 00289 double MaximumComponentValue; 00290 00291 int GeneratePointScalars; 00292 int GeneratePointVectors; 00293 int GeneratePointNormals; 00294 int GeneratePointTCoords; 00295 int GeneratePointTensors; 00296 int GeneratePointArray; 00297 00298 int GenerateCellScalars; 00299 int GenerateCellVectors; 00300 int GenerateCellNormals; 00301 int GenerateCellTCoords; 00302 int GenerateCellTensors; 00303 int GenerateCellArray; 00304 00305 int GenerateFieldArray; 00306 00307 // Helper functions 00308 vtkDataArray *GenerateData(int dataType, vtkIdType numTuples, int numComp, 00309 int minComp, int maxComp, double min, double max); 00310 00311 private: 00312 vtkRandomAttributeGenerator(const vtkRandomAttributeGenerator&); // Not implemented. 00313 void operator=(const vtkRandomAttributeGenerator&); // Not implemented. 00314 }; 00315 00316 #endif