AGX Dynamics  2.38.0.2
ExampleApplication.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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>
47 
48 #if AGX_USE_WEBSOCKETS()
50 #endif
51 
52 #include <agxSDK/Simulation.h>
56 #include <agxOSG/ImageCapture.h>
57 #include <agxCFG/ConfigScript.h>
58 
59 #include <agx/Timer.h>
60 #include <agx/Journal.h>
62 
63 #include <agxIO/ArgumentParser.h>
64 #include <agx/HighAccuracyTimer.h>
65 
66 #include <cstddef>
67 
68 #if AGX_USE_OPENGL()
69 #include <agxGL/Camera.h>
70 #include <agxGL/Lights.h>
71 #endif
72 
73 #if AGX_USE_PYTHON()
74 # include <agxPython/ScriptManager.h>
75 # include <agxPython/ScriptContext.h>
76 # include <agx/config/AGX_PYTHON_VERSION.h>
77 #endif
78 
79 #ifdef __clang__
80 #pragma clang diagnostic pop
81 #endif
82 
83 namespace osgGA
84 {
85  class StandardManipulator;
86  class MatrixManipulator;
87 }
88 
89 namespace agxFMI2
90 {
91  namespace Export
92  {
93  class Module;
94  }
95 }
96 
97 
98 namespace agxSDK
99 {
100  class Assembly;
101 }
102 
103 namespace agxNet
104 {
105  class CoSimulationServer;
106 }
107 
108 namespace agxOSG {
109  class ExampleApplication;
110  class SceneDecorator;
111  class RenderProxyFactory;
112  class GeometryNode;
113 #if AGX_USE_WEBSOCKETS()
114  class ExampleApplicationController;
115 #endif
116 
117  typedef osg::Group * (*BuildScenePtr)(agxSDK::Simulation *simulation, ExampleApplication *application);
118 
121 
124 
126  SceneDescription(BuildScenePtr sc, bool isTest = false, float stop = -1, bool isSlowUnittest = false);
127 
129  SceneDescription(const std::string& scriptFileName, const std::string& scriptFunctionName, bool isTest = false, float stop = -1, bool isSlowUnittest = false);
130 
132  SceneDescription(const std::string& sceneFile, bool isTest = false, float stop = -1, bool isSlowUnittest = false);
133 
134  bool isValid() const { return valid; }
135 
136 
138  bool unittest;
139  float stopAfter;
141  bool valid;
142  std::string scriptFunction;
143  std::string fileName;
144  };
145 
146 
147 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
148 # if OSG_VERSION_GREATER_OR_EQUAL(2,9,11)
149  typedef osgGA::StandardManipulator CameraManipulatorType;
150 # else
151  typedef osgGA::MatrixManipulator CameraManipulatorType;
152 # endif
153 #else
154  typedef osgGA::MatrixManipulator CameraManipulatorType;
155 #endif
156 
157 
158 
159 #if AGX_USE_OPENGL()
160  class CameraSynchronization : public osg::Camera::DrawCallback
161  {
162  public:
163  CameraSynchronization(osg::Camera *mainCamera, agxGL::Camera *glCamera) : m_mainCamera(mainCamera), m_glCamera(glCamera)
164  {
165  }
166 
168  {
169  }
170 
171  virtual void operator () (osg::RenderInfo& /* renderInfo */) const
172  {
173  // Explicit support for Real=float agx with Real=double osg
174  agxData::Val<agx::Matrix4x4d> projection(agx::Matrix4x4d(m_mainCamera->getProjectionMatrix().ptr()));
175  agx::Matrix4x4 m = projection.transform<agx::Matrix4x4 > ();
176 
177  if (m != m_glCamera->getProjectionMatrix())
178  m_glCamera->setProjectionMatrix(m);
179 
180  agxData::Val<agx::Matrix4x4d> view(agx::Matrix4x4d(m_mainCamera->getViewMatrix().ptr()));
181  agx::Matrix4x4 m2 = view.transform<agx::Matrix4x4 > ();
182 
183  if (m2 != m_glCamera->getViewMatrix())
184  m_glCamera->setViewMatrix(m2);
185 
186  auto viewport = m_mainCamera->getViewport();
187  m_glCamera->setViewPort(static_cast<int>(viewport->width()), static_cast<int>(m_mainCamera->getViewport()->height()));
188  }
189  using osg::Camera::DrawCallback::operator();
190 
191  private:
192  osg::Camera *m_mainCamera;
193  agxGL::Camera *m_glCamera;
194  };
195 
196  class LightsSynchronization : public osg::Camera::DrawCallback
197  {
198  public:
200  : m_glLights(mainLights),
201  m_decorator(decorator)
202  {
203  }
204 
206  {
207  }
208 
209  virtual void operator () (osg::RenderInfo& /* renderInfo */) const
210  {
211 
212  auto updateLight = [this](size_t index, agxOSG::LightSource l)
213  {
214  m_glLights->setLightPosition(index, l.getPosition());
215  m_glLights->setLightDirection(index, l.getDirection());
216  };
217 
218  updateLight(0, m_decorator->getLightSource(agxOSG::SceneDecorator::LIGHT0));
219  updateLight(1, m_decorator->getLightSource(agxOSG::SceneDecorator::LIGHT1));
220  updateLight(2, m_decorator->getLightSource(agxOSG::SceneDecorator::LIGHT2));
221  }
222 
223  using osg::Camera::DrawCallback::operator();
224 
225  private:
226  agxGL::Lights *m_glLights;
227  SceneDecorator *m_decorator;
228  };
229 #endif
230 
232  {
233  public:
234  enum Types { TRACKBALL,
235 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
236 # if OSG_VERSION_GREATER_OR_EQUAL(2,9,11)
237  FPS,
238 # endif
239 #endif
240  NUM_TYPES };
241 
243 
244  static CameraManipulatorFactory* instance();
245 
246  CameraManipulatorType* next( osgViewer::Viewer* viewer = nullptr );
247  CameraManipulatorType* next( osgViewer::GraphicsWindow* window = nullptr );
248  CameraManipulatorType* create( osgViewer::Viewer* viewer = nullptr );
249  CameraManipulatorType* create( Types type, osgViewer::Viewer* viewer = nullptr );
250  CameraManipulatorType* create( Types type, osgViewer::GraphicsWindow* window = nullptr );
251  CameraManipulatorType* create( osgViewer::GraphicsWindow* window = nullptr );
252 
253  void setType( Types type ) { m_currentType = type; }
254  Types getType() const { return m_currentType; }
255 
256  protected:
257  SINGLETON_CLASSNAME_METHOD();
258  virtual void shutdown() override { s_instance = nullptr; }
259  osgViewer::GraphicsWindow* getWindow( osgViewer::Viewer* viewer, size_t num = 0 ) const;
260 
263  };
264 
266  {
270  CameraData( const osg::Camera* camera );
271 
275  CameraData( const osgViewer::Viewer* viewer );
276 
280  void applyTo( osg::Camera* camera ) const;
281 
285  void applyTo( osgViewer::Viewer* viewer ) const;
286 
289  double fieldOfView;
290  double aspectRatio;
291  bool valid;
292  double nearFarRatio;
293 
297 
298  private:
299  CameraData();
300  void initialize( const osg::Camera* camera );
301  };
302 
305 
306  public:
307  virtual void preFrame(ExampleApplication* app);
308  virtual void postFrame(ExampleApplication* app);
309 
310  protected:
311  virtual ~ExampleApplicationListener() override;
312  };
313 
314 
316 
321  {
322  public:
325 
332  {
333  MAIN_SCENE_MASK = 1 << 1,
334  DEBUG_RENDER_MASK = 1 << 2,
335  OSG_RENDER_MASK = 1 << 3,
336  HUD_MASK = 1 << 4,
337  DECORATOR_MASK = 1 << 5,
338  };
339 
341  {
342  MULTI, // New.
343  ITERATIVE, // New forced to iterative.
344  NUM_SOLVERS
345  };
346 
347 
348  void setSolverType( SolverType t ) { m_solverType = t; }
349  SolverType getSolverType() const { return m_solverType; }
350 
351  std::string getSolverName( SolverType t ) const;
352  SolverType getSolverType( const std::string& name ) const;
353 
357  void addAutoPausePair(const agx::RigidBody *body1, const agx::RigidBody *body2);
358  void addAutoPausePair(const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2);
359  void removeAutoPausePair(const agx::RigidBody *body1, const agx::RigidBody *body2);
360  void removeAutoPausePair(const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2);
361 
365  void setEnableAutoPausing(bool flag);
366  bool getEnableAutoPausing();
367 
369  ExampleApplication( agxSDK::Simulation *simulation=nullptr );
370 
371  bool init( agxIO::ArgumentParser* arguments, bool agxOnly = false );
372 
373  void addListener(ExampleApplicationListener *listener);
374 
375 #ifndef SWIG
376  bool init( int argc, char** argv );
377 #endif
378 
379  agxIO::ArgumentParser* getArguments() { return m_arguments.get(); }
380 
381  agxOSG::RenderProxyFactory *getRenderProxyFactory() { return m_renderProxyFactory; }
382 
383  void setTimeStep( agx::Real dt );
384  agx::Real getTimeStep() const;
385 
386  bool addScene( const std::string& scriptFile, const std::string& scriptFunction, int key, bool isPartofUnitTest=true, float stopAfter=-1, bool isSlowUnittest=false );
387  bool addScene( const std::string& scriptFile, const std::string& scriptFunction, bool isPartofUnitTest=true, float stopAfter=-1, bool isSlowUnittest=false );
388 
389  bool addScene( BuildScenePtr sceneFunction, int key, bool isPartofUnitTest=true, float stopAfter=-1, bool isSlowUnittest=false );
390  bool addScene( BuildScenePtr sceneFunction, bool isPartofUnitTest=true, float stopAfter=-1, bool isSlowUnittest=false );
391 
392  bool addScene( SceneDescription sceneDescription, int key);
393  bool addScene( SceneDescription sceneDescription);
394 
396  void clearAddedScenes() { m_keybindingVector.clear(); }
397 
398  agx::Callback getStepCallback() const { return m_stepCallback; }
399  void setStepCallback(agx::Callback callback) { m_stepCallback = callback; }
400 
401  bool initialized() const { return m_initialized; }
402 
403  agxOSG::SceneDecorator *getSceneDecorator() { return m_decorator; }
404 
405  virtual int run();
406 
407  void setOsgNotifyLevel(osg::NotifySeverity severity) const;
408 
420  osg::Group* executePythonScript(const agx::String& file, const agx::String& function, bool& success);
421 
426  void stop(int exitCode = 0) { m_shouldStop = true; m_exitCode = exitCode; }
427 
429  void cancelStop() { m_shouldStop = false; }
430 
432  bool shouldStop() const { return m_shouldStop; }
433 
440  bool setWindowRectangle(unsigned int x, unsigned int y, unsigned int width, unsigned int height);
441 
447  bool setWindowTitle(const std::string& title);
448 
450  bool breakRequested() const;
451 
452  virtual void setupViewer( bool lightingEnabled = true, bool visibleWindow = true );
453 
454  void setupVideoCaptureRenderTotexture();
455 
456  //void initScene();
457 
458  osg::Group *getScene() { return m_scene.get(); }
459  void setScene(osg::Group *scene ) { m_scene = scene; }
460  osg::Group *getSceneRoot() { return m_sceneRoot.get(); }
461  osg::Group* getSceneAgxOSGRoot();
462  osg::Group *getSceneSwitch() { return m_sceneSwitch.get(); }
463 
464 #ifdef AGX_HAVE_DEPTHPEELING
465  void setEnableDepthPeeling( bool flag );
466  bool getEnableDepthPeeling() const;
467  agxOSG::DepthPeeling* getDepthPeeling();
468 #endif
469 
477  bool setEnableDebugRenderer( bool flag );
478 
480  bool getEnableDebugRenderer() const;
481 
482  void setEnableTextDebugRendering( bool flag );
483  bool getEnableTextDebugRendering() const;
484 
485  void setEnableCaptureSyncWithSimulation( bool enableSync );
486  bool getEnableCaptureSyncWithSimulation( ) const;
487 
488  void setEnableOSGRenderer( bool flag );
489  bool getEnableOSGRenderer();
490 
491  void setEnableVSync( bool flag, bool forceUpdate = false );
492  bool getEnableVSync() const;
493 
494  void getCameraHome( agx::Vec3& eye, agx::Vec3& center, agx::Vec3& up);
495  void setCameraHome( const agx::Vec3& eye, const agx::Vec3& center, const agx::Vec3& up=agx::Vec3(0,0,1) );
496 
502  void addRenderTarget(agxOSG::RenderTarget* rtt, osg::Node *targetSceneNode=nullptr);
503 
508  bool removeRenderTarget(agxOSG::RenderTarget* rtt);
509 
515  void setDebugRenderInverseMatrix( const agx::AffineMatrix4x4 &m );
516 
517 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
518 # if OSG_VERSION_GREATER_OR_EQUAL(2,9,11)
519  osgGA::CameraManipulator* getCameraManipulator();
520  const osgGA::CameraManipulator* getCameraManipulator() const;
521 #else
522  osgGA::MatrixManipulator* getCameraManipulator();
523  const osgGA::MatrixManipulator* getCameraManipulator() const;
524 #endif
525 #else
526  osgGA::MatrixManipulator* getCameraManipulator();
527  const osgGA::MatrixManipulator* getCameraManipulator() const;
528 #endif
529  agxSDK::Simulation *getSimulation() { return m_simulation.get(); }
530 
531  bool restoreFromFile( const std::string& filename );
532  void journalRenderLoader(agxSDK::Assembly *assembly, bool keyFrame);
533 
534 
541  void setAutoStepping( bool flag, bool resetTimer = true );
542 
544  bool getAutoStepping( ) const;
545 
546 
547  void setEnablePauseUpdate( bool flag ) { m_pauseUpdate = flag; }
548  bool getEnablePauseUpdate( ) const { return m_pauseUpdate; }
549 
555  void setRealTimeSync(bool flag);
556  bool getRealTimeSync() const;
557 
558  agx::Journal *getJournal();
559  const std::string& getJournalConfigurationPath() const;
560  const std::string& getJournalPlaybackPath() const;
561 
562  void setJournalConfigurationPath(const agx::String& path);
563 
564  void setEnableJournalIncrementalStructure( bool enable );
565  bool getEnableJournalIncrementalStructure() const;
566 
567  SceneDescription getCallbackIdx( size_t idx );
568 
569  SceneDescription getCallback( int key );
570  bool createSceneFromKey( int key );
571  bool createSceneFromIndex( int idx, bool firstStartUp = false );
572 
573 
574  void reloadScene();
575  void createNextScene();
576  void createPreviousScene();
577 
578  size_t getNumScenes() const;
579 
580  void step();
581 
582  void changeSolver();
583 
584  const std::string& getSaveSceneFilename() const { return m_sceneFilename; }
585 
586  osg::Group *getRoot() { return m_root.get(); }
587 
588  void fitSceneIntoView();
589  void initSimulation(agxSDK::Simulation *simulation = nullptr, bool initializeGraphics = true);
590  void initViewer(int width, int height, bool osgWindow = true);
591 
592  void initGraphics();
593  void initRpc();
594  bool readCFGFile();
595 
601  void stopAfter(const agx::Real stopTime);
602 
603  osgViewer::Viewer *getViewer() { return m_viewer.get(); }
604  osg::Camera *getCamera() { if (m_viewer.valid()) return m_viewer->getCamera(); else return nullptr; }
605 
606  bool hasOffscreenWindow() const;
607 
611  agxOSG::CameraData getCameraData() const;
612 
616  void applyCameraData( const agxOSG::CameraData& cameraData );
617 
618  intptr_t getHWND() const;
619 
620  agx::Vec3 getViewDirection();
621 
622  PickHandler* getPickHandler() { return m_pickHandler; }
623  const PickHandler* getPickHandler() const { return m_pickHandler; }
624 
625  std::string getScriptFile() const { return m_scriptFile; }
626 
627  void handleReactiveScriptErrors( bool abortSimulation = true );
628 
629  agx::Real getTimeStamp() const;
630 
631  void clearScene();
632 
633  void setEnableSimulationDump( bool flag );
634  bool getEnableSimulationDump( ) const;
635 
636  void updateCoSimulationServer();
637  bool updatePythonCoSimulationServer(const agx::String& filename, std::stringstream& buffer);
638  bool coSimulationCallPython(agxNet::CoSimulationServer* server);
639 
640  void updateRemoteDebugger();
641  void centerScene();
642  void stepSimulation();
643 
644  bool useCoSimulation() const {return m_useCoSimulation;}
645 
646  agx::Vec3 getGravity() const { return m_gravity; }
647 
648 
649  agxOSG::ImageCapture *getImageCapture() { return m_imageCapture; }
650  const agxOSG::ImageCapture *getImageCapture() const { return m_imageCapture; }
651 
653 
654  osg::Camera *getTextureCamera() { return m_textureCamera; }
655 
656 
657  bool isCameraHomeSet() const { return m_cameraHomeSet; }
658 
659  static void registerRemovedGeometry(GeometryNode *node);
660 
661  void storeInitialJournalState();
662  void initRecordJournal();
663  void initAppendJournal();
664 
665  void journalPlayback();
666  void listSessionNames(const std::string& journalToList);
667 
677  double heading, double elevation, double distance,
678  int trackerMode = 0);
679 
689  const agx::Vec3& eye, const agx::Vec3& center, const agx::Vec3& up = agx::Vec3::Z_AXIS(),
690  int trackerMode = 0);
691 
698  bool executeOneStepWithGraphics(agx::HighAccuracyTimer& timer);
699 
700  bool executeOneStepWithoutGraphics();
701 
702  void updateServices();
703 
704 
709  bool done() const;
710 
711 
716  void setQuitEventSetsDone(bool flag);
717  bool getQuitEventSetsDone() const;
718 
722  bool getAllowWindowResizing() const;
723 
727  void setAllowWindowResizing(bool flag);
728 
733  void takeScreenShot(const agx::String& filename="");
734 
735  void synchronizedStep(bool blocking = false);
736 
737  void stepWrapper();
738 
739  void initScene();
740  void initScene(osg::Group *root);
741 
742 
744  agx::UInt getJournalFormat() const;
745 
747  void setJournalFormat(agx::UInt journalFormat);
748 
750  void setEnableJournal32bitMode(bool enable);
751 
753  void setEnableJournalRecord(bool enable);
754 
756  void setRequestedJournalFrequency(agx::Real freq);
757 
759  void setJournalRecordPath(const agx::String& journalPath);
760 
762  void setCoordinateSystemTransform( const agx::AffineMatrix4x4& coordinateSystemTransform);
763 
765  agx::AffineMatrix4x4 getCoordinateSystemTransform() const;
766 
768  void setGridSize(const agx::Vec2& gridSize);
769 
771  agx::Vec2 getGridSize() const;
772 
774  void setGridResolution(const agx::Vec2u gridResolution);
775 
777  agx::Vec2u getGridResolution() const;
778 
780  void setEnableGrid(bool flag);
781 
783  bool getEnableGrid() const;
784 
786  void setEnableCoordinateSystem(bool flag);
787 
789  bool getEnableCoordinateSystem() const;
790 
791  // Throttle calls to avoid excessive CPU usage
792  // Is automatically called from `executeWithoutGraphics`
793  void throttleIdleCpuUsageBySleeping();
794 
795  agxOSG::RenderToTexture * getVideoCaptureRendertoTexture() { return m_videoCaptureRenderToTexture; }
796 
797  std::string getProfilingJournalPath() const;
798 
799 #if AGX_USE_WEBSOCKETS()
800  agxOSG::ExampleApplicationController *getController();
801 
802  agx::UInt16 getControlChannelPort();
803  void pushParametersToControlChannel();
804  void setEnableControlChannelTickSignals(bool flag);
805  void pushFrameToRemoteViewer();
806 #endif
807 
808  void postExecution();
809  void setEnableThreadTimeline(bool flag);
810  void setEnableTaskProfile(bool flag);
811  int getExitCode() { return m_exitCode; }
812 
813 #if AGX_USE_PYTHON()
814  agxPython::ScriptContextInterface* initPythonContext(agxPython::ScriptManager *scriptManager);
815 #endif
816 
817  void createVisual(agxSDK::Simulation *simulation, float detailRatio = 1.0f, bool createAxes = false);
818  void createVisual(agxSDK::Assembly *assembly, float detailRatio = 1.0f, bool createAxes = false);
819  agx::Mutex& getFrameMutex() { return m_frameMutex; }
820 
825  void setTargetFPS(double fps);
826 
830  double getTargetFPS();
831 
832  protected:
833 
834  virtual ~ExampleApplication();
835 
836  void drawGrid();
837  void drawCoordinateSystem();
838 
839  void granularCreated( agxSDK::Simulation* sim, agx::RigidBody* body );
840  void addGranularCreateVisualCallbacks();
841  void foundIncrementalArchive( agx::Journal* journal );
842 
843  // Return true if we are ok with the number of particles with respect to the granular license limits.
844  bool validateGranularLicenseLimits();
845 
846  protected:
847  class SimulationListener;
848 
852  bool timeToStop() const;
853 
854 
855  void execute();
856  void executeWithoutGraphics();
857  bool executeOneStepWithoutGraphics(bool& saveAfterEnabled, agx::Real saveAfterTime, agx::HighAccuracyTimer& timer);
858 
859 
860  void executeWithGraphics();
861  bool executeOneStepWithGraphics(bool& saveAfterEnabled, agx::Real saveAfterTime, agx::HighAccuracyTimer& timer);
862 
863  void generateQuickProfiling();
864  void journalSceneLoader(const agx::String& path);
865  void removeGeometryNode(agxSDK::Simulation*, agxCollide::Geometry*);
866  void setArgumentsPostSceneCreation(); // This function will override a number of settings with their command line argument specifications
867  agxJson::Value extractSimulationStructureToJson();
868  void applyInitialParameters(const std::string& filePath);
869  void initThreadTimeline();
870 
871  void triggerPreFrameListeners();
872  void triggerPostFrameListeners();
873 
874  bool attachScripts( osg::Group* root );
875  osg::Group *executeMPyScript(const agx::String& file, bool& success);
876 
877  osg::Group *createScene( const SceneDescription& desc, bool &success );
878 
879  agx::Real calculateStopTime(const SceneDescription& desc);
880 
881  osg::ref_ptr<agxOSG::SceneDecorator> m_decorator;
883  osg::ref_ptr<agxOSG::GuiEventAdapter> m_eventAdapter;
884  osg::ref_ptr<osgViewer::Viewer> m_viewer;
885 
887 
888  osg::ref_ptr<osg::Group> m_root;
889  osg::ref_ptr<osg::Group> m_sceneRoot;
890  osg::ref_ptr<osg::Group> m_scene;
891  osg::ref_ptr<osg::Switch> m_sceneSwitch;
892 
894 
896 
898 
900 
903 
906 
907  std::string m_sceneFilename;
908  std::string m_parameterFilePath;
909 
911  std::string m_cfgFileName;
912 
914 
923  bool m_agxOnly;
925  // std::string m_exportMayaAnimationPath;
926 
927 #if AGX_USE_WEBSOCKETS()
928  friend class ExampleApplicationController;
929 #endif
930  friend class AutoPauseListener;
934 
936 
937  agxCFG::ConfigScriptRef m_settings;
938 
939  std::string m_xmlPlotFile;
941 
942  std::string m_scriptFile;
947 
949 #if AGX_USE_OPENGL()
952 #endif
959  std::string m_profilingRoot;
967  bool m_vSync;
968  std::string m_pythonFilePath;
975  std::string m_journalEofMode;
976  std::string m_journalRecordPath;
977  std::string m_journalSessionName;
980  // agx::UInt m_journalStride;
984 
987 
989 
991 
992 #ifdef AGX_HAVE_DEPTHPEELING
993  osg::ref_ptr<DepthPeeling> m_depthPeeling;
994 #endif
999  osg::ref_ptr<osg::Camera> m_textureCamera;
1011  osg::ref_ptr<osg::GraphicsContext> m_pBuffer;
1012  osg::ref_ptr<osg::Camera> m_pBufferCamera;
1014 
1015  public:
1018  bool m_isFMU;
1020  std::string m_hostName;
1021 
1022  protected:
1028  osg::ref_ptr<osg::Geode> m_grid;
1029  osg::ref_ptr<osg::MatrixTransform> m_coordinateSystem;
1038 
1039  std::string m_videoName;
1043 
1047  };
1048 
1049 }
agxOSG::ExampleApplication::m_isLoadingScene
bool m_isLoadingScene
Definition: ExampleApplication.h:1017
agxOSG::CameraData::eye
agx::Vec3 eye
Definition: ExampleApplication.h:294
agxOSG::ExampleApplication::m_coordinateSystemTransform
agx::AffineMatrix4x4 m_coordinateSystemTransform
Definition: ExampleApplication.h:1023
agxOSG::SceneDecorator::LIGHT2
@ LIGHT2
Definition: SceneDecorator.h:214
agxOSG::SceneDescription::unittest
bool unittest
Definition: ExampleApplication.h:138
agxOSG::ExampleApplication::m_coSimulationInputData
agx::RealVector m_coSimulationInputData
Definition: ExampleApplication.h:965
agxOSG::createAxes
AGXOSG_EXPORT osg::MatrixTransform * createAxes(float scale=1, float width=3)
Create a x, y and z arrow with the size 1.
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxOSG::CameraSynchronization
Definition: ExampleApplication.h:160
agxOSG::ExampleApplication::autoStepEvent
AutoStepEvent autoStepEvent
Definition: ExampleApplication.h:324
agxOSG::ExampleApplication::m_simulation
agxSDK::SimulationRef m_simulation
Definition: ExampleApplication.h:882
agxOSG::ExampleApplication::m_gridResolution
agx::Vec2u m_gridResolution
Definition: ExampleApplication.h:1024
agxOSG::ExampleApplication::m_sceneSwitch
osg::ref_ptr< osg::Switch > m_sceneSwitch
Definition: ExampleApplication.h:891
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:907
GraphicsThrottler
Definition: GraphicsThrottler.h:19
agxOSG::ExampleApplication::m_journalSessionName
std::string m_journalSessionName
Definition: ExampleApplication.h:977
agxOSG::CameraManipulatorFactory::m_currentType
Types m_currentType
Definition: ExampleApplication.h:262
agxOSG::ExampleApplication::getVideoServerCapture
agxOSG::VideoFFMPEGPipeCapture * getVideoServerCapture()
Definition: ExampleApplication.h:652
agxOSG::CameraData
Definition: ExampleApplication.h:265
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:932
VideoFFMPEGPipeCapture.h
agxOSG::ExampleApplication::m_eventAdapter
osg::ref_ptr< agxOSG::GuiEventAdapter > m_eventAdapter
Definition: ExampleApplication.h:883
agx::Vector< SceneDescription >
agxOSG::ExampleApplication::m_didStep
bool m_didStep
Definition: ExampleApplication.h:1009
agxOSG::ExampleApplication::stop
void stop(int exitCode=0)
Stop (=exit) the application at next opportunity.
Definition: ExampleApplication.h:426
agxOSG::ExampleApplication::m_useCoSimulation
bool m_useCoSimulation
Definition: ExampleApplication.h:962
agxOSG::ExampleApplication::m_removeGeometryCallback
agxSDK::Simulation::GeometryEvent::CallbackType m_removeGeometryCallback
Definition: ExampleApplication.h:998
agxOSG::ExampleApplication::m_journal
agx::ref_ptr< agx::Referenced > m_journal
Definition: ExampleApplication.h:983
agxOSG::ExampleApplication::m_GlCamera
agxGL::CameraRef m_GlCamera
Definition: ExampleApplication.h:950
agxOSG::ExampleApplicationListener
Definition: ExampleApplication.h:304
agxOSG::ExampleApplication::m_journalConfigurationPath
std::string m_journalConfigurationPath
Definition: ExampleApplication.h:970
Simulation.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxOSG::SceneDescription::stopAfter
float stopAfter
Definition: ExampleApplication.h:139
agxOSG::SceneDescription::scene
BuildScenePtr scene
Definition: ExampleApplication.h:137
agxOSG::CameraManipulatorFactory::setType
void setType(Types type)
Definition: ExampleApplication.h:253
agxOSG::ImageCapture
Definition: ImageCapture.h:129
agxOSG::ExampleApplication
Class that encapsulates rendering and simulation using OpenSceneGraph.
Definition: ExampleApplication.h:320
agxOSG::SceneDescription::fileName
std::string fileName
Definition: ExampleApplication.h:143
agxOSG::ExampleApplication::m_dt
agx::Real m_dt
Definition: ExampleApplication.h:1005
agxOSG::SceneDescription::slowUnittest
bool slowUnittest
Definition: ExampleApplication.h:140
agxOSG::PickHandler
Definition: agxOSG/PickHandler.h:75
agxOSG::ExampleApplication::m_debugClient
agx::ref_ptr< agx::Referenced > m_debugClient
Definition: ExampleApplication.h:946
agxOSG::ExampleApplication::m_cameraHomeUp
agx::Vec3 m_cameraHomeUp
Definition: ExampleApplication.h:956
agx::AffineMatrix4x4T
Matrix class for rigid transformations (translation, rotation).
Definition: AffineMatrix4x4.h:52
agxOSG::ExampleApplication::m_renderTargetSet
RenderTargetRefVector m_renderTargetSet
Definition: ExampleApplication.h:1010
agxOSG::ExampleApplication::CameraMask
CameraMask
Specifies node masks for different parts of the rendering scene.
Definition: ExampleApplication.h:331
agxOSG::ExampleApplication::m_scriptFile
std::string m_scriptFile
Definition: ExampleApplication.h:942
agxOSG::ExampleApplication::m_haveLicense
bool m_haveLicense
Definition: ExampleApplication.h:1003
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:985
agxOSG::CameraData::valid
bool valid
Definition: ExampleApplication.h:291
agxOSG::ExampleApplication::m_pythonFilePath
std::string m_pythonFilePath
Definition: ExampleApplication.h:968
agx::Vec3T< Real >::Z_AXIS
static Vec3T Z_AXIS()
Definition: Vec3Template.h:783
agxOSG::ExampleApplication::m_controller
agx::ref_ptr< agx::Referenced > m_controller
Definition: ExampleApplication.h:986
agxOSG::CameraSynchronization::~CameraSynchronization
virtual ~CameraSynchronization()
Definition: ExampleApplication.h:167
agxOSG::ExampleApplication::m_autoCycleThroughScenes
bool m_autoCycleThroughScenes
Definition: ExampleApplication.h:922
GraphicsThrottler.h
agxOSG::ExampleApplication::m_coordinateSystemEnabled
bool m_coordinateSystemEnabled
Definition: ExampleApplication.h:1026
agxOSG::ExampleApplication::KeyBindings
agx::HashTable< int, int > KeyBindings
Definition: ExampleApplication.h:897
agxOSG::ExampleApplication::m_agxOnly
bool m_agxOnly
Definition: ExampleApplication.h:923
agxOSG::ExampleApplication::m_extractSimulationStructureToJsonPath
std::string m_extractSimulationStructureToJsonPath
Definition: ExampleApplication.h:978
agxOSG::ExampleApplication::m_enableJournalIncrementalStructure
bool m_enableJournalIncrementalStructure
Definition: ExampleApplication.h:1032
ScriptManager.h
agxOSG::SceneDescription::scriptFunction
std::string scriptFunction
Definition: ExampleApplication.h:142
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:1002
agxOSG::ExampleApplication::m_sceneLoadEvent
agx::Event m_sceneLoadEvent
Definition: ExampleApplication.h:1019
agxOSG::ExampleApplication::m_explicitFmu
bool m_explicitFmu
Definition: ExampleApplication.h:1034
agxOSG::ExampleApplication::m_arguments
agxIO::ArgumentParserRef m_arguments
Definition: ExampleApplication.h:905
agxOSG::ExampleApplication::m_listeners
agx::Vector< ExampleApplicationListenerRef > m_listeners
Definition: ExampleApplication.h:1042
agxOSG::ExampleApplication::getSaveSceneFilename
const std::string & getSaveSceneFilename() const
Definition: ExampleApplication.h:584
agxOSG::ExampleApplication::m_hostName
std::string m_hostName
Definition: ExampleApplication.h:1020
ExampleApplicationController.h
agxGL::Lights::setLightDirection
bool setLightDirection(agx::UInt index, const agx::Vec3 &direction)
agxOSG::ExampleApplication::m_gfxThrottler
GraphicsThrottler m_gfxThrottler
Definition: ExampleApplication.h:1046
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:429
agx::VectorPOD< Real >
agxOSG::ExampleApplication::getExitCode
int getExitCode()
Definition: ExampleApplication.h:811
agxOSG::ExampleApplication::m_root
osg::ref_ptr< osg::Group > m_root
Definition: ExampleApplication.h:888
agxOSG::ExampleApplication::m_serviceMutex
agx::Mutex m_serviceMutex
Definition: ExampleApplication.h:1001
agxOSG::ExampleApplication::getVideoCaptureRendertoTexture
agxOSG::RenderToTexture * getVideoCaptureRendertoTexture()
Definition: ExampleApplication.h:795
agxOSG::ExampleApplication::m_enableJournalRecording
bool m_enableJournalRecording
Definition: ExampleApplication.h:1031
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:604
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:650
agxOSG::ExampleApplication::m_stepCallback
agx::Callback m_stepCallback
Definition: ExampleApplication.h:1035
agxOSG::ExampleApplication::m_isFMU
bool m_isFMU
Definition: ExampleApplication.h:1018
agxOSG::ExampleApplication::getEnablePauseUpdate
bool getEnablePauseUpdate() const
Definition: ExampleApplication.h:548
agxOSG::ExampleApplication::m_autoPauseListener
agxSDK::ContactEventListenerRef m_autoPauseListener
Definition: ExampleApplication.h:933
agxOSG::ExampleApplication::m_coordinateSystem
osg::ref_ptr< osg::MatrixTransform > m_coordinateSystem
Definition: ExampleApplication.h:1029
agxOSG::ExampleApplication::m_generateThreadTimeline
bool m_generateThreadTimeline
Definition: ExampleApplication.h:958
agxOSG::ExampleApplication::m_autoPausingEnabled
bool m_autoPausingEnabled
Definition: ExampleApplication.h:931
agxOSG::ExampleApplication::m_journalPlaybackPath
std::string m_journalPlaybackPath
Definition: ExampleApplication.h:969
agxOSG::ExampleApplication::m_numGfxFrames
size_t m_numGfxFrames
Definition: ExampleApplication.h:1045
agxOSG::ExampleApplication::m_gravity
agx::Vec3 m_gravity
Definition: ExampleApplication.h:948
agx::Block
Block synchronization primitive.
Definition: ThreadSynchronization.h:96
agxOSG::ExampleApplication::m_stopFrame
agx::UInt m_stopFrame
Definition: ExampleApplication.h:920
agxOSG::ExampleApplication::getFrameMutex
agx::Mutex & getFrameMutex()
Definition: ExampleApplication.h:819
agxOSG::ExampleApplication::getSceneRoot
osg::Group * getSceneRoot()
Definition: ExampleApplication.h:460
agxOSG::LightsSynchronization::operator()
virtual void operator()(osg::RenderInfo &) const
Definition: ExampleApplication.h:209
agxOSG::ExampleApplication::SolverType
SolverType
Definition: ExampleApplication.h:340
agxOSG::ExampleApplication::m_statisticsRenderer
StatisticsRendererRef m_statisticsRenderer
Definition: ExampleApplication.h:924
agxSDK::Assembly
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:67
agxGL::Camera
Definition: Camera.h:49
agxOSG::ExampleApplication::shouldStop
bool shouldStop() const
Definition: ExampleApplication.h:432
agxOSG::BuildScenePtr
osg::Group *(* BuildScenePtr)(agxSDK::Simulation *simulation, ExampleApplication *application)
Definition: ExampleApplication.h:117
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:975
agx::UInt16
uint16_t UInt16
Definition: Integer.h:31
agxOSG::ExampleApplication::m_solverType
SolverType m_solverType
Definition: ExampleApplication.h:904
agxOSG::ExampleApplication::m_timestep
agx::Real m_timestep
Definition: ExampleApplication.h:913
agxOSG::ExampleApplication::useCoSimulation
bool useCoSimulation() const
Definition: ExampleApplication.h:644
agxOSG::ExampleApplication::m_grid
osg::ref_ptr< osg::Geode > m_grid
Definition: ExampleApplication.h:1028
agxOSG::ExampleApplication::getRoot
osg::Group * getRoot()
Definition: ExampleApplication.h:586
agxOSG::ExampleApplication::getSolverType
SolverType getSolverType() const
Definition: ExampleApplication.h:349
agxOSG::ExampleApplication::m_textureCamera
osg::ref_ptr< osg::Camera > m_textureCamera
Definition: ExampleApplication.h:999
agxOSG::ExampleApplication::getScriptFile
std::string getScriptFile() const
Definition: ExampleApplication.h:625
agx::ref_ptr< Simulation >
agxOSG::CameraManipulatorType
osgGA::MatrixManipulator CameraManipulatorType
Definition: ExampleApplication.h:154
agxOSG::ExampleApplication::getGravity
agx::Vec3 getGravity() const
Definition: ExampleApplication.h:646
agxOSG::ExampleApplication::m_pBuffer
osg::ref_ptr< osg::GraphicsContext > m_pBuffer
Definition: ExampleApplication.h:1011
agxOSG::ExampleApplication::m_gridEnabled
bool m_gridEnabled
Definition: ExampleApplication.h:1027
agxOSG::ExampleApplication::m_GlLights
agxGL::LightsRef m_GlLights
Definition: ExampleApplication.h:951
agxOSG::CameraManipulatorFactory
Definition: ExampleApplication.h:231
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
agxOSG::ExampleApplication::setScene
void setScene(osg::Group *scene)
Definition: ExampleApplication.h:459
agxOSG::ExampleApplication::setSolverType
void setSolverType(SolverType t)
Definition: ExampleApplication.h:348
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:916
agxOSG::ExampleApplication::getPickHandler
const PickHandler * getPickHandler() const
Definition: ExampleApplication.h:623
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agxOSG::ExampleApplication::m_journalAppend
bool m_journalAppend
Definition: ExampleApplication.h:1036
PushDisableWarnings.h
Timer.h
agxOSG::ExampleApplication::m_sceneIndex
int m_sceneIndex
Definition: ExampleApplication.h:895
agxOSG::ExampleApplication::m_keybindingVector
KeyBindingsVector m_keybindingVector
Definition: ExampleApplication.h:902
agxOSG::ExampleApplication::MULTI
@ MULTI
Definition: ExampleApplication.h:342
Journal.h
agxOSG::ExampleApplication::m_cache
agxOSG::RigidBodyRenderCacheRef m_cache
Definition: ExampleApplication.h:1044
agxOSG::SceneDescription::isValid
bool isValid() const
Definition: ExampleApplication.h:134
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:953
agxOSG::ExampleApplication::m_videoCaptureRenderToTexture
RenderToTextureRef m_videoCaptureRenderToTexture
Definition: ExampleApplication.h:1041
agxOSG::ExampleApplication::m_explicitJournalConfigurationPath
bool m_explicitJournalConfigurationPath
Definition: ExampleApplication.h:971
agxOSG::ExampleApplication::m_exitCode
int m_exitCode
Definition: ExampleApplication.h:944
agxOSG::ExampleApplication::m_allowWindowResizing
bool m_allowWindowResizing
Definition: ExampleApplication.h:1004
agxOSG::ExampleApplication::m_startTime
agx::Real m_startTime
Definition: ExampleApplication.h:918
GuiEventListener.h
agxOSG::ExampleApplication::getPickHandler
PickHandler * getPickHandler()
Definition: ExampleApplication.h:622
agxOSG::ExampleApplication::m_newSimulation
bool m_newSimulation
Definition: ExampleApplication.h:921
agxOSG::CameraData::center
agx::Vec3 center
Definition: ExampleApplication.h:295
agx::Mutex
std::mutex Mutex
Definition: Referenced.h:99
PickHandler.h
agxOSG::ExampleApplication::m_journalFormat
agx::UInt m_journalFormat
Definition: ExampleApplication.h:972
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:926
agxOSG::ExampleApplication::getViewer
osgViewer::Viewer * getViewer()
Definition: ExampleApplication.h:603
agxOSG::ExampleApplication::m_videoCapture
VideoFFMPEGPipeCaptureRef m_videoCapture
Definition: ExampleApplication.h:1040
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:91
StatisticsRenderer.h
agxOSG::ExampleApplication::m_scene
osg::ref_ptr< osg::Group > m_scene
Definition: ExampleApplication.h:890
agx::Vec2T< Real >
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:955
agxOSG::ExampleApplication::m_initialized
bool m_initialized
Definition: ExampleApplication.h:910
agxOSG::ExampleApplication::m_coSimulationServer
agx::ref_ptr< agx::Referenced > m_coSimulationServer
Definition: ExampleApplication.h:945
agxOSG::CameraData::aspectRatio
double aspectRatio
Definition: ExampleApplication.h:290
agxOSG::ExampleApplication::m_videoName
std::string m_videoName
Definition: ExampleApplication.h:1039
agxOSG::ExampleApplication::setEnablePauseUpdate
void setEnablePauseUpdate(bool flag)
Definition: ExampleApplication.h:547
agxOSG::ExampleApplication::m_foundIncrementalArchiveCallback
agx::Journal::FrameJumpEvent::CallbackType m_foundIncrementalArchiveCallback
Definition: ExampleApplication.h:990
agxOSG::ExampleApplication::getSimulation
agxSDK::Simulation * getSimulation()
Definition: ExampleApplication.h:529
agxOSG::LightsSynchronization::~LightsSynchronization
virtual ~LightsSynchronization()
Definition: ExampleApplication.h:205
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_stepTimer
agx::Timer m_stepTimer
Definition: ExampleApplication.h:1007
agxOSG::ExampleApplication::m_vSync
bool m_vSync
Definition: ExampleApplication.h:967
agxOSG::ExampleApplication::m_coSimulationInputFile
std::string m_coSimulationInputFile
Definition: ExampleApplication.h:963
agxGL::Camera::setViewPort
void setViewPort(unsigned width, unsigned height)
agx::Callback1
Templated callback with one argument.
Definition: Callback.h:100
agxOSG::CameraData::farClippingPlane
double farClippingPlane
Definition: ExampleApplication.h:288
agxOSG::ExampleApplication::m_profilingRoot
std::string m_profilingRoot
Definition: ExampleApplication.h:959
agxOSG::ExampleApplication::clearAddedScenes
void clearAddedScenes()
Remove all added scenes.
Definition: ExampleApplication.h:396
agxOSG::ExampleApplication::m_viewer
osg::ref_ptr< osgViewer::Viewer > m_viewer
Definition: ExampleApplication.h:884
ScriptContext.h
agxOSG::ExampleApplication::m_loadedSceneFile
bool m_loadedSceneFile
Definition: ExampleApplication.h:1016
agxOSG::ExampleApplication::m_coSimulationOutputFile
std::string m_coSimulationOutputFile
Definition: ExampleApplication.h:964
agxOSG::CameraManipulatorFactory::Types
Types
Definition: ExampleApplication.h:234
agxOSG::ExampleApplication::m_profilingFrequency
agx::Real m_profilingFrequency
Definition: ExampleApplication.h:1013
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:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxOSG::ExampleApplication::getArguments
agxIO::ArgumentParser * getArguments()
Definition: ExampleApplication.h:379
agxOSG::ExampleApplication::ITERATIVE
@ ITERATIVE
Definition: ExampleApplication.h:343
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::m_journalRealMode
agx::RealModeEnum m_journalRealMode
Definition: ExampleApplication.h:982
agxOSG::ExampleApplication::m_coSimulationOutputData
agx::RealVector m_coSimulationOutputData
Definition: ExampleApplication.h:966
agxOSG::setOrbitCamera
AGXOSG_EXPORT bool setOrbitCamera(osgViewer::Viewer *viewer, osg::Group *node, const agx::Vec3 &eye, const agx::Vec3 &center, const agx::Vec3 &up, int trackerMode)
agxOSG::ExampleApplication::m_journalFrequency
agx::Real m_journalFrequency
Definition: ExampleApplication.h:981
agxOSG::ExampleApplication::m_enableStepping
bool m_enableStepping
Definition: ExampleApplication.h:996
agxOSG::ExampleApplication::KeyBindingsVector
agx::Vector< SceneDescription > KeyBindingsVector
Definition: ExampleApplication.h:899
agxOSG::ExampleApplication::AutoStepEvent
agx::Event1< bool > AutoStepEvent
Definition: ExampleApplication.h:323
agxOSG::ExampleApplication::m_settings
agxCFG::ConfigScriptRef m_settings
Definition: ExampleApplication.h:937
agxOSG::ExampleApplication::m_interactiveRemoteClient
bool m_interactiveRemoteClient
Definition: ExampleApplication.h:1033
agxOSG::CameraData::nearFarRatio
double nearFarRatio
Definition: ExampleApplication.h:292
agxOSG::ExampleApplication::m_shouldStop
bool m_shouldStop
Definition: ExampleApplication.h:943
agxOSG::ExampleApplication::m_xmlPlotFile
std::string m_xmlPlotFile
Definition: ExampleApplication.h:939
agxOSG::ExampleApplication::m_pBufferCamera
osg::ref_ptr< osg::Camera > m_pBufferCamera
Definition: ExampleApplication.h:1012
agxOSG::ExampleApplication::m_cfgFileName
std::string m_cfgFileName
Definition: ExampleApplication.h:911
RigidBodyRenderCache.h
agxOSG::CameraManipulatorFactory::s_instance
static CameraManipulatorFactory * s_instance
Definition: ExampleApplication.h:261
agxOSG::ExampleApplication::m_automaticStop
bool m_automaticStop
Definition: ExampleApplication.h:915
export.h
GuiEventAdapter.h
agxOSG::ExampleApplication::m_journalRecordStartTime
agx::Real m_journalRecordStartTime
Definition: ExampleApplication.h:979
agxOSG::ExampleApplication::m_quickProfiling
bool m_quickProfiling
Definition: ExampleApplication.h:957
agxOSG::ExampleApplication::getStepCallback
agx::Callback getStepCallback() const
Definition: ExampleApplication.h:398
agxOSG::ExampleApplication::m_gridSize
agx::Vec2 m_gridSize
Definition: ExampleApplication.h:1025
ArgumentParser.h
Camera.h
Lights.h
agx::AgXString< std::string >
agxOSG::CameraSynchronization::operator()
virtual void operator()(osg::RenderInfo &) const
Definition: ExampleApplication.h:171
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 Dynamics API including thread resources and must be executed before using the AGX API.
agxOSG::ExampleApplication::m_renderProxyFactory
agxOSG::RenderProxyFactory * m_renderProxyFactory
Definition: ExampleApplication.h:995
agxOSG::CameraManipulatorFactory::getType
Types getType() const
Definition: ExampleApplication.h:254
agxOSG::SceneDecorator::LIGHT0
@ LIGHT0
Definition: SceneDecorator.h:212
agxOSG::ExampleApplication::m_sceneRoot
osg::ref_ptr< osg::Group > m_sceneRoot
Definition: ExampleApplication.h:889
agx::Vec3T< Real >
agxOSG::ExampleApplication::m_pauseUpdate
bool m_pauseUpdate
Definition: ExampleApplication.h:1030
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:976
agxOSG::ExampleApplication::m_pickHandler
PickHandlerRef m_pickHandler
Definition: ExampleApplication.h:935
agxData::Value::transform
T transform() const
Definition: Value.h:339
DepthPeeling.h
ImageCapture.h
agxOSG::CameraSynchronization::CameraSynchronization
CameraSynchronization(osg::Camera *mainCamera, agxGL::Camera *glCamera)
Definition: ExampleApplication.h:163
agxOSG::ExampleApplication::getSceneDecorator
agxOSG::SceneDecorator * getSceneDecorator()
Definition: ExampleApplication.h:403
agxOSG::ExampleApplication::getImageCapture
agxOSG::ImageCapture * getImageCapture()
Definition: ExampleApplication.h:649
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:462
agxOSG::CameraManipulatorFactory::shutdown
virtual void shutdown() override
Implement this method to cleanup your Singleton class.
Definition: ExampleApplication.h:258
agxOSG::ExampleApplication::initialized
bool initialized() const
Definition: ExampleApplication.h:401
agxOSG::ExampleApplication::m_timelineFormats
agx::Vector< agx::String > m_timelineFormats
Definition: ExampleApplication.h:960
agxOSG::ExampleApplication::m_realTimeRest
agx::Real m_realTimeRest
Definition: ExampleApplication.h:1006
agxOSG::ExampleApplication::isCameraHomeSet
bool isCameraHomeSet() const
Definition: ExampleApplication.h:657
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::m_enableTerrainJournalRecording
bool m_enableTerrainJournalRecording
Definition: ExampleApplication.h:1037
agxOSG::ExampleApplication::getScene
osg::Group * getScene()
Definition: ExampleApplication.h:458
agxOSG::LightsSynchronization::LightsSynchronization
LightsSynchronization(agxGL::Lights *mainLights, agxOSG::SceneDecorator *decorator)
Definition: ExampleApplication.h:199
HighAccuracyTimer.h
agxOSG::ExampleApplication::m_decorator
osg::ref_ptr< agxOSG::SceneDecorator > m_decorator
Definition: ExampleApplication.h:881
agxOSG::ExampleApplication::m_journalStartTime
agx::Real m_journalStartTime
Definition: ExampleApplication.h:973
agxOSG::CameraData::fieldOfView
double fieldOfView
Definition: ExampleApplication.h:289
agxOSG::ExampleApplication::m_keyBindings
KeyBindings m_keyBindings
Definition: ExampleApplication.h:901
agxOSG::ExampleApplication::m_relativeStopTime
agx::Real m_relativeStopTime
Definition: ExampleApplication.h:917
agxOSG::CameraData::up
agx::Vec3 up
Definition: ExampleApplication.h:296
agxOSG::ExampleApplication::m_frameSleepTimer
agx::Timer m_frameSleepTimer
Definition: ExampleApplication.h:1008
agxOSG::ExampleApplication::m_imageCapture
agxOSG::ImageCaptureRef m_imageCapture
Definition: ExampleApplication.h:886
agxOSG::SceneDescription
A pod-struct for holding information about scenes to load by the application.
Definition: ExampleApplication.h:120
agxOSG::ExampleApplication::m_stopTime
agx::Real m_stopTime
Definition: ExampleApplication.h:919
RenderTarget.h
agx::Event
An event with no arguments.
Definition: Event.h:89
agxOSG::ExampleApplication::m_osgWindow
bool m_osgWindow
Definition: ExampleApplication.h:893
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:284
agxOSG::ExampleApplication::m_journalStopTime
agx::Real m_journalStopTime
Definition: ExampleApplication.h:974
agxOSG::ExampleApplication::m_generateTaskProfile
bool m_generateTaskProfile
Definition: ExampleApplication.h:961
agxOSG::ExampleApplication::m_startScene
int m_startScene
Definition: ExampleApplication.h:997
agxOSG::ExampleApplication::m_shouldLoadXmlPlot
bool m_shouldLoadXmlPlot
Definition: ExampleApplication.h:940
agxOSG::ExampleApplication::getTextureCamera
osg::Camera * getTextureCamera()
Definition: ExampleApplication.h:654
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:381
agxIO::ArgumentParser
A small argument parser class.
Definition: ArgumentParser.h:38
agxOSG::SceneDescription::valid
bool valid
Definition: ExampleApplication.h:141
agxOSG::CameraData::nearClippingPlane
double nearClippingPlane
Definition: ExampleApplication.h:287
agxOSG::ExampleApplication::m_frameMutex
agx::Mutex m_frameMutex
Definition: ExampleApplication.h:1000
AGXOSG_EXPORT
#define AGXOSG_EXPORT
agxOSG::ExampleApplication::m_addBodyCallback
agxSDK::Simulation::RigidBodyEvent::CallbackType m_addBodyCallback
Definition: ExampleApplication.h:988
agxOSG::ExampleApplication::m_cameraHomeEye
agx::Vec3 m_cameraHomeEye
Definition: ExampleApplication.h:954
agxOSG::ExampleApplication::m_parameterFilePath
std::string m_parameterFilePath
Definition: ExampleApplication.h:908
agxOSG::LightsSynchronization
Definition: ExampleApplication.h:196
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:399
agxOSG::VideoFFMPEGPipeCapture
Definition: VideoFFMPEGPipeCapture.h:35