AGX Dynamics  2.35.0.1
agxOSG::ExampleApplication Class Reference

Class that encapsulates rendering and simulation using OpenSceneGraph. More...

#include <ExampleApplication.h>

+ Inheritance diagram for agxOSG::ExampleApplication:

Public Types

typedef agx::Event1< bool > AutoStepEvent
 
enum  CameraMask {
  MAIN_SCENE_MASK = 1 << 1 , DEBUG_RENDER_MASK = 1 << 2 , OSG_RENDER_MASK = 1 << 3 , HUD_MASK = 1 << 4 ,
  DECORATOR_MASK = 1 << 5
}
 Specifies node masks for different parts of the rendering scene. More...
 
enum  SolverType { MULTI , ITERATIVE , NUM_SOLVERS }
 

Public Member Functions

 ExampleApplication (agxSDK::Simulation *simulation=nullptr)
 Constructor. More...
 
void addAutoPausePair (const agx::RigidBody *body1, const agx::RigidBody *body2)
 Add/remove a pair of bodies/geometries that when colliding will cause the simulation to pause. More...
 
void addAutoPausePair (const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2)
 
void addListener (ExampleApplicationListener *listener)
 
void addRenderTarget (agxOSG::RenderTarget *rtt, osg::Node *targetSceneNode=nullptr)
 Add a render target to the current viewer. More...
 
bool addScene (BuildScenePtr sceneFunction, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false)
 
bool addScene (BuildScenePtr sceneFunction, int key, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false)
 
bool addScene (const std::string &scriptFile, const std::string &scriptFunction, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false)
 
bool addScene (const std::string &scriptFile, const std::string &scriptFunction, int key, bool isPartofUnitTest=true, float stopAfter=float(), bool isSlowUnittest=false)
 
bool addScene (SceneDescription sceneDescription)
 
bool addScene (SceneDescription sceneDescription, int key)
 
void applyCameraData (const agxOSG::CameraData &cameraData)
 Apply camera data. More...
 
bool breakRequested () const
 
void cancelStop ()
 Will cancel the stop if possible. Continue the ::run loop. More...
 
void centerScene ()
 
void changeSolver ()
 
void clearAddedScenes ()
 Remove all added scenes. More...
 
void clearScene ()
 
bool coSimulationCallPython (agxNet::CoSimulationServer *server)
 
void createNextScene ()
 
void createPreviousScene ()
 
bool createSceneFromIndex (int idx, bool firstStartUp=false)
 
bool createSceneFromKey (int key)
 
void createVisual (agxSDK::Assembly *assembly, float detailRatio=1.0f, bool createAxes=false)
 
void createVisual (agxSDK::Simulation *simulation, float detailRatio=1.0f, bool createAxes=false)
 
bool done () const
 If no graphics is used, this method always return false. More...
 
bool executeOneStepWithGraphics ()
 
bool executeOneStepWithoutGraphics ()
 
void fitSceneIntoView ()
 
bool getAllowWindowResizing () const
 Is window resizing allowed? More...
 
agxIO::ArgumentParser * getArguments ()
 
bool getAutoStepping () const
 Should the application step automatically? False for 'pause', true for 'play'. More...
 
SceneDescription getCallback (int key)
 
SceneDescription getCallbackIdx (size_t idx)
 
osg::Camera * getCamera ()
 
agxOSG::CameraData getCameraData () const
 
void getCameraHome (agx::Vec3 &eye, agx::Vec3 &center, agx::Vec3 &up)
 
osgGA::MatrixManipulator * getCameraManipulator ()
 
const osgGA::MatrixManipulator * getCameraManipulator () const
 
agx::AffineMatrix4x4 getCoordinateSystemTransform () const
 Gets the transformation for the visual coordinate system and grid. More...
 
bool getEnableAutoPausing ()
 
bool getEnableCaptureSyncWithSimulation () const
 
bool getEnableCoordinateSystem () const
 Is the visual coordinate system enabled/disabled? More...
 
bool getEnableDebugRenderer () const
 Is the debug renderer enabled? Will also return false if no simulation exists. More...
 
bool getEnableGrid () const
 Is the visual grid enabled/disabled? More...
 
bool getEnableJournalIncrementalStructure () const
 
bool getEnableOSGRenderer ()
 
bool getEnablePauseUpdate () const
 
bool getEnableSimulationDump () const
 
bool getEnableTextDebugRendering () const
 
bool getEnableVSync () const
 
int getExitCode ()
 
agx::Mutex & getFrameMutex ()
 
agx::Vec3 getGravity () const
 
agx::Vec2u getGridResolution () const
 Gets the grid resolution for the visual grid. More...
 
agx::Vec2 getGridSize () const
 Gets the grid size for the visual grid. More...
 
intptr_t getHWND () const
 
agxOSG::ImageCapture * getImageCapture ()
 
const agxOSG::ImageCapture * getImageCapture () const
 
agx::Journal * getJournal ()
 
const std::string & getJournalConfigurationPath () const
 
agx::UInt getJournalFormat () const
 Gets journal format. More...
 
const std::string & getJournalPlaybackPath () const
 
std::string getLuaFilePath () const
 Get file path to most recent lua file. More...
 
size_t getNumScenes () const
 
PickHandler * getPickHandler ()
 
const PickHandler * getPickHandler () const
 
std::string getProfilingJournalPath () const
 
bool getQuitEventSetsDone () const
 
bool getRealTimeSync () const
 
agxOSG::RenderProxyFactory * getRenderProxyFactory ()
 
osg::Group * getRoot ()
 
const std::string & getSaveSceneFilename () const
 
osg::Group * getScene ()
 
osg::Group * getSceneAgxOSGRoot ()
 
agxOSG::SceneDecorator * getSceneDecorator ()
 
osg::Group * getSceneRoot ()
 
osg::Group * getSceneSwitch ()
 
std::string getScriptFile () const
 
agxSDK::Simulation * getSimulation ()
 
std::string getSolverName (SolverType t) const
 
SolverType getSolverType () const
 
SolverType getSolverType (const std::string &name) const
 
agx::Callback getStepCallback () const
 
osg::Camera * getTextureCamera ()
 
agx::Real getTimeStamp () const
 
agx::Real getTimeStep () const
 
agxOSG::RenderToTexture * getVideoCaptureRendertoTexture ()
 
agxOSG::VideoFFMPEGPipeCapture * getVideoServerCapture ()
 
agx::Vec3 getViewDirection ()
 
osgViewer::Viewer * getViewer ()
 
void handleReactiveScriptErrors (bool abortSimulation=true)
 
bool hasOffscreenWindow () const
 
bool init (agxIO::ArgumentParser *arguments, bool agxOnly=false)
 
bool init (int argc, char **argv)
 
void initGraphics ()
 
bool initialized () const
 
void initRecordJournal ()
 
void initRpc ()
 
void initScene ()
 
void initScene (osg::Group *root)
 
void initSimulation (agxSDK::Simulation *simulation=nullptr, bool initializeGraphics=true)
 
void initViewer (int width, int height, bool osgWindow=true)
 
bool isCameraHomeSet () const
 
void journalPlayback ()
 
void journalRenderLoader (agxSDK::Assembly *assembly, bool keyFrame)
 
void listSessionNames (const std::string &journalToList)
 
void postExecution ()
 
bool readCFGFile ()
 
void reloadScene ()
 
void removeAutoPausePair (const agx::RigidBody *body1, const agx::RigidBody *body2)
 
void removeAutoPausePair (const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2)
 
bool removeRenderTarget (agxOSG::RenderTarget *rtt)
 Remove a specified renderTarget. More...
 
bool restoreFromFile (const std::string &filename)
 
virtual int run ()
 
void setAllowWindowResizing (bool flag)
 Set if window resizing should be allowed. More...
 
void setAutoStepping (bool flag)
 Should the application step automatically? False for 'pause', true for 'play'. More...
 
void setCameraHome (const agx::Vec3 &eye, const agx::Vec3 &center, const agx::Vec3 &up=agx::Vec3(0, 0, 1))
 
void setCoordinateSystemTransform (const agx::AffineMatrix4x4 &coordinateSystemTransform)
 Sets the transformation for the visual coordinate system and grid. More...
 
void setDebugRenderInverseMatrix (const agx::AffineMatrix4x4 &m)
 Transform the debug rendering AND pick handler origin by this matrix. More...
 
void setEnableAutoPausing (bool flag)
 Enable/disable auto-pausing. More...
 
void setEnableCaptureSyncWithSimulation (bool enableSync)
 
void setEnableCoordinateSystem (bool flag)
 Enables/disables the visual coordinate system. More...
 
bool setEnableDebugRenderer (bool flag)
 Set enabling the debug renderer. More...
 
void setEnableGrid (bool flag)
 Enables/disables the visual grid. More...
 
void setEnableJournal32bitMode (bool enable)
 Set to true if journal should save data in 32bit float. More...
 
void setEnableJournalIncrementalStructure (bool enable)
 
