VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkAlgorithm;
34 class vtkPropCollection;
35 class vtkRenderer;
36 class vtkImageData;
37 
38 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkImageActor : public vtkImageSlice
39 {
40 public:
41  vtkTypeMacro(vtkImageActor, vtkImageSlice);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  static vtkImageActor* New();
48 
50 
55  virtual void SetInputData(vtkImageData*);
56  virtual vtkImageData* GetInput();
58 
60 
64  virtual void SetInterpolate(vtkTypeBool);
65  virtual vtkTypeBool GetInterpolate();
66  vtkBooleanMacro(Interpolate, vtkTypeBool);
68 
70 
74  virtual void SetOpacity(double);
75  virtual double GetOpacity();
76  double GetOpacityMinValue() { return 0.0; }
77  double GetOpacityMaxValue() { return 1.0; }
79 
81 
85  void SetDisplayExtent(const int extent[6]);
86  void SetDisplayExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
87  void GetDisplayExtent(int extent[6]);
88  int* GetDisplayExtent() VTK_SIZEHINT(6) { return this->DisplayExtent; }
90 
92 
98  double* GetBounds() VTK_SIZEHINT(6) override;
99  void GetBounds(double bounds[6]) { this->Superclass::GetBounds(bounds); }
101 
103 
109  double* GetDisplayBounds() VTK_SIZEHINT(6);
110  void GetDisplayBounds(double bounds[6]);
112 
114 
118  int GetSliceNumber();
119  int GetSliceNumberMax();
120  int GetSliceNumberMin();
122 
124 
133  void SetZSlice(int z)
134  {
135  this->SetDisplayExtent(this->DisplayExtent[0], this->DisplayExtent[1], this->DisplayExtent[2],
136  this->DisplayExtent[3], z, z);
137  }
138  int GetZSlice() { return this->DisplayExtent[4]; }
139  int GetWholeZMin();
140  int GetWholeZMax();
142 
151 
153 
158  vtkGetMacro(ForceOpaque, bool);
159  vtkSetMacro(ForceOpaque, bool);
160  vtkBooleanMacro(ForceOpaque, bool);
162 
163 protected:
164  vtkImageActor();
165  ~vtkImageActor() override;
166 
171  static int GetOrientationFromExtent(const int extent[6]);
172 
173  int DisplayExtent[6];
174  double DisplayBounds[6];
175 
176  // Convenience function that returns the input of the mapper
177  vtkAlgorithm* GetInputAlgorithm();
178 
179  // the result of HasTranslucentPolygonalGeometry is cached
183 
184 private:
185  vtkImageActor(const vtkImageActor&) = delete;
186  void operator=(const vtkImageActor&) = delete;
187 };
188 
189 VTK_ABI_NAMESPACE_END
190 #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:88
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:63
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:53
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:38
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
double GetOpacityMinValue()
Set/Get the object's opacity.
Definition: vtkImageActor.h:76
double GetOpacityMaxValue()
Set/Get the object's opacity.
Definition: vtkImageActor.h:77
#define VTK_SIZEHINT(...)
represents an image in a 3D scene
Definition: vtkImageSlice.h:39
static vtkImageSlice * New()
Creates an Image with the following defaults: origin(0,0,0) position=(0,0,0) scale=1 visibility=1 pic...
#define VTK_MARSHALAUTO
int TranslucentCachedResult
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.