VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkTransformToGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTransformToGrid.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef __vtkTransformToGrid_h
30 #define __vtkTransformToGrid_h
31 
32 #include "vtkFiltersHybridModule.h" // For export macro
33 #include "vtkAlgorithm.h"
34 #include "vtkImageData.h" // makes things a bit easier
35 
36 class vtkAbstractTransform;
37 
38 class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
39 {
40 public:
41  static vtkTransformToGrid *New();
42  vtkTypeMacro(vtkTransformToGrid,vtkAlgorithm);
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
47  virtual void SetInput(vtkAbstractTransform*);
48  vtkGetObjectMacro(Input,vtkAbstractTransform);
50 
52 
53  vtkSetVector6Macro(GridExtent,int);
54  vtkGetVector6Macro(GridExtent,int);
56 
58 
59  vtkSetVector3Macro(GridOrigin,double);
60  vtkGetVector3Macro(GridOrigin,double);
62 
64 
65  vtkSetVector3Macro(GridSpacing,double);
66  vtkGetVector3Macro(GridSpacing,double);
68 
70 
71  vtkSetMacro(GridScalarType,int);
72  vtkGetMacro(GridScalarType,int);
73  void SetGridScalarTypeToDouble(){this->SetGridScalarType(VTK_DOUBLE);};
74  void SetGridScalarTypeToFloat(){this->SetGridScalarType(VTK_FLOAT);};
75  void SetGridScalarTypeToShort(){this->SetGridScalarType(VTK_SHORT);};
77  {this->SetGridScalarType(VTK_UNSIGNED_SHORT);};
79  {this->SetGridScalarType(VTK_UNSIGNED_CHAR);};
81  {this->SetGridScalarType(VTK_CHAR);};
83 
85 
89  this->UpdateShiftScale(); return this->DisplacementScale; };
91  this->UpdateShiftScale(); return this->DisplacementShift; };
93 
95  vtkImageData* GetOutput();
96 
98 
99  virtual int ProcessRequest(vtkInformation*,
100  vtkInformationVector**,
101  vtkInformationVector*);
103 
104 protected:
107 
108  void RequestInformation (vtkInformation *,
109  vtkInformationVector **, vtkInformationVector *);
110 
111  void RequestData(vtkInformation *,
112  vtkInformationVector **, vtkInformationVector *);
113 
116  void UpdateShiftScale();
117 
118  unsigned long GetMTime();
119 
120  vtkAbstractTransform *Input;
121 
123  int GridExtent[6];
124  double GridOrigin[3];
125  double GridSpacing[3];
126 
129  vtkTimeStamp ShiftScaleTime;
130 
131  // see algorithm for more info
132  virtual int FillOutputPortInformation(int port, vtkInformation* info);
133 
134 private:
135  vtkTransformToGrid(const vtkTransformToGrid&); // Not implemented.
136  void operator=(const vtkTransformToGrid&); // Not implemented.
137 };
138 
139 #endif
vtkAbstractTransform * Input
vtkTimeStamp ShiftScaleTime
void SetGridScalarTypeToUnsignedShort()
void SetGridScalarTypeToUnsignedChar()
create a grid for a vtkGridTransform