17#ifndef AGXQT_QTAGXWRAPPER_H
18#define AGXQT_QTAGXWRAPPER_H
20#include <agx/config/AGX_USE_PYTHON.h>
27#include <QElapsedTimer>
28#include <osgGA/TrackballManipulator>
29#include <osgGA/StateSetManipulator>
30#include <osgViewer/ViewerEventHandlers>
31#include <osgViewer/Renderer>
41#include <agxCFG/ConfigScript.h>
65 class QtAgxWrapperStepCallback;
74 friend class QtAgxWrapperStepCallback;
103 void setViewer(osgViewer::Viewer* viewer);
104 osgViewer::Viewer* getViewer();
107 void setScene(osg::Group* scene);
108 osg::Group* getScene();
126 void setTimeStep(
float dt);
132 static agxSDK::SimulationController* getActiveSimulation();
156 bool isSimulationRunning()
const;
253 bool initPythonContext(agxPython::ScriptManager* scriptManager, osg::Group* root);
262 void journalPlayback(
const std::string& journalPlaybackPath,
const std::string asessionName =
"");
286 static void setActiveSimulationController(agxSDK::SimulationController* controller);
347 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...
RigidBodyRenderCache is used to cache generated visuals and lookup mappings of RigidBodies cloned fro...
Decorates a scene with a specific AGX Rendering Style.
Class that is used to manipulate the clip plane in the scene.
Class that is used to manipulate the axes 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
void setSceneDescription(const agxOSG::SceneDescription &desc)
osg::Group * createScene(const agxOSG::SceneDescription &desc, bool &success)
void incrementOrthographicProjection(agx::Real increment)
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()
agxQt::MeasurementAxesControllerRef m_axesController
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)
agxQt::MeasurementAxesController * getAxesController()
osg::ref_ptr< agxOSG::SceneDecorator > m_decorator
void slotUpdateAxesDrawable()
bool journalContainsImpactData()
void setEnableOrthographicCamera(bool enable)
void initSimulationController()
agx::Real getSimulationUpdateTimeStep()
agx::AnalysisBox * getAnalysisBox()
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
void setupPostProcessor()
void slotSetJournalStride(uint stride)
void slotDecrementOrthographicZoom()
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 setCameraViewDirection(const agx::Vec3 &direction)
void setViewer(osgViewer::Viewer *viewer)
Set the viewer to sync the simulation content to.
void slotUpdateAnalysisBoxDrawable()
bool executeMPyScript(const agx::String &file, osg::Group *root)
void signalSimulationPause()
agxQt::VideoCapture * getVideoCapture()
void handleJournalLooping()
ParticleSystemRenderUtilityRef m_particleRenderUtil
static agxSDK::SimulationController * s_activeController
osgViewer::Viewer * getViewer()
agxOSG::RigidBodyRenderCache * getRenderCache()
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)
agxQt::ClipPlaneController * getClipPlaneController()
void slotHandleStopSimulation()
std::string m_pythonFilePath
osg::ref_ptr< osg::Group > m_analysisBoxDrawable
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
void slotPauseSimulation()
agxOSG::RigidBodyRenderCacheRef m_renderBodyCache
void slotIncrementOrthographicZoom()
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)
osg::ref_ptr< osg::Group > m_axesDrawable
void loadDefaultCameraConfig(const agx::String &filename)
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 addGLCameraSynchronizationtoPreCallback(osg::Camera *camera)
agxOSG::ClipPlane * getClipPlane()
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()
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...
bool setTimeStep(agx::Real timeStep)
Sets the time step determined by the TimeGovernor in the DynamicsSystem.
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.
A pod-struct for holding information about scenes to load by the application.