|
AGX Dynamics 2.42.3.1
|
#include <Journal.h>
Inheritance diagram for agx::Journal:Classes | |
| struct | SessionHeader |
Public Types | |
| enum | ArchiveFormat { AUTO , HDF5 , CUSTOM } |
| typedef agx::Callback2< Journal *, std::exception & > | ExceptionHandler |
| typedef agx::Event1< Journal * > | FoundIncrementalArchiveEvent |
| typedef agx::Event1< Journal * > | FrameJumpEvent |
| enum | Mode { INVALID = -1 , RECORD , PLAYBACK } |
| typedef agx::Event1< UInt > | ProgressEvent |
| typedef Callback2< agxSDK::Assembly *, bool > | RenderLoaderCallback |
| typedef Callback1< const agx::String & > | SceneLoaderCallback |
| A callback that will be called when starting playback from a recording. | |
| typedef agx::Event1< SessionHeader > | SessionEvent |
Public Member Functions | |
| Journal (const String &diskPath="Journal.agxJournal", ArchiveFormat archiveFormat=AUTO, bool loadPlotFromJournal=true, bool readOnlyIfExists=false) | |
| void | addDataBinding (const agx::Object *object, bool recursive=false) |
| void | addDataBinding (const agx::Path &path, bool recursive=false) |
| Add a data binding to the journal, eg Particle.position will register the buffer to be stored/restored by journal. | |
| void | attach (agxSDK::Simulation *simulation, Mode mode, agxData::Track *frameCache=nullptr, bool passive=false) |
| Attach the journal to a simulation. | |
| void | clearDataBindings () |
| Remove all data bindings. | |
| Converter () | |
| agxData::JournalArchive::Session * | createNewSession () |
| Create a new session within the current Journal archive. | |
| agxData::JournalArchive::Session * | createNewSession (const Name &name) |
| void | detach () |
| Detach from the currently attached simulation. | |
| void | execute () |
| void | extractScene (const agx::String &sessionName) |
| agxData::JournalArchive::Session * | findNewestSession () |
| void | flush (bool force=false) |
| Flush the journal. | |
| ArchiveFormat | getArchiveFormat () const |
| agxData::JournalArchive::Session * | getCurrentSession () |
| const String & | getDiskPath () const |
| Set the disk path. | |
| bool | getEnableIncrementalStructure () const |
| agx::Real | getEndTime () const |
| const ExceptionHandler & | getExceptionHandler () const |
| agx::Bool | getExpand () const |
| agxData::JournalArchive * | getFileJournal () const |
| agxData::DiskFrameReader * | getFileReader () |
| const agxData::DiskFrameReader * | getFileReader () const |
| agxData::DiskFrameWriter * | getFileWriter () |
| const agxData::DiskFrameWriter * | getFileWriter () const |
| agx::UInt | getFrameStride () const |
| Mode | getMode () const |
| const Name & | getName () const |
| RenderLoaderCallback | getRenderLoader () |
| bool | getSaveSceneToDisk () const |
| agx::UInt16 | getSerializationVersion () const |
| Find what serialization version a Journal was stored with. | |
| agxData::JournalArchive::Session * | getSession (const agx::Name &name) |
| const agxData::JournalArchive::SessionTable & | getSessions () const |
| agxSDK::Simulation * | getSimulation () |
| const agxSDK::Simulation * | getSimulation () const |
| agxSDK::SimulationFrameReader * | getSimulationReader () |
| const agxSDK::SimulationFrameReader * | getSimulationReader () const |
| agxSDK::SimulationFrameWriter * | getSimulationWriter () |
| const agxSDK::SimulationFrameWriter * | getSimulationWriter () const |
| const agx::String & | getSourcePath () const |
| agx::Real | getStartTime () const |
| ArchiveFormat | getTargetFormat () const |
| const agx::String & | getTargetPath () const |
| agxData::Track * | getTrack () |
| const agxData::Track * | getTrack () const |
| bool | isJumping () const |
| bool | jumpToFrame (agx::UInt frameIndex) |
| Jump to a specified frame during playback. | |
| bool | jumpToTime (agx::Real time) |
| Jump to a specified time during playback. | |
| bool | loadConfiguration (const String &configurationFilePath) |
| Load data bindings from a configuration file. | |
| agxData::JournalArchive::Session * | loadNewestSession () |
| Load the most recent session. | |
| agxData::FrameRef | readFrameAtTime (agx::Real time) |
| Explicitly read a frame from the journal. | |
| agxData::FrameRef | readFrameWithIndex (agx::UInt index) |
| Explicitly read a frame from the journal. | |
| bool | removeDataBinding (const agx::Object *object) |
| bool | removeDataBinding (const agx::Path &path) |
| Remove a data binding from the journal. | |
| bool | removeSession (const agx::Name &sessionName) |
| Remove a session from the journal. | |
| bool | renameCurrentSession (const agx::String &newName) |
| Change the name of the current session. | |
| bool | sanityCheck (const agxSDK::Simulation *simulation, agxData::JournalArchive::Session *session) const |
| void | saveScene () |
| Save the scene state, normally done automatically. | |
| void | setCurrentSession (agxData::JournalArchive::Session *session, bool saveSceneOnNextPreTick=true) |
| Change the active session to the given session. | |
| agxData::JournalArchive::Session * | setCurrentSession (const agx::Name &sessionName, bool saveSceneOnNextPreTick=true) |
| Change the active session to the session with the given name. | |
| void | setEnableIncrementalStructure (bool flag) |
| Enable/disable incremental simulation structure recording. | |
| void | setEndTime (agx::Real endTime) |
| void | setExceptionHandler (const ExceptionHandler &handler) |
| Specify an exception handler. | |
| void | setExpand (agx::Bool expand) |
| void | setFrameStride (agx::UInt stride) |
| void | setMode (Mode mode) |
| Set the journal mode, RECORD or PLAYBACK. | |
| void | setRenderLoader (RenderLoaderCallback loader) |
| void | setSaveSceneToDisk (bool flag) |
| Specifies if the simulation serialization should be temporary stored to disk or to memory when creating the journal. | |
| void | setSceneLoader (SceneLoaderCallback loader) |
| void | setSourcePath (const agx::String &path) |
| void | setStartTime (agx::Real startTime) |
| void | setTargetFormat (ArchiveFormat format) |
| void | setTargetPath (const agx::String &path) |
| void | startRecordingAtTime (agx::Real time) |
| Specify time stamp when journal recording should begin. | |
| void | triggerFrame () |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Static Public Member Functions | |
| static void | convert (const String &targetPath, const String &sourcePath, ArchiveFormat targetFormat, bool expand=false) |
| Convert journal from one format to another. | |
| static bool | findNewestSession (const agx::String &diskPath, agx::JournalRef &journal, agxData::JournalArchive::SessionRef &session) |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~Journal () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
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. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| typedef agx::Callback2<Journal *, std::exception&> agx::Journal::ExceptionHandler |
| typedef agx::Event1<Journal*> agx::Journal::FrameJumpEvent |
| typedef agx::Event1<UInt> agx::Journal::ProgressEvent |
| typedef Callback2<agxSDK::Assembly *, bool> agx::Journal::RenderLoaderCallback |
| typedef Callback1<const agx::String&> agx::Journal::SceneLoaderCallback |
| enum agx::Journal::Mode |
| agx::Journal::Journal | ( | const String & | diskPath = "Journal.agxJournal", |
| ArchiveFormat | archiveFormat = AUTO, |
||
| bool | loadPlotFromJournal = true, |
||
| bool | readOnlyIfExists = false |
||
| ) |
|
protectedvirtual |
| void agx::Journal::addDataBinding | ( | const agx::Object * | object, |
| bool | recursive = false |
||
| ) |
| void agx::Journal::addDataBinding | ( | const agx::Path & | path, |
| bool | recursive = false |
||
| ) |
Add a data binding to the journal, eg Particle.position will register the buffer to be stored/restored by journal.
| void agx::Journal::attach | ( | agxSDK::Simulation * | simulation, |
| Mode | mode, | ||
| agxData::Track * | frameCache = nullptr, |
||
| bool | passive = false |
||
| ) |
Attach the journal to a simulation.
| simulation | The simulation |
| mode | RECORD or PLAYBACK |
| frameCache | An existing track to load cached frames from |
| passive | True if simulation should not be made aware of this journal, must be true if more than one journal is attached |
| void agx::Journal::clearDataBindings | ( | ) |
Remove all data bindings.
|
static |
Convert journal from one format to another.
| agx::Journal::Converter | ( | ) |
| agxData::JournalArchive::Session * agx::Journal::createNewSession | ( | ) |
Create a new session within the current Journal archive.
Will make the newly created session the active session.
| agxData::JournalArchive::Session * agx::Journal::createNewSession | ( | const Name & | name | ) |
| void agx::Journal::detach | ( | ) |
Detach from the currently attached simulation.
| void agx::Journal::execute | ( | ) |
| void agx::Journal::extractScene | ( | const agx::String & | sessionName | ) |
| agxData::JournalArchive::Session * agx::Journal::findNewestSession | ( | ) |
|
static |
| void agx::Journal::flush | ( | bool | force = false | ) |
Flush the journal.
| force | Does not wait for output thread to completed if true. |
| ArchiveFormat agx::Journal::getArchiveFormat | ( | ) | const |
| agxData::JournalArchive::Session * agx::Journal::getCurrentSession | ( | ) |
| const String & agx::Journal::getDiskPath | ( | ) | const |
| bool agx::Journal::getEnableIncrementalStructure | ( | ) | const |
| agx::Real agx::Journal::getEndTime | ( | ) | const |
| const ExceptionHandler & agx::Journal::getExceptionHandler | ( | ) | const |
| agx::Bool agx::Journal::getExpand | ( | ) | const |
| agxData::JournalArchive * agx::Journal::getFileJournal | ( | ) | const |
| agxData::DiskFrameReader * agx::Journal::getFileReader | ( | ) |
| const agxData::DiskFrameReader * agx::Journal::getFileReader | ( | ) | const |
| agxData::DiskFrameWriter * agx::Journal::getFileWriter | ( | ) |
| const agxData::DiskFrameWriter * agx::Journal::getFileWriter | ( | ) | const |
| agx::UInt agx::Journal::getFrameStride | ( | ) | const |
| Journal::Mode agx::Journal::getMode | ( | ) | const |
| const Name & agx::Journal::getName | ( | ) | const |
| RenderLoaderCallback agx::Journal::getRenderLoader | ( | ) |
| bool agx::Journal::getSaveSceneToDisk | ( | ) | const |
| agx::UInt16 agx::Journal::getSerializationVersion | ( | ) | const |
Find what serialization version a Journal was stored with.
| agxData::JournalArchive::Session * agx::Journal::getSession | ( | const agx::Name & | name | ) |
| const agxData::JournalArchive::SessionTable & agx::Journal::getSessions | ( | ) | const |
| agxSDK::Simulation * agx::Journal::getSimulation | ( | ) |
| const agxSDK::Simulation * agx::Journal::getSimulation | ( | ) | const |
| agxSDK::SimulationFrameReader * agx::Journal::getSimulationReader | ( | ) |
| const agxSDK::SimulationFrameReader * agx::Journal::getSimulationReader | ( | ) | const |
| agxSDK::SimulationFrameWriter * agx::Journal::getSimulationWriter | ( | ) |
| const agxSDK::SimulationFrameWriter * agx::Journal::getSimulationWriter | ( | ) | const |
| const agx::String & agx::Journal::getSourcePath | ( | ) | const |
| agx::Real agx::Journal::getStartTime | ( | ) | const |
| ArchiveFormat agx::Journal::getTargetFormat | ( | ) | const |
| const agx::String & agx::Journal::getTargetPath | ( | ) | const |
| agxData::Track * agx::Journal::getTrack | ( | ) |
| const agxData::Track * agx::Journal::getTrack | ( | ) | const |
| bool agx::Journal::isJumping | ( | ) | const |
| bool agx::Journal::jumpToFrame | ( | agx::UInt | frameIndex | ) |
Jump to a specified frame during playback.
| bool agx::Journal::jumpToTime | ( | agx::Real | time | ) |
Jump to a specified time during playback.
| bool agx::Journal::loadConfiguration | ( | const String & | configurationFilePath | ) |
Load data bindings from a configuration file.
| agxData::JournalArchive::Session * agx::Journal::loadNewestSession | ( | ) |
Load the most recent session.
| agxData::FrameRef agx::Journal::readFrameAtTime | ( | agx::Real | time | ) |
Explicitly read a frame from the journal.
| time | The point in time |
| agxData::FrameRef agx::Journal::readFrameWithIndex | ( | agx::UInt | index | ) |
Explicitly read a frame from the journal.
| index | The frame index |
| bool agx::Journal::removeDataBinding | ( | const agx::Object * | object | ) |
| bool agx::Journal::removeDataBinding | ( | const agx::Path & | path | ) |
Remove a data binding from the journal.
| bool agx::Journal::removeSession | ( | const agx::Name & | sessionName | ) |
Remove a session from the journal.
| bool agx::Journal::renameCurrentSession | ( | const agx::String & | newName | ) |
Change the name of the current session.
| bool agx::Journal::sanityCheck | ( | const agxSDK::Simulation * | simulation, |
| agxData::JournalArchive::Session * | session | ||
| ) | const |
| void agx::Journal::saveScene | ( | ) |
Save the scene state, normally done automatically.
| void agx::Journal::setCurrentSession | ( | agxData::JournalArchive::Session * | session, |
| bool | saveSceneOnNextPreTick = true |
||
| ) |
Change the active session to the given session.
The session must be part of the current JournalArchive.
| agxData::JournalArchive::Session * agx::Journal::setCurrentSession | ( | const agx::Name & | sessionName, |
| bool | saveSceneOnNextPreTick = true |
||
| ) |
Change the active session to the session with the given name.
The session must be part of the current JournalArchive. Will return nullptr if it it didn't exist
| void agx::Journal::setEnableIncrementalStructure | ( | bool | flag | ) |
Enable/disable incremental simulation structure recording.
Enabled by default.
| void agx::Journal::setEndTime | ( | agx::Real | endTime | ) |
| void agx::Journal::setExceptionHandler | ( | const ExceptionHandler & | handler | ) |
Specify an exception handler.
| void agx::Journal::setExpand | ( | agx::Bool | expand | ) |
| void agx::Journal::setFrameStride | ( | agx::UInt | stride | ) |
| void agx::Journal::setMode | ( | Mode | mode | ) |
Set the journal mode, RECORD or PLAYBACK.
| void agx::Journal::setRenderLoader | ( | RenderLoaderCallback | loader | ) |
| void agx::Journal::setSaveSceneToDisk | ( | bool | flag | ) |
Specifies if the simulation serialization should be temporary stored to disk or to memory when creating the journal.
Storing to memory is default. But this might cause problem, as a large continuous memory need to be allocated. For 32bit applications, it might be problematic to allocate 100Mb or more continuous memory, hence storing to disk might be better. And slower.
DEFAULT: store to memory (false)
| flag | - if true, scene will be stored to disk, otherwise to memory before written to journal. |
| void agx::Journal::setSceneLoader | ( | SceneLoaderCallback | loader | ) |
| void agx::Journal::setSourcePath | ( | const agx::String & | path | ) |
| void agx::Journal::setStartTime | ( | agx::Real | startTime | ) |
| void agx::Journal::setTargetFormat | ( | ArchiveFormat | format | ) |
| void agx::Journal::setTargetPath | ( | const agx::String & | path | ) |
| void agx::Journal::startRecordingAtTime | ( | agx::Real | time | ) |
Specify time stamp when journal recording should begin.
| void agx::Journal::triggerFrame | ( | ) |
| FoundIncrementalArchiveEvent agx::Journal::foundIncrementalArchiveEvent |
| FrameJumpEvent agx::Journal::journalFrameJumpEvent |
| ProgressEvent agx::Journal::progressEvent |
| SessionEvent agx::Journal::sessionEndEvent |
| SessionEvent agx::Journal::sessionStartEvent |