 |
AGXDynamics
2.35.0.3
|
Go to the documentation of this file.
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;
99 bool loadFile(
const std::string& filename);
102 void reloadActiveScene();
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();
144 void takeScreenShot();
147 bool saveSimulationState(
const std::string& filename);
150 bool writeCameraViewsToFile(
const std::string& filename);
158 bool isSimulationRunning()
const;
165 bool journalContainsImpactData();
167 bool attachScripts(osg::Group*
root);
169 void finalizeAndResetVideoCapture();
179 void signalSimulationUpdate(
float timeStamp);
180 void signalNewPlayback(
float timeStart,
float timeEnd, uint numFrames);
181 void signalNewSimulation();
182 void signalSimulationPause();
183 void signalJournalTrackReachedEnd();
184 void signalJournalContainsImpactData(
bool hasData);
186 void signalUpdateSimulationStructure();
188 void signalActiveCameraViewChanged();
191 void signalRenderUpdate();
193 void signalNewSimulationLoaded();
197 void slotUpdateLoop();
200 void slotPauseSimulation();
201 void slotPlaySimulation();
202 void slotStepForwardSimulation();
203 void slotStepBackSimulation();
204 void slotStopSimulation();
205 void slotChangeSimulationTime(
float);
206 void slotJumpToEnd();
207 void slotJumpToStart();
208 void slotSetJournalStride(uint stride);
209 void slotEnableJournalLooping(
bool enable);
212 void slotEnableDebugRenderMode(
bool);
213 void slotEnableOSGRenderMode(
bool);
214 void slotEnbleDrawStatistics(
bool);
215 void slotChangeDrawMode(
int mode);
216 void slotCenterScene();
217 void slotChangeParticleShaderMode(
int mode);
219 void slotSetEnableShaders(
bool enable);
220 void slotChangeBackgroundColor(
int mode );
221 void slotSetEnableRenderDataRendering(
bool enable);
222 void slotSetEnableCollisionDataRendering(
bool enable);
223 void slotMoveLightToLookAt();
224 void slotUpdateAnalysisBoxDrawable();
225 void slotUpdateClipplingPlaneDrawable();
226 void slotHandleStopSimulation();
229 void slotIncrementCamera();
230 void slotDecrementCamera();
231 void slotStoreCurrentViewInCameraSet();
232 void slotSetViewFromActiveCameraDescription();
233 void slotIncrementClipPlane();
234 void slotDecrementClipPlane();
237 void stepSimulation();
238 void slotClearSimulation();
239 void slotReloadSimulation();
240 void slotUpdateSpace();
246 void loadDefaultCameraConfig(
const agx::String& filename);
248 void lockSimulationAndTriggerEvents();
251 void journalPlayback(
const std::string& journalPlaybackPath,
const std::string asessionName =
"");
252 void clearJournalSessionData();
255 bool restoreFromFile(
const std::string& file);
259 void initSimulationController();
261 void fitSceneIntoView();
262 void clearSimulation();
264 bool loadActiveScene();
267 void setupUpdateLoop();
268 void handleJournalLooping();
269 bool playbackIsAtEnd();
270 void setupPostProcessor();
272 void updateAnalysisBox();
273 void triggetStopInScripts();
276 static void setActiveSimulationController(agxSDK::SimulationController* controller);
335 osg::ref_ptr<osgGA::StateSetManipulator>
m_ssm;
std::string m_luaFilePath
osg::ref_ptr< osgViewer::Viewer > m_viewer
agxGL::LightsRef m_GlLights
std::string m_currentCaptureFolder
Contains classes/utility functions for connecting AGX to QT with OSG.
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
Manager class that acts as a wrapper container for the CameravViewset class for OSG based view system...
static void setActiveSimulationController(agxSDK::SimulationController *controller)
Static helper function to get active simulation controller so that other classes can lock the active ...
TrajectoryRendererRef m_trajectoryRenderer
osgViewer::Viewer * getViewer()
osg::ref_ptr< osg::Group > m_sceneRoot
osg::ref_ptr< agxOSG::ClipPlane > m_clipPlane
agxOSG::RenderProxyFactory * m_renderProxyFactory
osg::ref_ptr< agxOSG::SceneDecorator > m_decorator
Class that can be used to extract data from elements in a simulation within a specified bound.
agxQt::ClipPlaneControllerRef m_clipPlaneController
agx::AnalysisBox * getAnalysisBox()
Class that is used to manipulate the clip plane in the scene.
RigidBodyRenderCache is used to cache mappings between RigidBodies and GeometryNodes for fast lookup ...
This utility class is used for post processing of the particle system drawable representation,...
void setViewer(osgViewer::Viewer *viewer)
Set the viewer to sync the simulation content to.
osg::ref_ptr< osg::Group > m_scene
Block synchronization primitive.
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
agxQt::OsgCameraViewManager * getCameraViewManager()
Get the camera view manager.
Decorates a scene with a specific AGX Rendering Style.
std::string m_journalSessionName
void setTimeStep(float dt)
Set the time step used in the simulation.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
agxQt::VideoCaptureRef m_videoCapture
agx::UInt m_journalStride
void startCapture()
Starts or resumes the video capture.
osg::ref_ptr< osg::Switch > m_sceneSwitch
agxSDK::Simulation * getSimulation()
RigidBodyRenderCacheRef m_renderBodyCache
osg::ref_ptr< osgGA::StateSetManipulator > m_ssm
std::string m_pythonFilePath
OsgCameraViewManagerRef m_cameraManager
agxOSG::SceneDescription getSceneDescription() const
Returns the description of the active scene.
This class wraps the ClipPlane functionality of osg together with a clip node and a clip plane.
AGXCORE_EXPORT Component * root()
static agxSDK::SimulationController * s_activeController
void setScene(osg::Group *scene)
Returns pointer to osg structure of the scene.
agxQt::ParticleSystemRenderUtility * getParticleRenderUtillity()
void stopCapture()
Pauses the video capture, if active.
Base class providing referencing counted objects.
agx::AnalysisBoxRef m_analysisBox
agxSDK::SimulationControllerRef m_simulationController
agxOSG::SceneDecorator * getSceneDecorator()
Get Scene decorator.
std::string m_cfgFileName
agxGL::CameraRef m_GlCamera
static agxSDK::SimulationController * getActiveSimulation()
Returns the active simulation in the wrapper. This is kind of a "hack" to let the renderer get a simu...
agxOSG::SceneDescription m_sceneDescription
osg::ref_ptr< osg::Group > m_clipPlaneDrawable
void AGXPHYSICS_EXPORT init()
Initialize agx.
agxQt::TrajectoryRenderer * getTrajectoryRenderer()
agxCFG::ConfigScriptRef m_settings
void setSceneDescription(const agxOSG::SceneDescription &desc)
osg::ref_ptr< osg::Group > m_analysisBoxDrawable
Implementation of the abstract class from the agxRender namespace, this class is responsible for crea...
osg::ref_ptr< agxOSG::GuiEventAdapter > m_eventAdapter
A pod-struct for holding information about scenes to load by the application.
osg::ref_ptr< osg::Group > m_postProcessRoot
bool isSimulationRunning() const
osg::ref_ptr< osg::Group > m_root
agx::StringVector m_attachedScripts
agxOSG::PickHandlerRef m_pickHandler
A small argument parser class.
ParticleSystemRenderUtilityRef m_particleRenderUtil