VTK
dox/Filters/Hybrid/vtkTransformToGrid.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTransformToGrid.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 =========================================================================*/
00029 #ifndef __vtkTransformToGrid_h
00030 #define __vtkTransformToGrid_h
00031 
00032 #include "vtkFiltersHybridModule.h" // For export macro
00033 #include "vtkAlgorithm.h"
00034 #include "vtkImageData.h" // makes things a bit easier
00035 
00036 class vtkAbstractTransform;
00037 
00038 class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
00039 {
00040 public:
00041   static vtkTransformToGrid *New();
00042   vtkTypeMacro(vtkTransformToGrid,vtkAlgorithm);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00046 
00047   virtual void SetInput(vtkAbstractTransform*);
00048   vtkGetObjectMacro(Input,vtkAbstractTransform);
00050 
00052 
00053   vtkSetVector6Macro(GridExtent,int);
00054   vtkGetVector6Macro(GridExtent,int);
00056 
00058 
00059   vtkSetVector3Macro(GridOrigin,double);
00060   vtkGetVector3Macro(GridOrigin,double);
00062 
00064 
00065   vtkSetVector3Macro(GridSpacing,double);
00066   vtkGetVector3Macro(GridSpacing,double);
00068 
00070 
00071   vtkSetMacro(GridScalarType,int);
00072   vtkGetMacro(GridScalarType,int);
00073   void SetGridScalarTypeToDouble(){this->SetGridScalarType(VTK_DOUBLE);};
00074   void SetGridScalarTypeToFloat(){this->SetGridScalarType(VTK_FLOAT);};
00075   void SetGridScalarTypeToShort(){this->SetGridScalarType(VTK_SHORT);};
00076   void SetGridScalarTypeToUnsignedShort()
00077     {this->SetGridScalarType(VTK_UNSIGNED_SHORT);};
00078   void SetGridScalarTypeToUnsignedChar()
00079     {this->SetGridScalarType(VTK_UNSIGNED_CHAR);};
00080   void SetGridScalarTypeToChar()
00081     {this->SetGridScalarType(VTK_CHAR);};
00083 
00085 
00088   double GetDisplacementScale() {
00089     this->UpdateShiftScale(); return this->DisplacementScale; };
00090   double GetDisplacementShift() {
00091     this->UpdateShiftScale(); return this->DisplacementShift; };
00093 
00095   vtkImageData* GetOutput();
00096 
00098 
00099   virtual int ProcessRequest(vtkInformation*,
00100                              vtkInformationVector**,
00101                              vtkInformationVector*);
00103 
00104 protected:
00105   vtkTransformToGrid();
00106   ~vtkTransformToGrid();
00107 
00108   void RequestInformation (vtkInformation *,
00109                            vtkInformationVector **, vtkInformationVector *);
00110 
00111   void RequestData(vtkInformation *,
00112                    vtkInformationVector **, vtkInformationVector *);
00113 
00116   void UpdateShiftScale();
00117 
00118   unsigned long GetMTime();
00119 
00120   vtkAbstractTransform *Input;
00121 
00122   int GridScalarType;
00123   int GridExtent[6];
00124   double GridOrigin[3];
00125   double GridSpacing[3];
00126 
00127   double DisplacementScale;
00128   double DisplacementShift;
00129   vtkTimeStamp ShiftScaleTime;
00130 
00131   // see algorithm for more info
00132   virtual int FillOutputPortInformation(int port, vtkInformation* info);
00133 
00134 private:
00135   vtkTransformToGrid(const vtkTransformToGrid&);  // Not implemented.
00136   void operator=(const vtkTransformToGrid&);  // Not implemented.
00137 };
00138 
00139 #endif