AGXDynamics  2.35.0.2
ExampleApplication.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #ifdef __clang__
20 #pragma clang diagnostic push
21 #pragma clang diagnostic ignored "-Wconversion"
22 #endif
23 
24 #include <agx/config/AGX_USE_OPENGL.h>
25 #include <agx/config/AGX_USE_FFMPEG.h>
26 #include <agx/config/AGX_USE_PYTHON.h>
27 
28 #include <agx/config.h>
29 
30 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
31 #include <osg/Switch>
32 #include <osgViewer/Viewer>
33 #include <osg/Version>
34 #include <osg/ref_ptr>
35 #include <osg/MatrixTransform>
36 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
37 
38 #include <agxOSG/DepthPeeling.h>
39 #include <agxOSG/export.h>
40 #include <agxOSG/GuiEventAdapter.h>
41 #include <agxOSG/PickHandler.h>
42 #include <agxOSG/RenderTarget.h>
43 #include <agxOSG/RenderToTexture.h>
45 
46 #if AGX_USE_WEBSOCKETS()
48 #endif
49 
50 #include <agxSDK/Simulation.h>
54 #include <agxOSG/ImageCapture.h>
55 #include <agxCFG/ConfigScript.h>
56 
57 #include <agx/Timer.h>
59 
60 #include <agxIO/ArgumentParser.h>
61 #include <agx/HighAccuracyTimer.h>
62 
63 #include <cstddef>
64 
65 #if AGX_USE_OPENGL()
66 #include <agxGL/Camera.h>
67 #include <agxGL/Lights.h>
68 #endif
69 
70 #if AGX_USE_PYTHON()
71 # include <agxPython/ScriptManager.h>
72 # include <agxPython/ScriptContext.h>
73 # include <agx/config/AGX_PYTHON_VERSION.h>
74 #endif
75 
76 #ifdef __clang__
77 #pragma clang diagnostic pop
78 #endif
79 
80 namespace osgGA
81 {
82  class StandardManipulator;
83  class MatrixManipulator;
84 }
85 
86 namespace agxFMI2
87 {
88  namespace Export
89  {
90  class Module;
91  }
92 }
93 
94 
95 namespace agxSDK
96 {
97  class Assembly;
98 }
99 
100 namespace agxNet
101 {
102  class CoSimulationServer;
103 }
104 
105 namespace agxOSG {
106  class ExampleApplication;
107  class SceneDecorator;
108  class RenderProxyFactory;
109  class GeometryNode;
110 #if AGX_USE_WEBSOCKETS()
111  class ExampleApplicationController;
112 #endif
113 
114  typedef osg::Group * (*BuildScenePtr)(agxSDK::Simulation *simulation, ExampleApplication *application);
115 
118 
121 
123  SceneDescription(BuildScenePtr sc, bool isTest = false, float stop = float(), bool isSlowUnittest = false);
124 
126  SceneDescription(const std::string& scriptFileName, const std::string& scriptFunctionName, bool isTest = false, float stop = float(), bool isSlowUnittest = false);
127 
129  SceneDescription(const std::string& sceneFile, bool isTest = false, float stop = float(), bool isSlowUnittest = false);
130 
131  bool isValid() const { return valid; }
132 
133 
135  bool unittest;
136  float stopAfter;
138  bool valid;
139  std::string scriptFunction;
140  std::string fileName;
141  };
142 
143 
144 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
145 # if OSG_VERSION_GREATER_OR_EQUAL(2,9,11)
146  typedef osgGA::StandardManipulator CameraManipulatorType;
147 # else
148  typedef osgGA::MatrixManipulator CameraManipulatorType;
149 # endif
150 #else
151  typedef osgGA::MatrixManipulator CameraManipulatorType;
152 #endif
153 
154 
155 
156 #if AGX_USE_OPENGL()
157  class CameraSynchronization : public osg::Camera::DrawCallback
158  {
159  public:
160  CameraSynchronization(osg::Camera *mainCamera, agxGL::Camera *glCamera) : m_mainCamera(mainCamera), m_glCamera(glCamera)
161  {
162  }
163 
165  {
166  }
167 
168  virtual void operator () (osg::RenderInfo& /* renderInfo */) const
169  {
170  // Explicit support for Real=float agx with Real=double osg
171  agxData::Val<agx::Matrix4x4d> projection(agx::Matrix4x4d(m_mainCamera->getProjectionMatrix().ptr()));
172  agx::Matrix4x4 m = projection.transform<agx::Matrix4x4 > ();
173 
174  if (m != m_glCamera->getProjectionMatrix())
175  m_glCamera->setProjectionMatrix(m);
176 
177  agxData::Val<agx::Matrix4x4d> view(agx::Matrix4x4d(m_mainCamera->getViewMatrix().ptr()));
178  agx::Matrix4x4 m2 = view.transform<agx::Matrix4x4 > ();
179 
180  if (m2 != m_glCamera->getViewMatrix())
181  m_glCamera->setViewMatrix(m2);
182 
183  auto viewport = m_mainCamera->getViewport();
184  m_glCamera->setViewPort(static_cast<int>(viewport->width()), static_cast<int>(m_mainCamera->getViewport()->height()));
185  }
186  using osg::Camera::DrawCallback::operator();
187 
188  private:
189  osg::Camera *m_mainCamera;
190  agxGL::Camera *m_glCamera;
191  };
192 
193  class LightsSynchronization : public osg::Camera::DrawCallback
194  {
195  public:
197  : m_glLights(mainLights),
198  m_decorator(decorator)
199  {
200  }
201 
203  {
204  }
205 
206  virtual void operator () (osg::RenderInfo& /* renderInfo */) const
207  {
208 
209  auto updateLight = [this](size_t index, agxOSG::LightSource l)
210  {
211  m_glLights->setLightPosition(index, l.getPosition());
212  m_glLights->setLightDirection(index, l.getDirection());
213  };
214 
215  updateLight(0, m_decorator->getLightSource(agxOSG::SceneDecorator::LIGHT0));
216  updateLight(1, m_decorator->getLightSource(agxOSG::SceneDecorator::LIGHT1));
217  updateLight(2, m_decorator->getLightSource(agxOSG::SceneDecorator::LIGHT2));
218  }
219 
220  using osg::Camera::DrawCallback::operator();
221 
222  private:
223  agxGL::Lights *m_glLights;
224  SceneDecorator *m_decorator;
225  };
226 #endif
227 
229  {
230  public:
231  enum Types { TRACKBALL,
232 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
233 # if OSG_VERSION_GREATER_OR_EQUAL(2,9,11)
234  FPS,
235 # endif
236 #endif
237  NUM_TYPES };
238 
240 
241  static CameraManipulatorFactory* instance();
242 
243  CameraManipulatorType* next( osgViewer::Viewer* viewer = nullptr );
244  CameraManipulatorType* next( osgViewer::GraphicsWindow* window = nullptr );
245  CameraManipulatorType* create( osgViewer::Viewer* viewer = nullptr );
246  CameraManipulatorType* create( Types type, osgViewer::Viewer* viewer = nullptr );
247  CameraManipulatorType* create( Types type, osgViewer::GraphicsWindow* window = nullptr );
248  CameraManipulatorType* create( osgViewer::GraphicsWindow* window = nullptr );
249 
250  void setType( Types type ) { m_currentType = type; }
251  Types getType() const { return m_currentType; }
252 
253  protected:
254  SINGLETON_CLASSNAME_METHOD();
255  virtual void shutdown() override { s_instance = nullptr; }
256  osgViewer::GraphicsWindow* getWindow( osgViewer::Viewer* viewer, size_t num = 0 ) const;
257 
260  };
261 
263  {
267  CameraData( const osg::Camera* camera );
268 
272  CameraData( const osgViewer::Viewer* viewer );
273 
277  void applyTo( osg::Camera* camera ) const;
278 
282  void applyTo( osgViewer::Viewer* viewer ) const;
283 
286  double fieldOfView;
287  double aspectRatio;
288  bool valid;
289  double nearFarRatio;
290 
294 
295  private:
296  CameraData();
297  void initialize( const osg::Camera* camera );
298  };
299 
302 
303  public:
304  virtual void preFrame(ExampleApplication* app);
305  virtual void postFrame(ExampleApplication* app);
306 
307  protected:
308  virtual ~ExampleApplicationListener() override;
309  };
310 
311 
313 
318  {
319  public:
322 
329  {
330  MAIN_SCENE_MASK = 1 << 1,
331  DEBUG_RENDER_MASK = 1 << 2,
332  OSG_RENDER_MASK = 1 << 3,
333  HUD_MASK = 1 << 4,
334  DECORATOR_MASK = 1 << 5,
335  };
336 
338  {
339  MULTI, // New.
340  ITERATIVE, // New forced to iterative.
341  NUM_SOLVERS
342  };
343 
344 
345  void setSolverType( SolverType t ) { m_solverType = t; }
346  SolverType getSolverType() const { return m_solverType; }
347 
348  std::string getSolverName( SolverType t ) const;
349  SolverType getSolverType( const std::string& name ) const;
350 
354  void addAutoPausePair(const agx::RigidBody *body1, const agx::RigidBody *body2);
355  void addAutoPausePair(const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2);
356  void removeAutoPausePair(const agx::RigidBody *body1, const agx::RigidBody *body2);
357  void removeAutoPausePair(const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2);
358 
362  void setEnableAutoPausing(bool flag);
363  bool getEnableAutoPausing();
364 
366  ExampleApplication( agxSDK::Simulation *simulation=nullptr );
367 
368  bool init( agxIO::ArgumentParser* arguments, bool agxOnly = false );
369 
370  void addListener(ExampleApplicationListener *listener);
371 
372 #ifndef SWIG
373  bool init( int argc, char** argv );
374 #endif
375 
376  agxIO::ArgumentParser* getArguments() { return m_arguments.get(); }
377 
378  agxOSG::RenderProxyFactory *getRenderProxyFactory() { return m_renderProxyFactory; }
379 
380  void setTimeStep( agx::Real dt );
381  agx::Real getTimeStep() const;
382 
383  bool addScene( const std::string& scriptFile, const std::string& scriptFunction, int key, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false );
384  bool addScene( const std::string& scriptFile, const std::string& scriptFunction, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false );
385 
386  bool addScene( BuildScenePtr sceneFunction, int key, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false );
387  bool addScene( BuildScenePtr sceneFunction, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false );
388 
389  bool addScene( SceneDescription sceneDescription, int key);
390  bool addScene( SceneDescription sceneDescription);
391 
393  void clearAddedScenes() { m_keybindingVector.clear(); }
394 
395  agx::Callback getStepCallback() const { return m_stepCallback; }
396  void setStepCallback(agx::Callback callback) { m_stepCallback = callback; }
397 
398  bool initialized() const { return m_initialized; }
399 
400  agxOSG::SceneDecorator *getSceneDecorator() { return m_decorator; }
401 
402  virtual int run();
403 
404  void setOsgNotifyLevel(osg::NotifySeverity severity) const;
405 
410  void stop(int exitCode = 0) { m_shouldStop = true; m_exitCode = exitCode; }
411 
413  void cancelStop() { m_shouldStop = false; }
414 
416  bool shouldStop() const { return m_shouldStop; }
417 
418 
425  bool setWindowRectangle(unsigned int x, unsigned int y, unsigned int width, unsigned int height);
426 
432  bool setWindowTitle(const std::string& title);
433 
435  bool breakRequested() const;
436 
437  virtual void setupViewer( bool lightingEnabled = true, bool visibleWindow = true );
438 
439  void setupVideoCaptureRenderTotexture();
440 
441  //void initScene();
442 
443  osg::Group *getScene() { return m_scene.get(); }
444  void setScene(osg::Group *scene ) { m_scene = scene; }
445  osg::Group *getSceneRoot() { return m_sceneRoot.get(); }
446  osg::Group* getSceneAgxOSGRoot();
447  osg::Group *getSceneSwitch() { return m_sceneSwitch.get(); }
448 
449 #ifdef AGX_HAVE_DEPTHPEELING
450  void setEnableDepthPeeling( bool flag );
451  bool getEnableDepthPeeling() const;
452  agxOSG::DepthPeeling* getDepthPeeling();
453 #endif
454 
462  bool setEnableDebugRenderer( bool flag );
463 
465  bool getEnableDebugRenderer() const;
466 
467  void setEnableTextDebugRendering( bool flag );
468  bool getEnableTextDebugRendering() const;
469 
470  void setEnableCaptureSyncWithSimulation( bool enableSync );
471  bool getEnableCaptureSyncWithSimulation( ) const;
472 
473  void setEnableOSGRenderer( bool flag );
474  bool getEnableOSGRenderer();
475 
476  void setEnableVSync( bool flag, bool forceUpdate = false );
477  bool getEnableVSync() const;
478 
479  void getCameraHome( agx::Vec3& eye, agx::Vec3& center, agx::Vec3& up);
480  void setCameraHome( const agx::Vec3& eye, const agx::Vec3& center, const agx::Vec3& up=agx::Vec3(0,0,1) );
481 
487  void addRenderTarget(agxOSG::RenderTarget* rtt, osg::Node *targetSceneNode=nullptr);
488 
493  bool removeRenderTarget(agxOSG::RenderTarget* rtt);
494 
500  void setDebugRenderInverseMatrix( const agx::AffineMatrix4x4 &m );
501 
502 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
503 # if OSG_VERSION_GREATER_OR_EQUAL(2,9,11)
504  osgGA::CameraManipulator* getCameraManipulator();
505  const osgGA::CameraManipulator* getCameraManipulator() const;
506 #else
507  osgGA::MatrixManipulator* getCameraManipulator();
508  const osgGA::MatrixManipulator* getCameraManipulator() const;
509 #endif
510 #else
511  osgGA::MatrixManipulator* getCameraManipulator();
512  const osgGA::MatrixManipulator* getCameraManipulator() const;
513 #endif
514  agxSDK::Simulation *getSimulation() { return m_simulation.get(); }
515 
516  bool restoreFromFile( const std::string& filename );
517  void journalRenderLoader(agxSDK::Assembly *assembly, bool keyFrame);
518 
519 
521  void setAutoStepping( bool flag );
522 
524  bool getAutoStepping( ) const;
525 
526 
527  void setEnablePauseUpdate( bool flag ) { m_pauseUpdate = flag; }
528  bool getEnablePauseUpdate( ) const { return m_pauseUpdate; }
529 
535  void setRealTimeSync(bool flag);
536  bool getRealTimeSync() const;
537 
538  agx::Journal *getJournal();
539  const std::string& getJournalConfigurationPath() const;
540  const std::string& getJournalPlaybackPath() const;
541 
542  void setJournalConfigurationPath(const agx::String& path);
543 
544  void setEnableJournalIncrementalStructure( bool enable );
545  bool getEnableJournalIncrementalStructure() const;
546 
547  SceneDescription getCallbackIdx( size_t idx );
548 
549  SceneDescription getCallback( int key );
550  bool createSceneFromKey( int key );
551  bool createSceneFromIndex( int idx, bool firstStartUp = false );
552 
553 
554  void reloadScene();
555  void createNextScene();
556  void createPreviousScene();
557 
558  size_t getNumScenes() const;
559 
560  void step();
561 
562  void changeSolver();
563 
564  const std::string& getSaveSceneFilename() const { return m_sceneFilename; }
565 
566  osg::Group *getRoot() { return m_root.get(); }
567 
568  void fitSceneIntoView();
569  void initSimulation(agxSDK::Simulation *simulation = nullptr, bool initializeGraphics = true);
570  void initViewer(int width, int height, bool osgWindow = true);
571 
572  void initGraphics();
573  void initRpc();
574  bool readCFGFile();
575 
581  void stopAfter(const agx::Real stopTime);
582 
583  osgViewer::Viewer *getViewer() { return m_viewer.get(); }
584  osg::Camera *getCamera() { if (m_viewer.valid()) return m_viewer->getCamera(); else return nullptr; }
585 
586  bool hasOffscreenWindow() const;
587 
591  agxOSG::CameraData getCameraData() const;
592 
596  void applyCameraData( const agxOSG::CameraData& cameraData );
597 
598  intptr_t getHWND() const;
599 
600  agx::Vec3 getViewDirection();
601 
602  PickHandler* getPickHandler() { return m_pickHandler; }
603  const PickHandler* getPickHandler() const { return m_pickHandler; }
604 
605  std::string getScriptFile() const { return m_scriptFile; }
606 
608  std::string getLuaFilePath() const
609  {
610  return m_luaFilePath;
611  }
612 
613  void handleReactiveScriptErrors( bool abortSimulation = true );
614 
615  agx::Real getTimeStamp() const;
616 
617  void clearScene();
618 
619  void setEnableSimulationDump( bool flag );
620  bool getEnableSimulationDump( ) const;
621 
622  void updateCoSimulationServer();
623  bool updatePythonCoSimulationServer(const agx::String& filename, std::stringstream& buffer);
624  bool coSimulationCallPython(agxNet::CoSimulationServer* server);
625 
626  void updateRemoteDebugger();
627  void centerScene();
628  void stepSimulation();
629 
630  bool useCoSimulation() const {return m_useCoSimulation;}
631 
632  agx::Vec3 getGravity() const { return m_gravity; }
633 
634 
635  agxOSG::ImageCapture *getImageCapture() { return m_imageCapture; }
636  const agxOSG::ImageCapture *getImageCapture() const { return m_imageCapture; }
637 
639 
640  osg::Camera *getTextureCamera() { return m_textureCamera; }
641 
642 
643  bool isCameraHomeSet() const { return m_cameraHomeSet; }
644 
645  static void registerRemovedGeometry(GeometryNode *node);
646 
647  void storeInitialJournalState();
648  void initRecordJournal();
649 
650  void journalPlayback();
651  void listSessionNames(const std::string& journalToList);
652 
662  double heading, double elevation, double distance,
663  int trackerMode = 0);
664 
674  const agx::Vec3& eye, const agx::Vec3& center, const agx::Vec3& up = agx::Vec3::Z_AXIS(),
675  int trackerMode = 0);
676 
677  bool executeOneStepWithGraphics();
678  bool executeOneStepWithoutGraphics();
679 
680  void updateServices();
681 
682 
687  bool done() const;
688 
689 
694  void setQuitEventSetsDone(bool flag);
695  bool getQuitEventSetsDone() const;
696 
700  bool getAllowWindowResizing() const;
701 
705  void setAllowWindowResizing(bool flag);
706 
711  void takeScreenShot(const agx::String& filename="");
712 
713  void synchronizedStep(bool blocking = false);
714 
715  void stepWrapper();
716 
717  void initScene();
718  void initScene(osg::Group *root);
719 
720 
722  agx::UInt getJournalFormat() const;
723 
725  void setJournalFormat(agx::UInt journalFormat);
726 
728  void setEnableJournal32bitMode(bool enable);
729 
731  void setEnableJournalRecord(bool enable);
732 
734  void setRequestedJournalFrequency(agx::Real freq);
735 
737  void setJournalRecordPath(const agx::String& journalPath);
738 
740  void setCoordinateSystemTransform( const agx::AffineMatrix4x4& coordinateSystemTransform);
741 
743  agx::AffineMatrix4x4 getCoordinateSystemTransform() const;
744 
746  void setGridSize(const agx::Vec2& gridSize);
747 
749  agx::Vec2 getGridSize() const;
750 
752  void setGridResolution(const agx::Vec2u gridResolution);
753 
755  agx::Vec2u getGridResolution() const;
756 
758  void setEnableGrid(bool flag);
759 
761  bool getEnableGrid() const;
762 
764  void setEnableCoordinateSystem(bool flag);
765 
767  bool getEnableCoordinateSystem() const;
768 
769  // Throttle calls to avoid excessive CPU usage
770  // Is automatically called from `executeWithoutGraphics`
771  void throttleIdleCpuUsageBySleeping();
772 
773  agxOSG::RenderToTexture * getVideoCaptureRendertoTexture() { return m_videoCaptureRenderToTexture; }
774 
775  std::string getProfilingJournalPath() const;
776 
777 #if AGX_USE_WEBSOCKETS()
778  agxOSG::ExampleApplicationController *getController();
779 
780  agx::UInt16 getControlChannelPort();
781  void pushParametersToControlChannel();
782  void setEnableControlChannelTickSignals(bool flag);
783  void pushFrameToRemoteViewer();
784 #endif
785 
786  void postExecution();
787  void setEnableThreadTimeline(bool flag);
788  void setEnableTaskProfile(bool flag);
789  int getExitCode() { return m_exitCode; }
790 
791 #if AGX_USE_PYTHON()
792  agxPython::ScriptContextInterface* initPythonContext(agxPython::ScriptManager *scriptManager);
793 #endif
794 
795  void createVisual(agxSDK::Simulation *simulation, float detailRatio = 1.0f, bool createAxes = false);
796  void createVisual(agxSDK::Assembly *assembly, float detailRatio = 1.0f, bool createAxes = false);
797  agx::Mutex& getFrameMutex() { return m_frameMutex; }
798 
799  protected:
800 
801  virtual ~ExampleApplication();
802 
803  void drawGrid();
804  void drawCoordinateSystem();
805 
806  void granularCreated( agxSDK::Simulation* sim, agx::RigidBody* body );
807  void addGranularCreateVisualCallbacks();
808 
809  protected:
810  class SimulationListener;
811 
812  void execute();
813  void executeWithoutGraphics();
814  bool executeOneStepWithoutGraphics(bool& saveAfterEnabled, agx::Real saveAfterTime, agx::HighAccuracyTimer& timer);
815 
816 
817  void executeWithGraphics();
818  bool executeOneStepWithGraphics(bool& saveAfterEnabled, agx::Real saveAfterTime, agx::HighAccuracyTimer& timer);
819 
820  void generateQuickProfiling();
821  void journalSceneLoader(const agx::String& path);
822  void removeGeometryNode(agxSDK::Simulation*, agxCollide::Geometry*);
823  void setArgumentsPostSceneCreation(); // This function will override a number of settings with their command line argument specifications
824  agxJson::Value extractSimulationStructureToJson();
825  void applyInitialParameters(const std::string& filePath);
826  void initThreadTimeline();
827  bool initBrickInterop();
828 
829  void triggerPreFrameListeners();
830  void triggerPostFrameListeners();
831 
832  bool attachScripts( osg::Group* root );
833  osg::Group *executeLuaScript( const agx::String& file, const agx::String& function, bool& success );
834  osg::Group *executePythonScript( const agx::String& file, const agx::String& function, bool& success );
835  osg::Group *loadBrickModel( const agx::String& file, const agx::String& model, bool& success );
836  osg::Group *executeMPyScript(const agx::String& file, bool& success);
837 
838  osg::Group *createScene( const SceneDescription& desc, bool &success );
839 
840  osg::ref_ptr<agxOSG::SceneDecorator> m_decorator;
842  osg::ref_ptr<agxOSG::GuiEventAdapter> m_eventAdapter;
843  osg::ref_ptr<osgViewer::Viewer> m_viewer;
844 
846 
847  osg::ref_ptr<osg::Group> m_root;
848  osg::ref_ptr<osg::Group> m_sceneRoot;
849  osg::ref_ptr<osg::Group> m_scene;
850  osg::ref_ptr<osg::Switch> m_sceneSwitch;
851 
853 
855 
857 
859 
862 
865 
866  std::string m_sceneFilename;
867  std::string m_parameterFilePath;
868 
870  std::string m_cfgFileName;
871 
873 
881  bool m_agxOnly;
883  // std::string m_exportMayaAnimationPath;
884 
885 #if AGX_USE_WEBSOCKETS()
886  friend class ExampleApplicationController;
887 #endif
888  friend class AutoPauseListener;
892 
894 
895  agxCFG::ConfigScriptRef m_settings;
896 
897  std::string m_xmlPlotFile;
899 
900  std::string m_scriptFile;
905 
907 #if AGX_USE_OPENGL()
910 #endif
917  std::string m_profilingRoot;
925  bool m_vSync;
926  std::string m_luaFilePath;
927  std::string m_pythonFilePath;
934  std::string m_journalEofMode;
935  std::string m_journalRecordPath;
936  std::string m_journalSessionName;
939  // agx::UInt m_journalStride;
943 
946 
948 
949 #ifdef AGX_HAVE_DEPTHPEELING
950  osg::ref_ptr<DepthPeeling> m_depthPeeling;
951 #endif
956  osg::ref_ptr<osg::Camera> m_textureCamera;
966  bool m_didStep;
968  osg::ref_ptr<osg::GraphicsContext> m_pBuffer;
969  osg::ref_ptr<osg::Camera> m_pBufferCamera;
971 
972  public:
975  bool m_isFMU;
977  std::string m_hostName;
978 
979  protected:
985  osg::ref_ptr<osg::Geode> m_grid;
986  osg::ref_ptr<osg::MatrixTransform> m_coordinateSystem;
993 
994  std::string m_videoName;
998 
999  };
1000 
1001 }
agxOSG::ExampleApplication::m_isLoadingScene
bool m_isLoadingScene
Definition: ExampleApplication.h:974
agxOSG::CameraData::eye
agx::Vec3 eye
Definition: ExampleApplication.h:291
agxOSG::ExampleApplication::m_coordinateSystemTransform
agx::AffineMatrix4x4 m_coordinateSystemTransform
Definition: ExampleApplication.h:980
agxOSG::SceneDecorator::LIGHT2
@ LIGHT2
Definition: SceneDecorator.h:214
agxOSG::SceneDescription::unittest
bool unittest
Definition: ExampleApplication.h:135
agxOSG::ExampleApplication::m_coSimulationInputData
agx::RealVector m_coSimulationInputData
Definition: ExampleApplication.h:923
agxOSG::CameraSynchronization
Definition: ExampleApplication.h:157
agxOSG::ExampleApplication::autoStepEvent
AutoStepEvent autoStepEvent
Definition: ExampleApplication.h:321
agxOSG::ExampleApplication::m_simulation
agxSDK::SimulationRef m_simulation
Definition: ExampleApplication.h:841
agxOSG::ExampleApplication::m_gridResolution
agx::Vec2u m_gridResolution
Definition: ExampleApplication.h:981
agxOSG::ExampleApplication::m_sceneSwitch
osg::ref_ptr< osg::Switch > m_sceneSwitch
Definition: ExampleApplication.h:850
agx::Journal
Definition: Journal.h:46
agxGL::Lights::setLightPosition
bool setLightPosition(agx::UInt index, const agx::Vec4 &position)
agxOSG::ExampleApplication::m_sceneFilename
std::string m_sceneFilename
Definition: ExampleApplication.h:866
agxOSG::ExampleApplication::m_journalSessionName
std::string m_journalSessionName
Definition: ExampleApplication.h:936
agxOSG::CameraManipulatorFactory::m_currentType
Types m_currentType
Definition: ExampleApplication.h:259
agxOSG::ExampleApplication::getVideoServerCapture
agxOSG::VideoFFMPEGPipeCapture * getVideoServerCapture()
Definition: ExampleApplication.h:638
agxOSG::CameraData
Definition: ExampleApplication.h:262
agx::Real
double Real
Definition: Real.h:42
agxNet::CoSimulationServer
Class for sending serialized agxSDK::Simulation over to a client.
Definition: CoSimulationServer.h:33
agxOSG::ExampleApplication::m_autoPausePairs
agx::HashSet< agxCollide::GeometryPair > m_autoPausePairs
Definition: ExampleApplication.h:890
VideoFFMPEGPipeCapture.h
agxOSG::ExampleApplication::m_eventAdapter
osg::ref_ptr< agxOSG::GuiEventAdapter > m_eventAdapter
Definition: ExampleApplication.h:842
agx::Vector< SceneDescription >
agxOSG::ExampleApplication::m_didStep
bool m_didStep
Definition: ExampleApplication.h:966
agxOSG::ExampleApplication::stop
void stop(int exitCode=0)
Stop (=exit) the application at next opportunity.
Definition: ExampleApplication.h:410
agxOSG::ExampleApplication::m_useCoSimulation
bool m_useCoSimulation
Definition: ExampleApplication.h:920
agxOSG::ExampleApplication::m_removeGeometryCallback
agxSDK::Simulation::GeometryEvent::CallbackType m_removeGeometryCallback
Definition: ExampleApplication.h:955
agxOSG::ExampleApplication::m_journal
agx::ref_ptr< agx::Referenced > m_journal
Definition: ExampleApplication.h:942
agxOSG::ExampleApplication::m_GlCamera
agxGL::CameraRef m_GlCamera
Definition: ExampleApplication.h:908
agxOSG::ExampleApplicationListener
Definition: ExampleApplication.h:301
agxOSG::ExampleApplication::m_journalConfigurationPath
std::string m_journalConfigurationPath
Definition: ExampleApplication.h:929
Simulation.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
agxOSG::SceneDescription::stopAfter
float stopAfter
Definition: ExampleApplication.h:136
agxOSG::SceneDescription::scene
BuildScenePtr scene
Definition: ExampleApplication.h:134
agxOSG::CameraManipulatorFactory::setType
void setType(Types type)
Definition: ExampleApplication.h:250
agxOSG::ImageCapture
Definition: ImageCapture.h:129
agxOSG::ExampleApplication
Class that encapsulates rendering and simulation using OpenSceneGraph.
Definition: ExampleApplication.h:317
agxOSG::SceneDescription::fileName
std::string fileName
Definition: ExampleApplication.h:140
agxOSG::ExampleApplication::m_dt
agx::Real m_dt
Definition: ExampleApplication.h:962
agxOSG::SceneDescription::slowUnittest
bool slowUnittest
Definition: ExampleApplication.h:137
agxOSG::PickHandler
Definition: agxOSG/PickHandler.h:75
agxOSG::ExampleApplication::m_debugClient
agx::ref_ptr< agx::Referenced > m_debugClient
Definition: ExampleApplication.h:904
agxOSG::ExampleApplication::m_cameraHomeUp
agx::Vec3 m_cameraHomeUp
Definition: ExampleApplication.h:914
agx::AffineMatrix4x4T< Real >
agxOSG::ExampleApplication::m_renderTargetSet
RenderTargetRefVector m_renderTargetSet
Definition: ExampleApplication.h:967
agxOSG::setOrbitCamera
AGXOSG_EXPORT bool setOrbitCamera(osgViewer::Viewer *viewer, agxOSG::GeometryNode *node, const agx::Vec3 &eye, const agx::Vec3 &center, const agx::Vec3 &up, int trackerMode)
agxOSG::ExampleApplication::CameraMask
CameraMask
Specifies node masks for different parts of the rendering scene.
Definition: ExampleApplication.h:328
agxOSG::ExampleApplication::m_scriptFile
std::string m_scriptFile
Definition: ExampleApplication.h:900
agxOSG::ExampleApplication::m_haveLicense
bool m_haveLicense
Definition: ExampleApplication.h:960
agxGL::Camera::getProjectionMatrix
const agx::Matrix4x4 & getProjectionMatrix() const
Get the projection matrix.
Definition: Camera.h:187
agxOSG::ExampleApplication::m_attachedScripts
agx::Vector< std::pair< std::string, int > > m_attachedScripts
Definition: ExampleApplication.h:944
agxOSG::CameraData::valid
bool valid
Definition: ExampleApplication.h:288
agxOSG::ExampleApplication::m_pythonFilePath
std::string m_pythonFilePath
Definition: ExampleApplication.h:927
agx::Vec3T< Real >::Z_AXIS
static Vec3T Z_AXIS()
Definition: Vec3Template.h:789
agxOSG::ExampleApplication::m_controller
agx::ref_ptr< agx::Referenced > m_controller
Definition: ExampleApplication.h:945
agxOSG::CameraSynchronization::~CameraSynchronization
virtual ~CameraSynchronization()
Definition: ExampleApplication.h:164
agxOSG::ExampleApplication::m_autoCycleThroughScenes
bool m_autoCycleThroughScenes
Definition: ExampleApplication.h:880
agxOSG::ExampleApplication::m_coordinateSystemEnabled
bool m_coordinateSystemEnabled
Definition: ExampleApplication.h:983
agxOSG::ExampleApplication::KeyBindings
agx::HashTable< int, int > KeyBindings
Definition: ExampleApplication.h:856
agxOSG::ExampleApplication::m_agxOnly
bool m_agxOnly
Definition: ExampleApplication.h:881
agxOSG::ExampleApplication::m_extractSimulationStructureToJsonPath
std::string m_extractSimulationStructureToJsonPath
Definition: ExampleApplication.h:937
agxOSG::ExampleApplication::m_enableJournalIncrementalStructure
bool m_enableJournalIncrementalStructure
Definition: ExampleApplication.h:989
agxOSG::SceneDescription::scriptFunction
std::string scriptFunction
Definition: ExampleApplication.h:139
agxGL::Camera::getViewMatrix
const agx::Matrix4x4 & getViewMatrix() const
Get the view matrix.
Definition: Camera.h:188
agxOSG::ExampleApplication::m_frameBlock
agx::Block m_frameBlock
Definition: ExampleApplication.h:959
agxOSG::ExampleApplication::m_sceneLoadEvent
agx::Event m_sceneLoadEvent
Definition: ExampleApplication.h:976
agxOSG::ExampleApplication::m_explicitFmu
bool m_explicitFmu
Definition: ExampleApplication.h:991
agxOSG::ExampleApplication::m_arguments
agxIO::ArgumentParserRef m_arguments
Definition: ExampleApplication.h:864
agxOSG::ExampleApplication::m_listeners
agx::Vector< ExampleApplicationListenerRef > m_listeners
Definition: ExampleApplication.h:997
agxOSG::ExampleApplication::getSaveSceneFilename
const std::string & getSaveSceneFilename() const
Definition: ExampleApplication.h:564
agxOSG::ExampleApplication::m_hostName
std::string m_hostName
Definition: ExampleApplication.h:977
ExampleApplicationController.h
agxGL::Lights::setLightDirection
bool setLightDirection(agx::UInt index, const agx::Vec3 &direction)
agx::EventT< Callback2< Simulation *, agxCollide::Geometry * > >::CallbackType
Callback2< Simulation *, agxCollide::Geometry * > CallbackType
Definition: Event.h:37
agxOSG::ExampleApplication::cancelStop
void cancelStop()
Will cancel the stop if possible. Continue the ::run loop.
Definition: ExampleApplication.h:413
agx::VectorPOD< Real >
agxOSG::ExampleApplication::getExitCode
int getExitCode()
Definition: ExampleApplication.h:789
agxOSG::ExampleApplication::m_root
osg::ref_ptr< osg::Group > m_root
Definition: ExampleApplication.h:847
agxOSG::ExampleApplication::m_serviceMutex
agx::Mutex m_serviceMutex
Definition: ExampleApplication.h:958
agxOSG::ExampleApplication::getVideoCaptureRendertoTexture
agxOSG::RenderToTexture * getVideoCaptureRendertoTexture()
Definition: ExampleApplication.h:773
agxOSG::ExampleApplication::m_enableJournalRecording
bool m_enableJournalRecording
Definition: ExampleApplication.h:988
agx::Callback
Generalized callback, using std::function.
Definition: Callback.h:53
agx::Matrix4x4T
Matrix class for affine transformations.
Definition: EulerAngles.h:34
RenderToTexture.h
agxOSG::ExampleApplication::getCamera
osg::Camera * getCamera()
Definition: ExampleApplication.h:584
agxOSG::SceneDecorator::getLightSource
agxOSG::LightSource getLightSource(Lights l)
Get a wrapper for a LightSource with only AGX types.
agxOSG::ExampleApplication::getImageCapture
const agxOSG::ImageCapture * getImageCapture() const
Definition: ExampleApplication.h:636
agxOSG::ExampleApplication::m_stepCallback
agx::Callback m_stepCallback
Definition: ExampleApplication.h:992
agxOSG::ExampleApplication::m_isFMU
bool m_isFMU
Definition: ExampleApplication.h:975
agxOSG::ExampleApplication::getEnablePauseUpdate
bool getEnablePauseUpdate() const
Definition: ExampleApplication.h:528
agxOSG::ExampleApplication::m_autoPauseListener
agxSDK::ContactEventListenerRef m_autoPauseListener
Definition: ExampleApplication.h:891
agxOSG::ExampleApplication::m_coordinateSystem
osg::ref_ptr< osg::MatrixTransform > m_coordinateSystem
Definition: ExampleApplication.h:986
agxOSG::ExampleApplication::m_generateThreadTimeline
bool m_generateThreadTimeline
Definition: ExampleApplication.h:916
agxOSG::ExampleApplication::m_autoPausingEnabled
bool m_autoPausingEnabled
Definition: ExampleApplication.h:889
agxOSG::ExampleApplication::m_journalPlaybackPath
std::string m_journalPlaybackPath
Definition: ExampleApplication.h:928
agxOSG::ExampleApplication::m_gravity
agx::Vec3 m_gravity
Definition: ExampleApplication.h:906
agx::Block
Block synchronization primitive.
Definition: ThreadSynchronization.h:96
agxOSG::ExampleApplication::m_stopFrame
agx::UInt m_stopFrame
Definition: ExampleApplication.h:878
agxOSG::ExampleApplication::getFrameMutex
agx::Mutex & getFrameMutex()
Definition: ExampleApplication.h:797
agxOSG::ExampleApplication::getSceneRoot
osg::Group * getSceneRoot()
Definition: ExampleApplication.h:445
agxOSG::LightsSynchronization::operator()
virtual void operator()(osg::RenderInfo &) const
Definition: ExampleApplication.h:206
agxOSG::ExampleApplication::SolverType
SolverType
Definition: ExampleApplication.h:337
agxOSG::ExampleApplication::m_statisticsRenderer
StatisticsRendererRef m_statisticsRenderer
Definition: ExampleApplication.h:882
agxSDK::Assembly
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:66
agxGL::Camera
Definition: Camera.h:49
agxOSG::ExampleApplication::shouldStop
bool shouldStop() const
Definition: ExampleApplication.h:416
agxOSG::BuildScenePtr
osg::Group *(* BuildScenePtr)(agxSDK::Simulation *simulation, ExampleApplication *application)
Definition: ExampleApplication.h:114
agxOSG::SceneDecorator
Decorates a scene with a specific AGX Rendering Style.
Definition: SceneDecorator.h:62
agxOSG::ExampleApplication::m_journalEofMode
std::string m_journalEofMode
Definition: ExampleApplication.h:934
agx::UInt16
uint16_t UInt16
Definition: Integer.h:39
agxOSG::ExampleApplication::m_solverType
SolverType m_solverType
Definition: ExampleApplication.h:863
agxOSG::ExampleApplication::m_timestep
agx::Real m_timestep
Definition: ExampleApplication.h:872
agxOSG::ExampleApplication::useCoSimulation
bool useCoSimulation() const
Definition: ExampleApplication.h:630
agxOSG::ExampleApplication::m_grid
osg::ref_ptr< osg::Geode > m_grid
Definition: ExampleApplication.h:985
agxOSG::ExampleApplication::getRoot
osg::Group * getRoot()
Definition: ExampleApplication.h:566
agxOSG::ExampleApplication::getSolverType
SolverType getSolverType() const
Definition: ExampleApplication.h:346
agxOSG::ExampleApplication::m_textureCamera
osg::ref_ptr< osg::Camera > m_textureCamera
Definition: ExampleApplication.h:956
agxOSG::ExampleApplication::getScriptFile
std::string getScriptFile() const
Definition: ExampleApplication.h:605
agx::ref_ptr< Simulation >
agxOSG::CameraManipulatorType
osgGA::MatrixManipulator CameraManipulatorType
Definition: ExampleApplication.h:151
agxOSG::ExampleApplication::getGravity
agx::Vec3 getGravity() const
Definition: ExampleApplication.h:632
agxOSG::ExampleApplication::m_pBuffer
osg::ref_ptr< osg::GraphicsContext > m_pBuffer
Definition: ExampleApplication.h:968
agxOSG::ExampleApplication::m_gridEnabled
bool m_gridEnabled
Definition: ExampleApplication.h:984
agxOSG::ExampleApplication::m_GlLights
agxGL::LightsRef m_GlLights
Definition: ExampleApplication.h:909
agxOSG::CameraManipulatorFactory
Definition: ExampleApplication.h:228
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxOSG::ExampleApplication::setScene
void setScene(osg::Group *scene)
Definition: ExampleApplication.h:444
agxOSG::ExampleApplication::setSolverType
void setSolverType(SolverType t)
Definition: ExampleApplication.h:345
agx::HighAccuracyTimer
The HighAccurayTimer class can replace the regular Timer class in high level applications where the n...
Definition: HighAccuracyTimer.h:63
agxOSG::ExampleApplication::m_realTime
bool m_realTime
Definition: ExampleApplication.h:875
agxOSG::ExampleApplication::getPickHandler
const PickHandler * getPickHandler() const
Definition: ExampleApplication.h:603
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
Timer.h
agxOSG::ExampleApplication::m_sceneIndex
int m_sceneIndex
Definition: ExampleApplication.h:854
agxOSG::ExampleApplication::m_keybindingVector
KeyBindingsVector m_keybindingVector
Definition: ExampleApplication.h:861
agxOSG::ExampleApplication::MULTI
@ MULTI
Definition: ExampleApplication.h:339
agxOSG::SceneDescription::isValid
bool isValid() const
Definition: ExampleApplication.h:131
agx::Singleton
Base class for Singletons that should have its shutdown called explicitly before exit of the applicat...
Definition: Singleton.h:30
agxOSG::ExampleApplication::m_cameraHomeSet
bool m_cameraHomeSet
Definition: ExampleApplication.h:911
agxOSG::ExampleApplication::m_videoCaptureRenderToTexture
RenderToTextureRef m_videoCaptureRenderToTexture
Definition: ExampleApplication.h:996
agxOSG::ExampleApplication::m_explicitJournalConfigurationPath
bool m_explicitJournalConfigurationPath
Definition: ExampleApplication.h:930
agxOSG::ExampleApplication::m_exitCode
int m_exitCode
Definition: ExampleApplication.h:902
agxOSG::ExampleApplication::m_allowWindowResizing
bool m_allowWindowResizing
Definition: ExampleApplication.h:961
GuiEventListener.h
agxOSG::ExampleApplication::getPickHandler
PickHandler * getPickHandler()
Definition: ExampleApplication.h:602
agxOSG::ExampleApplication::m_newSimulation
bool m_newSimulation
Definition: ExampleApplication.h:879
agxOSG::CameraData::center
agx::Vec3 center
Definition: ExampleApplication.h:292
agx::Mutex
std::mutex Mutex
Definition: Referenced.h:93
PickHandler.h
agxOSG::ExampleApplication::m_journalFormat
agx::UInt m_journalFormat
Definition: ExampleApplication.h:931
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:871
agxOSG::ExampleApplication::getViewer
osgViewer::Viewer * getViewer()
Definition: ExampleApplication.h:583
agxOSG::ExampleApplication::m_videoCapture
VideoFFMPEGPipeCaptureRef m_videoCapture
Definition: ExampleApplication.h:995
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
StatisticsRenderer.h
agxOSG::ExampleApplication::m_scene
osg::ref_ptr< osg::Group > m_scene
Definition: ExampleApplication.h:849
agx::Vec2T
Definition: Vec2Template.h:30
agxFMI2
This namespace contains functionality for using AGX together with version 2 of the Functional Mockup ...
agxOSG::ExampleApplication::m_cameraHomeCenter
agx::Vec3 m_cameraHomeCenter
Definition: ExampleApplication.h:913
agxOSG::ExampleApplication::m_initialized
bool m_initialized
Definition: ExampleApplication.h:869
agxOSG::ExampleApplication::m_coSimulationServer
agx::ref_ptr< agx::Referenced > m_coSimulationServer
Definition: ExampleApplication.h:903
agxOSG::CameraData::aspectRatio
double aspectRatio
Definition: ExampleApplication.h:287
agxOSG::ExampleApplication::m_videoName
std::string m_videoName
Definition: ExampleApplication.h:994
agxOSG::ExampleApplication::setEnablePauseUpdate
void setEnablePauseUpdate(bool flag)
Definition: ExampleApplication.h:527
agxOSG::ExampleApplication::getSimulation
agxSDK::Simulation * getSimulation()
Definition: ExampleApplication.h:514
agxOSG::LightsSynchronization::~LightsSynchronization
virtual ~LightsSynchronization()
Definition: ExampleApplication.h:202
agx::HashSet< agxCollide::GeometryPair >
agxOSG::createVisual
AGXOSG_EXPORT agxOSG::GeometryNode * createVisual(const agxCollide::Geometry *geometry, osg::Group *root, float detailRatio=1.0f, bool createAxes=false, bool evenIfSensor=true)
Given a geometry, this function create visual representation of the shape.
GeometryPair.h
agx::root
AGXCORE_EXPORT Component * root()
agxOSG::SceneDecorator::LIGHT1
@ LIGHT1
Definition: SceneDecorator.h:213
agxOSG::ExampleApplication::m_luaFilePath
std::string m_luaFilePath
Definition: ExampleApplication.h:926
agxOSG::ExampleApplication::m_stepTimer
agx::Timer m_stepTimer
Definition: ExampleApplication.h:964
agxOSG::ExampleApplication::m_vSync
bool m_vSync
Definition: ExampleApplication.h:925
agxOSG::ExampleApplication::m_coSimulationInputFile
std::string m_coSimulationInputFile
Definition: ExampleApplication.h:921
agxGL::Camera::setViewPort
void setViewPort(unsigned width, unsigned height)
agxOSG::CameraData::farClippingPlane
double farClippingPlane
Definition: ExampleApplication.h:285
agxOSG::ExampleApplication::m_profilingRoot
std::string m_profilingRoot
Definition: ExampleApplication.h:917
agxOSG::ExampleApplication::clearAddedScenes
void clearAddedScenes()
Remove all added scenes.
Definition: ExampleApplication.h:393
agxOSG::ExampleApplication::m_viewer
osg::ref_ptr< osgViewer::Viewer > m_viewer
Definition: ExampleApplication.h:843
ScriptContext.h
agxOSG::ExampleApplication::m_loadedSceneFile
bool m_loadedSceneFile
Definition: ExampleApplication.h:973
ScriptManager.h
agxOSG::ExampleApplication::m_coSimulationOutputFile
std::string m_coSimulationOutputFile
Definition: ExampleApplication.h:922
agxOSG::CameraManipulatorFactory::Types
Types
Definition: ExampleApplication.h:231
agxOSG::ExampleApplication::m_profilingFrequency
agx::Real m_profilingFrequency
Definition: ExampleApplication.h:970
agx::Event1< bool >
agxGL::Camera::setViewMatrix
void setViewMatrix(const agx::Matrix4x4 &matrix)
Set the view matrix.
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agxOSG::ExampleApplication::getArguments
agxIO::ArgumentParser * getArguments()
Definition: ExampleApplication.h:376
agxOSG::ExampleApplication::ITERATIVE
@ ITERATIVE
Definition: ExampleApplication.h:340
agx::UInt
uint32_t UInt
Definition: Integer.h:34
ContactEventListener.h
agx::Timer
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
Definition: Timer.h:74
agxOSG::ExampleApplication::getLuaFilePath
std::string getLuaFilePath() const
Get file path to most recent lua file.
Definition: ExampleApplication.h:608
agxOSG::ExampleApplication::m_journalRealMode
agx::RealModeEnum m_journalRealMode
Definition: ExampleApplication.h:941
agxOSG::ExampleApplication::m_coSimulationOutputData
agx::RealVector m_coSimulationOutputData
Definition: ExampleApplication.h:924
agxOSG::ExampleApplication::m_journalFrequency
agx::Real m_journalFrequency
Definition: ExampleApplication.h:940
agxOSG::ExampleApplication::m_enableStepping
bool m_enableStepping
Definition: ExampleApplication.h:953
agxOSG::ExampleApplication::KeyBindingsVector
agx::Vector< SceneDescription > KeyBindingsVector
Definition: ExampleApplication.h:858
agxOSG::ExampleApplication::AutoStepEvent
agx::Event1< bool > AutoStepEvent
Definition: ExampleApplication.h:320
agxOSG::ExampleApplication::m_settings
agxCFG::ConfigScriptRef m_settings
Definition: ExampleApplication.h:895
agxOSG::ExampleApplication::m_interactiveRemoteClient
bool m_interactiveRemoteClient
Definition: ExampleApplication.h:990
agxOSG::CameraData::nearFarRatio
double nearFarRatio
Definition: ExampleApplication.h:289
agxOSG::ExampleApplication::m_shouldStop
bool m_shouldStop
Definition: ExampleApplication.h:901
agxOSG::ExampleApplication::m_xmlPlotFile
std::string m_xmlPlotFile
Definition: ExampleApplication.h:897
agxOSG::ExampleApplication::m_pBufferCamera
osg::ref_ptr< osg::Camera > m_pBufferCamera
Definition: ExampleApplication.h:969
agxOSG::ExampleApplication::m_cfgFileName
std::string m_cfgFileName
Definition: ExampleApplication.h:870
agxOSG::CameraManipulatorFactory::s_instance
static CameraManipulatorFactory * s_instance
Definition: ExampleApplication.h:258
agxOSG::ExampleApplication::m_automaticStop
bool m_automaticStop
Definition: ExampleApplication.h:874
export.h
GuiEventAdapter.h
agxOSG::ExampleApplication::m_journalRecordStartTime
agx::Real m_journalRecordStartTime
Definition: ExampleApplication.h:938
agxOSG::ExampleApplication::m_quickProfiling
bool m_quickProfiling
Definition: ExampleApplication.h:915
agxOSG::ExampleApplication::getStepCallback
agx::Callback getStepCallback() const
Definition: ExampleApplication.h:395
agxOSG::ExampleApplication::m_gridSize
agx::Vec2 m_gridSize
Definition: ExampleApplication.h:982
ArgumentParser.h
Camera.h
Lights.h
agx::AgXString< std::string >
agxOSG::CameraSynchronization::operator()
virtual void operator()(osg::RenderInfo &) const
Definition: ExampleApplication.h:168
agxOSG::RenderToTexture
Definition: RenderToTexture.h:29
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx::init
void AGXPHYSICS_EXPORT init()
Initialize agx.
agxOSG::ExampleApplication::m_renderProxyFactory
agxOSG::RenderProxyFactory * m_renderProxyFactory
Definition: ExampleApplication.h:952
agxOSG::CameraManipulatorFactory::getType
Types getType() const
Definition: ExampleApplication.h:251
agxOSG::SceneDecorator::LIGHT0
@ LIGHT0
Definition: SceneDecorator.h:212
agxOSG::ExampleApplication::m_sceneRoot
osg::ref_ptr< osg::Group > m_sceneRoot
Definition: ExampleApplication.h:848
agx::Vec3T< Real >
agxOSG::ExampleApplication::m_pauseUpdate
bool m_pauseUpdate
Definition: ExampleApplication.h:987
agxOSG::GeometryNode
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition: GeometryNode.h:41
agxOSG::ExampleApplication::m_journalRecordPath
std::string m_journalRecordPath
Definition: ExampleApplication.h:935
agxOSG::ExampleApplication::m_pickHandler
PickHandlerRef m_pickHandler
Definition: ExampleApplication.h:893
agxData::Value::transform
T transform() const
Definition: Value.h:333
DepthPeeling.h
ImageCapture.h
agxOSG::CameraSynchronization::CameraSynchronization
CameraSynchronization(osg::Camera *mainCamera, agxGL::Camera *glCamera)
Definition: ExampleApplication.h:160
agxOSG::ExampleApplication::getSceneDecorator
agxOSG::SceneDecorator * getSceneDecorator()
Definition: ExampleApplication.h:400
agxOSG::ExampleApplication::getImageCapture
agxOSG::ImageCapture * getImageCapture()
Definition: ExampleApplication.h:635
agxOSG::LightSource
Definition: LightSource.h:32
agx::Callback2
Templated callback with two arguments.
Definition: Callback.h:139
agxOSG::ExampleApplication::getSceneSwitch
osg::Group * getSceneSwitch()
Definition: ExampleApplication.h:447
agxOSG::CameraManipulatorFactory::shutdown
virtual void shutdown() override
Implement this method to cleanup your Singleton class.
Definition: ExampleApplication.h:255
agxOSG::ExampleApplication::initialized
bool initialized() const
Definition: ExampleApplication.h:398
agxOSG::ExampleApplication::m_timelineFormats
agx::Vector< agx::String > m_timelineFormats
Definition: ExampleApplication.h:918
agxOSG::ExampleApplication::m_realTimeRest
agx::Real m_realTimeRest
Definition: ExampleApplication.h:963
agxOSG::ExampleApplication::isCameraHomeSet
bool isCameraHomeSet() const
Definition: ExampleApplication.h:643
agxOSG::RenderProxyFactory
Implementation of the abstract class from the agxRender namespace, this class is responsible for crea...
Definition: agxOSG/RenderProxy.h:74
agxGL::Lights
Container class for lights that is used for synchronizing light data with shaders,...
Definition: Lights.h:30
agxOSG::ExampleApplication::getScene
osg::Group * getScene()
Definition: ExampleApplication.h:443
agxOSG::LightsSynchronization::LightsSynchronization
LightsSynchronization(agxGL::Lights *mainLights, agxOSG::SceneDecorator *decorator)
Definition: ExampleApplication.h:196
HighAccuracyTimer.h
agxOSG::ExampleApplication::m_decorator
osg::ref_ptr< agxOSG::SceneDecorator > m_decorator
Definition: ExampleApplication.h:840
agxOSG::ExampleApplication::m_journalStartTime
agx::Real m_journalStartTime
Definition: ExampleApplication.h:932
agxOSG::createAxes
AGXOSG_EXPORT osg::MatrixTransform * createAxes(agxCollide::Geometry *geometry, agx::Frame *relativeTransform, osg::Group *root, float scale=1, const agx::Vec4f &color=agx::Vec4f())
Creates osg axes relative a geometry given relative transform.
agxOSG::CameraData::fieldOfView
double fieldOfView
Definition: ExampleApplication.h:286
agxOSG::ExampleApplication::m_keyBindings
KeyBindings m_keyBindings
Definition: ExampleApplication.h:860
agxOSG::ExampleApplication::m_relativeStopTime
agx::Real m_relativeStopTime
Definition: ExampleApplication.h:876
agxOSG::CameraData::up
agx::Vec3 up
Definition: ExampleApplication.h:293
agxOSG::ExampleApplication::m_frameSleepTimer
agx::Timer m_frameSleepTimer
Definition: ExampleApplication.h:965
agxOSG::ExampleApplication::m_imageCapture
agxOSG::ImageCaptureRef m_imageCapture
Definition: ExampleApplication.h:845
agxOSG::SceneDescription
A pod-struct for holding information about scenes to load by the application.
Definition: ExampleApplication.h:117
agxOSG::ExampleApplication::m_stopTime
agx::Real m_stopTime
Definition: ExampleApplication.h:877
RenderTarget.h
agx::Event
An event with no arguments.
Definition: Event.h:89
agxOSG::ExampleApplication::m_osgWindow
bool m_osgWindow
Definition: ExampleApplication.h:852
agxGL::Camera::setProjectionMatrix
void setProjectionMatrix(const agx::Matrix4x4 &matrix)
Set the projection matrix.
agx::RealModeEnum
RealModeEnum
The data type for basic floating point representation.
Definition: Real.h:35
agxData::Val
Only use as member allocated variable.
Definition: Value.h:278
agxOSG::ExampleApplication::m_journalStopTime
agx::Real m_journalStopTime
Definition: ExampleApplication.h:933
agxOSG::ExampleApplication::m_generateTaskProfile
bool m_generateTaskProfile
Definition: ExampleApplication.h:919
agxOSG::ExampleApplication::m_startScene
int m_startScene
Definition: ExampleApplication.h:954
agxOSG::ExampleApplication::m_shouldLoadXmlPlot
bool m_shouldLoadXmlPlot
Definition: ExampleApplication.h:898
agxOSG::ExampleApplication::getTextureCamera
osg::Camera * getTextureCamera()
Definition: ExampleApplication.h:640
agxNet
Containins classes for sending/reading data over sockets as well as compression functionality.
Definition: MacUtil.h:22
agxOSG::ExampleApplication::getRenderProxyFactory
agxOSG::RenderProxyFactory * getRenderProxyFactory()
Definition: ExampleApplication.h:378
agxIO::ArgumentParser
A small argument parser class.
Definition: ArgumentParser.h:38
agxOSG::SceneDescription::valid
bool valid
Definition: ExampleApplication.h:138
agxOSG::CameraData::nearClippingPlane
double nearClippingPlane
Definition: ExampleApplication.h:284
agxOSG::ExampleApplication::m_frameMutex
agx::Mutex m_frameMutex
Definition: ExampleApplication.h:957
AGXOSG_EXPORT
#define AGXOSG_EXPORT
agxOSG::ExampleApplication::m_addBodyCallback
agxSDK::Simulation::RigidBodyEvent::CallbackType m_addBodyCallback
Definition: ExampleApplication.h:947
agxOSG::ExampleApplication::m_cameraHomeEye
agx::Vec3 m_cameraHomeEye
Definition: ExampleApplication.h:912
agxOSG::ExampleApplication::m_parameterFilePath
std::string m_parameterFilePath
Definition: ExampleApplication.h:867
agxOSG::LightsSynchronization
Definition: ExampleApplication.h:193
agxOSG::RenderTarget
Render target is used for rendering camera content to a buffer, either a DEPTH or COLOR target.
Definition: RenderTarget.h:40
PopDisableWarnings.h
agxOSG::ExampleApplication::setStepCallback
void setStepCallback(agx::Callback callback)
Definition: ExampleApplication.h:396
agxOSG::VideoFFMPEGPipeCapture
Definition: VideoFFMPEGPipeCapture.h:35