|
AGXDynamics
2.31.1.0
|
#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 |
| 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. More... | |
| 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::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. More... | |
| void | addDataBinding (const agx::Object *object, bool recursive=false) |
| 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 |
| void | attach (agxSDK::Simulation *simulation, Mode mode, agxData::Track *frameCache=nullptr, bool passive=false) |
| Attach the journal to a simulation. More... | |
| void | clearDataBindings () |
| Remove all data bindings. More... | |
| Converter () | |
| agxData::JournalArchive::Session * | createNewSession () |
| Create a new session within the current Journal archive. More... | |
| agxData::JournalArchive::Session * | createNewSession (const Name &name) |
| void | detach () |
| Detach from the currently attached simulation. More... | |
| void | execute () |
| void | extractScene (const agx::String &sessionName) |
| agxData::JournalArchive::Session * | findNewestSession () |
| void | flush (bool force=false) |
| Flush the journal. More... | |
| ArchiveFormat | getArchiveFormat () const |
| agxData::JournalArchive::Session * | getCurrentSession () |
| const String & | getDiskPath () const |
| Set the disk path. More... | |
| 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 |
| int | getReferenceCount () const |
| RenderLoaderCallback | getRenderLoader () |
| bool | getSaveSceneToDisk () const |
| agx::UInt16 | getSerializationVersion () const |
| Find what serialization version a Journal was stored with. More... | |
| 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 |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isJumping () const |
| bool | jumpToFrame (agx::UInt frameIndex) |
| Jump to a specified frame during playback. More... | |
| bool | jumpToTime (agx::Real time) |
| Jump to a specified time during playback. More... | |
| bool | loadConfiguration (const String &configurationFilePath) |
| Load data bindings from a configuration file. More... | |
| agxData::JournalArchive::Session * | loadNewestSession () |
| Load the most recent session. More... | |
| agxData::FrameRef | readFrameAtTime (agx::Real time) |
| Explicitly read a frame from the journal. More... | |
| agxData::FrameRef | readFrameWithIndex (agx::UInt index) |
| Explicitly read a frame from the journal. 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... | |
| bool | removeDataBinding (const agx::Path &path) |
| Remove a data binding from the journal. More... | |
| bool | removeDataBinding (const agx::Object *object) |
| bool | removeSession (const agx::Name &sessionName) |
| Remove a session from the journal. More... | |
| bool | renameCurrentSession (const agx::String &newName) |
| Change the name of the current session. More... | |
| bool | sanityCheck (const agxSDK::Simulation *simulation, agxData::JournalArchive::Session *session) const |
| void | saveScene () |
| Save the scene state, normally done automatically. More... | |
| agxData::JournalArchive::Session * | setCurrentSession (const agx::Name &sessionName, bool saveSceneOnNextPreTick=true) |
| Change the active session to the session with the given name. More... | |
| void | setCurrentSession (agxData::JournalArchive::Session *session, bool saveSceneOnNextPreTick=true) |
| Change the active session to the given session. More... | |
| void | setEnableIncrementalStructure (bool flag) |
| Enable/disable incremental simulation structure recording. More... | |
| void | setEndTime (agx::Real endTime) |
| void | setExceptionHandler (const ExceptionHandler &handler) |
| Specify an exception handler. More... | |
| void | setExpand (agx::Bool expand) |
| void | setFrameStride (agx::UInt stride) |
| void | setMode (Mode mode) |
| Set the journal mode, RECORD or PLAYBACK. More... | |
| 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. More... | |
| 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. More... | |
| void | triggerFrame () |
| 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 | convert (const String &targetPath, const String &sourcePath, ArchiveFormat targetFormat, bool expand=false) |
| Convert journal from one format to another. More... | |
| static bool | findNewestSession (const agx::String &diskPath, agx::JournalRef &journal, agxData::JournalArchive::SessionRef &session) |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Public Attributes | |
| ProgressEvent | progressEvent |
| SessionEvent | sessionEndEvent |
| SessionEvent | sessionStartEvent |
Protected Member Functions | |
| virtual | ~Journal () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Static Protected Member Functions | |
| 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... | |
Protected Attributes | |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| typedef agx::Callback2<Journal *, std::exception&> agx::Journal::ExceptionHandler |
| 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 |
Add a data binding to the journal, eg Particle.position will register the buffer to be stored/restored by journal.
| void agx::Journal::addDataBinding | ( | const agx::Object * | object, |
| bool | recursive = false |
||
| ) |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
| 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 | ) |
|
protectedinherited |
| 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 | ( | ) |
|
staticprotectedinherited |
| 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 |
|
inherited |
| 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 |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
| 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 |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
| bool agx::Journal::removeDataBinding | ( | const agx::Path & | path | ) |
Remove a data binding from the journal.
| bool agx::Journal::removeDataBinding | ( | const agx::Object * | object | ) |
| 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.
| 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::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.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
| void agx::Journal::setEnableIncrementalStructure | ( | bool | flag | ) |
Enable/disable incremental simulation structure recording.
Enabled by default.
| void agx::Journal::setExceptionHandler | ( | const ExceptionHandler & | handler | ) |
Specify an exception handler.
| 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::setTargetFormat | ( | ArchiveFormat | format | ) |
| void agx::Journal::setTargetPath | ( | const agx::String & | path | ) |
Specify time stamp when journal recording should begin.
| void agx::Journal::triggerFrame | ( | ) |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
| ProgressEvent agx::Journal::progressEvent |
| SessionEvent agx::Journal::sessionEndEvent |
| SessionEvent agx::Journal::sessionStartEvent |