VTK  9.0.20210624
vtkActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkActor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkActor_h
33 #define vtkActor_h
34 
35 #include "vtkProp3D.h"
36 #include "vtkRenderingCoreModule.h" // For export macro
37 
38 class vtkRenderer;
39 class vtkPropCollection;
40 class vtkActorCollection;
41 class vtkTexture;
42 class vtkMapper;
43 class vtkProperty;
44 
45 class VTKRENDERINGCORE_EXPORT vtkActor : public vtkProp3D
46 {
47 public:
48  vtkTypeMacro(vtkActor, vtkProp3D);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
56  static vtkActor* New();
57 
63  void GetActors(vtkPropCollection*) override;
64 
66 
69  int RenderOpaqueGeometry(vtkViewport* viewport) override;
72 
74 
80 
87  virtual void Render(vtkRenderer*, vtkMapper*) {}
88 
92  void ShallowCopy(vtkProp* prop) override;
93 
100 
102 
112 
119 
121 
128  vtkGetObjectMacro(BackfaceProperty, vtkProperty);
130 
132 
137  virtual void SetTexture(vtkTexture*);
138  vtkGetObjectMacro(Texture, vtkTexture);
140 
147  virtual void SetMapper(vtkMapper*);
148 
150 
153  vtkGetObjectMacro(Mapper, vtkMapper);
155 
160  using Superclass::GetBounds;
161  double* GetBounds() VTK_SIZEHINT(6) override;
162 
171  virtual void ApplyProperties() {}
172 
176  vtkMTimeType GetMTime() override;
177 
185 
187 
190  vtkGetMacro(ForceOpaque, bool);
191  vtkSetMacro(ForceOpaque, bool);
192  vtkBooleanMacro(ForceOpaque, bool);
193  vtkGetMacro(ForceTranslucent, bool);
194  vtkSetMacro(ForceTranslucent, bool);
195  vtkBooleanMacro(ForceTranslucent, bool);
197 
204  bool GetSupportsSelection() override;
205 
211  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets) override;
212 
214  // Get if we are in the translucent polygonal geometry pass
215  bool IsRenderingTranslucentPolygonalGeometry() override { return this->InTranslucentPass; }
216  void SetIsRenderingTranslucentPolygonalGeometry(bool val) { this->InTranslucentPass = val; }
218 
219 protected:
221  ~vtkActor() override;
222 
223  // is this actor opaque
224  int GetIsOpaque();
228 
233 
234  // Bounds are cached in an actor - the MapperBounds are also cache to
235  // help know when the Bounds need to be recomputed.
236  double MapperBounds[6];
238 
239 private:
240  vtkActor(const vtkActor&) = delete;
241  void operator=(const vtkActor&) = delete;
242 };
243 
244 #endif
vtkActor::SetIsRenderingTranslucentPolygonalGeometry
void SetIsRenderingTranslucentPolygonalGeometry(bool val)
Definition: vtkActor.h:216
vtkActor::GetIsOpaque
int GetIsOpaque()
vtkActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkActor::ProcessSelectorPixelBuffers
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
vtkActor::Mapper
vtkMapper * Mapper
Definition: vtkActor.h:232
vtkActor::GetSupportsSelection
bool GetSupportsSelection() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkActor::GetProperty
vtkProperty * GetProperty()
Set/Get the property object that controls this actors surface properties.
vtkActor::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:44
vtkActor::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of an actor.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkActor::SetTexture
virtual void SetTexture(vtkTexture *)
Set/Get the texture object to control rendering texture maps.
vtkActor::BoundsMTime
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:237
vtkActor::Property
vtkProperty * Property
Definition: vtkActor.h:229
vtkActor::BackfaceProperty
vtkProperty * BackfaceProperty
Definition: vtkActor.h:230
vtkProp3D::GetBounds
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
vtkActor::MakeProperty
virtual vtkProperty * MakeProperty()
Create a new property suitable for use with this type of Actor.
vtkActor::Texture
vtkTexture * Texture
Definition: vtkActor.h:231
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkActor::~vtkActor
~vtkActor() override
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:66
vtkActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
vtkActor::GetMTime
vtkMTimeType GetMTime() override
Get the actors mtime plus consider its properties and texture if set.
vtkActor::New
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,...
vtkActor::IsRenderingTranslucentPolygonalGeometry
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:215
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:82
vtkHardwareSelector
Definition: vtkHardwareSelector.h:124
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkActor::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkProp::GetBounds
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:135
vtkActor::ForceTranslucent
bool ForceTranslucent
Definition: vtkActor.h:226
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:45
vtkActor::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
vtkActor::SetBackfaceProperty
void SetBackfaceProperty(vtkProperty *lut)
Set/Get the property object that controls this actors backface surface properties.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
vtkActor::GetRedrawMTime
vtkMTimeType GetRedrawMTime() override
Return the mtime of anything that would cause the rendered image to appear differently.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkActorCollection
an ordered list of actors
Definition: vtkActorCollection.h:37
vtkActor::HasOpaqueGeometry
vtkTypeBool HasOpaqueGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
vtkActor::SetProperty
void SetProperty(vtkProperty *lut)
Set/Get the property object that controls this actors surface properties.
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:62
vtkActor::SetMapper
virtual void SetMapper(vtkMapper *)
This is the method that is used to connect an actor to the end of a visualization pipeline,...
vtkActor::vtkActor
vtkActor()
vtkActor::InTranslucentPass
bool InTranslucentPass
Definition: vtkActor.h:227
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:36
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkActor::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkActor::ForceOpaque
bool ForceOpaque
Definition: vtkActor.h:225
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkActor::Render
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:87
vtkProp3D.h