17 #ifndef AGXQT_QTOSGUTILS_H 18 #define AGXQT_QTOSGUTILS_H 20 #include <agx/config/AGX_USE_KEYSHOT.h> 37 #include <osgViewer/ViewerEventHandlers> 39 #include <osgViewer/Renderer> 40 #include <osgSim/ColorRange> 41 #include <osgSim/ScalarsToColors> 69 : legendScaleFactor{ 0.5 },
70 orientation { Orientation::HORIZONTAL },
71 enableAutoPlacement{
true },
100 bool getEnable()
const;
102 void setEnable(
bool enable);
104 bool getEnableRendering()
const;
106 void setEnableRendering(
bool enable);
113 void incrementClipPlane();
116 void decrementClipPlane();
121 void updateClipPlaneFromIncrement(
agx::Real increment );
150 void setMaxPositionPoints(
agx::UInt posPoints );
154 void setEnable(
bool enable );
156 bool getEnable()
const;
164 void resetTrajectoires();
198 void setEnable(
bool enable);
200 bool getEnable()
const;
204 void setMinNetworkForce(
agx::Real minForce);
208 void setMaxNetworkForce(
agx::Real minForce);
221 AGX_FORCE_INLINE void ParticleContactGraphRenderer::setEnable(
bool enable) { m_graphDrawable->setEnable(enable); }
223 AGX_FORCE_INLINE bool ParticleContactGraphRenderer::getEnable()
const {
return m_graphDrawable->getEnable(); }
257 void setParticleColorModeFromName(
const agx::String& mode);
265 void setMaxColorScalar(
agx::Real maxVel);
267 void setMinColorScalar(
agx::Real minVel);
275 void setLimitColoringToAnalysisBound(
bool enable);
277 bool getLimitColoringToAnalysisBound()
const;
279 void setShowColorLegend(
bool enable,
int width,
int height);
281 void setShowColorLegend(
bool enable);
283 void updateColorLegend(
int width,
int height);
285 void refreshColorLegend();
287 bool getShowColorLegend()
const;
289 void setEnableParticleRendering(
bool enable);
291 bool getEnableParticleRendering()
const;
295 void preRenderBodies();
301 void addCustomColorers();
303 bool hasOpenColorLegend()
const;
305 void resetParticleFilteredState();
313 void setLegendScaleFactor(
agx::Real scaleFactor );
325 void resetAlphaOnColors();
327 void setAlphaOnParticles(
agx::Real alpha);
329 void removeColorLegend();
365 AGX_FORCE_INLINE void ParticleSystemRenderUtility::setLimitColoringToAnalysisBound(
bool enable) { m_particleColorerManager->setLimitInBound(enable); }
367 AGX_FORCE_INLINE bool ParticleSystemRenderUtility::getLimitColoringToAnalysisBound()
const {
return m_particleColorerManager->getLimitInBound(); }
371 if (m_particleColorerManager)
372 return m_particleColorerManager->getMinScalar();
379 if (m_particleColorerManager)
380 return m_particleColorerManager->getMaxScalar();
385 AGX_FORCE_INLINE bool ParticleSystemRenderUtility::getEnableParticleRendering()
const {
return m_enableParticleRendering; }
399 #if AGX_USE_KEYSHOT() 403 class KeyShotParticleDumper
405 KeyShotParticleDumper();
410 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)
bool m_enableParticleRendering
LegendSettings m_legendSettings
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
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
agx::Real legendScaleFactor
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
osg::ref_ptr< agxOSG::ParticleSystemDrawable > m_psDrawable
Class that represents a linear scalar color map that converts a scalar interval to a specified color ...
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