VTK
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 "vtkAlgorithm.h"
33 #include "vtkImageData.h" // makes things a bit easier
34 
36 
38 {
39 public:
40  static vtkTransformToGrid *New();
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
46  virtual void SetInput(vtkAbstractTransform*);
47  vtkGetObjectMacro(Input,vtkAbstractTransform);
49 
51 
52  vtkSetVector6Macro(GridExtent,int);
53  vtkGetVector6Macro(GridExtent,int);
55 
57 
58  vtkSetVector3Macro(GridOrigin,double);
59  vtkGetVector3Macro(GridOrigin,double);
61 
63 
64  vtkSetVector3Macro(GridSpacing,double);
65  vtkGetVector3Macro(GridSpacing,double);
67 
69 
70  vtkSetMacro(GridScalarType,int);
71  vtkGetMacro(GridScalarType,int);
72  void SetGridScalarTypeToFloat(){this->SetGridScalarType(VTK_DOUBLE);};
73  void SetGridScalarTypeToShort(){this->SetGridScalarType(VTK_SHORT);};
74  void SetGridScalarTypeToUnsignedShort()
75  {this->SetGridScalarType(VTK_UNSIGNED_SHORT);};
76  void SetGridScalarTypeToUnsignedChar()
77  {this->SetGridScalarType(VTK_UNSIGNED_CHAR);};
78  void SetGridScalarTypeToChar()
79  {this->SetGridScalarType(VTK_CHAR);};
81 
83 
87  this->UpdateShiftScale(); return this->DisplacementScale; };
89  this->UpdateShiftScale(); return this->DisplacementShift; };
91 
93  vtkImageData* GetOutput();
94 
96 
97  virtual int ProcessRequest(vtkInformation*,
101 
102 protected:
105 
106  void RequestInformation (vtkInformation *,
108 
109  void RequestData(vtkInformation *,
111 
114  void UpdateShiftScale();
115 
116  unsigned long GetMTime();
117 
119 
121  int GridExtent[6];
122  double GridOrigin[3];
123  double GridSpacing[3];
124 
128 
129  // see algorithm for more info
131 
132 private:
133  vtkTransformToGrid(const vtkTransformToGrid&); // Not implemented.
134  void operator=(const vtkTransformToGrid&); // Not implemented.
135 };
136 
137 #endif