VTK  9.1.0
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 "vtkAlgorithm.h"
31#include "vtkFiltersHybridModule.h" // For export macro
32#include "vtkImageData.h" // makes things a bit easier
33
35
36class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
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); }
84 void SetGridScalarTypeToUnsignedShort() { this->SetGridScalarType(VTK_UNSIGNED_SHORT); }
85 void SetGridScalarTypeToUnsignedChar() { this->SetGridScalarType(VTK_UNSIGNED_CHAR); }
86 void SetGridScalarTypeToChar() { this->SetGridScalarType(VTK_CHAR); }
88
90
96 {
97 this->UpdateShiftScale();
98 return this->DisplacementScale;
99 }
101 {
102 this->UpdateShiftScale();
103 return this->DisplacementShift;
104 }
106
111
117
118protected:
121
123
125
131
133
135
137 int GridExtent[6];
138 double GridOrigin[3];
139 double GridSpacing[3];
140
144
145 // see algorithm for more info
147
148private:
149 vtkTransformToGrid(const vtkTransformToGrid&) = delete;
150 void operator=(const vtkTransformToGrid&) = delete;
151};
152
153#endif
superclass for all geometric transformations
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:114
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:52
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
static vtkTransformToGrid * New()
void SetGridScalarTypeToShort()
Get/Set the scalar type of the grid.
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
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SHORT
Definition: vtkType.h:48
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_FLOAT
Definition: vtkType.h:54
#define VTK_CHAR
Definition: vtkType.h:45