17 #ifndef AGXQT_QTAGXWRAPPER_H
18 #define AGXQT_QTAGXWRAPPER_H
20 #include <agx/config/AGX_USE_LUA.h>
21 #include <agx/config/AGX_USE_PYTHON.h>
28 #include <QElapsedTimer>
29 #include <osgGA/TrackballManipulator>
30 #include <osgGA/StateSetManipulator>
31 #include <osgViewer/ViewerEventHandlers>
32 #include <osgViewer/Renderer>
43 #include <agxCFG/ConfigScript.h>
67 class QtAgxWrapperStepCallback;
76 friend class QtAgxWrapperStepCallback;
105 void setViewer(osgViewer::Viewer* viewer);
106 osgViewer::Viewer* getViewer();
109 void setScene(osg::Group* scene);
110 osg::Group* getScene();
128 void setTimeStep(
float dt);
134 static agxSDK::SimulationController* getActiveSimulation();
158 bool isSimulationRunning()
const;
251 void journalPlayback(
const std::string& journalPlaybackPath,
const std::string asessionName =
"");
276 static void setActiveSimulationController(agxSDK::SimulationController* controller);
335 osg::ref_ptr<osgGA::StateSetManipulator>
m_ssm;
A small argument parser class.
This class wraps the ClipPlane functionality of osg together with a clip node and a clip plane.
Implementation of the abstract class from the agxRender namespace, this class is responsible for crea...
Decorates a scene with a specific AGX Rendering Style.
Class that is used to manipulate the clip plane in the scene.
Manager class that acts as a wrapper container for the CameravViewset class for OSG based view system...
This utility class is used for post processing of the particle system drawable representation,...
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
std::string m_currentCaptureFolder
RigidBodyRenderCache * getRenderCache()
void setSceneDescription(const agxOSG::SceneDescription &desc)
std::string m_cfgFileName
agxQt::ParticleSystemRenderUtility * getParticleRenderUtillity()
osg::ref_ptr< osg::Group > m_postProcessRoot
osg::ref_ptr< osgGA::StateSetManipulator > m_ssm
bool writeCameraViewsToFile(const std::string &filename)
Save the active camera view set to a file.
void journalRenderLoader(agxSDK::Assembly *assembly, bool keyFrame)
void slotSetEnableShaders(bool enable)
void slotChangeDrawMode(int mode)
void signalUpdateSimulationStructure()
bool executeLuaScript(const agx::String &file, const agx::String &function)
osg::ref_ptr< agxOSG::ClipPlane > m_clipPlane
void finalizeAndResetVideoCapture()
void lockSimulationAndTriggerEvents()
agxOSG::RenderProxyFactory * m_renderProxyFactory
void slotPlaySimulation()
void handleArguments(agxIO::ArgumentParser *arguments)
void slotEnableDebugRenderMode(bool)
bool attachScripts(osg::Group *root)
osg::ref_ptr< agxOSG::SceneDecorator > m_decorator
bool journalContainsImpactData()
void initSimulationController()
agxQt::ClipPlaneController * getClipPlaneController()
agx::Real getSimulationUpdateTimeStep()
agx::AnalysisBox * getAnalysisBox()
std::string m_luaFilePath
agxQt::OsgCameraViewManager * getCameraViewManager()
Get the camera view manager.
agxSDK::SimulationControllerRef m_simulationController
void slotIncrementCamera()
agx::UInt m_journalStride
void slotSetViewFromActiveCameraDescription()
agx::String getCurrentSessionName() const
osg::ref_ptr< osg::Group > m_clipPlaneDrawable
agxQt::VideoCapture * getVideoCapture()
void setupPostProcessor()
void slotSetJournalStride(uint stride)
static agxSDK::SimulationController * getActiveSimulation()
Returns the active simulation in the wrapper. This is kind of a "hack" to let the renderer get a simu...
void slotStopSimulation()
void slotDecrementClipPlane()
std::string m_journalSessionName
void setScene(osg::Group *scene)
Returns pointer to osg structure of the scene.
void setViewer(osgViewer::Viewer *viewer)
Set the viewer to sync the simulation content to.
void slotUpdateAnalysisBoxDrawable()
void signalSimulationPause()
void handleJournalLooping()
ParticleSystemRenderUtilityRef m_particleRenderUtil
static agxSDK::SimulationController * s_activeController
osgViewer::Viewer * getViewer()
agxOSG::SceneDescription m_sceneDescription
void slotChangeSimulationTime(float)
void startCapture()
Image capturing for video.
bool init(osgViewer::Viewer *viewer, agxIO::ArgumentParser *arguments)
Init.
void journalPlayback(const std::string &journalPlaybackPath, const std::string asessionName="")
osg::ref_ptr< agxOSG::GuiEventAdapter > m_eventAdapter
osg::ref_ptr< osg::Group > m_root
agxSDK::Simulation * getSimulation()
OsgCameraViewManagerRef m_cameraManager
void slotEnableJournalLooping(bool enable)
void signalNewPlayback(float timeStart, float timeEnd, uint numFrames)
RigidBodyRenderCacheRef m_renderBodyCache
void slotHandleStopSimulation()
std::string m_pythonFilePath
osg::ref_ptr< osg::Group > m_analysisBoxDrawable
bool executeMPyScript(const agx::String &file)
void signalJournalTrackReachedEnd()
void slotStepForwardSimulation()
void slotChangeParticleShaderMode(int mode)
void slotClearSimulation()
bool loadFile(const std::string &filename)
Loads a file into the wrapper.
agxOSG::PickHandlerRef m_pickHandler
agxCFG::ConfigScriptRef m_settings
bool restoreFromFile(const std::string &file)
agxQt::ClipPlaneControllerRef m_clipPlaneController
agxOSG::ClipPlane * getClipPlane()
void slotPauseSimulation()
void journalSceneLoader(const agx::String &path)
void slotEnbleDrawStatistics(bool)
agxGL::CameraRef m_GlCamera
void signalNewSimulationLoaded()
void handleFileNameArguments(agxIO::ArgumentParser *arguments)
void slotStoreCurrentViewInCameraSet()
void signalSimulationUpdate(float timeStamp)
void loadDefaultCameraConfig(const agx::String &filename)
osg::Group * createScene(const agxOSG::SceneDescription &desc, bool &success)
bool executePythonScript(const agx::String &file, const agx::String &function)
osg::ref_ptr< osg::Group > m_scene
void setEnableDataRenderFlag(bool enable, agxOSG::GeometryNode::RenderFlag flag)
void signalNewSimulation()
agx::AnalysisBoxRef m_analysisBox
bool saveSimulationState(const std::string &filename)
Save simulation state to file.
agx::TimeStamp getTimeStamp()
Get the current timestamp of the simulation.
void clearJournalSessionData()
void setTimeStep(float dt)
Set the time step used in the simulation.
void slotStepBackSimulation()
void signalJournalContainsImpactData(bool hasData)
void slotChangeBackgroundColor(int mode)
agxOSG::SceneDecorator * getSceneDecorator()
Get Scene decorator.
agxQt::VideoCaptureRef m_videoCapture
void slotSetEnableCollisionDataRendering(bool enable)
agxQt::TrajectoryRenderer * getTrajectoryRenderer()
void takeScreenShot()
Take screenshot.
void slotReloadSimulation()
osg::ref_ptr< osg::Switch > m_sceneSwitch
osg::ref_ptr< osg::Group > m_sceneRoot
void slotEnableOSGRenderMode(bool)
agxGL::LightsRef m_GlLights
void triggetStopInScripts()
agxOSG::SceneDescription getSceneDescription() const
Returns the description of the active scene.
agx::Vec2u getRenderWindowSize() const
Returns the size of the render window.
void slotSetEnableRenderDataRendering(bool enable)
static void setActiveSimulationController(agxSDK::SimulationController *controller)
Static helper function to get active simulation controller so that other classes can lock the active ...
void signalActiveCameraViewChanged()
void slotChangeAlpha(agx::Real alpha)
TrajectoryRendererRef m_trajectoryRenderer
void signalRenderUpdate()
void slotDecrementCamera()
void reloadActiveScene()
Reloads the active loaded scene.
bool isSimulationRunning() const
void slotIncrementClipPlane()
agx::StringVector m_attachedScripts
void slotUpdateClipplingPlaneDrawable()
osg::ref_ptr< osgViewer::Viewer > m_viewer
void slotMoveLightToLookAt()
RigidBodyRenderCache is used to cache mappings between RigidBodies and GeometryNodes for fast lookup ...
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Class that can be used to extract data from elements in a simulation within a specified bound.
Block synchronization primitive.
Base class providing referencing counted objects.
Contains classes/utility functions for connecting AGX to QT with OSG.
AGXCORE_EXPORT Component * root()
A pod-struct for holding information about scenes to load by the application.