VTK  9.2.20230201
vtkImageGridSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageGridSource.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 =========================================================================*/
58 #ifndef vtkImageGridSource_h
59 #define vtkImageGridSource_h
60 
61 #include "vtkImageAlgorithm.h"
62 #include "vtkImagingSourcesModule.h" // For export macro
63 
64 VTK_ABI_NAMESPACE_BEGIN
65 class VTKIMAGINGSOURCES_EXPORT vtkImageGridSource : public vtkImageAlgorithm
66 {
67 public:
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
77  vtkSetVector3Macro(GridSpacing, int);
78  vtkGetVector3Macro(GridSpacing, int);
80 
82 
85  vtkSetVector3Macro(GridOrigin, int);
86  vtkGetVector3Macro(GridOrigin, int);
88 
90 
93  vtkSetMacro(LineValue, double);
94  vtkGetMacro(LineValue, double);
96 
98 
101  vtkSetMacro(FillValue, double);
102  vtkGetMacro(FillValue, double);
104 
106 
110  vtkSetMacro(DataScalarType, int);
111  void SetDataScalarTypeToDouble() { this->SetDataScalarType(VTK_DOUBLE); }
112  void SetDataScalarTypeToInt() { this->SetDataScalarType(VTK_INT); }
113  void SetDataScalarTypeToShort() { this->SetDataScalarType(VTK_SHORT); }
114  void SetDataScalarTypeToUnsignedShort() { this->SetDataScalarType(VTK_UNSIGNED_SHORT); }
115  void SetDataScalarTypeToUnsignedChar() { this->SetDataScalarType(VTK_UNSIGNED_CHAR); }
116  vtkGetMacro(DataScalarType, int);
118  {
119  return vtkImageScalarTypeNameMacro(this->DataScalarType);
120  }
122 
124 
128  vtkSetVector6Macro(DataExtent, int);
129  vtkGetVector6Macro(DataExtent, int);
131 
133 
136  vtkSetVector3Macro(DataSpacing, double);
137  vtkGetVector3Macro(DataSpacing, double);
139 
141 
144  vtkSetVector3Macro(DataOrigin, double);
145  vtkGetVector3Macro(DataOrigin, double);
147 
148 protected:
150  ~vtkImageGridSource() override = default;
151 
152  int GridSpacing[3];
153  int GridOrigin[3];
154 
155  double LineValue;
156  double FillValue;
157 
159 
160  int DataExtent[6];
161  double DataSpacing[3];
162  double DataOrigin[3];
163 
166 
167 private:
168  vtkImageGridSource(const vtkImageGridSource&) = delete;
169  void operator=(const vtkImageGridSource&) = delete;
170 };
171 
172 VTK_ABI_NAMESPACE_END
173 #endif
general representation of visualization data
Generic algorithm superclass for image algs.
Create an image of a grid.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
static vtkImageGridSource * New()
void SetDataScalarTypeToUnsignedChar()
Set/Get the data type of pixels in the imported data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetDataScalarTypeAsString()
Set/Get the data type of pixels in the imported data.
void SetDataScalarTypeToUnsignedShort()
Set/Get the data type of pixels in the imported data.
void SetDataScalarTypeToShort()
Set/Get the data type of pixels in the imported data.
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
void SetDataScalarTypeToInt()
Set/Get the data type of pixels in the imported data.
~vtkImageGridSource() override=default
void SetDataScalarTypeToDouble()
Set/Get the data type of pixels in the imported data.
a simple class to control print indentation
Definition: vtkIndent.h:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ data
Definition: vtkX3D.h:327
#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
#define VTK_INT
Definition: vtkType.h:50