VTK  9.3.20240328
vtkImageActor.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
134 #ifndef vtkImageActor_h
135 #define vtkImageActor_h
136 
137 #include "vtkImageSlice.h"
138 #include "vtkRenderingCoreModule.h" // For export macro
139 
140 VTK_ABI_NAMESPACE_BEGIN
141 class vtkAlgorithm;
142 class vtkPropCollection;
143 class vtkRenderer;
144 class vtkImageData;
145 
146 class VTKRENDERINGCORE_EXPORT vtkImageActor : public vtkImageSlice
147 {
148 public:
149  vtkTypeMacro(vtkImageActor, vtkImageSlice);
150  void PrintSelf(ostream& os, vtkIndent indent) override;
151 
155  static vtkImageActor* New();
156 
158 
163  virtual void SetInputData(vtkImageData*);
164  virtual vtkImageData* GetInput();
166 
168 
174  vtkBooleanMacro(Interpolate, vtkTypeBool);
176 
178 
182  virtual void SetOpacity(double);
183  virtual double GetOpacity();
184  double GetOpacityMinValue() { return 0.0; }
185  double GetOpacityMaxValue() { return 1.0; }
187 
189 
193  void SetDisplayExtent(const int extent[6]);
194  void SetDisplayExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
195  void GetDisplayExtent(int extent[6]);
196  int* GetDisplayExtent() VTK_SIZEHINT(6) { return this->DisplayExtent; }
198 
200 
206  double* GetBounds() VTK_SIZEHINT(6) override;
207  void GetBounds(double bounds[6]) { this->Superclass::GetBounds(bounds); }
209 
211 
218  void GetDisplayBounds(double bounds[6]);
220 
222 
226  int GetSliceNumber();
227  int GetSliceNumberMax();
228  int GetSliceNumberMin();
230 
232 
241  void SetZSlice(int z)
242  {
243  this->SetDisplayExtent(this->DisplayExtent[0], this->DisplayExtent[1], this->DisplayExtent[2],
244  this->DisplayExtent[3], z, z);
245  }
246  int GetZSlice() { return this->DisplayExtent[4]; }
250 
259 
261 
266  vtkGetMacro(ForceOpaque, bool);
267  vtkSetMacro(ForceOpaque, bool);
268  vtkBooleanMacro(ForceOpaque, bool);
270 
271 protected:
273  ~vtkImageActor() override;
274 
279  static int GetOrientationFromExtent(const int extent[6]);
280 
281  int DisplayExtent[6];
282  double DisplayBounds[6];
283 
284  // Convenience function that returns the input of the mapper
286 
287  // the result of HasTranslucentPolygonalGeometry is cached
291 
292 private:
293  vtkImageActor(const vtkImageActor&) = delete;
294  void operator=(const vtkImageActor&) = delete;
295 };
296 
297 VTK_ABI_NAMESPACE_END
298 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:161
draw an image in a rendered 3D scene
virtual vtkImageData * GetInput()
Set/Get the image data input for the image actor.
virtual void SetInputData(vtkImageData *)
Set/Get the image data input for the image actor.
int GetWholeZMax()
Set/Get the current slice number.
double * GetDisplayBounds()
Get the bounds of the data that is displayed by this image actor.
virtual vtkTypeBool GetInterpolate()
Turn on/off linear interpolation of the image when rendering.
void GetDisplayExtent(int extent[6])
The image extent is generally set explicitly, but if not set it will be determined from the input ima...
int * GetDisplayExtent()
The image extent is generally set explicitly, but if not set it will be determined from the input ima...
static vtkImageActor * New()
Instantiate the image actor.
double GetOpacityMaxValue()
Set/Get the object's opacity.
vtkTimeStamp TranslucentComputationTime
virtual double GetOpacity()
Set/Get the object's opacity.
virtual void SetOpacity(double)
Set/Get the object's opacity.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Internal method, should only be used by rendering.
virtual void SetInterpolate(vtkTypeBool)
Turn on/off linear interpolation of the image when rendering.
int TranslucentCachedResult
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double GetOpacityMinValue()
Set/Get the object's opacity.
vtkAlgorithm * GetInputAlgorithm()
void SetDisplayExtent(const int extent[6])
The image extent is generally set explicitly, but if not set it will be determined from the input ima...
static int GetOrientationFromExtent(const int extent[6])
Guess the orientation from the extent.
~vtkImageActor() override
double * GetBounds() override
Get the bounds of this image actor.
int GetWholeZMin()
Set/Get the current slice number.
void SetDisplayExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ)
The image extent is generally set explicitly, but if not set it will be determined from the input ima...
int GetZSlice()
Set/Get the current slice number.
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
represents an image in a 3D scene
a simple class to control print indentation
Definition: vtkIndent.h:108
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
an ordered list of Props
abstract specification for renderers
Definition: vtkRenderer.h:171
record modification and/or execution time
Definition: vtkTimeStamp.h:44
void GetBounds(T a, double bds[6])
@ extent
Definition: vtkX3D.h:345
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)