00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00070 #ifndef __vtkDataObjectToDataSetFilter_h
00071 #define __vtkDataObjectToDataSetFilter_h
00072
00073 #include "vtkDataSetAlgorithm.h"
00074
00075 class vtkCellArray;
00076 class vtkDataArray;
00077 class vtkDataSet;
00078 class vtkPointSet;
00079 class vtkPolyData;
00080 class vtkRectilinearGrid;
00081 class vtkStructuredGrid;
00082 class vtkStructuredPoints;
00083 class vtkUnstructuredGrid;
00084
00085 class VTK_GRAPHICS_EXPORT vtkDataObjectToDataSetFilter : public vtkDataSetAlgorithm
00086 {
00087 public:
00088 static vtkDataObjectToDataSetFilter *New();
00089 vtkTypeRevisionMacro(vtkDataObjectToDataSetFilter,vtkDataSetAlgorithm);
00090 void PrintSelf(ostream& os, vtkIndent indent);
00091
00093 vtkDataObject *GetInput();
00094
00096
00097 void SetDataSetType(int);
00098 vtkGetMacro(DataSetType,int);
00099 void SetDataSetTypeToPolyData() {
00100 this->SetDataSetType(VTK_POLY_DATA);};
00101 void SetDataSetTypeToStructuredPoints() {
00102 this->SetDataSetType(VTK_STRUCTURED_POINTS);};
00103 void SetDataSetTypeToStructuredGrid() {
00104 this->SetDataSetType(VTK_STRUCTURED_GRID);};
00105 void SetDataSetTypeToRectilinearGrid() {
00106 this->SetDataSetType(VTK_RECTILINEAR_GRID);};
00107 void SetDataSetTypeToUnstructuredGrid() {
00108 this->SetDataSetType(VTK_UNSTRUCTURED_GRID);};
00110
00112
00117 vtkDataSet *GetOutput();
00118 vtkDataSet *GetOutput(int idx);
00119 vtkPolyData *GetPolyDataOutput();
00120 vtkStructuredPoints *GetStructuredPointsOutput();
00121 vtkStructuredGrid *GetStructuredGridOutput();
00122 vtkUnstructuredGrid *GetUnstructuredGridOutput();
00123 vtkRectilinearGrid *GetRectilinearGridOutput();
00125
00127
00138 void SetPointComponent(int comp, char *arrayName, int arrayComp,
00139 int min, int max, int normalize);
00140 void SetPointComponent(int comp, char *arrayName, int arrayComp)
00141 {this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
00142 const char *GetPointComponentArrayName(int comp);
00143 int GetPointComponentArrayComponent(int comp);
00144 int GetPointComponentMinRange(int comp);
00145 int GetPointComponentMaxRange(int comp);
00146 int GetPointComponentNormailzeFlag(int comp);
00148
00150
00157 void SetVertsComponent(char *arrayName, int arrayComp, int min, int max);
00158 void SetVertsComponent(char *arrayName, int arrayComp)
00159 {this->SetVertsComponent(arrayName, arrayComp, -1, -1);};
00160 const char *GetVertsComponentArrayName();
00161 int GetVertsComponentArrayComponent();
00162 int GetVertsComponentMinRange();
00163 int GetVertsComponentMaxRange();
00164 void SetLinesComponent(char *arrayName, int arrayComp, int min, int max);
00165 void SetLinesComponent(char *arrayName, int arrayComp)
00166 {this->SetLinesComponent(arrayName, arrayComp, -1, -1);};
00167 const char *GetLinesComponentArrayName();
00168 int GetLinesComponentArrayComponent();
00169 int GetLinesComponentMinRange();
00170 int GetLinesComponentMaxRange();
00171 void SetPolysComponent(char *arrayName, int arrayComp, int min, int max);
00172 void SetPolysComponent(char *arrayName, int arrayComp)
00173 {this->SetPolysComponent(arrayName, arrayComp, -1, -1);};
00174 const char *GetPolysComponentArrayName();
00175 int GetPolysComponentArrayComponent();
00176 int GetPolysComponentMinRange();
00177 int GetPolysComponentMaxRange();
00178 void SetStripsComponent(char *arrayName, int arrayComp, int min, int max);
00179 void SetStripsComponent(char *arrayName, int arrayComp)
00180 {this->SetStripsComponent(arrayName, arrayComp, -1, -1);};
00181 const char *GetStripsComponentArrayName();
00182 int GetStripsComponentArrayComponent();
00183 int GetStripsComponentMinRange();
00184 int GetStripsComponentMaxRange();
00186
00188
00195 void SetCellTypeComponent(char *arrayName, int arrayComp,
00196 int min, int max);
00197 void SetCellTypeComponent(char *arrayName, int arrayComp)
00198 {this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);};
00199 const char *GetCellTypeComponentArrayName();
00200 int GetCellTypeComponentArrayComponent();
00201 int GetCellTypeComponentMinRange();
00202 int GetCellTypeComponentMaxRange();
00203 void SetCellConnectivityComponent(char *arrayName, int arrayComp,
00204 int min, int max);
00205 void SetCellConnectivityComponent(char *arrayName, int arrayComp)
00206 {this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);};
00207 const char *GetCellConnectivityComponentArrayName();
00208 int GetCellConnectivityComponentArrayComponent();
00209 int GetCellConnectivityComponentMinRange();
00210 int GetCellConnectivityComponentMaxRange();
00212
00214
00216 vtkSetMacro(DefaultNormalize,int);
00217 vtkGetMacro(DefaultNormalize,int);
00218 vtkBooleanMacro(DefaultNormalize,int);
00220
00222
00225 vtkSetVector3Macro(Dimensions,int);
00226 vtkGetVectorMacro(Dimensions,int,3);
00228
00230
00232 vtkSetVector3Macro(Origin,double);
00233 vtkGetVectorMacro(Origin,double,3);
00235
00237
00239 vtkSetVector3Macro(Spacing,double);
00240 vtkGetVectorMacro(Spacing,double,3);
00242
00244
00249 void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max);
00250 void SetDimensionsComponent(char *arrayName, int arrayComp)
00251 {this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);};
00252 void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max);
00253 void SetSpacingComponent(char *arrayName, int arrayComp)
00254 {this->SetSpacingComponent(arrayName, arrayComp, -1, -1);};
00255 void SetOriginComponent(char *arrayName, int arrayComp, int min, int max);
00256 void SetOriginComponent(char *arrayName, int arrayComp)
00257 {this->SetOriginComponent(arrayName, arrayComp, -1, -1);};
00259
00260 protected:
00261 vtkDataObjectToDataSetFilter();
00262 ~vtkDataObjectToDataSetFilter();
00263
00264 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00265 virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00266 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00267 virtual int FillInputPortInformation(int port, vtkInformation *info);
00268 virtual int RequestDataObject(vtkInformation *, vtkInformationVector **,
00269 vtkInformationVector *);
00270
00271 char Updating;
00272
00273
00274 int DataSetType;
00275
00276
00277 char *PointArrays[3];
00278 int PointArrayComponents[3];
00279 vtkIdType PointComponentRange[3][2];
00280 int PointNormalize[3];
00281
00282
00283 char *VertsArray;
00284 int VertsArrayComponent;
00285 vtkIdType VertsComponentRange[2];
00286
00287 char *LinesArray;
00288 int LinesArrayComponent;
00289 vtkIdType LinesComponentRange[2];
00290
00291 char *PolysArray;
00292 int PolysArrayComponent;
00293 vtkIdType PolysComponentRange[2];
00294
00295 char *StripsArray;
00296 int StripsArrayComponent;
00297 vtkIdType StripsComponentRange[2];
00298
00299
00300 char *CellTypeArray;
00301 int CellTypeArrayComponent;
00302 vtkIdType CellTypeComponentRange[2];
00303
00304 char *CellConnectivityArray;
00305 int CellConnectivityArrayComponent;
00306 vtkIdType CellConnectivityComponentRange[2];
00307
00308
00309 void SetArrayName(char* &name, char *newName);
00310 vtkIdType ConstructPoints(vtkDataObject *input, vtkPointSet *ps);
00311 vtkIdType ConstructPoints(vtkDataObject *input, vtkRectilinearGrid *rg);
00312 int ConstructCells(vtkDataObject *input, vtkPolyData *pd);
00313 int ConstructCells(vtkDataObject *input, vtkUnstructuredGrid *ug);
00314 vtkCellArray *ConstructCellArray(vtkDataArray *da, int comp,
00315 vtkIdType compRange[2]);
00316
00317
00318 int DefaultNormalize;
00319
00320
00321 int Dimensions[3];
00322 double Origin[3];
00323 double Spacing[3];
00324
00325 char *DimensionsArray;
00326 int DimensionsArrayComponent;
00327 vtkIdType DimensionsComponentRange[2];
00328
00329 char *OriginArray;
00330 int OriginArrayComponent;
00331 vtkIdType OriginComponentRange[2];
00332
00333 char *SpacingArray;
00334 int SpacingArrayComponent;
00335 vtkIdType SpacingComponentRange[2];
00336
00337 void ConstructDimensions(vtkDataObject *input);
00338 void ConstructSpacing(vtkDataObject *input);
00339 void ConstructOrigin(vtkDataObject *input);
00340
00341 private:
00342 vtkDataObjectToDataSetFilter(const vtkDataObjectToDataSetFilter&);
00343 void operator=(const vtkDataObjectToDataSetFilter&);
00344 };
00345
00346 #endif