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 =========================================================================*/
30 #ifndef vtkTransformToGrid_h
31 #define vtkTransformToGrid_h
32 
33 #include "vtkFiltersHybridModule.h" // For export macro
34 #include "vtkAlgorithm.h"
35 #include "vtkImageData.h" // makes things a bit easier
36 
38 
39 class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
51  vtkGetObjectMacro(Input,vtkAbstractTransform);
53 
55 
58  vtkSetVector6Macro(GridExtent,int);
59  vtkGetVector6Macro(GridExtent,int);
61 
63 
66  vtkSetVector3Macro(GridOrigin,double);
67  vtkGetVector3Macro(GridOrigin,double);
69 
71 
74  vtkSetVector3Macro(GridSpacing,double);
75  vtkGetVector3Macro(GridSpacing,double);
77 
79 
82  vtkSetMacro(GridScalarType,int);
83  vtkGetMacro(GridScalarType,int);
84  void SetGridScalarTypeToDouble(){this->SetGridScalarType(VTK_DOUBLE);};
85  void SetGridScalarTypeToFloat(){this->SetGridScalarType(VTK_FLOAT);};
86  void SetGridScalarTypeToShort(){this->SetGridScalarType(VTK_SHORT);};
88  {this->SetGridScalarType(VTK_UNSIGNED_SHORT);};
90  {this->SetGridScalarType(VTK_UNSIGNED_CHAR);};
92  {this->SetGridScalarType(VTK_CHAR);};
94 
96 
102  this->UpdateShiftScale(); return this->DisplacementScale; };
104  this->UpdateShiftScale(); return this->DisplacementShift; };
106 
111 
117  vtkInformationVector*) override;
118 
119 protected:
122 
125 
128 
134 
135  vtkMTimeType GetMTime() override;
136 
138 
140  int GridExtent[6];
141  double GridOrigin[3];
142  double GridSpacing[3];
143 
147 
148  // see algorithm for more info
150 
151 private:
152  vtkTransformToGrid(const vtkTransformToGrid&) = delete;
153  void operator=(const vtkTransformToGrid&) = delete;
154 };
155 
156 #endif
vtkTransformToGrid::RequestInformation
void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData.h
vtkTransformToGrid
create a grid for a vtkGridTransform
Definition: vtkTransformToGrid.h:40
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:51
vtkTransformToGrid::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTransformToGrid::SetGridScalarTypeToUnsignedChar
void SetGridScalarTypeToUnsignedChar()
Definition: vtkTransformToGrid.h:89
vtkTransformToGrid::GridScalarType
int GridScalarType
Definition: vtkTransformToGrid.h:139
vtkTransformToGrid::GetDisplacementScale
double GetDisplacementScale()
Get the scale and shift to convert integer grid elements into real values: dx = scale*di + shift.
Definition: vtkTransformToGrid.h:101
vtkTransformToGrid::GetOutput
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTransformToGrid::ProcessRequest
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
vtkTransformToGrid::Input
vtkAbstractTransform * Input
Definition: vtkTransformToGrid.h:137
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkTransformToGrid::~vtkTransformToGrid
~vtkTransformToGrid() override
vtkTransformToGrid::New
static vtkTransformToGrid * New()
vtkTransformToGrid::UpdateShiftScale
void UpdateShiftScale()
Internal method to calculate the shift and scale values which will provide maximum grid precision for...
vtkTransformToGrid::GetMTime
vtkMTimeType GetMTime() override
Return this object's modified time.
vtkTransformToGrid::SetGridScalarTypeToShort
void SetGridScalarTypeToShort()
Definition: vtkTransformToGrid.h:86
vtkTransformToGrid::SetGridScalarTypeToUnsignedShort
void SetGridScalarTypeToUnsignedShort()
Definition: vtkTransformToGrid.h:87
vtkTransformToGrid::SetGridScalarTypeToFloat
void SetGridScalarTypeToFloat()
Definition: vtkTransformToGrid.h:85
vtkTransformToGrid::DisplacementShift
double DisplacementShift
Definition: vtkTransformToGrid.h:145
vtkAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:447
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:49
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTransformToGrid::RequestData
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
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:91
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkTransformToGrid::SetGridScalarTypeToDouble
void SetGridScalarTypeToDouble()
Definition: vtkTransformToGrid.h:84
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkTransformToGrid::GetDisplacementShift
double GetDisplacementShift()
Definition: vtkTransformToGrid.h:103
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:52
vtkTransformToGrid::vtkTransformToGrid
vtkTransformToGrid()
vtkTransformToGrid::SetInput
virtual void SetInput(vtkAbstractTransform *)
Set/Get the transform which will be converted into a grid.
vtkTransformToGrid::DisplacementScale
double DisplacementScale
Definition: vtkTransformToGrid.h:144
vtkTransformToGrid::ShiftScaleTime
vtkTimeStamp ShiftScaleTime
Definition: vtkTransformToGrid.h:146
vtkTransformToGrid::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302