VTK  9.2.5
vtkImageActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageActor.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 =========================================================================*/
146 #ifndef vtkImageActor_h
147 #define vtkImageActor_h
148 
149 #include "vtkImageSlice.h"
150 #include "vtkRenderingCoreModule.h" // For export macro
151 
152 class vtkAlgorithm;
153 class vtkPropCollection;
154 class vtkRenderer;
155 class vtkImageData;
156 
157 class VTKRENDERINGCORE_EXPORT vtkImageActor : public vtkImageSlice
158 {
159 public:
160  vtkTypeMacro(vtkImageActor, vtkImageSlice);
161  void PrintSelf(ostream& os, vtkIndent indent) override;
162 
166  static vtkImageActor* New();
167 
169 
174  virtual void SetInputData(vtkImageData*);
175  virtual vtkImageData* GetInput();
177 
179 
185  vtkBooleanMacro(Interpolate, vtkTypeBool);
187 
189 
193  virtual void SetOpacity(double);
194  virtual double GetOpacity();
195  double GetOpacityMinValue() { return 0.0; }
196  double GetOpacityMaxValue() { return 1.0; }
198 
200 
204  void SetDisplayExtent(const int extent[6]);
205  void SetDisplayExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
206  void GetDisplayExtent(int extent[6]);
207  int* GetDisplayExtent() VTK_SIZEHINT(6) { return this->DisplayExtent; }
209 
211 
217  double* GetBounds() VTK_SIZEHINT(6) override;
218  void GetBounds(double bounds[6]) { this->Superclass::GetBounds(bounds); }
220 
222 
228  double* GetDisplayBounds();
229  void GetDisplayBounds(double bounds[6]);
231 
233 
241 
243 
252  void SetZSlice(int z)
253  {
254  this->SetDisplayExtent(this->DisplayExtent[0], this->DisplayExtent[1], this->DisplayExtent[2],
255  this->DisplayExtent[3], z, z);
256  }
257  int GetZSlice() { return this->DisplayExtent[4]; }
261 
270 
272 
277  vtkGetMacro(ForceOpaque, bool);
278  vtkSetMacro(ForceOpaque, bool);
279  vtkBooleanMacro(ForceOpaque, bool);
281 
282 protected:
284  ~vtkImageActor() override;
285 
290  static int GetOrientationFromExtent(const int extent[6]);
291 
292  int DisplayExtent[6];
293  double DisplayBounds[6];
294 
295  // Convenience function that returns the input of the mapper
297 
298  // the result of HasTranslucentPolygonalGeometry is cached
302 
303 private:
304  vtkImageActor(const vtkImageActor&) = delete;
305  void operator=(const vtkImageActor&) = delete;
306 };
307 
308 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:122
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.
int GetSliceNumberMax()
Return the slice number (& min/max slice number) computed from the display extent.
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...
int GetSliceNumber()
Return the slice number (& min/max slice number) computed from the display extent.
static vtkImageActor * New()
Instantiate the image actor.
void GetDisplayBounds(double bounds[6])
Get the bounds of the data that is displayed by this image actor.
double GetOpacityMaxValue()
Set/Get the object's opacity.
vtkTimeStamp TranslucentComputationTime
virtual double GetOpacity()
Set/Get the object's opacity.
int GetSliceNumberMin()
Return the slice number (& min/max slice number) computed from the display extent.
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...
void SetZSlice(int z)
Set/Get the current slice number.
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:163
represents an image in a 3D scene
a simple class to control print indentation
Definition: vtkIndent.h:119
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:182
record modification and/or execution time
Definition: vtkTimeStamp.h:55
void GetBounds(T a, double bds[6])
@ extent
Definition: vtkX3D.h:351
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)