void setEnableJournalRecord (bool enable)
 Set if a journal should be recorded from the simulation. More...
 
void setEnableOSGRenderer (bool flag)
 
void setEnablePauseUpdate (bool flag)
 
void setEnableSimulationDump (bool flag)
 
void setEnableTaskProfile (bool flag)
 
void setEnableTextDebugRendering (bool flag)
 
void setEnableThreadTimeline (bool flag)
 
void setEnableVSync (bool flag, bool forceUpdate=false)
 
void setGridResolution (const agx::Vec2u gridResolution)
 Sets the grid resolution for the visual grid. More...
 
void setGridSize (const agx::Vec2 &gridSize)
 Sets the grid size for the visual grid. More...
 
void setJournalConfigurationPath (const agx::String &path)
 
void setJournalFormat (agx::UInt journalFormat)
 Sets journal format. Only valid before starting journal recording/playback. More...
 
void setJournalRecordPath (const agx::String &journalPath)
 Set the path for the recorded journal. More...
 
void setOrbitCamera (agxOSG::GeometryNode *node, const agx::Vec3 &eye, const agx::Vec3 &center, const agx::Vec3 &up=agx::Vec3::Z_AXIS(), int trackerMode=0)
 Sets an orbit camera following an node. More...
 
void setOrbitCamera (agxOSG::GeometryNode *node, double heading, double elevation, double distance, int trackerMode=0)
 Sets an orbit camera following an node. More...
 
void setOsgNotifyLevel (osg::NotifySeverity severity) const
 
void setQuitEventSetsDone (bool flag)
 If set to true (default) pressing the ESC key will exit the run loop and application will shut down. More...
 
void setRealTimeSync (bool flag)
 Should ExampleApplication try to hold simulation in real time? Will wait for wall clock if going to fast, but might still go too slow if simulation or rendering time take too long. More...
 
void setRequestedJournalFrequency (agx::Real freq)
 Set the requested recording frequency for attached journal. More...
 
void setScene (osg::Group *scene)
 
void setSolverType (SolverType t)
 
void setStepCallback (agx::Callback callback)
 
void setTimeStep (agx::Real dt)
 
void setupVideoCaptureRenderTotexture ()
 
virtual void setupViewer (bool lightingEnabled=true, bool visibleWindow=true)
 
bool setWindowRectangle (unsigned int x, unsigned int y, unsigned int width, unsigned int height)
 Set the position and size of the window. More...
 
bool setWindowTitle (const std::string &title)
 Set the title of the window. More...
 
bool shouldStop () const
 
void step ()
 
void stepSimulation ()
 
void stepWrapper ()
 
void stop (int exitCode=0)
 Stop (=exit) the application at next opportunity. More...
 
void stopAfter (const agx::Real stopTime)
 Lets the application stop after a certain simulation time. More...
 
void storeInitialJournalState ()
 
void synchronizedStep (bool blocking=false)
 
void takeScreenShot (const agx::String &filename="")
 Takes a screen shot of the scene. More...
 
void throttleIdleCpuUsageBySleeping ()
 
void updateCoSimulationServer ()
 
bool updatePythonCoSimulationServer (const agx::String &filename, std::stringstream &buffer)
 
void updateRemoteDebugger ()
 
void updateServices ()
 
bool useCoSimulation () const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

static void registerRemovedGeometry (GeometryNode *node)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

AutoStepEvent autoStepEvent
 
std::string m_hostName
 
bool m_isFMU
 
bool m_isLoadingScene
 
bool m_loadedSceneFile
 
agx::Event m_sceneLoadEvent
 

Protected Types

typedef agx::HashTable< int, int > KeyBindings
 
typedef agx::Vector< SceneDescription > KeyBindingsVector
 

Protected Member Functions

virtual ~ExampleApplication ()
 
void addGranularCreateVisualCallbacks ()
 
void applyInitialParameters (const std::string &filePath)
 
bool attachScripts (osg::Group *root)
 
osg::Group * createScene (const SceneDescription &desc, bool &success)
 
void drawCoordinateSystem ()
 
void drawGrid ()
 
void execute ()
 
osg::Group * executeLuaScript (const agx::String &file, const agx::String &function, bool &success)
 
osg::Group * executeMPyScript (const agx::String &file, bool &success)
 
bool executeOneStepWithGraphics (bool &saveAfterEnabled, agx::Real saveAfterTime, agx::HighAccuracyTimer &timer)
 
bool executeOneStepWithoutGraphics (bool &saveAfterEnabled, agx::Real saveAfterTime, agx::HighAccuracyTimer &timer)
 
osg::Group * executePythonScript (const agx::String &file, const agx::String &function, bool &success)
 
void executeWithGraphics ()
 
void executeWithoutGraphics ()
 
agxJson::Value extractSimulationStructureToJson ()
 
void generateQuickProfiling ()
 
void granularCreated (agxSDK::Simulation *sim, agx::RigidBody *body)
 
bool initBrickInterop ()
 
void initThreadTimeline ()
 
void journalSceneLoader (const agx::String &path)
 
osg::Group * loadBrickModel (const agx::String &file, const agx::String &model, bool &success)
 
void removeGeometryNode (agxSDK::Simulation *, agxCollide::Geometry *)
 
void setArgumentsPostSceneCreation ()
 
void triggerPostFrameListeners ()
 
void triggerPreFrameListeners ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agxSDK::Simulation::RigidBodyEvent::CallbackType m_addBodyCallback
 
bool m_agxOnly
 
bool m_allowWindowResizing
 
agxIO::ArgumentParserRef m_arguments
 
agx::Vector< std::pair< std::string, int > > m_attachedScripts
 
bool m_autoCycleThroughScenes
 
bool m_automaticStop
 
agxSDK::ContactEventListenerRef m_autoPauseListener
 
agx::HashSet< agxCollide::GeometryPair > m_autoPausePairs
 
bool m_autoPausingEnabled
 
agx::Vec3 m_cameraHomeCenter
 
agx::Vec3 m_cameraHomeEye
 
bool m_cameraHomeSet
 
agx::Vec3 m_cameraHomeUp
 
std::string m_cfgFileName
 
agx::ref_ptr< agx::Referenced > m_controller
 
osg::ref_ptr< osg::MatrixTransform > m_coordinateSystem
 
bool m_coordinateSystemEnabled
 
agx::AffineMatrix4x4 m_coordinateSystemTransform
 
agx::RealVector m_coSimulationInputData
 
std::string m_coSimulationInputFile
 
agx::RealVector m_coSimulationOutputData
 
std::string m_coSimulationOutputFile
 
agx::ref_ptr< agx::Referenced > m_coSimulationServer
 
agx::ref_ptr< agx::Referenced > m_debugClient
 
osg::ref_ptr< agxOSG::SceneDecorator > m_decorator
 
bool m_didStep
 
agx::Real m_dt
 
bool m_enableJournalIncrementalStructure
 
bool m_enableJournalRecording
 
bool m_enableStepping
 
osg::ref_ptr< agxOSG::GuiEventAdapter > m_eventAdapter
 
int m_exitCode
 
bool m_explicitFmu
 
bool m_explicitJournalConfigurationPath
 
std::string m_extractSimulationStructureToJsonPath
 
agx::Block m_frameBlock
 
agx::Mutex m_frameMutex
 
agx::Timer m_frameSleepTimer
 
bool m_generateTaskProfile
 
bool m_generateThreadTimeline
 
agxGL::CameraRef m_GlCamera
 
agxGL::LightsRef m_GlLights
 
agx::Vec3 m_gravity
 
osg::ref_ptr< osg::Geode > m_grid
 
bool m_gridEnabled
 
agx::Vec2u m_gridResolution
 
agx::Vec2 m_gridSize
 
bool m_haveLicense
 
agxOSG::ImageCaptureRef m_imageCapture
 
bool m_initialized
 
bool m_interactiveRemoteClient
 
agx::ref_ptr< agx::Referenced > m_journal
 
std::string m_journalConfigurationPath
 
std::string m_journalEofMode
 
agx::UInt m_journalFormat
 
agx::Real m_journalFrequency
 
std::string m_journalPlaybackPath
 
agx::RealModeEnum m_journalRealMode
 
std::string m_journalRecordPath
 
agx::Real m_journalRecordStartTime
 
std::string m_journalSessionName
 
agx::Real m_journalStartTime
 
agx::Real m_journalStopTime
 
KeyBindings m_keyBindings
 
KeyBindingsVector m_keybindingVector
 
agx::Vector< ExampleApplicationListenerRef > m_listeners
 
std::string m_luaFilePath
 
bool m_newSimulation
 
bool m_osgWindow
 
std::string m_parameterFilePath
 
bool m_pauseUpdate
 
osg::ref_ptr< osg::GraphicsContext > m_pBuffer
 
osg::ref_ptr< osg::Camera > m_pBufferCamera
 
PickHandlerRef m_pickHandler
 
agx::Real m_profilingFrequency
 
std::string m_profilingRoot
 
std::string m_pythonFilePath
 
