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 =========================================================================*/
38 #ifndef vtkActor_h
39 #define vtkActor_h
40 
41 #include "vtkRenderingCoreModule.h" // For export macro
42 #include "vtkProp3D.h"
43 
44 class vtkRenderer;
45 class vtkPropCollection;
46 class vtkActorCollection;
47 class vtkTexture;
48 class vtkMapper;
49 class vtkProperty;
50 
51 class VTKRENDERINGCORE_EXPORT vtkActor : public vtkProp3D
52 {
53 public:
54  vtkTypeMacro(vtkActor, vtkProp3D);
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
62  static vtkActor *New();
63 
69  void GetActors(vtkPropCollection *) override;
70 
72 
75  int RenderOpaqueGeometry(vtkViewport *viewport) override;
76  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
78 
82  int HasTranslucentPolygonalGeometry() override;
83 
90  virtual void Render(vtkRenderer *, vtkMapper *) {}
91 
95  void ShallowCopy(vtkProp *prop) override;
96 
102  void ReleaseGraphicsResources(vtkWindow *) override;
103 
105 
112  void SetProperty(vtkProperty *lut);
113  vtkProperty *GetProperty();
115 
121  virtual vtkProperty* MakeProperty();
122 
124 
130  void SetBackfaceProperty(vtkProperty *lut);
131  vtkGetObjectMacro(BackfaceProperty,vtkProperty);
133 
135 
140  virtual void SetTexture(vtkTexture*);
141  vtkGetObjectMacro(Texture, vtkTexture);
143 
150  virtual void SetMapper(vtkMapper *);
151 
153 
156  vtkGetObjectMacro(Mapper, vtkMapper);
158 
163  using Superclass::GetBounds;
164  double *GetBounds() override;
165 
174  virtual void ApplyProperties() {}
175 
179  vtkMTimeType GetMTime() override;
180 
187  vtkMTimeType GetRedrawMTime() override;
188 
190 
193  vtkGetMacro(ForceOpaque, bool);
194  vtkSetMacro(ForceOpaque, bool);
195  vtkBooleanMacro(ForceOpaque, bool);
196  vtkGetMacro(ForceTranslucent, bool);
197  vtkSetMacro(ForceTranslucent, bool);
198  vtkBooleanMacro(ForceTranslucent, bool);
200 
207  bool GetSupportsSelection() override;
208 
209 protected:
210  vtkActor();
211  ~vtkActor() override;
212 
213  // is this actor opaque
214  int GetIsOpaque();
217 
222 
223  // Bounds are cached in an actor - the MapperBounds are also cache to
224  // help know when the Bounds need to be recomputed.
225  double MapperBounds[6];
227 
228 private:
229  vtkActor(const vtkActor&) = delete;
230  void operator=(const vtkActor&) = delete;
231 };
232 
233 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:90
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:226
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract specification for Viewports
Definition: vtkViewport.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:65
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:222
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:294
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkProperty * Property
Definition: vtkActor.h:218
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:411
abstract specification for renderers
Definition: vtkRenderer.h:63
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
vtkTexture * Texture
Definition: vtkActor.h:220
an ordered list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:303
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:130
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:111
a simple class to control print indentation
Definition: vtkIndent.h:39
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
bool ForceTranslucent
Definition: vtkActor.h:216
vtkProperty * BackfaceProperty
Definition: vtkActor.h:219
handles properties associated with a texture map
Definition: vtkTexture.h:71
bool ForceOpaque
Definition: vtkActor.h:215
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:83
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
an ordered list of actors
virtual void ApplyProperties()
Apply the current properties to all parts that compose this actor.
Definition: vtkActor.h:174
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMapper * Mapper
Definition: vtkActor.h:221
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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:61
vtkMTimeType GetMTime() override
Get the vtkProp3D's mtime.