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 "vtkRenderingCoreModule.h" // For export macro
36 #include "vtkProp3D.h"
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 
76  int HasTranslucentPolygonalGeometry() override;
77 
84  virtual void Render(vtkRenderer *, vtkMapper *) {}
85 
89  void ShallowCopy(vtkProp *prop) override;
90 
96  void ReleaseGraphicsResources(vtkWindow *) override;
97 
99 
106  void SetProperty(vtkProperty *lut);
107  vtkProperty *GetProperty();
109 
115  virtual vtkProperty* MakeProperty();
116 
118 
124  void SetBackfaceProperty(vtkProperty *lut);
125  vtkGetObjectMacro(BackfaceProperty,vtkProperty);
127 
129 
134  virtual void SetTexture(vtkTexture*);
135  vtkGetObjectMacro(Texture, vtkTexture);
137 
144  virtual void SetMapper(vtkMapper *);
145 
147 
150  vtkGetObjectMacro(Mapper, vtkMapper);
152 
157  using Superclass::GetBounds;
158  double *GetBounds() VTK_SIZEHINT(6) override;
159 
168  virtual void ApplyProperties() {}
169 
173  vtkMTimeType GetMTime() override;
174 
181  vtkMTimeType GetRedrawMTime() override;
182 
184 
187  vtkGetMacro(ForceOpaque, bool);
188  vtkSetMacro(ForceOpaque, bool);
189  vtkBooleanMacro(ForceOpaque, bool);
190  vtkGetMacro(ForceTranslucent, bool);
191  vtkSetMacro(ForceTranslucent, bool);
192  vtkBooleanMacro(ForceTranslucent, bool);
194 
201  bool GetSupportsSelection() override;
202 
208  vtkHardwareSelector *sel,
209  std::vector<unsigned int> &pixeloffsets) override;
210 
211 protected:
212  vtkActor();
213  ~vtkActor() override;
214 
215  // is this actor opaque
216  int GetIsOpaque();
219 
224 
225  // Bounds are cached in an actor - the MapperBounds are also cache to
226  // help know when the Bounds need to be recomputed.
227  double MapperBounds[6];
229 
230 private:
231  vtkActor(const vtkActor&) = delete;
232  void operator=(const vtkActor&) = delete;
233 };
234 
235 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:46
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:84
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:228
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:60
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:218
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:290
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkProperty * Property
Definition: vtkActor.h:220
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:407
abstract specification for renderers
Definition: vtkRenderer.h:57
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkTexture * Texture
Definition: vtkActor.h:222
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:299
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:126
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:107
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:414
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
bool ForceTranslucent
Definition: vtkActor.h:218
vtkProperty * BackfaceProperty
Definition: vtkActor.h:221
handles properties associated with a texture map
Definition: vtkTexture.h:65
bool ForceOpaque
Definition: vtkActor.h:217
#define VTK_SIZEHINT(...)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:80
an ordered list of actors
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMapper * Mapper
Definition: vtkActor.h:223
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:220
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:57
vtkMTimeType GetMTime() override
Get the vtkProp3D's mtime.