VTK
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;
70  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
72 
74 
78  vtkTypeBool HasOpaqueGeometry() override;
80 
87  virtual void Render(vtkRenderer*, vtkMapper*) {}
88 
92  void ShallowCopy(vtkProp* prop) override;
93 
99  void ReleaseGraphicsResources(vtkWindow*) override;
100 
102 
109  void SetProperty(vtkProperty* lut);
110  vtkProperty* GetProperty();
112 
118  virtual vtkProperty* MakeProperty();
119 
121 
127  void SetBackfaceProperty(vtkProperty* lut);
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 
184  vtkMTimeType GetRedrawMTime() override;
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:
220  vtkActor();
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::Mapper
vtkMapper * Mapper
Definition: vtkActor.h:232
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkProp::GetSupportsSelection
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:411
vtkProp3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkProp::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:215
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
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkActor::Texture
vtkTexture * Texture
Definition: vtkActor.h:231
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkProp::HasTranslucentPolygonalGeometry
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:279
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:65
vtkProp::GetActors
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:58
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkActor::IsRenderingTranslucentPolygonalGeometry
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:215
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:80
vtkHardwareSelector
Definition: vtkHardwareSelector.h:123
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkProp3D::GetMTime
vtkMTimeType GetMTime() override
Get the vtkProp3D's mtime.
vtkProp::GetBounds
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:126
vtkActor::ForceTranslucent
bool ForceTranslucent
Definition: vtkActor.h:226
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:216
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkProp3D::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:58
vtkActorCollection
an ordered list of actors
Definition: vtkActorCollection.h:36
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:417
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:61
vtkProp::HasOpaqueGeometry
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:292
vtkActor::InTranslucentPass
bool InTranslucentPass
Definition: vtkActor.h:227
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:108
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:300
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkActor::ForceOpaque
bool ForceOpaque
Definition: vtkActor.h:225
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
vtkActor::Render
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:87
vtkProp3D.h