AGX Dynamics  2.35.0.1
Renderable.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXRENDER_RENDERABLE_H
18 #define AGXRENDER_RENDERABLE_H
19 
20 
21 #include <agx/agxPhysics_export.h>
22 #include <agx/Referenced.h>
23 #include <agx/Referenced.h>
24 
25 namespace agxSDK
26 {
27  class Simulation;
28 }
29 
30 namespace agxRender
31 {
32 
33  class RenderManager;
34 
36 
39  {
40  public:
41  Renderable() : m_simulation( nullptr ), m_enable( true ) {}
42 
44  virtual void render( agxRender::RenderManager* mgr ) = 0;
45 
49  bool getEnable() const;
50 
54  inline bool isEnabled() const { return getEnable(); }
55 
59  void setEnable( bool enable );
60 
61  protected:
62 
64  virtual ~Renderable();
65 
66  friend class RenderManager;
67 
70 
73 
75  void setSimulation( agxSDK::Simulation* simulation );
76 
78  virtual void addNotification() {}
79 
81  virtual void removeNotification() {}
82 
83  private:
84  agxSDK::Simulation* m_simulation;
85  bool m_enable;
86  };
87 }
88 
89 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXPHYSICS_EXPORT
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Inherit from this class and implement the render() method to make it it self during debug rendering.
Definition: Renderable.h:39
const agxSDK::Simulation * getSimulation() const
void setEnable(bool enable)
Enable/disable this Renderable.
bool isEnabled() const
Definition: Renderable.h:54
virtual void render(agxRender::RenderManager *mgr)=0
Pure virtual method that should implemented to render a derived class during debug rendering.
virtual void removeNotification()
Called when this Renderable is removed from a RenderManager.
Definition: Renderable.h:81
agxSDK::Simulation * getSimulation()
void setSimulation(agxSDK::Simulation *simulation)
Set the associated simulation.
bool getEnable() const
virtual ~Renderable()
Destructor.
virtual void addNotification()
Called when this Renderable is added to a RenderManager.
Definition: Renderable.h:78
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Base class providing referencing counted objects.
Definition: Referenced.h:114
Namespace containing classes for handling debug rendering of collision geometries,...
Definition: Constraint.h:36
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31