AGX Dynamics  2.38.0.2
SoilParticleSystemDrawable.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #pragma once
18 
19 #include <agx/config/AGX_USE_AGXTERRAIN.h>
20 #if AGX_USE_AGXTERRAIN()
21 
22 
23 #include <agxOSG/export.h>
24 
25 #include <agxTerrain/Terrain.h>
26 
27 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
28 #include <osg/Drawable>
29 #include <osg/Version>
30 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
31 
32 namespace agxOSG
33 {
37  class AGXOSG_EXPORT SoilParticleSystemDrawable : public osg::Drawable
38  {
39  public:
41 
42  void setEnable(bool enable);
43  bool getEnable() const;
44 
48  bool isInitialized() const;
49 
50  virtual osg::Object* cloneType() const { return new SoilParticleSystemDrawable(m_terrain); }
51  virtual osg::Object* clone(const osg::CopyOp&) const { return new SoilParticleSystemDrawable(*this); }
52  virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const SoilParticleSystemDrawable *>(obj) != nullptr; }
53  virtual const char* libraryName() const { return "agxOSG"; }
54  virtual const char* className() const { return "SoilParticleSystemDrawable"; }
55 
57 #if OSG_VERSION_GREATER_OR_EQUAL(3,4,0)
58  virtual osg::BoundingSphere computeBound() const;
59  virtual osg::BoundingBox computeBoundingBox() const;
60 #else
61  virtual osg::BoundingBox computeBound() const;
62 #endif
63 
65  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
66 
67  agx::ParticleSystem* getParticleSystem();
68 
69  public:
70  void onAddNotification( agxSDK::Simulation* simulation );
71  void onRemoveNotification( agxSDK::Simulation* simulation );
72 
73  protected:
74  virtual ~SoilParticleSystemDrawable();
75 
77  // Variables
79  protected:
81  osg::Group* m_group;
83  bool m_enable;
84  };
85 }
86 #endif
agxTerrain::Terrain
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:85
agxOSG::SoilParticleSystemDrawable::m_terrain
agxTerrain::TerrainRef m_terrain
Definition: SoilParticleSystemDrawable.h:80
agxOSG::SoilParticleSystemDrawable::className
virtual const char * className() const
Definition: SoilParticleSystemDrawable.h:54
agxOSG::SoilParticleSystemDrawable::isSameKindAs
virtual bool isSameKindAs(const osg::Object *obj) const
Definition: SoilParticleSystemDrawable.h:52
agxOSG::SoilParticleSystemDrawable::cloneType
virtual osg::Object * cloneType() const
Definition: SoilParticleSystemDrawable.h:50
agxOSG::SoilParticleSystemDrawable::libraryName
virtual const char * libraryName() const
Definition: SoilParticleSystemDrawable.h:53
agx::ParticleSystem
A basic particle system that contains all the storages and buffers required for basic operation and a...
Definition: ParticleSystem.h:67
agxOSG::SoilParticleSystemDrawable::m_renderTask
agx::TaskGroupRef m_renderTask
Definition: SoilParticleSystemDrawable.h:82
agx::ref_ptr< Terrain >
agx::isInitialized
bool AGXPHYSICS_EXPORT isInitialized()
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
agxOSG::SoilParticleSystemDrawable::m_group
osg::Group * m_group
Definition: SoilParticleSystemDrawable.h:81
export.h
agxOSG::SoilParticleSystemDrawable::m_enable
bool m_enable
Definition: SoilParticleSystemDrawable.h:83
Terrain.h
agxOSG::SoilParticleSystemDrawable
Internal drawable class for drawing the Voxel grid structure.
Definition: SoilParticleSystemDrawable.h:37
agxOSG::SoilParticleSystemDrawable::clone
virtual osg::Object * clone(const osg::CopyOp &) const
Definition: SoilParticleSystemDrawable.h:51
AGXOSG_EXPORT
#define AGXOSG_EXPORT
PopDisableWarnings.h