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 "vtkProp3D.h"
42 #include "vtkRenderingCoreModule.h" // For export macro
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 
80 
84  vtkTypeBool HasOpaqueGeometry() override;
86 
93  virtual void Render(vtkRenderer *, vtkMapper *) {}
94 
98  void ShallowCopy(vtkProp *prop) override;
99 
105  void ReleaseGraphicsResources(vtkWindow *) override;
106 
108 
115  void SetProperty(vtkProperty *lut);
116  vtkProperty *GetProperty();
118 
124  virtual vtkProperty* MakeProperty();
125 
127 
133  void SetBackfaceProperty(vtkProperty *lut);
134  vtkGetObjectMacro(BackfaceProperty,vtkProperty);
136 
138 
143  virtual void SetTexture(vtkTexture*);
144  vtkGetObjectMacro(Texture, vtkTexture);
146 
153  virtual void SetMapper(vtkMapper *);
154 
156 
159  vtkGetObjectMacro(Mapper, vtkMapper);
161 
166  using Superclass::GetBounds;
167  double *GetBounds() VTK_SIZEHINT(6) override;
168 
177  virtual void ApplyProperties() {}
178 
182  vtkMTimeType GetMTime() override;
183 
190  vtkMTimeType GetRedrawMTime() override;
191 
193 
196  vtkGetMacro(ForceOpaque, bool);
197  vtkSetMacro(ForceOpaque, bool);
198  vtkBooleanMacro(ForceOpaque, bool);
199  vtkGetMacro(ForceTranslucent, bool);
200  vtkSetMacro(ForceTranslucent, bool);
201  vtkBooleanMacro(ForceTranslucent, bool);
203 
210  bool GetSupportsSelection() override;
211 
217  vtkHardwareSelector *sel,
218  std::vector<unsigned int> &pixeloffsets) override;
219 
221  // Get if we are in the translucent polygonal geometry pass
223  return this->InTranslucentPass; };
225  this->InTranslucentPass = val; };
227 
228 protected:
229  vtkActor();
230  ~vtkActor() override;
231 
232  // is this actor opaque
233  int GetIsOpaque();
237 
242 
243  // Bounds are cached in an actor - the MapperBounds are also cache to
244  // help know when the Bounds need to be recomputed.
245  double MapperBounds[6];
247 
248 private:
249  vtkActor(const vtkActor&) = delete;
250  void operator=(const vtkActor&) = delete;
251 };
252 
253 #endif
vtkActor::SetIsRenderingTranslucentPolygonalGeometry
void SetIsRenderingTranslucentPolygonalGeometry(bool val)
Definition: vtkActor.h:224
vtkActor::Mapper
vtkMapper * Mapper
Definition: vtkActor.h:241
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
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:425
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:35
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:222
vtkActor::BoundsMTime
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:246
vtkActor::Property
vtkProperty * Property
Definition: vtkActor.h:238
vtkActor::BackfaceProperty
vtkProperty * BackfaceProperty
Definition: vtkActor.h:239
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:240
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:294
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:71
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:61
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkActor::IsRenderingTranslucentPolygonalGeometry
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:222
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:86
vtkHardwareSelector
Definition: vtkHardwareSelector.h:123
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
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:130
vtkActor::ForceTranslucent
bool ForceTranslucent
Definition: vtkActor.h:235
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkProp3D::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkActorCollection
an ordered list of actors
Definition: vtkActorCollection.h:39
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:432
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:67
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:308
vtkActor::InTranslucentPass
bool InTranslucentPass
Definition: vtkActor.h:236
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:38
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:111
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:317
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkActor::ForceOpaque
bool ForceOpaque
Definition: vtkActor.h:234
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
vtkActor::Render
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:93
vtkProp3D.h