VTK  9.3.1
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
25 #ifndef vtkImageActor_h
26 #define vtkImageActor_h
27 
28 #include "vtkImageSlice.h"
29 #include "vtkRenderingCoreModule.h" // For export macro
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkAlgorithm;
33 class vtkPropCollection;
34 class vtkRenderer;
35 class vtkImageData;
36 
37 class VTKRENDERINGCORE_EXPORT vtkImageActor : public vtkImageSlice
38 {
39 public:
40  vtkTypeMacro(vtkImageActor, vtkImageSlice);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  static vtkImageActor* New();
47 
49 
54  virtual void SetInputData(vtkImageData*);
55  virtual vtkImageData* GetInput();
57 
59 
63  virtual void SetInterpolate(vtkTypeBool);
64  virtual vtkTypeBool GetInterpolate();
65  vtkBooleanMacro(Interpolate, vtkTypeBool);
67 
69 
73  virtual void SetOpacity(double);
74  virtual double GetOpacity();
75  double GetOpacityMinValue() { return 0.0; }
76  double GetOpacityMaxValue() { return 1.0; }
78 
80 
84  void SetDisplayExtent(const int extent[6]);
85  void SetDisplayExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
86  void GetDisplayExtent(int extent[6]);
87  int* GetDisplayExtent() VTK_SIZEHINT(6) { return this->DisplayExtent; }
89 
91 
97  double* GetBounds() VTK_SIZEHINT(6) override;
98  void GetBounds(double bounds[6]) { this->Superclass::GetBounds(bounds); }
100 
102 
108  double* GetDisplayBounds() VTK_SIZEHINT(6);
109  void GetDisplayBounds(double bounds[6]);
111 
113 
117  int GetSliceNumber();
118  int GetSliceNumberMax();
119  int GetSliceNumberMin();
121 
123 
132  void SetZSlice(int z)
133  {
134  this->SetDisplayExtent(this->DisplayExtent[0], this->DisplayExtent[1], this->DisplayExtent[2],
135  this->DisplayExtent[3], z, z);
136  }
137  int GetZSlice() { return this->DisplayExtent[4]; }
138  int GetWholeZMin();
139  int GetWholeZMax();
141 
150 
152 
157  vtkGetMacro(ForceOpaque, bool);
158  vtkSetMacro(ForceOpaque, bool);
159  vtkBooleanMacro(ForceOpaque, bool);
161 
162 protected:
163  vtkImageActor();
164  ~vtkImageActor() override;
165 
170  static int GetOrientationFromExtent(const int extent[6]);
171 
172  int DisplayExtent[6];
173  double DisplayBounds[6];
174 
175  // Convenience function that returns the input of the mapper
176  vtkAlgorithm* GetInputAlgorithm();
177 
178  // the result of HasTranslucentPolygonalGeometry is cached
182 
183 private:
184  vtkImageActor(const vtkImageActor&) = delete;
185  void operator=(const vtkImageActor&) = delete;
186 };
187 
188 VTK_ABI_NAMESPACE_END
189 #endif
vtkTimeStamp TranslucentComputationTime
void GetBounds(T a, double bds[6])
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
int * GetDisplayExtent()
The image extent is generally set explicitly, but if not set it will be determined from the input ima...
Definition: vtkImageActor.h:87
record modification and/or execution time
Definition: vtkTimeStamp.h:24
int GetZSlice()
Set/Get the current slice number.
abstract specification for renderers
Definition: vtkRenderer.h:61
vtkTypeBool HasTranslucentPolygonalGeometry() override
Internal method, should only be used by rendering.
double * GetBounds() override
Get the bounds - either all six at once (xmin, xmax, ymin, ymax, zmin, zmax) or one at a time...
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:51
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:37
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
double GetOpacityMinValue()
Set/Get the object's opacity.
Definition: vtkImageActor.h:75
double GetOpacityMaxValue()
Set/Get the object's opacity.
Definition: vtkImageActor.h:76
#define VTK_SIZEHINT(...)
represents an image in a 3D scene
Definition: vtkImageSlice.h:38
static vtkImageSlice * New()
Creates an Image with the following defaults: origin(0,0,0) position=(0,0,0) scale=1 visibility=1 pic...
int TranslucentCachedResult
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.