VTK  9.2.6
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 "vtkAlgorithm.h"
34 #include "vtkFiltersHybridModule.h" // For export macro
35 #include "vtkImageData.h" // makes things a bit easier
36 
38 
39 class VTKFILTERSHYBRID_EXPORT vtkTransformToGrid : public vtkAlgorithm
40 {
41 public:
42  static vtkTransformToGrid* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  virtual void SetInput(vtkAbstractTransform*);
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); }
87  void SetGridScalarTypeToUnsignedShort() { this->SetGridScalarType(VTK_UNSIGNED_SHORT); }
88  void SetGridScalarTypeToUnsignedChar() { this->SetGridScalarType(VTK_UNSIGNED_CHAR); }
89  void SetGridScalarTypeToChar() { this->SetGridScalarType(VTK_CHAR); }
91 
93 
99  {
100  this->UpdateShiftScale();
101  return this->DisplacementScale;
102  }
104  {
105  this->UpdateShiftScale();
106  return this->DisplacementShift;
107  }
109 
113  vtkImageData* GetOutput();
114 
120 
121 protected:
123  ~vtkTransformToGrid() override;
124 
125  void RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
126 
128 
133  void UpdateShiftScale();
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
void SetGridScalarTypeToShort()
Get/Set the scalar type of the grid.
void SetGridScalarTypeToFloat()
Get/Set the scalar type of the grid.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
vtkAbstractTransform * Input
record modification and/or execution time
Definition: vtkTimeStamp.h:35
void SetGridScalarTypeToDouble()
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...
vtkTimeStamp ShiftScaleTime
void SetGridScalarTypeToUnsignedShort()
Get/Set the scalar type of the grid.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:69
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_FLOAT
Definition: vtkType.h:54
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
void SetGridScalarTypeToUnsignedChar()
Get/Set the scalar type of the grid.
double GetDisplacementShift()
Get the scale and shift to convert integer grid elements into real values: dx = scale*di + shift...
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
superclass for all geometric transformations
virtual vtkMTimeType GetMTime()
Return this object's modified time.
#define VTK_SHORT
Definition: vtkType.h:48
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
void SetGridScalarTypeToChar()
Get/Set the scalar type of the grid.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
create a grid for a vtkGridTransform