bool m_quickProfiling
 
bool m_realTime
 
agx::Real m_realTimeRest
 
agx::Real m_relativeStopTime
 
agxSDK::Simulation::GeometryEvent::CallbackType m_removeGeometryCallback
 
agxOSG::RenderProxyFactory * m_renderProxyFactory
 
RenderTargetRefVector m_renderTargetSet
 
osg::ref_ptr< osg::Group > m_root
 
osg::ref_ptr< osg::Group > m_scene
 
std::string m_sceneFilename
 
int m_sceneIndex
 
osg::ref_ptr< osg::Group > m_sceneRoot
 
osg::ref_ptr< osg::Switch > m_sceneSwitch
 
std::string m_scriptFile
 
agx::Mutex m_serviceMutex
 
agxCFG::ConfigScriptRef m_settings
 
bool m_shouldLoadXmlPlot
 
bool m_shouldStop
 
agxSDK::SimulationRef m_simulation
 
SolverType m_solverType
 
int m_startScene
 
StatisticsRendererRef m_statisticsRenderer
 
agx::Callback m_stepCallback
 
agx::Timer m_stepTimer
 
agx::UInt m_stopFrame
 
agx::Real m_stopTime
 
osg::ref_ptr< osg::Camera > m_textureCamera
 
agx::Vector< agx::String > m_timelineFormats
 
agx::Real m_timestep
 
bool m_useCoSimulation
 
VideoFFMPEGPipeCaptureRef m_videoCapture
 
RenderToTextureRef m_videoCaptureRenderToTexture
 
std::string m_videoName
 
osg::ref_ptr< osgViewer::Viewer > m_viewer
 
bool m_vSync
 
std::string m_xmlPlotFile
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Detailed Description

Class that encapsulates rendering and simulation using OpenSceneGraph.

Definition at line 317 of file ExampleApplication.h.

Member Typedef Documentation

◆ AutoStepEvent

◆ KeyBindings

Definition at line 856 of file ExampleApplication.h.

◆ KeyBindingsVector

Member Enumeration Documentation

◆ CameraMask

Specifies node masks for different parts of the rendering scene.

Makes it possible to later disable rendering of certain parts for different cameras. For example the HUD should not be rendered to RenderTargets (sensor cameras) by default.

Enumerator
MAIN_SCENE_MASK 
DEBUG_RENDER_MASK 
OSG_RENDER_MASK 
HUD_MASK 
DECORATOR_MASK 

Definition at line 328 of file ExampleApplication.h.

◆ SolverType

Enumerator
MULTI 
ITERATIVE 
NUM_SOLVERS 

Definition at line 337 of file ExampleApplication.h.

Constructor & Destructor Documentation

◆ ExampleApplication()

agxOSG::ExampleApplication::ExampleApplication ( agxSDK::Simulation *  simulation = nullptr)

Constructor.

◆ ~ExampleApplication()

virtual agxOSG::ExampleApplication::~ExampleApplication ( )
protectedvirtual

Member Function Documentation

◆ addAutoPausePair() [1/2]

void agxOSG::ExampleApplication::addAutoPausePair ( const agx::RigidBody *  body1,
const agx::RigidBody *  body2 
)

Add/remove a pair of bodies/geometries that when colliding will cause the simulation to pause.

◆ addAutoPausePair() [2/2]

void agxOSG::ExampleApplication::addAutoPausePair ( const agxCollide::Geometry *  geometry1,
const agxCollide::Geometry *  geometry2 
)

◆ addGranularCreateVisualCallbacks()

void agxOSG::ExampleApplication::addGranularCreateVisualCallbacks ( )
protected

◆ addListener()

void agxOSG::ExampleApplication::addListener ( ExampleApplicationListener *  listener)

◆ addRenderTarget()

void agxOSG::ExampleApplication::addRenderTarget ( agxOSG::RenderTarget *  rtt,
osg::Node *  targetSceneNode = nullptr 
)

Add a render target to the current viewer.

This can be used to add an additional camera which renders to a texture.

Parameters
rtt- The RenderTarget to be added to the viewer
targetSceneNode- If specified, this will be the part of the scene which is rendered to the target. Default is getSceneDecorator()

◆ addScene() [1/6]

bool agxOSG::ExampleApplication::addScene ( BuildScenePtr  sceneFunction,
bool  isPartofUnitTest = true,
float  stopAfter = float(),
bool  isSlowUnittest = false 
)

◆ addScene() [2/6]

bool agxOSG::ExampleApplication::addScene ( BuildScenePtr  sceneFunction,
int  key,
bool  isPartofUnitTest = true,
float  stopAfter = float(),
bool  isSlowUnittest = false 
)

◆ addScene() [3/6]

bool agxOSG::ExampleApplication::addScene ( const std::string &  scriptFile,
const std::string &  scriptFunction,
bool  isPartofUnitTest = true,
float  stopAfter = float(),
bool  isSlowUnittest = false 
)

◆ addScene() [4/6]

bool agxOSG::ExampleApplication::addScene ( const std::string &  scriptFile,
const std::string &  scriptFunction,
int  key,
bool  isPartofUnitTest = true,
float  stopAfter = float(),
bool  isSlowUnittest = false 
)

◆ addScene() [5/6]

bool agxOSG::ExampleApplication::addScene ( SceneDescription  sceneDescription)

◆ addScene() [6/6]

bool agxOSG::ExampleApplication::addScene ( SceneDescription  sceneDescription,
int  key 
)

◆ applyCameraData()

void agxOSG::ExampleApplication::applyCameraData ( const agxOSG::CameraData &  cameraData)

Apply camera data.

Typically: camData = app->getCameraData(); camData.nearClippingPlane = 0.01f; app->applyCameraData( camData );

◆ applyInitialParameters()

void agxOSG::ExampleApplication::applyInitialParameters ( const std::string &  filePath)
protected

◆ attachScripts()

bool agxOSG::ExampleApplication::attachScripts ( osg::Group *  root)
protected

◆ breakRequested()

bool agxOSG::ExampleApplication::breakRequested ( ) const
Returns
true if someone called stop OR viewer indicates we should stop (ESC pressed)

◆ cancelStop()

void agxOSG::ExampleApplication::cancelStop ( )
inline

Will cancel the stop if possible. Continue the ::run loop.

Definition at line 413 of file ExampleApplication.h.

◆ centerScene()

void agxOSG::ExampleApplication::centerScene ( )

◆ changeSolver()

void agxOSG::ExampleApplication::changeSolver ( )

◆ clearAddedScenes()

void agxOSG::ExampleApplication::clearAddedScenes ( )
inline

Remove all added scenes.

Definition at line 393 of file ExampleApplication.h.

◆ clearScene()

void agxOSG::ExampleApplication::clearScene ( )

◆ coSimulationCallPython()

bool agxOSG::ExampleApplication::coSimulationCallPython ( agxNet::CoSimulationServer *  server)

◆ createNextScene()

void agxOSG::ExampleApplication::createNextScene ( )

◆ createPreviousScene()

void agxOSG::ExampleApplication::createPreviousScene ( )

◆ createScene()

osg::Group* agxOSG::ExampleApplication::createScene ( const SceneDescription &  desc,
bool &  success 
)
protected

◆ createSceneFromIndex()

bool agxOSG::ExampleApplication::createSceneFromIndex ( int  idx,
bool  firstStartUp = false 
)

◆ createSceneFromKey()

bool agxOSG::ExampleApplication::createSceneFromKey ( int  key)

◆ createVisual() [1/2]

void agxOSG::ExampleApplication::createVisual ( agxSDK::Assembly *  assembly,
float  detailRatio = 1.0f,
bool  createAxes = false 
)

◆ createVisual() [2/2]

void agxOSG::ExampleApplication::createVisual ( agxSDK::Simulation *  simulation,
float  detailRatio = 1.0f,
bool  createAxes = false 
)

◆ done()

bool agxOSG::ExampleApplication::done ( ) const

If no graphics is used, this method always return false.

Returns
true when ESC key has been pressed in the graphics window, indicating that the application is shutting down.

◆ drawCoordinateSystem()

void agxOSG::ExampleApplication::drawCoordinateSystem ( )
protected

◆ drawGrid()

void agxOSG::ExampleApplication::drawGrid ( )
protected

◆ execute()

void agxOSG::ExampleApplication::execute ( )
protected

◆ executeLuaScript()

osg::Group* agxOSG::ExampleApplication::executeLuaScript ( const agx::String &  file,
const agx::String &  function,
bool &  success 
)
protected

◆ executeMPyScript()

osg::Group* agxOSG::ExampleApplication::executeMPyScript ( const agx::String &  file,
bool &  success 
)
protected

◆ executeOneStepWithGraphics() [1/2]

bool agxOSG::ExampleApplication::executeOneStepWithGraphics ( )

◆ executeOneStepWithGraphics() [2/2]

bool agxOSG::ExampleApplication::executeOneStepWithGraphics ( bool &  saveAfterEnabled,
agx::Real  saveAfterTime,
agx::HighAccuracyTimer &  timer 
)
protected

