17 #ifndef AGXOSG_FRAME_TRAJECTORY_DRAWABLE_H 18 #define AGXOSG_FRAME_TRAJECTORY_DRAWABLE_H 21 #include <osg/Drawable> 22 #include <osgViewer/Viewer> 23 #include <osg/Version> 36 typedef std::deque<agx::Vec3> PositionBuffer;
37 typedef std::deque<agx::Vec4f> ColorsBuffer;
38 typedef std::pair<PositionBuffer, ColorsBuffer> TrajectoryData;
49 virtual const char*
className()
const {
return "FrameTrajectoryDrawable"; }
53 # if OSG_VERSION_GREATER_OR_EQUAL(3,4,0) 54 virtual osg::BoundingSphere computeBound()
const;
55 virtual osg::BoundingBox computeBoundingBox()
const;
57 virtual osg::BoundingBox computeBound()
const;
61 virtual void drawImplementation(osg::RenderInfo& renderInfo)
const;
64 void updateTrajectories();
67 void setNumTrajectoryPositions(
agx::UInt num);
70 agx::UInt getNumTrajectoryPositions()
const;
73 void setDefaultTrajectoryColor(
const agx::Vec4f& color);
76 void resetTrajectories();
88 void setEnable(
bool enable);
91 bool getEnable()
const;
99 void updateKernelBuffers();
101 void popOldPositionsInDeadTrajectories();
virtual bool isSameKindAs(const osg::Object *obj) const
agxSDK::Simulation * getSimulation()
Get the simulation related to the drawable.
agxData::BufferRef m_countBuffer
bool getEnable() const
Return true of the drawable is enabled.
agxSDK::SimulationObserver m_simulation
A class holding 4 dimensional vectors and providing basic arithmetic.
void setDefaultTrajectoryColor(const agx::Vec4f &color)
Set default color of trajectories.
virtual const char * libraryName() const
#define AGX_DECLARE_POINTER_TYPES(type)
virtual osg::Object * clone(const osg::CopyOp &) const
virtual const char * className() const
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agx::TaskGroupRef m_renderTask
agx::Vector< TrajectoryData > m_destroyedTrajectories
void setEnable(bool enable)
Enable the drawable.
agx::Vector< std::tuple< agx::FrameRef, agx::Vec4f, TrajectoryData > > m_activeTrajectories
The object defining a frame of reference and providing transformations operations.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
agx::Vec4f m_defaultTrajectoryColor
virtual osg::Object * cloneType() const
agx::UInt getNumTrajectoryPositions() const
Get the number of positions used in the trajectories.
agxData::BufferRef m_colorBuffer
Inheritance with partial specialization due to bug with ref_ptr containers.
agxData::BufferRef m_firstsBuffer
agxData::BufferRef m_verticesBuffer