AGXDynamics  2.35.0.3
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 
69  agxSDK::Simulation* getSimulation();
70 
72  const agxSDK::Simulation* getSimulation() const;
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
agxPhysics_export.h
Referenced.h
agxRender
Namespace containing classes for handling debug rendering of collision geometries,...
Definition: Constraint.h:35
agxRender::Renderable::isEnabled
bool isEnabled() const
Definition: Renderable.h:54
agxRender::Renderable::Renderable
Renderable()
Definition: Renderable.h:41
agxRender::RenderManager
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Definition: RenderManager.h:106
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxRender::Renderable::removeNotification
virtual void removeNotification()
Called when this Renderable is removed from a RenderManager.
Definition: Renderable.h:81
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agxRender::Renderable
Inherit from this class and implement the render() method to make it it self during debug rendering.
Definition: Renderable.h:38
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agxRender::Renderable::addNotification
virtual void addNotification()
Called when this Renderable is added to a RenderManager.
Definition: Renderable.h:78