◆ executeOneStepWithoutGraphics() [1/2]

bool agxOSG::ExampleApplication::executeOneStepWithoutGraphics ( )

◆ executeOneStepWithoutGraphics() [2/2]

bool agxOSG::ExampleApplication::executeOneStepWithoutGraphics ( bool &  saveAfterEnabled,
agx::Real  saveAfterTime,
agx::HighAccuracyTimer &  timer 
)
protected

◆ executePythonScript()

osg::Group* agxOSG::ExampleApplication::executePythonScript ( const agx::String &  file,
const agx::String &  function,
bool &  success 
)
protected

◆ executeWithGraphics()

void agxOSG::ExampleApplication::executeWithGraphics ( )
protected

◆ executeWithoutGraphics()

void agxOSG::ExampleApplication::executeWithoutGraphics ( )
protected

◆ extractSimulationStructureToJson()

agxJson::Value agxOSG::ExampleApplication::extractSimulationStructureToJson ( )
protected

◆ fitSceneIntoView()

void agxOSG::ExampleApplication::fitSceneIntoView ( )

◆ generateQuickProfiling()

void agxOSG::ExampleApplication::generateQuickProfiling ( )
protected

◆ getAllowWindowResizing()

bool agxOSG::ExampleApplication::getAllowWindowResizing ( ) const

Is window resizing allowed?

◆ getArguments()

agxIO::ArgumentParser* agxOSG::ExampleApplication::getArguments ( )
inline

Definition at line 376 of file ExampleApplication.h.

◆ getAutoStepping()

bool agxOSG::ExampleApplication::getAutoStepping ( ) const

Should the application step automatically? False for 'pause', true for 'play'.

◆ getCallback()

SceneDescription agxOSG::ExampleApplication::getCallback ( int  key)

◆ getCallbackIdx()

SceneDescription agxOSG::ExampleApplication::getCallbackIdx ( size_t  idx)

◆ getCamera()

osg::Camera* agxOSG::ExampleApplication::getCamera ( )
inline

Definition at line 584 of file ExampleApplication.h.

◆ getCameraData()

agxOSG::CameraData agxOSG::ExampleApplication::getCameraData ( ) const
Returns
the camera data for main camera

◆ getCameraHome()

void agxOSG::ExampleApplication::getCameraHome ( agx::Vec3 &  eye,
agx::Vec3 &  center,
agx::Vec3 &  up 
)

◆ getCameraManipulator() [1/2]

osgGA::MatrixManipulator* agxOSG::ExampleApplication::getCameraManipulator ( )

◆ getCameraManipulator() [2/2]

const osgGA::MatrixManipulator* agxOSG::ExampleApplication::getCameraManipulator ( ) const

◆ getCoordinateSystemTransform()

agx::AffineMatrix4x4 agxOSG::ExampleApplication::getCoordinateSystemTransform ( ) const

Gets the transformation for the visual coordinate system and grid.

◆ getEnableAutoPausing()

bool agxOSG::ExampleApplication::getEnableAutoPausing ( )

◆ getEnableCaptureSyncWithSimulation()

bool agxOSG::ExampleApplication::getEnableCaptureSyncWithSimulation ( ) const

◆ getEnableCoordinateSystem()

bool agxOSG::ExampleApplication::getEnableCoordinateSystem ( ) const

Is the visual coordinate system enabled/disabled?

◆ getEnableDebugRenderer()

bool agxOSG::ExampleApplication::getEnableDebugRenderer ( ) const

Is the debug renderer enabled? Will also return false if no simulation exists.

◆ getEnableGrid()

bool agxOSG::ExampleApplication::getEnableGrid ( ) const

Is the visual grid enabled/disabled?

◆ getEnableJournalIncrementalStructure()

bool agxOSG::ExampleApplication::getEnableJournalIncrementalStructure ( ) const

◆ getEnableOSGRenderer()

bool agxOSG::ExampleApplication::getEnableOSGRenderer ( )

◆ getEnablePauseUpdate()

bool agxOSG::ExampleApplication::getEnablePauseUpdate ( ) const
inline

Definition at line 528 of file ExampleApplication.h.

◆ getEnableSimulationDump()

bool agxOSG::ExampleApplication::getEnableSimulationDump ( ) const

◆ getEnableTextDebugRendering()

bool agxOSG::ExampleApplication::getEnableTextDebugRendering ( ) const

◆ getEnableVSync()

bool agxOSG::ExampleApplication::getEnableVSync ( ) const

◆ getExitCode()

int agxOSG::ExampleApplication::getExitCode ( )
inline

Definition at line 789 of file ExampleApplication.h.

◆ getFrameMutex()

agx::Mutex& agxOSG::ExampleApplication::getFrameMutex ( )
inline

Definition at line 797 of file ExampleApplication.h.

◆ getGravity()

agx::Vec3 agxOSG::ExampleApplication::getGravity ( ) const
inline

Definition at line 632 of file ExampleApplication.h.

◆ getGridResolution()

agx::Vec2u agxOSG::ExampleApplication::getGridResolution ( ) const

Gets the grid resolution for the visual grid.

◆ getGridSize()

agx::Vec2 agxOSG::ExampleApplication::getGridSize ( ) const

Gets the grid size for the visual grid.

◆ getHWND()

intptr_t agxOSG::ExampleApplication::getHWND ( ) const

◆ getImageCapture() [1/2]

agxOSG::ImageCapture* agxOSG::ExampleApplication::getImageCapture ( )
inline

Definition at line 635 of file ExampleApplication.h.

◆ getImageCapture() [2/2]

const agxOSG::ImageCapture* agxOSG::ExampleApplication::getImageCapture ( ) const
inline

Definition at line 636 of file ExampleApplication.h.

◆ getJournal()

agx::Journal* agxOSG::ExampleApplication::getJournal ( )

◆ getJournalConfigurationPath()

const std::string& agxOSG::ExampleApplication::getJournalConfigurationPath ( ) const

◆ getJournalFormat()

agx::UInt agxOSG::ExampleApplication::getJournalFormat ( ) const

Gets journal format.

◆ getJournalPlaybackPath()

const std::string& agxOSG::ExampleApplication::getJournalPlaybackPath ( ) const

◆ getLuaFilePath()

std::string agxOSG::ExampleApplication::getLuaFilePath ( ) const
inline

Get file path to most recent lua file.

Definition at line 608 of file ExampleApplication.h.

◆ getNumScenes()

size_t agxOSG::ExampleApplication::getNumScenes ( ) const

◆ getPickHandler() [1/2]

PickHandler* agxOSG::ExampleApplication::getPickHandler ( )
inline

Definition at line 602 of file ExampleApplication.h.

◆ getPickHandler() [2/2]

const PickHandler* agxOSG::ExampleApplication::getPickHandler ( ) const
inline

Definition at line 603 of file ExampleApplication.h.

◆ getProfilingJournalPath()

std::string agxOSG::ExampleApplication::getProfilingJournalPath ( ) const

◆ getQuitEventSetsDone()

bool agxOSG::ExampleApplication::getQuitEventSetsDone ( ) const

◆ getRealTimeSync()

bool agxOSG::ExampleApplication::getRealTimeSync ( ) const

◆ getRenderProxyFactory()

agxOSG::RenderProxyFactory* agxOSG::ExampleApplication::getRenderProxyFactory ( )
inline

Definition at line 378 of file ExampleApplication.h.

◆ getRoot()

osg::Group* agxOSG::ExampleApplication::getRoot ( )
inline

Definition at line 566 of file ExampleApplication.h.

◆ getSaveSceneFilename()

const std::string& agxOSG::ExampleApplication::getSaveSceneFilename ( ) const
inline

Definition at line 564 of file ExampleApplication.h.

◆ getScene()

osg::Group* agxOSG::ExampleApplication::getScene ( )
inline

Definition at line 443 of file ExampleApplication.h.

◆ getSceneAgxOSGRoot()

osg::Group* agxOSG::ExampleApplication::getSceneAgxOSGRoot ( )

◆ getSceneDecorator()

agxOSG::SceneDecorator* agxOSG::ExampleApplication::getSceneDecorator ( )
inline

Definition at line 400 of file ExampleApplication.h.

◆ getSceneRoot()

osg::Group* agxOSG::ExampleApplication::getSceneRoot ( )
inline

Definition at line 445 of file ExampleApplication.h.

◆ getSceneSwitch()

osg::Group* agxOSG::ExampleApplication::getSceneSwitch ( )
inline

Definition at line 447 of file ExampleApplication.h.

◆ getScriptFile()

std::string agxOSG::ExampleApplication::getScriptFile ( ) const
inline

Definition at line 605 of file ExampleApplication.h.

◆ getSimulation()

agxSDK::Simulation* agxOSG::ExampleApplication::getSimulation ( )
inline

Definition at line 514 of file ExampleApplication.h.

◆ getSolverName()

std::string agxOSG::ExampleApplication::getSolverName ( SolverType  t) const

