AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Renderable.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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
virtual void addNotification()
Called when this Renderable is added to a RenderManager.
Definition: Renderable.h:78
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Base class providing referencing counted objects.
Definition: Referenced.h:113
Inherit from this class and implement the render() method to make it it self during debug rendering...
Definition: Renderable.h:38
virtual void removeNotification()
Called when this Renderable is removed from a RenderManager.
Definition: Renderable.h:81
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:121
bool isEnabled() const
Definition: Renderable.h:54