VTK
|
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 "vtkAlgorithm.h" 00033 #include "vtkImageData.h" // makes things a bit easier 00034 00035 class vtkAbstractTransform; 00036 00037 class VTK_HYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm 00038 { 00039 public: 00040 static vtkTransformToGrid *New(); 00041 vtkTypeMacro(vtkTransformToGrid,vtkAlgorithm); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00045 00046 virtual void SetInput(vtkAbstractTransform*); 00047 vtkGetObjectMacro(Input,vtkAbstractTransform); 00049 00051 00052 vtkSetVector6Macro(GridExtent,int); 00053 vtkGetVector6Macro(GridExtent,int); 00055 00057 00058 vtkSetVector3Macro(GridOrigin,double); 00059 vtkGetVector3Macro(GridOrigin,double); 00061 00063 00064 vtkSetVector3Macro(GridSpacing,double); 00065 vtkGetVector3Macro(GridSpacing,double); 00067 00069 00070 vtkSetMacro(GridScalarType,int); 00071 vtkGetMacro(GridScalarType,int); 00072 void SetGridScalarTypeToFloat(){this->SetGridScalarType(VTK_DOUBLE);}; 00073 void SetGridScalarTypeToShort(){this->SetGridScalarType(VTK_SHORT);}; 00074 void SetGridScalarTypeToUnsignedShort() 00075 {this->SetGridScalarType(VTK_UNSIGNED_SHORT);}; 00076 void SetGridScalarTypeToUnsignedChar() 00077 {this->SetGridScalarType(VTK_UNSIGNED_CHAR);}; 00078 void SetGridScalarTypeToChar() 00079 {this->SetGridScalarType(VTK_CHAR);}; 00081 00083 00086 double GetDisplacementScale() { 00087 this->UpdateShiftScale(); return this->DisplacementScale; }; 00088 double GetDisplacementShift() { 00089 this->UpdateShiftScale(); return this->DisplacementShift; }; 00091 00093 vtkImageData* GetOutput(); 00094 00096 00097 virtual int ProcessRequest(vtkInformation*, 00098 vtkInformationVector**, 00099 vtkInformationVector*); 00101 00102 protected: 00103 vtkTransformToGrid(); 00104 ~vtkTransformToGrid(); 00105 00106 void RequestInformation (vtkInformation *, 00107 vtkInformationVector **, vtkInformationVector *); 00108 00109 void RequestData(vtkInformation *, 00110 vtkInformationVector **, vtkInformationVector *); 00111 00114 void UpdateShiftScale(); 00115 00116 unsigned long GetMTime(); 00117 00118 vtkAbstractTransform *Input; 00119 00120 int GridScalarType; 00121 int GridExtent[6]; 00122 double GridOrigin[3]; 00123 double GridSpacing[3]; 00124 00125 double DisplacementScale; 00126 double DisplacementShift; 00127 vtkTimeStamp ShiftScaleTime; 00128 00129 // see algorithm for more info 00130 virtual int FillOutputPortInformation(int port, vtkInformation* info); 00131 00132 private: 00133 vtkTransformToGrid(const vtkTransformToGrid&); // Not implemented. 00134 void operator=(const vtkTransformToGrid&); // Not implemented. 00135 }; 00136 00137 #endif