AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
RenderTaskDrawable.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#ifndef AGXOSG_RENDERTASKDRAWABLE
17#define AGXOSG_RENDERTASKDRAWABLE
18
19#include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
20#include <osg/Drawable>
21#include <osg/Version>
22#include <agx/PopDisableWarnings.h> // End of disabled warnings.
23
24
25#include <agxOSG/export.h>
26#include <agx/Task.h>
27#include <agx/observer_ptr.h>
28
29namespace agxOSG {
30
31class ParticleDrawableCallback;
32
33 class AGXOSG_EXPORT RenderTaskDrawable : public osg::Drawable
34 {
35 public:
36
38 RenderTaskDrawable( const RenderTaskDrawable&c, const osg::CopyOp& copyOp );
39
41 void setDrawable(osg::Drawable *drawable ) { m_drawable = drawable; }
42
44 osg::Drawable *getDrawable( ) { return m_drawable.get(); }
45
46 virtual osg::Object* cloneType() const { return new RenderTaskDrawable ( m_renderTask ); }
47 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new RenderTaskDrawable (*this,copyop); }
48 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderTaskDrawable *>(obj)!=nullptr; }
49 virtual const char* libraryName() const { return "agxOSG"; }
50 virtual const char* className() const { return "RenderTaskDrawable"; }
51
52
54# if OSG_VERSION_GREATER_OR_EQUAL(3,4,0)
55 virtual osg::BoundingSphere computeBound() const;
56 virtual osg::BoundingBox computeBoundingBox() const;
57#else
58 virtual osg::BoundingBox computeBound() const;
59#endif
60
62 virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
63
64 protected:
65 friend class ParticleDrawableCallback;
67
68
69 osg::ref_ptr<osg::Drawable> m_drawable;
71 mutable osg::BoundingBox m_bbox;
72 };
73}
74#endif
#define AGXOSG_EXPORT
RenderTaskDrawable(const RenderTaskDrawable &c, const osg::CopyOp &copyOp)
virtual const char * className() const
agx::observer_ptr< agx::Task > m_renderTask
void setDrawable(osg::Drawable *drawable)
Set the drawable that will be drawn for each particle.
virtual osg::Object * clone(const osg::CopyOp &copyop) const
RenderTaskDrawable(agx::Task *renderTask)
virtual osg::Object * cloneType() const
virtual osg::BoundingBox computeBound() const
Compute the bounding box around Drawables's geometry.
virtual const char * libraryName() const
virtual bool isSameKindAs(const osg::Object *obj) const
osg::ref_ptr< osg::Drawable > m_drawable
osg::Drawable * getDrawable()
Return the drawable that will be drawn for each particle.
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
The actual draw method for the particle system.
A representation of a generic task.
Definition: Task.h:57
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:61
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.