◆ getSolverType() [1/2]

SolverType agxOSG::ExampleApplication::getSolverType ( ) const
inline

Definition at line 346 of file ExampleApplication.h.

◆ getSolverType() [2/2]

SolverType agxOSG::ExampleApplication::getSolverType ( const std::string &  name) const

◆ getStepCallback()

agx::Callback agxOSG::ExampleApplication::getStepCallback ( ) const
inline

Definition at line 395 of file ExampleApplication.h.

◆ getTextureCamera()

osg::Camera* agxOSG::ExampleApplication::getTextureCamera ( )
inline

Definition at line 640 of file ExampleApplication.h.

◆ getTimeStamp()

agx::Real agxOSG::ExampleApplication::getTimeStamp ( ) const

◆ getTimeStep()

agx::Real agxOSG::ExampleApplication::getTimeStep ( ) const

◆ getVideoCaptureRendertoTexture()

agxOSG::RenderToTexture* agxOSG::ExampleApplication::getVideoCaptureRendertoTexture ( )
inline

Definition at line 773 of file ExampleApplication.h.

◆ getVideoServerCapture()

agxOSG::VideoFFMPEGPipeCapture* agxOSG::ExampleApplication::getVideoServerCapture ( )
inline

Definition at line 638 of file ExampleApplication.h.

◆ getViewDirection()

agx::Vec3 agxOSG::ExampleApplication::getViewDirection ( )

◆ getViewer()

osgViewer::Viewer* agxOSG::ExampleApplication::getViewer ( )
inline

Definition at line 583 of file ExampleApplication.h.

◆ granularCreated()

void agxOSG::ExampleApplication::granularCreated ( agxSDK::Simulation *  sim,
agx::RigidBody *  body 
)
protected

◆ handleReactiveScriptErrors()

void agxOSG::ExampleApplication::handleReactiveScriptErrors ( bool  abortSimulation = true)

◆ hasOffscreenWindow()

bool agxOSG::ExampleApplication::hasOffscreenWindow ( ) const

◆ init() [1/2]

bool agxOSG::ExampleApplication::init ( agxIO::ArgumentParser *  arguments,
bool  agxOnly = false 
)

◆ init() [2/2]

bool agxOSG::ExampleApplication::init ( int  argc,
char **  argv 
)

◆ initBrickInterop()

bool agxOSG::ExampleApplication::initBrickInterop ( )
protected

◆ initGraphics()

void agxOSG::ExampleApplication::initGraphics ( )

◆ initialized()

bool agxOSG::ExampleApplication::initialized ( ) const
inline

Definition at line 398 of file ExampleApplication.h.

◆ initRecordJournal()

void agxOSG::ExampleApplication::initRecordJournal ( )

◆ initRpc()

void agxOSG::ExampleApplication::initRpc ( )

◆ initScene() [1/2]

void agxOSG::ExampleApplication::initScene ( )

◆ initScene() [2/2]

void agxOSG::ExampleApplication::initScene ( osg::Group *  root)

◆ initSimulation()

void agxOSG::ExampleApplication::initSimulation ( agxSDK::Simulation *  simulation = nullptr,
bool  initializeGraphics = true 
)

◆ initThreadTimeline()

void agxOSG::ExampleApplication::initThreadTimeline ( )
protected

◆ initViewer()

void agxOSG::ExampleApplication::initViewer ( int  width,
int  height,
bool  osgWindow = true 
)

◆ isCameraHomeSet()

bool agxOSG::ExampleApplication::isCameraHomeSet ( ) const
inline

Definition at line 643 of file ExampleApplication.h.

◆ journalPlayback()

void agxOSG::ExampleApplication::journalPlayback ( )

◆ journalRenderLoader()

void agxOSG::ExampleApplication::journalRenderLoader ( agxSDK::Assembly *  assembly,
bool  keyFrame 
)

◆ journalSceneLoader()

void agxOSG::ExampleApplication::journalSceneLoader ( const agx::String &  path)
protected

◆ listSessionNames()

void agxOSG::ExampleApplication::listSessionNames ( const std::string &  journalToList)

◆ loadBrickModel()

osg::Group* agxOSG::ExampleApplication::loadBrickModel ( const agx::String &  file,
const agx::String &  model,
bool &  success 
)
protected

◆ postExecution()

void agxOSG::ExampleApplication::postExecution ( )

◆ readCFGFile()

bool agxOSG::ExampleApplication::readCFGFile ( )

◆ registerRemovedGeometry()

static void agxOSG::ExampleApplication::registerRemovedGeometry ( GeometryNode *  node)
static

◆ reloadScene()

void agxOSG::ExampleApplication::reloadScene ( )

◆ removeAutoPausePair() [1/2]

void agxOSG::ExampleApplication::removeAutoPausePair ( const agx::RigidBody *  body1,
const agx::RigidBody *  body2 
)

◆ removeAutoPausePair() [2/2]

void agxOSG::ExampleApplication::removeAutoPausePair ( const agxCollide::Geometry *  geometry1,
const agxCollide::Geometry *  geometry2 
)

◆ removeGeometryNode()

void agxOSG::ExampleApplication::removeGeometryNode ( agxSDK::Simulation *  ,
agxCollide::Geometry *   
)
protected

◆ removeRenderTarget()

bool agxOSG::ExampleApplication::removeRenderTarget ( agxOSG::RenderTarget *  rtt)

Remove a specified renderTarget.

Returns
true if target is removed

◆ restoreFromFile()

bool agxOSG::ExampleApplication::restoreFromFile ( const std::string &  filename)

◆ run()

virtual int agxOSG::ExampleApplication::run ( )
virtual

◆ setAllowWindowResizing()

void agxOSG::ExampleApplication::setAllowWindowResizing ( bool  flag)

Set if window resizing should be allowed.

◆ setArgumentsPostSceneCreation()

void agxOSG::ExampleApplication::setArgumentsPostSceneCreation ( )
protected

◆ setAutoStepping()

void agxOSG::ExampleApplication::setAutoStepping ( bool  flag)

Should the application step automatically? False for 'pause', true for 'play'.

◆ setCameraHome()

void agxOSG::ExampleApplication::setCameraHome ( const agx::Vec3 &  eye,
const agx::Vec3 &  center,
const agx::Vec3 &  up = agx::Vec3(0, 0, 1) 
)

◆ setCoordinateSystemTransform()

void agxOSG::ExampleApplication::setCoordinateSystemTransform ( const agx::AffineMatrix4x4 &  coordinateSystemTransform)

Sets the transformation for the visual coordinate system and grid.

◆ setDebugRenderInverseMatrix()

void agxOSG::ExampleApplication::setDebugRenderInverseMatrix ( const agx::AffineMatrix4x4 &  m)

Transform the debug rendering AND pick handler origin by this matrix.

This is handy when you are creating scenes which have coordinates which are very large. For example on the surface of the earth. Find the object which you want to transform into origin, get its translation and call this method with its inverse transform (usually translation only).

◆ setEnableAutoPausing()

void agxOSG::ExampleApplication::setEnableAutoPausing ( bool  flag)

Enable/disable auto-pausing.

◆ setEnableCaptureSyncWithSimulation()

void agxOSG::ExampleApplication::setEnableCaptureSyncWithSimulation ( bool  enableSync)

◆ setEnableCoordinateSystem()

void agxOSG::ExampleApplication::setEnableCoordinateSystem ( bool  flag)

Enables/disables the visual coordinate system.

◆ setEnableDebugRenderer()

bool agxOSG::ExampleApplication::setEnableDebugRenderer ( bool  flag)

Set enabling the debug renderer.

Works only when running with graphics (no –agxOnly) and a simulation exists.

Parameters
flagShould the debug renderer be enabled or not?
Return values
Wassetting the value successful? Will e.g. return false if running without graphics, or if no simulation exists.

◆ setEnableGrid()

void agxOSG::ExampleApplication::setEnableGrid ( bool  flag)

Enables/disables the visual grid.

◆ setEnableJournal32bitMode()

void agxOSG::ExampleApplication::setEnableJournal32bitMode ( bool  enable)

Set to true if journal should save data in 32bit float.

◆ setEnableJournalIncrementalStructure()

void agxOSG::ExampleApplication::setEnableJournalIncrementalStructure ( bool  enable)

◆ setEnableJournalRecord()

void agxOSG::ExampleApplication::setEnableJournalRecord ( bool  enable)

Set if a journal should be recorded from the simulation.

◆ setEnableOSGRenderer()

void agxOSG::ExampleApplication::setEnableOSGRenderer ( bool  flag)

◆ setEnablePauseUpdate()

void agxOSG::ExampleApplication::setEnablePauseUpdate ( bool  flag)
inline

Definition at line 527 of file ExampleApplication.h.

◆ setEnableSimulationDump()

void agxOSG::ExampleApplication::setEnableSimulationDump ( bool  flag)

◆ setEnableTaskProfile()

void agxOSG::ExampleApplication::setEnableTaskProfile ( bool  flag)

