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 =========================================================================*/
27 #ifndef vtkTransformToGrid_h
28 #define vtkTransformToGrid_h
29 
30 #include "vtkFiltersHybridModule.h" // For export macro
31 #include "vtkAlgorithm.h"
32 #include "vtkImageData.h" // makes things a bit easier
33 
35 
36 class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
37 {
38 public:
39  static vtkTransformToGrid *New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  virtual void SetInput(vtkAbstractTransform*);
48  vtkGetObjectMacro(Input,vtkAbstractTransform);
50 
52 
55  vtkSetVector6Macro(GridExtent,int);
56  vtkGetVector6Macro(GridExtent,int);
58 
60 
63  vtkSetVector3Macro(GridOrigin,double);
64  vtkGetVector3Macro(GridOrigin,double);
66 
68 
71  vtkSetVector3Macro(GridSpacing,double);
72  vtkGetVector3Macro(GridSpacing,double);
74 
76 
79  vtkSetMacro(GridScalarType,int);
80  vtkGetMacro(GridScalarType,int);
81  void SetGridScalarTypeToDouble(){this->SetGridScalarType(VTK_DOUBLE);};
82  void SetGridScalarTypeToFloat(){this->SetGridScalarType(VTK_FLOAT);};
83  void SetGridScalarTypeToShort(){this->SetGridScalarType(VTK_SHORT);};
85  {this->SetGridScalarType(VTK_UNSIGNED_SHORT);};
87  {this->SetGridScalarType(VTK_UNSIGNED_CHAR);};
89  {this->SetGridScalarType(VTK_CHAR);};
91 
93 
99  this->UpdateShiftScale(); return this->DisplacementScale; };
101  this->UpdateShiftScale(); return this->DisplacementShift; };
103 
107  vtkImageData* GetOutput();
108 
114  vtkInformationVector*) override;
115 
116 protected:
118  ~vtkTransformToGrid() override;
119 
120  void RequestInformation (vtkInformation *,
122 
123  void RequestData(vtkInformation *,
125 
130  void UpdateShiftScale();
131 
132  vtkMTimeType GetMTime() override;
133 
135 
137  int GridExtent[6];
138  double GridOrigin[3];
139  double GridSpacing[3];
140 
144 
145  // see algorithm for more info
147 
148 private:
149  vtkTransformToGrid(const vtkTransformToGrid&) = delete;
150  void operator=(const vtkTransformToGrid&) = delete;
151 };
152 
153 #endif
vtkImageData.h
vtkTransformToGrid
create a grid for a vtkGridTransform
Definition: vtkTransformToGrid.h:36
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:50
vtkTransformToGrid::SetGridScalarTypeToUnsignedChar
void SetGridScalarTypeToUnsignedChar()
Definition: vtkTransformToGrid.h:86
vtkTransformToGrid::GridScalarType
int GridScalarType
Definition: vtkTransformToGrid.h:136
vtkTransformToGrid::GetDisplacementScale
double GetDisplacementScale()
Get the scale and shift to convert integer grid elements into real values: dx = scale*di + shift.
Definition: vtkTransformToGrid.h:98
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkTransformToGrid::Input
vtkAbstractTransform * Input
Definition: vtkTransformToGrid.h:134
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkTransformToGrid::SetGridScalarTypeToShort
void SetGridScalarTypeToShort()
Definition: vtkTransformToGrid.h:83
vtkTransformToGrid::SetGridScalarTypeToUnsignedShort
void SetGridScalarTypeToUnsignedShort()
Definition: vtkTransformToGrid.h:84
vtkTransformToGrid::SetGridScalarTypeToFloat
void SetGridScalarTypeToFloat()
Definition: vtkTransformToGrid.h:82
vtkTransformToGrid::DisplacementShift
double DisplacementShift
Definition: vtkTransformToGrid.h:142
vtkAlgorithm.h
vtkX3D::port
Definition: vtkX3D.h:447
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:49
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
vtkTransformToGrid::SetGridScalarTypeToChar
void SetGridScalarTypeToChar()
Definition: vtkTransformToGrid.h:88
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkTransformToGrid::SetGridScalarTypeToDouble
void SetGridScalarTypeToDouble()
Definition: vtkTransformToGrid.h:81
vtkX3D::info
Definition: vtkX3D.h:376
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkAlgorithm::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkTransformToGrid::GetDisplacementShift
double GetDisplacementShift()
Definition: vtkTransformToGrid.h:100
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:52
vtkAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTransformToGrid::DisplacementScale
double DisplacementScale
Definition: vtkTransformToGrid.h:141
vtkTransformToGrid::ShiftScaleTime
vtkTimeStamp ShiftScaleTime
Definition: vtkTransformToGrid.h:143
vtkAlgorithm::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302