VTK  9.3.20240419
vtkImageGridSource.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
46 #ifndef vtkImageGridSource_h
47 #define vtkImageGridSource_h
48 
49 #include "vtkImageAlgorithm.h"
50 #include "vtkImagingSourcesModule.h" // For export macro
51 
52 VTK_ABI_NAMESPACE_BEGIN
53 class VTKIMAGINGSOURCES_EXPORT vtkImageGridSource : public vtkImageAlgorithm
54 {
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
65  vtkSetVector3Macro(GridSpacing, int);
66  vtkGetVector3Macro(GridSpacing, int);
68 
70 
73  vtkSetVector3Macro(GridOrigin, int);
74  vtkGetVector3Macro(GridOrigin, int);
76 
78 
81  vtkSetMacro(LineValue, double);
82  vtkGetMacro(LineValue, double);
84 
86 
89  vtkSetMacro(FillValue, double);
90  vtkGetMacro(FillValue, double);
92 
94 
98  vtkSetMacro(DataScalarType, int);
99  void SetDataScalarTypeToDouble() { this->SetDataScalarType(VTK_DOUBLE); }
100  void SetDataScalarTypeToInt() { this->SetDataScalarType(VTK_INT); }
101  void SetDataScalarTypeToShort() { this->SetDataScalarType(VTK_SHORT); }
102  void SetDataScalarTypeToUnsignedShort() { this->SetDataScalarType(VTK_UNSIGNED_SHORT); }
103  void SetDataScalarTypeToUnsignedChar() { this->SetDataScalarType(VTK_UNSIGNED_CHAR); }
104  vtkGetMacro(DataScalarType, int);
106  {
107  return vtkImageScalarTypeNameMacro(this->DataScalarType);
108  }
110 
112 
116  vtkSetVector6Macro(DataExtent, int);
117  vtkGetVector6Macro(DataExtent, int);
119 
121 
124  vtkSetVector3Macro(DataSpacing, double);
125  vtkGetVector3Macro(DataSpacing, double);
127 
129 
132  vtkSetVector3Macro(DataOrigin, double);
133  vtkGetVector3Macro(DataOrigin, double);
135 
136 protected:
138  ~vtkImageGridSource() override = default;
139 
140  int GridSpacing[3];
141  int GridOrigin[3];
142 
143  double LineValue;
144  double FillValue;
145 
147 
148  int DataExtent[6];
149  double DataSpacing[3];
150  double DataOrigin[3];
151 
154 
155 private:
156  vtkImageGridSource(const vtkImageGridSource&) = delete;
157  void operator=(const vtkImageGridSource&) = delete;
158 };
159 
160 VTK_ABI_NAMESPACE_END
161 #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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ data
Definition: vtkX3D.h:315
#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
#define VTK_INT
Definition: vtkType.h:38