VTK  9.2.20230207
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 =========================================================================*/
147 #ifndef vtkActor_h
148 #define vtkActor_h
149 
150 #include "vtkProp3D.h"
151 #include "vtkRenderingCoreModule.h" // For export macro
152 
153 VTK_ABI_NAMESPACE_BEGIN
154 class vtkRenderer;
155 class vtkPropCollection;
156 class vtkActorCollection;
157 class vtkTexture;
158 class vtkMapper;
159 class vtkProperty;
160 
161 class VTKRENDERINGCORE_EXPORT vtkActor : public vtkProp3D
162 {
163 public:
164  vtkTypeMacro(vtkActor, vtkProp3D);
165  void PrintSelf(ostream& os, vtkIndent indent) override;
166 
172  static vtkActor* New();
173 
179  void GetActors(vtkPropCollection*) override;
180 
182 
185  int RenderOpaqueGeometry(vtkViewport* viewport) override;
188 
190 
196 
203  virtual void Render(vtkRenderer*, vtkMapper*) {}
204 
208  void ShallowCopy(vtkProp* prop) override;
209 
216 
218 
228 
235 
237 
244  vtkGetObjectMacro(BackfaceProperty, vtkProperty);
246 
248 
253  virtual void SetTexture(vtkTexture*);
254  vtkGetObjectMacro(Texture, vtkTexture);
256 
263  virtual void SetMapper(vtkMapper*);
264 
266 
269  vtkGetObjectMacro(Mapper, vtkMapper);
271 
276  using Superclass::GetBounds;
277  double* GetBounds() VTK_SIZEHINT(6) override;
278 
287  virtual void ApplyProperties() {}
288 
292  vtkMTimeType GetMTime() override;
293 
301 
303 
306  vtkGetMacro(ForceOpaque, bool);
307  vtkSetMacro(ForceOpaque, bool);
308  vtkBooleanMacro(ForceOpaque, bool);
309  vtkGetMacro(ForceTranslucent, bool);
310  vtkSetMacro(ForceTranslucent, bool);
311  vtkBooleanMacro(ForceTranslucent, bool);
313 
320  bool GetSupportsSelection() override;
321 
327  vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets) override;
328 
330  // Get if we are in the translucent polygonal geometry pass
331  bool IsRenderingTranslucentPolygonalGeometry() override { return this->InTranslucentPass; }
332  void SetIsRenderingTranslucentPolygonalGeometry(bool val) { this->InTranslucentPass = val; }
334 
335 protected:
337  ~vtkActor() override;
338 
339  // is this actor opaque
340  int GetIsOpaque();
344 
349 
350  // Bounds are cached in an actor - the MapperBounds are also cache to
351  // help know when the Bounds need to be recomputed.
352  double MapperBounds[6];
354 
355 private:
356  vtkActor(const vtkActor&) = delete;
357  void operator=(const vtkActor&) = delete;
358 };
359 
360 VTK_ABI_NAMESPACE_END
361 #endif
an ordered list of actors
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
void SetProperty(vtkProperty *lut)
Set/Get the property object that controls this actors surface properties.
virtual vtkProperty * MakeProperty()
Create a new property suitable for use with this type of Actor.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetRedrawMTime() override
Return the mtime of anything that would cause the rendered image to appear differently.
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:203
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
virtual void SetMapper(vtkMapper *)
This is the method that is used to connect an actor to the end of a visualization pipeline,...
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
vtkMTimeType GetMTime() override
Get the actors mtime plus consider its properties and texture if set.
bool InTranslucentPass
Definition: vtkActor.h:343
vtkProperty * GetProperty()
Set/Get the property object that controls this actors surface properties.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkProperty * BackfaceProperty
Definition: vtkActor.h:346
void SetBackfaceProperty(vtkProperty *lut)
Set/Get the property object that controls this actors backface surface properties.
vtkTypeBool HasOpaqueGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
~vtkActor() override
vtkTimeStamp BoundsMTime
Definition: vtkActor.h:353
bool ForceOpaque
Definition: vtkActor.h:341
bool IsRenderingTranslucentPolygonalGeometry() override
Definition: vtkActor.h:331
vtkTexture * Texture
Definition: vtkActor.h:347
vtkProperty * Property
Definition: vtkActor.h:345
int GetIsOpaque()
vtkMapper * Mapper
Definition: vtkActor.h:348
bool ForceTranslucent
Definition: vtkActor.h:342
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
void ShallowCopy(vtkProp *prop) override
Shallow copy of an actor.
virtual void SetTexture(vtkTexture *)
Set/Get the texture object to control rendering texture maps.
bool GetSupportsSelection() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetIsRenderingTranslucentPolygonalGeometry(bool val)
Definition: vtkActor.h:332
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:178
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:100
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:77
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:155
represent surface properties of a geometric object
Definition: vtkProperty.h:178
abstract specification for renderers
Definition: vtkRenderer.h:183
handles properties associated with a texture map
Definition: vtkTexture.h:179
record modification and/or execution time
Definition: vtkTimeStamp.h:56
abstract specification for Viewports
Definition: vtkViewport.h:57
window superclass for vtkRenderWindow
Definition: vtkWindow.h:40
int vtkTypeBool
Definition: vtkABI.h:71
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:282
#define VTK_SIZEHINT(...)