VTK  9.3.0
vtkTransformToGrid.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkTransformToGrid_h
19 #define vtkTransformToGrid_h
20 
21 #include "vtkAlgorithm.h"
22 #include "vtkFiltersHybridModule.h" // For export macro
23 #include "vtkImageData.h" // makes things a bit easier
24 
25 VTK_ABI_NAMESPACE_BEGIN
27 
28 class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
29 {
30 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
40  vtkGetObjectMacro(Input, vtkAbstractTransform);
42 
44 
47  vtkSetVector6Macro(GridExtent, int);
48  vtkGetVector6Macro(GridExtent, int);
50 
52 
55  vtkSetVector3Macro(GridOrigin, double);
56  vtkGetVector3Macro(GridOrigin, double);
58 
60 
63  vtkSetVector3Macro(GridSpacing, double);
64  vtkGetVector3Macro(GridSpacing, double);
66 
68 
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); }
76  void SetGridScalarTypeToUnsignedShort() { this->SetGridScalarType(VTK_UNSIGNED_SHORT); }
77  void SetGridScalarTypeToUnsignedChar() { this->SetGridScalarType(VTK_UNSIGNED_CHAR); }
78  void SetGridScalarTypeToChar() { this->SetGridScalarType(VTK_CHAR); }
80 
82 
88  {
89  this->UpdateShiftScale();
90  return this->DisplacementScale;
91  }
93  {
94  this->UpdateShiftScale();
95  return this->DisplacementShift;
96  }
98 
103 
109 
110 protected:
113 
115 
117 
123 
124  vtkMTimeType GetMTime() override;
125 
127 
129  int GridExtent[6];
130  double GridOrigin[3];
131  double GridSpacing[3];
132 
136 
137  // see algorithm for more info
139 
140 private:
141  vtkTransformToGrid(const vtkTransformToGrid&) = delete;
142  void operator=(const vtkTransformToGrid&) = delete;
143 };
144 
145 VTK_ABI_NAMESPACE_END
146 #endif
superclass for all geometric transformations
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
create a grid for a vtkGridTransform
void SetGridScalarTypeToUnsignedShort()
Get/Set the scalar type of the grid.
virtual void SetInput(vtkAbstractTransform *)
Set/Get the transform which will be converted into a grid.
vtkMTimeType GetMTime() override
Return this object's modified time.
double GetDisplacementShift()
Get the scale and shift to convert integer grid elements into real values: dx = scale*di + shift.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractTransform * Input
void SetGridScalarTypeToDouble()
Get/Set the scalar type of the grid.
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetGridScalarTypeToFloat()
Get/Set the scalar type of the grid.
void SetGridScalarTypeToUnsignedChar()
Get/Set the scalar type of the grid.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
void SetGridScalarTypeToShort()
Get/Set the scalar type of the grid.
static vtkTransformToGrid * New()
double GetDisplacementScale()
Get the scale and shift to convert integer grid elements into real values: dx = scale*di + shift.
void UpdateShiftScale()
Internal method to calculate the shift and scale values which will provide maximum grid precision for...
vtkTimeStamp ShiftScaleTime
void SetGridScalarTypeToChar()
Get/Set the scalar type of the grid.
~vtkTransformToGrid() override
void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SHORT
Definition: vtkType.h:36
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_FLOAT
Definition: vtkType.h:42
#define VTK_CHAR
Definition: vtkType.h:33