VTK  9.3.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 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkRenderer;
34 class vtkPropCollection;
35 class vtkActorCollection;
36 class vtkTexture;
37 class vtkMapper;
38 class vtkProperty;
39 
40 class VTKRENDERINGCORE_EXPORT vtkActor : public vtkProp3D
41 {
42 public:
43  vtkTypeMacro(vtkActor, vtkProp3D);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
51  static vtkActor* New();
52 
58  void GetActors(vtkPropCollection*) override;
59 
61 
64  int RenderOpaqueGeometry(vtkViewport* viewport) override;
65  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
67 
69 
73  vtkTypeBool HasOpaqueGeometry() override;
75 
82  virtual void Render(vtkRenderer*, vtkMapper*) {}
83 
87  void ShallowCopy(vtkProp* prop) override;
88 
94  void ReleaseGraphicsResources(vtkWindow*) override;
95 
97 
104  void SetProperty(vtkProperty* lut);
105  vtkProperty* GetProperty();
107 
113  virtual vtkProperty* MakeProperty();
114 
116 
122  void SetBackfaceProperty(vtkProperty* lut);
123  vtkGetObjectMacro(BackfaceProperty, vtkProperty);
125 
127 
132  virtual void SetTexture(vtkTexture*);
133  vtkGetObjectMacro(Texture, vtkTexture);
135 
142  virtual void SetMapper(vtkMapper*);
143 
145 
148  vtkGetObjectMacro(Mapper, vtkMapper);
150 
155  using Superclass::GetBounds;
156  double* GetBounds() VTK_SIZEHINT(6) override;
157 
166  virtual void ApplyProperties() {}
167 
171  vtkMTimeType GetMTime() override;
172 
179  vtkMTimeType GetRedrawMTime() override;
180 
182 
185  vtkGetMacro(ForceOpaque, bool);
186  vtkSetMacro(ForceOpaque, bool);
187  vtkBooleanMacro(ForceOpaque, bool);
188  vtkGetMacro(ForceTranslucent, bool);
189  vtkSetMacro(ForceTranslucent, bool);
190  vtkBooleanMacro(ForceTranslucent, bool);
192 
199  bool GetSupportsSelection() override;
200 
206  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets) override;
207 
209  // Get if we are in the translucent polygonal geometry pass
210  bool IsRenderingTranslucentPolygonalGeometry() override { return this->InTranslucentPass; }
211  void SetIsRenderingTranslucentPolygonalGeometry(bool val) { this->InTranslucentPass = val; }
213 
214 protected:
215  vtkActor();
216  ~vtkActor() override;
217 
218  // is this actor opaque
219  int GetIsOpaque();
223 
228 
229  // Bounds are cached in an actor - the MapperBounds are also cache to
230  // help know when the Bounds need to be recomputed.
231  double MapperBounds[6];
233 
234 private:
235  vtkActor(const vtkActor&) = delete;
236  void operator=(const vtkActor&) = delete;
237 };
238 
239 VTK_ABI_NAMESPACE_END
240 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:82
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:232
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:56
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:213
void SetIsRenderingTranslucentPolygonalGeometry(bool val)
Definition: vtkActor.h:211
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:277
record modification and/or execution time
Definition: vtkTimeStamp.h:24
vtkProperty * Property
Definition: vtkActor.h:224
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:409
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:210
abstract specification for renderers
Definition: vtkRenderer.h:61
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:38
vtkTexture * Texture
Definition: vtkActor.h:226
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:298
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:124
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:106
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:290
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:415
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
bool ForceTranslucent
Definition: vtkActor.h:221
vtkProperty * BackfaceProperty
Definition: vtkActor.h:225
handles properties associated with a texture map
Definition: vtkTexture.h:57
bool ForceOpaque
Definition: vtkActor.h:220
#define VTK_SIZEHINT(...)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:76
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:227
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:214
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:56
vtkMTimeType GetMTime() override
Get the vtkProp3D's mtime.
bool InTranslucentPass
Definition: vtkActor.h:222