00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00094 #ifndef __vtkDataObjectToDataSetFilter_h
00095 #define __vtkDataObjectToDataSetFilter_h
00096
00097 #include "vtkSource.h"
00098 #include "vtkFieldData.h"
00099
00100 class vtkDataSet;
00101 class vtkPointSet;
00102 class vtkPolyData;
00103 class vtkStructuredPoints;
00104 class vtkStructuredGrid;
00105 class vtkRectilinearGrid;
00106 class vtkUnstructuredGrid;
00107 class vtkCellArray;
00108
00109 class VTK_EXPORT vtkDataObjectToDataSetFilter : public vtkSource
00110 {
00111 public:
00112 static vtkDataObjectToDataSetFilter *New();
00113 vtkTypeMacro(vtkDataObjectToDataSetFilter,vtkSource);
00114 void PrintSelf(ostream& os, vtkIndent indent);
00115
00117 void SetInput(vtkDataObject *input);
00118 vtkDataObject *GetInput();
00119
00121 void SetDataSetType(int);
00122 vtkGetMacro(DataSetType,int);
00123 void SetDataSetTypeToPolyData() {
00124 this->SetDataSetType(VTK_POLY_DATA);};
00125 void SetDataSetTypeToStructuredPoints() {
00126 this->SetDataSetType(VTK_STRUCTURED_POINTS);};
00127 void SetDataSetTypeToStructuredGrid() {
00128 this->SetDataSetType(VTK_STRUCTURED_GRID);};
00129 void SetDataSetTypeToRectilinearGrid() {
00130 this->SetDataSetType(VTK_RECTILINEAR_GRID);};
00131 void SetDataSetTypeToUnstructuredGrid() {
00132 this->SetDataSetType(VTK_UNSTRUCTURED_GRID);};
00133
00139 vtkDataSet *GetOutput();
00140 vtkDataSet *GetOutput(int idx)
00141 {return (vtkDataSet *) this->vtkSource::GetOutput(idx); };
00142 vtkPolyData *GetPolyDataOutput();
00143 vtkStructuredPoints *GetStructuredPointsOutput();
00144 vtkStructuredGrid *GetStructuredGridOutput();
00145 vtkUnstructuredGrid *GetUnstructuredGridOutput();
00146 vtkRectilinearGrid *GetRectilinearGridOutput();
00147
00159 void SetPointComponent(int comp, char *arrayName, int arrayComp,
00160 int min, int max, int normalize);
00161 void SetPointComponent(int comp, char *arrayName, int arrayComp)
00162 {this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
00163 const char *GetPointComponentArrayName(int comp);
00164 int GetPointComponentArrayComponent(int comp);
00165 int GetPointComponentMinRange(int comp);
00166 int GetPointComponentMaxRange(int comp);
00167 int GetPointComponentNormailzeFlag(int comp);
00168
00176 void SetVertsComponent(char *arrayName, int arrayComp, int min, int max);
00177 void SetVertsComponent(char *arrayName, int arrayComp)
00178 {this->SetVertsComponent(arrayName, arrayComp, -1, -1);};
00179 const char *GetVertsComponentArrayName();
00180 int GetVertsComponentArrayComponent();
00181 int GetVertsComponentMinRange();
00182 int GetVertsComponentMaxRange();
00183 void SetLinesComponent(char *arrayName, int arrayComp, int min, int max);
00184 void SetLinesComponent(char *arrayName, int arrayComp)
00185 {this->SetLinesComponent(arrayName, arrayComp, -1, -1);};
00186 const char *GetLinesComponentArrayName();
00187 int GetLinesComponentArrayComponent();
00188 int GetLinesComponentMinRange();
00189 int GetLinesComponentMaxRange();
00190 void SetPolysComponent(char *arrayName, int arrayComp, int min, int max);
00191 void SetPolysComponent(char *arrayName, int arrayComp)
00192 {this->SetPolysComponent(arrayName, arrayComp, -1, -1);};
00193 const char *GetPolysComponentArrayName();
00194 int GetPolysComponentArrayComponent();
00195 int GetPolysComponentMinRange();
00196 int GetPolysComponentMaxRange();
00197 void SetStripsComponent(char *arrayName, int arrayComp, int min, int max);
00198 void SetStripsComponent(char *arrayName, int arrayComp)
00199 {this->SetStripsComponent(arrayName, arrayComp, -1, -1);};
00200 const char *GetStripsComponentArrayName();
00201 int GetStripsComponentArrayComponent();
00202 int GetStripsComponentMinRange();
00203 int GetStripsComponentMaxRange();
00204
00212 void SetCellTypeComponent(char *arrayName, int arrayComp,
00213 int min, int max);
00214 void SetCellTypeComponent(char *arrayName, int arrayComp)
00215 {this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);};
00216 const char *GetCellTypeComponentArrayName();
00217 int GetCellTypeComponentArrayComponent();
00218 int GetCellTypeComponentMinRange();
00219 int GetCellTypeComponentMaxRange();
00220 void SetCellConnectivityComponent(char *arrayName, int arrayComp,
00221 int min, int max);
00222 void SetCellConnectivityComponent(char *arrayName, int arrayComp)
00223 {this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);};
00224 const char *GetCellConnectivityComponentArrayName();
00225 int GetCellConnectivityComponentArrayComponent();
00226 int GetCellConnectivityComponentMinRange();
00227 int GetCellConnectivityComponentMaxRange();
00228
00231 vtkSetMacro(DefaultNormalize,int);
00232 vtkGetMacro(DefaultNormalize,int);
00233 vtkBooleanMacro(DefaultNormalize,int);
00234
00238 vtkSetVector3Macro(Dimensions,int);
00239 vtkGetVectorMacro(Dimensions,int,3);
00240
00243 vtkSetVector3Macro(Origin,float);
00244 vtkGetVectorMacro(Origin,float,3);
00245
00248 vtkSetVector3Macro(Spacing,float);
00249 vtkGetVectorMacro(Spacing,float,3);
00250
00256 void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max);
00257 void SetDimensionsComponent(char *arrayName, int arrayComp)
00258 {this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);};
00259 void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max);
00260 void SetSpacingComponent(char *arrayName, int arrayComp)
00261 {this->SetSpacingComponent(arrayName, arrayComp, -1, -1);};
00262 void SetOriginComponent(char *arrayName, int arrayComp, int min, int max);
00263 void SetOriginComponent(char *arrayName, int arrayComp)
00264 {this->SetOriginComponent(arrayName, arrayComp, -1, -1);};
00265
00266 protected:
00267 vtkDataObjectToDataSetFilter();
00268 ~vtkDataObjectToDataSetFilter();
00269 vtkDataObjectToDataSetFilter(const vtkDataObjectToDataSetFilter&) {};
00270 void operator=(const vtkDataObjectToDataSetFilter&) {};
00271
00272 void Execute();
00273 void ExecuteInformation();
00274 void ComputeInputUpdateExtents(vtkDataObject *output);
00275
00276 char Updating;
00277
00278
00279 int DataSetType;
00280
00281
00282 char *PointArrays[3];
00283 int PointArrayComponents[3];
00284 int PointComponentRange[3][2];
00285 int PointNormalize[3];
00286
00287
00288 char *VertsArray;
00289 int VertsArrayComponent;
00290 int VertsComponentRange[2];
00291
00292 char *LinesArray;
00293 int LinesArrayComponent;
00294 int LinesComponentRange[2];
00295
00296 char *PolysArray;
00297 int PolysArrayComponent;
00298 int PolysComponentRange[2];
00299
00300 char *StripsArray;
00301 int StripsArrayComponent;
00302 int StripsComponentRange[2];
00303
00304
00305 char *CellTypeArray;
00306 int CellTypeArrayComponent;
00307 int CellTypeComponentRange[2];
00308
00309 char *CellConnectivityArray;
00310 int CellConnectivityArrayComponent;
00311 int CellConnectivityComponentRange[2];
00312
00313
00314 void SetArrayName(char* &name, char *newName);
00315 int ConstructPoints(vtkPointSet *ps);
00316 int ConstructPoints(vtkRectilinearGrid *rg);
00317 int ConstructCells(vtkPolyData *pd);
00318 int ConstructCells(vtkUnstructuredGrid *ug);
00319 vtkCellArray *ConstructCellArray(vtkDataArray *da, int comp, int compRange[2]);
00320
00321
00322 int DefaultNormalize;
00323
00324
00325 int Dimensions[3];
00326 float Origin[3];
00327 float Spacing[3];
00328
00329 char *DimensionsArray;
00330 int DimensionsArrayComponent;
00331 int DimensionsComponentRange[2];
00332
00333 char *OriginArray;
00334 int OriginArrayComponent;
00335 int OriginComponentRange[2];
00336
00337 char *SpacingArray;
00338 int SpacingArrayComponent;
00339 int SpacingComponentRange[2];
00340
00341 void ConstructDimensions();
00342 void ConstructSpacing();
00343 void ConstructOrigin();
00344
00345 };
00346
00347 #endif
00348
00349