◆ setEnableTextDebugRendering()

void agxOSG::ExampleApplication::setEnableTextDebugRendering ( bool  flag)

◆ setEnableThreadTimeline()

void agxOSG::ExampleApplication::setEnableThreadTimeline ( bool  flag)

◆ setEnableVSync()

void agxOSG::ExampleApplication::setEnableVSync ( bool  flag,
bool  forceUpdate = false 
)

◆ setGridResolution()

void agxOSG::ExampleApplication::setGridResolution ( const agx::Vec2u  gridResolution)

Sets the grid resolution for the visual grid.

◆ setGridSize()

void agxOSG::ExampleApplication::setGridSize ( const agx::Vec2 &  gridSize)

Sets the grid size for the visual grid.

◆ setJournalConfigurationPath()

void agxOSG::ExampleApplication::setJournalConfigurationPath ( const agx::String &  path)

◆ setJournalFormat()

void agxOSG::ExampleApplication::setJournalFormat ( agx::UInt  journalFormat)

Sets journal format. Only valid before starting journal recording/playback.

◆ setJournalRecordPath()

void agxOSG::ExampleApplication::setJournalRecordPath ( const agx::String &  journalPath)

Set the path for the recorded journal.

◆ setOrbitCamera() [1/2]

void agxOSG::ExampleApplication::setOrbitCamera ( agxOSG::GeometryNode *  node,
const agx::Vec3 &  eye,
const agx::Vec3 &  center,
const agx::Vec3 &  up = agx::Vec3::Z_AXIS(),
int  trackerMode = 0 
)

Sets an orbit camera following an node.

Parameters
nodeThe node.
eyeThe camera eye.
centerThe camera center relative geometry center.
upThe camera up vector
trackerModeSee osgGA::NodeTrackerManipulator::TrackerNode.

◆ setOrbitCamera() [2/2]

void agxOSG::ExampleApplication::setOrbitCamera ( agxOSG::GeometryNode *  node,
double  heading,
double  elevation,
double  distance,
int  trackerMode = 0 
)

Sets an orbit camera following an node.

Parameters
nodeThe node.
headingThe camera heading.
elevationThe camera elevation.
distanceThe camera distance
trackerModeSee osgGA::NodeTrackerManipulator::TrackerNode.

◆ setOsgNotifyLevel()

void agxOSG::ExampleApplication::setOsgNotifyLevel ( osg::NotifySeverity  severity) const

◆ setQuitEventSetsDone()

void agxOSG::ExampleApplication::setQuitEventSetsDone ( bool  flag)

If set to true (default) pressing the ESC key will exit the run loop and application will shut down.

If false, pressing esc will not quit the application.

◆ setRealTimeSync()

void agxOSG::ExampleApplication::setRealTimeSync ( bool  flag)

Should ExampleApplication try to hold simulation in real time? Will wait for wall clock if going to fast, but might still go too slow if simulation or rendering time take too long.

◆ setRequestedJournalFrequency()

void agxOSG::ExampleApplication::setRequestedJournalFrequency ( agx::Real  freq)

Set the requested recording frequency for attached journal.

◆ setScene()

void agxOSG::ExampleApplication::setScene ( osg::Group *  scene)
inline

Definition at line 444 of file ExampleApplication.h.

◆ setSolverType()

void agxOSG::ExampleApplication::setSolverType ( SolverType  t)
inline

Definition at line 345 of file ExampleApplication.h.

◆ setStepCallback()

void agxOSG::ExampleApplication::setStepCallback ( agx::Callback  callback)
inline

Definition at line 396 of file ExampleApplication.h.

◆ setTimeStep()

void agxOSG::ExampleApplication::setTimeStep ( agx::Real  dt)

◆ setupVideoCaptureRenderTotexture()

void agxOSG::ExampleApplication::setupVideoCaptureRenderTotexture ( )

◆ setupViewer()

virtual void agxOSG::ExampleApplication::setupViewer ( bool  lightingEnabled = true,
bool  visibleWindow = true 
)
virtual

◆ setWindowRectangle()

bool agxOSG::ExampleApplication::setWindowRectangle ( unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height 
)

Set the position and size of the window.

Parameters
x,y- X/Y position in pixels of the graphics window
width,height- size in pixels of the graphics window
Returns
true if the window is present and the resize was successful. False if there are no windows to be modified.

◆ setWindowTitle()

bool agxOSG::ExampleApplication::setWindowTitle ( const std::string &  title)

Set the title of the window.

Parameters
title- Title string to set on the window
Returns
true if the window is present and the title was successfully updated. False if there are no windows to be modified.

◆ shouldStop()

bool agxOSG::ExampleApplication::shouldStop ( ) const
inline
Returns
true if someone has called stop.

Definition at line 416 of file ExampleApplication.h.

◆ step()

void agxOSG::ExampleApplication::step ( )

◆ stepSimulation()

void agxOSG::ExampleApplication::stepSimulation ( )

◆ stepWrapper()

void agxOSG::ExampleApplication::stepWrapper ( )

◆ stop()

void agxOSG::ExampleApplication::stop ( int  exitCode = 0)
inline

Stop (=exit) the application at next opportunity.

Meaning, exit the run loop.

Parameters
exitCode- The exit code that will be used when returning from the ::run loop.

Definition at line 410 of file ExampleApplication.h.

◆ stopAfter()

void agxOSG::ExampleApplication::stopAfter ( const agx::Real  stopTime)

Lets the application stop after a certain simulation time.

Same as using –stopAfter command line argument.

Parameters
stopTimeSimulation time after which the application should stop.

◆ storeInitialJournalState()

void agxOSG::ExampleApplication::storeInitialJournalState ( )

◆ synchronizedStep()

void agxOSG::ExampleApplication::synchronizedStep ( bool  blocking = false)

◆ takeScreenShot()

void agxOSG::ExampleApplication::takeScreenShot ( const agx::String &  filename = "")

Takes a screen shot of the scene.

If filename is left empty, it will default to "agx_screen_%05d.png".

◆ throttleIdleCpuUsageBySleeping()

void agxOSG::ExampleApplication::throttleIdleCpuUsageBySleeping ( )

◆ triggerPostFrameListeners()

void agxOSG::ExampleApplication::triggerPostFrameListeners ( )
protected

◆ triggerPreFrameListeners()

void agxOSG::ExampleApplication::triggerPreFrameListeners ( )
protected

◆ updateCoSimulationServer()

void agxOSG::ExampleApplication::updateCoSimulationServer ( )

◆ updatePythonCoSimulationServer()

bool agxOSG::ExampleApplication::updatePythonCoSimulationServer ( const agx::String &  filename,
std::stringstream &  buffer 
)

◆ updateRemoteDebugger()

void agxOSG::ExampleApplication::updateRemoteDebugger ( )

◆ updateServices()

void agxOSG::ExampleApplication::updateServices ( )

◆ useCoSimulation()

bool agxOSG::ExampleApplication::useCoSimulation ( ) const
inline

Definition at line 630 of file ExampleApplication.h.

Member Data Documentation

◆ autoStepEvent

AutoStepEvent agxOSG::ExampleApplication::autoStepEvent

Definition at line 321 of file ExampleApplication.h.

◆ m_addBodyCallback

agxSDK::Simulation::RigidBodyEvent::CallbackType agxOSG::ExampleApplication::m_addBodyCallback
protected

Definition at line 947 of file ExampleApplication.h.

◆ m_agxOnly

bool agxOSG::ExampleApplication::m_agxOnly
protected

Definition at line 881 of file ExampleApplication.h.

◆ m_allowWindowResizing

bool agxOSG::ExampleApplication::m_allowWindowResizing
protected

Definition at line 961 of file ExampleApplication.h.

◆ m_arguments

agxIO::ArgumentParserRef agxOSG::ExampleApplication::m_arguments
protected

Definition at line 864 of file ExampleApplication.h.

◆ m_attachedScripts

agx::Vector<std::pair<std::string, int> > agxOSG::ExampleApplication::m_attachedScripts
protected

Definition at line 944 of file ExampleApplication.h.

◆ m_autoCycleThroughScenes

bool agxOSG::ExampleApplication::m_autoCycleThroughScenes
protected

Definition at line 880 of file ExampleApplication.h.

◆ m_automaticStop

bool agxOSG::ExampleApplication::m_automaticStop
protected

Definition at line 874 of file ExampleApplication.h.

◆ m_autoPauseListener

agxSDK::ContactEventListenerRef agxOSG::ExampleApplication::m_autoPauseListener
protected

Definition at line 891 of file ExampleApplication.h.

◆ m_autoPausePairs

agx::HashSet<agxCollide::GeometryPair> agxOSG::ExampleApplication::m_autoPausePairs
protected

Definition at line 890 of file ExampleApplication.h.

◆ m_autoPausingEnabled

bool agxOSG::ExampleApplication::m_autoPausingEnabled
protected

Definition at line 889 of file ExampleApplication.h.

◆ m_cameraHomeCenter

