VTK  9.1.0
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 =========================================================================*/
52 #ifndef vtkImageGridSource_h
53 #define vtkImageGridSource_h
54 
55 #include "vtkImageAlgorithm.h"
56 #include "vtkImagingSourcesModule.h" // For export macro
57 
58 class VTKIMAGINGSOURCES_EXPORT vtkImageGridSource : public vtkImageAlgorithm
59 {
60 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
70  vtkSetVector3Macro(GridSpacing, int);
71  vtkGetVector3Macro(GridSpacing, int);
73 
75 
78  vtkSetVector3Macro(GridOrigin, int);
79  vtkGetVector3Macro(GridOrigin, int);
81 
83 
86  vtkSetMacro(LineValue, double);
87  vtkGetMacro(LineValue, double);
89 
91 
94  vtkSetMacro(FillValue, double);
95  vtkGetMacro(FillValue, double);
97 
99 
103  vtkSetMacro(DataScalarType, int);
104  void SetDataScalarTypeToDouble() { this->SetDataScalarType(VTK_DOUBLE); }
105  void SetDataScalarTypeToInt() { this->SetDataScalarType(VTK_INT); }
106  void SetDataScalarTypeToShort() { this->SetDataScalarType(VTK_SHORT); }
107  void SetDataScalarTypeToUnsignedShort() { this->SetDataScalarType(VTK_UNSIGNED_SHORT); }
108  void SetDataScalarTypeToUnsignedChar() { this->SetDataScalarType(VTK_UNSIGNED_CHAR); }
109  vtkGetMacro(DataScalarType, int);
111  {
112  return vtkImageScalarTypeNameMacro(this->DataScalarType);
113  }
115 
117 
121  vtkSetVector6Macro(DataExtent, int);
122  vtkGetVector6Macro(DataExtent, int);
124 
126 
129  vtkSetVector3Macro(DataSpacing, double);
130  vtkGetVector3Macro(DataSpacing, double);
132 
134 
137  vtkSetVector3Macro(DataOrigin, double);
138  vtkGetVector3Macro(DataOrigin, double);
140 
141 protected:
143  ~vtkImageGridSource() override = default;
144 
145  int GridSpacing[3];
146  int GridOrigin[3];
147 
148  double LineValue;
149  double FillValue;
150 
152 
153  int DataExtent[6];
154  double DataSpacing[3];
155  double DataOrigin[3];
156 
159 
160 private:
161  vtkImageGridSource(const vtkImageGridSource&) = delete;
162  void operator=(const vtkImageGridSource&) = delete;
163 };
164 
165 #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:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ data
Definition: vtkX3D.h:321
#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