VTK  9.7.1
vtkActor.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
26 #ifndef vtkActor_h
27 #define vtkActor_h
28 
29 #include "vtkProp3D.h"
30 #include "vtkRenderingCoreModule.h" // For export macro
31 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkRenderer;
35 class vtkPropCollection;
36 class vtkActorCollection;
37 class vtkTexture;
38 class vtkMapper;
39 class vtkProperty;
40 
41 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkActor : public vtkProp3D
42 {
43 public:
44  vtkTypeMacro(vtkActor, vtkProp3D);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
52  static vtkActor* New();
53 
59  void GetActors(vtkPropCollection*) override;
60 
62 
65  int RenderOpaqueGeometry(vtkViewport* viewport) override;
66  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
68 
70 
74  vtkTypeBool HasOpaqueGeometry() override;
76 
83  virtual void Render(vtkRenderer*, vtkMapper*) {}
84 
88  void ShallowCopy(vtkProp* prop) override;
89 
95  void ReleaseGraphicsResources(vtkWindow*) override;
96 
98 
105  void SetProperty(vtkProperty* lut);
106  vtkProperty* GetProperty();
108 
114  virtual vtkProperty* MakeProperty();
115 
117 
123  void SetBackfaceProperty(vtkProperty* lut);
124  vtkGetObjectMacro(BackfaceProperty, vtkProperty);
126 
128 
133  virtual void SetTexture(vtkTexture*);
134  vtkGetObjectMacro(Texture, vtkTexture);
136 
143  virtual void SetMapper(vtkMapper*);
144 
146 
149  vtkGetObjectMacro(Mapper, vtkMapper);
151 
156  using Superclass::GetBounds;
157  double* GetBounds() VTK_SIZEHINT(6) override;
158 
167  virtual void ApplyProperties() {}
168 
172  vtkMTimeType GetMTime() override;
173 
180  vtkMTimeType GetRedrawMTime() override;
181 
183 
186  vtkGetMacro(ForceOpaque, bool);
187  vtkSetMacro(ForceOpaque, bool);
188  vtkBooleanMacro(ForceOpaque, bool);
189  vtkGetMacro(ForceTranslucent, bool);
190  vtkSetMacro(ForceTranslucent, bool);
191  vtkBooleanMacro(ForceTranslucent, bool);
193 
200  bool GetSupportsSelection() override;
201 
207  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets) override;
208 
210  // Get if we are in the translucent polygonal geometry pass
211  bool IsRenderingTranslucentPolygonalGeometry() override { return this->InTranslucentPass; }
212  void SetIsRenderingTranslucentPolygonalGeometry(bool val) { this->InTranslucentPass = val; }
214 
215 protected:
216  vtkActor();
217  ~vtkActor() override;
218 
219  // is this actor opaque
220  int GetIsOpaque();
224 
229 
230  // Bounds are cached in an actor - the MapperBounds are also cache to
231  // help know when the Bounds need to be recomputed.
232  double MapperBounds[6];
234 
235 private:
236  vtkActor(const vtkActor&) = delete;
237  void operator=(const vtkActor&) = delete;
238 };
239 
240 VTK_ABI_NAMESPACE_END
241 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:83
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:233
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
abstract specification for Viewports
Definition: vtkViewport.h:46
represent surface properties of a geometric object
Definition: vtkProperty.h:59
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:236
void SetIsRenderingTranslucentPolygonalGeometry(bool val)
Definition: vtkActor.h:212
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:300
record modification and/or execution time
Definition: vtkTimeStamp.h:24
vtkProperty * Property
Definition: vtkActor.h:225
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:432
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:211
abstract specification for renderers
Definition: vtkRenderer.h:63
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:39
vtkTexture * Texture
Definition: vtkActor.h:227
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:321
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:128
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:110
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:313
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:438
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
bool ForceTranslucent
Definition: vtkActor.h:222
vtkProperty * BackfaceProperty
Definition: vtkActor.h:226
handles properties associated with a texture map
Definition: vtkTexture.h:58
bool ForceOpaque
Definition: vtkActor.h:221
#define VTK_SIZEHINT(...)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:77
an ordered list of actors
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMapper * Mapper
Definition: vtkActor.h:228
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:237
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
Definition: vtkProp.h:60
vtkMTimeType GetMTime() override
Get the vtkProp3D's mtime.
bool InTranslucentPass
Definition: vtkActor.h:223