agx::Vec3 agxOSG::ExampleApplication::m_cameraHomeCenter
protected

Definition at line 913 of file ExampleApplication.h.

◆ m_cameraHomeEye

agx::Vec3 agxOSG::ExampleApplication::m_cameraHomeEye
protected

Definition at line 912 of file ExampleApplication.h.

◆ m_cameraHomeSet

bool agxOSG::ExampleApplication::m_cameraHomeSet
protected

Definition at line 911 of file ExampleApplication.h.

◆ m_cameraHomeUp

agx::Vec3 agxOSG::ExampleApplication::m_cameraHomeUp
protected

Definition at line 914 of file ExampleApplication.h.

◆ m_cfgFileName

std::string agxOSG::ExampleApplication::m_cfgFileName
protected

Definition at line 870 of file ExampleApplication.h.

◆ m_controller

agx::ref_ptr<agx::Referenced> agxOSG::ExampleApplication::m_controller
protected

Definition at line 945 of file ExampleApplication.h.

◆ m_coordinateSystem

osg::ref_ptr<osg::MatrixTransform> agxOSG::ExampleApplication::m_coordinateSystem
protected

Definition at line 986 of file ExampleApplication.h.

◆ m_coordinateSystemEnabled

bool agxOSG::ExampleApplication::m_coordinateSystemEnabled
protected

Definition at line 983 of file ExampleApplication.h.

◆ m_coordinateSystemTransform

agx::AffineMatrix4x4 agxOSG::ExampleApplication::m_coordinateSystemTransform
protected

Definition at line 980 of file ExampleApplication.h.

◆ m_coSimulationInputData

agx::RealVector agxOSG::ExampleApplication::m_coSimulationInputData
protected

Definition at line 923 of file ExampleApplication.h.

◆ m_coSimulationInputFile

std::string agxOSG::ExampleApplication::m_coSimulationInputFile
protected

Definition at line 921 of file ExampleApplication.h.

◆ m_coSimulationOutputData

agx::RealVector agxOSG::ExampleApplication::m_coSimulationOutputData
protected

Definition at line 924 of file ExampleApplication.h.

◆ m_coSimulationOutputFile

std::string agxOSG::ExampleApplication::m_coSimulationOutputFile
protected

Definition at line 922 of file ExampleApplication.h.

◆ m_coSimulationServer

agx::ref_ptr<agx::Referenced> agxOSG::ExampleApplication::m_coSimulationServer
protected

Definition at line 903 of file ExampleApplication.h.

◆ m_debugClient

agx::ref_ptr<agx::Referenced> agxOSG::ExampleApplication::m_debugClient
protected

Definition at line 904 of file ExampleApplication.h.

◆ m_decorator

osg::ref_ptr<agxOSG::SceneDecorator> agxOSG::ExampleApplication::m_decorator
protected

Definition at line 840 of file ExampleApplication.h.

◆ m_didStep

bool agxOSG::ExampleApplication::m_didStep
protected

Definition at line 966 of file ExampleApplication.h.

◆ m_dt

agx::Real agxOSG::ExampleApplication::m_dt
protected

Definition at line 962 of file ExampleApplication.h.

◆ m_enableJournalIncrementalStructure

bool agxOSG::ExampleApplication::m_enableJournalIncrementalStructure
protected

Definition at line 989 of file ExampleApplication.h.

◆ m_enableJournalRecording

bool agxOSG::ExampleApplication::m_enableJournalRecording
protected

Definition at line 988 of file ExampleApplication.h.

◆ m_enableStepping

bool agxOSG::ExampleApplication::m_enableStepping
protected

Definition at line 953 of file ExampleApplication.h.

◆ m_eventAdapter

osg::ref_ptr<agxOSG::GuiEventAdapter> agxOSG::ExampleApplication::m_eventAdapter
protected

Definition at line 842 of file ExampleApplication.h.

◆ m_exitCode

int agxOSG::ExampleApplication::m_exitCode
protected

Definition at line 902 of file ExampleApplication.h.

◆ m_explicitFmu

bool agxOSG::ExampleApplication::m_explicitFmu
protected

Definition at line 991 of file ExampleApplication.h.

◆ m_explicitJournalConfigurationPath

bool agxOSG::ExampleApplication::m_explicitJournalConfigurationPath
protected

Definition at line 930 of file ExampleApplication.h.

◆ m_extractSimulationStructureToJsonPath

std::string agxOSG::ExampleApplication::m_extractSimulationStructureToJsonPath
protected

Definition at line 937 of file ExampleApplication.h.

◆ m_frameBlock

agx::Block agxOSG::ExampleApplication::m_frameBlock
protected

Definition at line 959 of file ExampleApplication.h.

◆ m_frameMutex

agx::Mutex agxOSG::ExampleApplication::m_frameMutex
protected

Definition at line 957 of file ExampleApplication.h.

◆ m_frameSleepTimer

agx::Timer agxOSG::ExampleApplication::m_frameSleepTimer
protected

Definition at line 965 of file ExampleApplication.h.

◆ m_generateTaskProfile

bool agxOSG::ExampleApplication::m_generateTaskProfile
protected

Definition at line 919 of file ExampleApplication.h.

◆ m_generateThreadTimeline

bool agxOSG::ExampleApplication::m_generateThreadTimeline
protected

Definition at line 916 of file ExampleApplication.h.

◆ m_GlCamera

agxGL::CameraRef agxOSG::ExampleApplication::m_GlCamera
protected

Definition at line 908 of file ExampleApplication.h.

◆ m_GlLights

agxGL::LightsRef agxOSG::ExampleApplication::m_GlLights
protected

Definition at line 909 of file ExampleApplication.h.

◆ m_gravity

agx::Vec3 agxOSG::ExampleApplication::m_gravity
protected

Definition at line 906 of file ExampleApplication.h.

◆ m_grid

osg::ref_ptr<osg::Geode> agxOSG::ExampleApplication::m_grid
protected

Definition at line 985 of file ExampleApplication.h.

◆ m_gridEnabled

bool agxOSG::ExampleApplication::m_gridEnabled
protected

Definition at line 984 of file ExampleApplication.h.

◆ m_gridResolution

agx::Vec2u agxOSG::ExampleApplication::m_gridResolution
protected

Definition at line 981 of file ExampleApplication.h.

◆ m_gridSize

agx::Vec2 agxOSG::ExampleApplication::m_gridSize
protected

Definition at line 982 of file ExampleApplication.h.

◆ m_haveLicense

bool agxOSG::ExampleApplication::m_haveLicense
protected

Definition at line 960 of file ExampleApplication.h.

◆ m_hostName

std::string agxOSG::ExampleApplication::m_hostName

Definition at line 977 of file ExampleApplication.h.

◆ m_imageCapture

agxOSG::ImageCaptureRef agxOSG::ExampleApplication::m_imageCapture
protected

Definition at line 845 of file ExampleApplication.h.

◆ m_initialized

bool agxOSG::ExampleApplication::m_initialized
protected

Definition at line 869 of file ExampleApplication.h.

◆ m_interactiveRemoteClient

bool agxOSG::ExampleApplication::m_interactiveRemoteClient
protected

Definition at line 990 of file ExampleApplication.h.

◆ m_isFMU

bool agxOSG::ExampleApplication::m_isFMU

Definition at line 975 of file ExampleApplication.h.

◆ m_isLoadingScene

bool agxOSG::ExampleApplication::m_isLoadingScene

Definition at line 974 of file ExampleApplication.h.

◆ m_journal

agx::ref_ptr<agx::Referenced> agxOSG::ExampleApplication::m_journal
protected

Definition at line 942 of file ExampleApplication.h.

◆ m_journalConfigurationPath

std::string agxOSG::ExampleApplication::m_journalConfigurationPath
protected

Definition at line 929 of file ExampleApplication.h.

◆ m_journalEofMode

std::string agxOSG::ExampleApplication::m_journalEofMode
protected

Definition at line 934 of file ExampleApplication.h.

◆ m_journalFormat

agx::UInt agxOSG::ExampleApplication::m_journalFormat
protected

Definition at line 931 of file ExampleApplication.h.

◆ m_journalFrequency

agx::Real agxOSG::ExampleApplication::m_journalFrequency
protected

Definition at line 940 of file ExampleApplication.h.

◆ m_journalPlaybackPath

std::string agxOSG::ExampleApplication::m_journalPlaybackPath
protected

Definition at line 928 of file ExampleApplication.h.

◆ m_journalRealMode

agx::RealModeEnum agxOSG::ExampleApplication::m_journalRealMode
protected

Definition at line 941 of file ExampleApplication.h.

◆ m_journalRecordPath

std::string agxOSG::ExampleApplication::m_journalRecordPath
protected

Definition at line 935 of file ExampleApplication.h.

◆ m_journalRecordStartTime

agx::Real agxOSG::ExampleApplication::m_journalRecordStartTime
protected

Definition at line 938 of file ExampleApplication.h.

◆ m_journalSessionName

std::string agxOSG::ExampleApplication::m_journalSessionName
protected

