VTK  9.3.20231128
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
135 #ifndef vtkActor_h
136 #define vtkActor_h
137 
138 #include "vtkProp3D.h"
139 #include "vtkRenderingCoreModule.h" // For export macro
140 
141 VTK_ABI_NAMESPACE_BEGIN
142 class vtkRenderer;
143 class vtkPropCollection;
144 class vtkActorCollection;
145 class vtkTexture;
146 class vtkMapper;
147 class vtkProperty;
148 
149 class VTKRENDERINGCORE_EXPORT vtkActor : public vtkProp3D
150 {
151 public:
152  vtkTypeMacro(vtkActor, vtkProp3D);
153  void PrintSelf(ostream& os, vtkIndent indent) override;
154 
160  static vtkActor* New();
161 
167  void GetActors(vtkPropCollection*) override;
168 
170 
173  int RenderOpaqueGeometry(vtkViewport* viewport) override;
176 
178 
184 
191  virtual void Render(vtkRenderer*, vtkMapper*) {}
192 
196  void ShallowCopy(vtkProp* prop) override;
197 
204 
206 
216 
223 
225 
232  vtkGetObjectMacro(BackfaceProperty, vtkProperty);
234 
236 
241  virtual void SetTexture(vtkTexture*);
242  vtkGetObjectMacro(Texture, vtkTexture);
244 
251  virtual void SetMapper(vtkMapper*);
252 
254 
257  vtkGetObjectMacro(Mapper, vtkMapper);
259 
264  using Superclass::GetBounds;
265  double* GetBounds() VTK_SIZEHINT(6) override;
266 
275  virtual void ApplyProperties() {}
276 
280  vtkMTimeType GetMTime() override;
281 
289 
291 
294  vtkGetMacro(ForceOpaque, bool);
295  vtkSetMacro(ForceOpaque, bool);
296  vtkBooleanMacro(ForceOpaque, bool);
297  vtkGetMacro(ForceTranslucent, bool);
298  vtkSetMacro(ForceTranslucent, bool);
299  vtkBooleanMacro(ForceTranslucent, bool);
301 
308  bool GetSupportsSelection() override;
309 
315  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets) override;
316 
318  // Get if we are in the translucent polygonal geometry pass
319  bool IsRenderingTranslucentPolygonalGeometry() override { return this->InTranslucentPass; }
320  void SetIsRenderingTranslucentPolygonalGeometry(bool val) { this->InTranslucentPass = val; }
322 
323 protected:
325  ~vtkActor() override;
326 
327  // is this actor opaque
328  int GetIsOpaque();
332 
337 
338  // Bounds are cached in an actor - the MapperBounds are also cache to
339  // help know when the Bounds need to be recomputed.
340  double MapperBounds[6];
342 
343 private:
344  vtkActor(const vtkActor&) = delete;
345  void operator=(const vtkActor&) = delete;
346 };
347 
348 VTK_ABI_NAMESPACE_END
349 #endif
an ordered list of actors
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:150
void SetProperty(vtkProperty *lut)
Set/Get the property object that controls this actors surface properties.
virtual vtkProperty * MakeProperty()
Create a new property suitable for use with this type of Actor.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetRedrawMTime() override
Return the mtime of anything that would cause the rendered image to appear differently.
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:191
void ProcessSelectorPixelBuffers(vtkHardwareSelector *sel, std::vector< unsigned int > &pixeloffsets) override
allows a prop to update a selections color buffers Default just forwards to the Mapper
virtual void SetMapper(vtkMapper *)
This is the method that is used to connect an actor to the end of a visualization pipeline,...
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
vtkMTimeType GetMTime() override
Get the actors mtime plus consider its properties and texture if set.
bool InTranslucentPass
Definition: vtkActor.h:331
vtkProperty * GetProperty()
Set/Get the property object that controls this actors surface properties.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkProperty * BackfaceProperty
Definition: vtkActor.h:334
void SetBackfaceProperty(vtkProperty *lut)
Set/Get the property object that controls this actors backface surface properties.
vtkTypeBool HasOpaqueGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
~vtkActor() override
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:341
bool ForceOpaque
Definition: vtkActor.h:329
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:319
vtkTexture * Texture
Definition: vtkActor.h:335
vtkProperty * Property
Definition: vtkActor.h:333
int GetIsOpaque()
vtkMapper * Mapper
Definition: vtkActor.h:336
bool ForceTranslucent
Definition: vtkActor.h:330
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
void ShallowCopy(vtkProp *prop) override
Shallow copy of an actor.
virtual void SetTexture(vtkTexture *)
Set/Get the texture object to control rendering texture maps.
bool GetSupportsSelection() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetIsRenderingTranslucentPolygonalGeometry(bool val)
Definition: vtkActor.h:320
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:136
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:88
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:65
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:143
represent surface properties of a geometric object
Definition: vtkProperty.h:166
abstract specification for renderers
Definition: vtkRenderer.h:171
handles properties associated with a texture map
Definition: vtkTexture.h:167
record modification and/or execution time
Definition: vtkTimeStamp.h:44
abstract specification for Viewports
Definition: vtkViewport.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
int vtkTypeBool
Definition: vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_SIZEHINT(...)