AGXDynamics  2.35.0.3
SimulationDrawable.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, is 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 AGXOSG_SIMULATIONDRAWABLE_H
18 #define AGXOSG_SIMULATIONDRAWABLE_H
19 
20 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
21 #include <osg/Drawable>
22 #include <osgViewer/Viewer>
23 #include <osg/Version>
24 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
25 
26 #include <agxOSG/export.h>
27 #include <agx/Task.h>
28 #include <agx/observer_ptr.h>
29 #include <agxSDK/Simulation.h>
30 
31 namespace agxOSG
32 {
33  class AGXOSG_EXPORT SimulationDrawable : public osg::Drawable
34  {
35  public:
36 
38  SimulationDrawable( const SimulationDrawable&c, const osg::CopyOp& copyOp );
39 
40  virtual osg::Object* cloneType() const { return new SimulationDrawable ( m_simulation.get() ); }
41  virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new SimulationDrawable (*this,copyop); }
42  virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const SimulationDrawable *>(obj)!=nullptr; }
43  virtual const char* libraryName() const { return "agxOSG"; }
44  virtual const char* className() const { return "SimulationDrawable"; }
45 
46 
48 # if OSG_VERSION_GREATER_OR_EQUAL(3,4,0)
49  virtual osg::BoundingSphere computeBound() const;
50  virtual osg::BoundingBox computeBoundingBox() const;
51 #else
52  virtual osg::BoundingBox computeBound() const;
53 #endif
54 
56  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
57 
58  protected:
59  virtual ~SimulationDrawable() {}
60 
61 
63  // mutable osg::BoundingBox m_bbox;
64  };
65 
66 }
67 
68 
69 #endif /* AGXOSG_SIMULATIONDRAWABLE_H */
agxOSG::SimulationDrawable::libraryName
virtual const char * libraryName() const
Definition: SimulationDrawable.h:43
Simulation.h
Task.h
agxOSG::SimulationDrawable::clone
virtual osg::Object * clone(const osg::CopyOp &copyop) const
Definition: SimulationDrawable.h:41
agx::observer_ptr< Simulation >
agxOSG::SimulationDrawable
Definition: SimulationDrawable.h:33
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxOSG::SimulationDrawable::cloneType
virtual osg::Object * cloneType() const
Definition: SimulationDrawable.h:40
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
agxOSG::SimulationDrawable::isSameKindAs
virtual bool isSameKindAs(const osg::Object *obj) const
Definition: SimulationDrawable.h:42
agxOSG::SimulationDrawable::className
virtual const char * className() const
Definition: SimulationDrawable.h:44
observer_ptr.h
export.h
agxOSG::SimulationDrawable::~SimulationDrawable
virtual ~SimulationDrawable()
Definition: SimulationDrawable.h:59
agxOSG::SimulationDrawable::m_simulation
agxSDK::SimulationObserver m_simulation
Definition: SimulationDrawable.h:62
AGXOSG_EXPORT
#define AGXOSG_EXPORT
PopDisableWarnings.h