VTK  9.3.0
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
17 #ifndef vtkImageGridSource_h
18 #define vtkImageGridSource_h
19 
20 #include "vtkImageAlgorithm.h"
21 #include "vtkImagingSourcesModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKIMAGINGSOURCES_EXPORT vtkImageGridSource : public vtkImageAlgorithm
25 {
26 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
32 
36  vtkSetVector3Macro(GridSpacing, int);
37  vtkGetVector3Macro(GridSpacing, int);
39 
41 
44  vtkSetVector3Macro(GridOrigin, int);
45  vtkGetVector3Macro(GridOrigin, int);
47 
49 
52  vtkSetMacro(LineValue, double);
53  vtkGetMacro(LineValue, double);
55 
57 
60  vtkSetMacro(FillValue, double);
61  vtkGetMacro(FillValue, double);
63 
65 
69  vtkSetMacro(DataScalarType, int);
70  void SetDataScalarTypeToDouble() { this->SetDataScalarType(VTK_DOUBLE); }
71  void SetDataScalarTypeToInt() { this->SetDataScalarType(VTK_INT); }
72  void SetDataScalarTypeToShort() { this->SetDataScalarType(VTK_SHORT); }
73  void SetDataScalarTypeToUnsignedShort() { this->SetDataScalarType(VTK_UNSIGNED_SHORT); }
74  void SetDataScalarTypeToUnsignedChar() { this->SetDataScalarType(VTK_UNSIGNED_CHAR); }
75  vtkGetMacro(DataScalarType, int);
77  {
78  return vtkImageScalarTypeNameMacro(this->DataScalarType);
79  }
81 
83 
87  vtkSetVector6Macro(DataExtent, int);
88  vtkGetVector6Macro(DataExtent, int);
90 
92 
95  vtkSetVector3Macro(DataSpacing, double);
96  vtkGetVector3Macro(DataSpacing, double);
98 
100 
103  vtkSetVector3Macro(DataOrigin, double);
104  vtkGetVector3Macro(DataOrigin, double);
106 
107 protected:
109  ~vtkImageGridSource() override = default;
110 
111  int GridSpacing[3];
112  int GridOrigin[3];
113 
114  double LineValue;
115  double FillValue;
116 
118 
119  int DataExtent[6];
120  double DataSpacing[3];
121  double DataOrigin[3];
122 
125 
126 private:
127  vtkImageGridSource(const vtkImageGridSource&) = delete;
128  void operator=(const vtkImageGridSource&) = delete;
129 };
130 
131 VTK_ABI_NAMESPACE_END
132 #endif
general representation of visualization data
Definition: vtkDataObject.h:55
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:29
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