17 #ifndef AGXQT_QTOSGUTILS_H 18 #define AGXQT_QTOSGUTILS_H 20 #include <agx/config/AGX_USE_KEYSHOT.h> 23 #include <agxQt/ui_RenderController.h> 25 #include <osgViewer/ViewerEventHandlers> 27 #include <osgViewer/Renderer> 28 #include <osgSim/ColorRange> 29 #include <osgSim/ScalarsToColors> 77 bool getEnable()
const;
79 void setEnable(
bool enable);
81 bool getEnableRendering()
const;
83 void setEnableRendering(
bool enable);
90 void incrementClipPlane();
93 void decrementClipPlane();
96 void updateClipPlaneFromIncrement(
agx::Real increment );
125 void setMaxPositionPoints(
agx::UInt posPoints );
129 void setEnable(
bool enable );
131 bool getEnable()
const;
139 void resetTrajectoires();
169 void setEnable(
bool enable);
171 bool getEnable()
const;
175 void setMinNetworkForce(
agx::Real minForce);
179 void setMaxNetworkForce(
agx::Real minForce);
192 AGX_FORCE_INLINE void ParticleContactGraphRenderer::setEnable(
bool enable) { m_graphDrawable->setEnable(enable); }
194 AGX_FORCE_INLINE bool ParticleContactGraphRenderer::getEnable()
const {
return m_graphDrawable->getEnable(); }
228 void setParticleColorModeFromName(
const agx::String& mode);
236 void setMaxColorScalar(
agx::Real maxVel);
238 void setMinColorScalar(
agx::Real minVel);
246 void setLimitColoringToAnalysisBound(
bool enable);
248 bool getLimitColoringToAnalysisBound()
const;
250 void setShowColorLegend(
bool enable,
int width,
int height);
252 void setShowColorLegend(
bool enable);
254 void updateColorLegend(
int width,
int height);
256 void refreshColorLegend();
258 bool getShowColorLegend()
const;
260 void setEnableParticleRendering(
bool enable);
262 bool getEnableParticleRendering()
const;
270 void addCustomColorers();
272 bool hasOpenColorLegend()
const;
274 void resetParticleFilteredState();
282 void resetAlphaOnColors();
284 void setAlphaOnParticles(
agx::Real alpha);
286 void removeColorLegend();
319 AGX_FORCE_INLINE void ParticleSystemRenderUtility::setLimitColoringToAnalysisBound(
bool enable) { m_particleColorerManager->setLimitInBound(enable); }
321 AGX_FORCE_INLINE bool ParticleSystemRenderUtility::getLimitColoringToAnalysisBound()
const {
return m_particleColorerManager->getLimitInBound(); }
325 if (m_particleColorerManager)
326 return m_particleColorerManager->getMinScalar();
333 if (m_particleColorerManager)
334 return m_particleColorerManager->getMaxScalar();
339 AGX_FORCE_INLINE bool ParticleSystemRenderUtility::getEnableParticleRendering()
const {
return m_psDrawable !=
nullptr && m_psDrawable->getEnable(); }
341 AGX_FORCE_INLINE void ParticleSystemRenderUtility::setEnableParticleRendering(
bool enable) {
if( m_psDrawable !=
nullptr ) m_psDrawable->setEnable(enable); }
351 #if AGX_USE_KEYSHOT() 355 class KeyShotParticleDumper
357 KeyShotParticleDumper();
362 static void exportCurrentJournalFrameToBip(
int frame,
agx::UInt m_numTrajectoryPositions
agxOSG::ParticleContactGraphDrawable * m_graphDrawable
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
osg::Geode * createCubeLines(const agx::Vec3 &position, const agx::Vec3 &boxhalfVec3)
agx::ParticleSystem * m_system
Derive from this class to implement a listener for simulation Step events.
This utility class is used for post processing of the particle system drawable representation, such as alpha rendering and velocity color.
agxQt::QtAgxWrapper * m_qtAgxWrapper
osg::ref_ptr< agxOSG::ParticleTrajectoriesDrawable > m_particleTrajectoryDrawable
agx::ParticleSystem * m_particleSystem
osg::ref_ptr< agxQt::GranularImpactsDrawable > m_impactsDrawable
Contains classes/utility functions for connecting AGX to QT with OSG.
#define AGX_DECLARE_POINTER_TYPES(type)
This class wraps the ClipPlane functionality of osg together with a clip node and a clip plane...
agx::ParticleSystem * m_particleSystem
osg::observer_ptr< osg::Group > m_root
Base class providing referencing counted objects.
osg::observer_ptr< osg::Group > m_root
agxOSG::ParticleSystemDrawable * m_psDrawable
A basic particle system that contains all the storages and buffers required for basic operation and a...
osg::Geode * createPlaneLines(const agx::Vec3 &position, const agx::Vec3 &normal, agx::Real size)
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
osg::ref_ptr< osg::Geode > m_trajectoryGeode
Class that can be used to extract data from elements in a simulation within a specified bound...
ParticleColorerManagerRef m_particleColorerManager
osg::ref_ptr< agxOSG::RigidBodyTrajectoryDrawable > m_RBTrajectorydrawable
ParticleRenderFilterManagerRef m_particleRenderFilterManager
Class that describes an abstract camera and it's properties.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Class that is used to manipulate the clip plane in the scene.
ParticleContactGraphRendererRef m_particleContactGraphRenderer
AGXCORE_EXPORT Component * root()
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
osg::Geode * createCube(const agx::Vec3 &position, const agx::Vec3 &boxhalfVec3)
osg::ref_ptr< osg::Group > m_hudGroup
osg::observer_ptr< osg::Group > m_root
agxOSG::ClipPlane * m_clipPlane