Definition at line 936 of file ExampleApplication.h.

◆ m_journalStartTime

agx::Real agxOSG::ExampleApplication::m_journalStartTime
protected

Definition at line 932 of file ExampleApplication.h.

◆ m_journalStopTime

agx::Real agxOSG::ExampleApplication::m_journalStopTime
protected

Definition at line 933 of file ExampleApplication.h.

◆ m_keyBindings

KeyBindings agxOSG::ExampleApplication::m_keyBindings
protected

Definition at line 860 of file ExampleApplication.h.

◆ m_keybindingVector

KeyBindingsVector agxOSG::ExampleApplication::m_keybindingVector
protected

Definition at line 861 of file ExampleApplication.h.

◆ m_listeners

agx::Vector<ExampleApplicationListenerRef> agxOSG::ExampleApplication::m_listeners
protected

Definition at line 997 of file ExampleApplication.h.

◆ m_loadedSceneFile

bool agxOSG::ExampleApplication::m_loadedSceneFile

Definition at line 973 of file ExampleApplication.h.

◆ m_luaFilePath

std::string agxOSG::ExampleApplication::m_luaFilePath
protected

Definition at line 926 of file ExampleApplication.h.

◆ m_newSimulation

bool agxOSG::ExampleApplication::m_newSimulation
protected

Definition at line 879 of file ExampleApplication.h.

◆ m_osgWindow

bool agxOSG::ExampleApplication::m_osgWindow
protected

Definition at line 852 of file ExampleApplication.h.

◆ m_parameterFilePath

std::string agxOSG::ExampleApplication::m_parameterFilePath
protected

Definition at line 867 of file ExampleApplication.h.

◆ m_pauseUpdate

bool agxOSG::ExampleApplication::m_pauseUpdate
protected

Definition at line 987 of file ExampleApplication.h.

◆ m_pBuffer

osg::ref_ptr<osg::GraphicsContext> agxOSG::ExampleApplication::m_pBuffer
protected

Definition at line 968 of file ExampleApplication.h.

◆ m_pBufferCamera

osg::ref_ptr<osg::Camera> agxOSG::ExampleApplication::m_pBufferCamera
protected

Definition at line 969 of file ExampleApplication.h.

◆ m_pickHandler

PickHandlerRef agxOSG::ExampleApplication::m_pickHandler
protected

Definition at line 893 of file ExampleApplication.h.

◆ m_profilingFrequency

agx::Real agxOSG::ExampleApplication::m_profilingFrequency
protected

Definition at line 970 of file ExampleApplication.h.

◆ m_profilingRoot

std::string agxOSG::ExampleApplication::m_profilingRoot
protected

Definition at line 917 of file ExampleApplication.h.

◆ m_pythonFilePath

std::string agxOSG::ExampleApplication::m_pythonFilePath
protected

Definition at line 927 of file ExampleApplication.h.

◆ m_quickProfiling

bool agxOSG::ExampleApplication::m_quickProfiling
protected

Definition at line 915 of file ExampleApplication.h.

◆ m_realTime

bool agxOSG::ExampleApplication::m_realTime
protected

Definition at line 875 of file ExampleApplication.h.

◆ m_realTimeRest

agx::Real agxOSG::ExampleApplication::m_realTimeRest
protected

Definition at line 963 of file ExampleApplication.h.

◆ m_relativeStopTime

agx::Real agxOSG::ExampleApplication::m_relativeStopTime
protected

Definition at line 876 of file ExampleApplication.h.

◆ m_removeGeometryCallback

agxSDK::Simulation::GeometryEvent::CallbackType agxOSG::ExampleApplication::m_removeGeometryCallback
protected

Definition at line 955 of file ExampleApplication.h.

◆ m_renderProxyFactory

agxOSG::RenderProxyFactory* agxOSG::ExampleApplication::m_renderProxyFactory
protected

Definition at line 952 of file ExampleApplication.h.

◆ m_renderTargetSet

RenderTargetRefVector agxOSG::ExampleApplication::m_renderTargetSet
protected

Definition at line 967 of file ExampleApplication.h.

◆ m_root

osg::ref_ptr<osg::Group> agxOSG::ExampleApplication::m_root
protected

Definition at line 847 of file ExampleApplication.h.

◆ m_scene

osg::ref_ptr<osg::Group> agxOSG::ExampleApplication::m_scene
protected

Definition at line 849 of file ExampleApplication.h.

◆ m_sceneFilename

std::string agxOSG::ExampleApplication::m_sceneFilename
protected

Definition at line 866 of file ExampleApplication.h.

◆ m_sceneIndex

int agxOSG::ExampleApplication::m_sceneIndex
protected

Definition at line 854 of file ExampleApplication.h.

◆ m_sceneLoadEvent

agx::Event agxOSG::ExampleApplication::m_sceneLoadEvent

Definition at line 976 of file ExampleApplication.h.

◆ m_sceneRoot

osg::ref_ptr<osg::Group> agxOSG::ExampleApplication::m_sceneRoot
protected

Definition at line 848 of file ExampleApplication.h.

◆ m_sceneSwitch

osg::ref_ptr<osg::Switch> agxOSG::ExampleApplication::m_sceneSwitch
protected

Definition at line 850 of file ExampleApplication.h.

◆ m_scriptFile

std::string agxOSG::ExampleApplication::m_scriptFile
protected

Definition at line 900 of file ExampleApplication.h.

◆ m_serviceMutex

agx::Mutex agxOSG::ExampleApplication::m_serviceMutex
protected

Definition at line 958 of file ExampleApplication.h.

◆ m_settings

agxCFG::ConfigScriptRef agxOSG::ExampleApplication::m_settings
protected

Definition at line 895 of file ExampleApplication.h.

◆ m_shouldLoadXmlPlot

bool agxOSG::ExampleApplication::m_shouldLoadXmlPlot
protected

Definition at line 898 of file ExampleApplication.h.

◆ m_shouldStop

bool agxOSG::ExampleApplication::m_shouldStop
protected

Definition at line 901 of file ExampleApplication.h.

◆ m_simulation

agxSDK::SimulationRef agxOSG::ExampleApplication::m_simulation
protected

Definition at line 841 of file ExampleApplication.h.

◆ m_solverType

SolverType agxOSG::ExampleApplication::m_solverType
protected

Definition at line 863 of file ExampleApplication.h.

◆ m_startScene

int agxOSG::ExampleApplication::m_startScene
protected

Definition at line 954 of file ExampleApplication.h.

◆ m_statisticsRenderer

StatisticsRendererRef agxOSG::ExampleApplication::m_statisticsRenderer
protected

Definition at line 882 of file ExampleApplication.h.

◆ m_stepCallback

agx::Callback agxOSG::ExampleApplication::m_stepCallback
protected

Definition at line 992 of file ExampleApplication.h.

◆ m_stepTimer

agx::Timer agxOSG::ExampleApplication::m_stepTimer
protected

Definition at line 964 of file ExampleApplication.h.

◆ m_stopFrame

agx::UInt agxOSG::ExampleApplication::m_stopFrame
protected

Definition at line 878 of file ExampleApplication.h.

◆ m_stopTime

agx::Real agxOSG::ExampleApplication::m_stopTime
protected

Definition at line 877 of file ExampleApplication.h.

◆ m_textureCamera

osg::ref_ptr<osg::Camera> agxOSG::ExampleApplication::m_textureCamera
protected

Definition at line 956 of file ExampleApplication.h.

◆ m_timelineFormats

agx::Vector<agx::String> agxOSG::ExampleApplication::m_timelineFormats
protected

Definition at line 918 of file ExampleApplication.h.

◆ m_timestep

agx::Real agxOSG::ExampleApplication::m_timestep
mutableprotected

Definition at line 872 of file ExampleApplication.h.

◆ m_useCoSimulation

bool agxOSG::ExampleApplication::m_useCoSimulation
protected

Definition at line 920 of file ExampleApplication.h.

◆ m_videoCapture

VideoFFMPEGPipeCaptureRef agxOSG::ExampleApplication::m_videoCapture
protected

Definition at line 995 of file ExampleApplication.h.

◆ m_videoCaptureRenderToTexture

RenderToTextureRef agxOSG::ExampleApplication::m_videoCaptureRenderToTexture
protected

Definition at line 996 of file ExampleApplication.h.

◆ m_videoName

std::string agxOSG::ExampleApplication::m_videoName
protected

Definition at line 994 of file ExampleApplication.h.

◆ m_viewer

osg::ref_ptr<osgViewer::Viewer> agxOSG::ExampleApplication::m_viewer
protected

Definition at line 843 of file ExampleApplication.h.

◆ m_vSync

bool agxOSG::ExampleApplication::m_vSync
protected

Definition at line 925 of file ExampleApplication.h.

◆ m_xmlPlotFile

std::string agxOSG::ExampleApplication::m_xmlPlotFile
protected

Definition at line 897 of file ExampleApplication.h.


The documentation for this class was generated from the following file: