75 Journal(
const String& diskPath =
"Journal.agxJournal",
ArchiveFormat archiveFormat = AUTO,
bool loadPlotFromJournal =
true,
bool readOnlyIfExists=
false);
80 const Name& getName()
const;
91 const String& getDiskPath()
const;
149 Mode getMode()
const;
313 void attachStandalone(
agxData::FrameReader* input,
agxData::FrameWriter* output );
329 void setSaveSceneToDisk(
bool flag );
334 bool getSaveSceneToDisk() const;
341 void preTickCallback(
Clock *clock);
343 void defaultSceneLoader(const
String& path);
345 void trackExceptionCallback(
agxData::Track *track,
std::exception& e);
346 void createApiTrack();
350 agxData::JournalArchiveRef m_diskJournal;
355 agxData::JournalArchive::SessionRef m_currentSession;
356 agxSDK::SimulationObserver m_simulation;
359 agxSDK::SimulationFrameReaderRef m_simulationReader;
360 agxSDK::SimulationFrameWriterRef m_simulationWriter;
361 agxData::DiskFrameWriterRef m_fileWriter;
362 agxData::DiskFrameReaderRef m_fileReader;
374 Clock::TickEvent::CallbackType m_preTickCallback;
381 bool m_hasSavedScene;
384 bool m_saveSimulationToDisk;
387 Real m_recordStartTime;
390 bool m_enableIncrementalStructure;
441 void writeCallback(
const agxData::Frame *frame);
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXPHYSICS_EXPORT
Helper class for the FrameReaders that are backed by a file on disk.
Base class for the FrameReaders that are backed by a file on disk.
The JournalArchive provides an abstract class for inspecting and manipulating the contents of a creat...
Session(const agx::Name &name)
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Block synchronization primitive.
Templated callback with one argument.
Templated callback with two arguments.
Generalized callback, using std::function.
Clock class keeps representation of virtual/simulated time.
An event with one argument.
Callback1< const agx::String & > SceneLoaderCallback
A callback that will be called when starting playback from a recording.
void setTargetFormat(ArchiveFormat format)
agxData::JournalArchive::Session * findNewestSession()
agxData::JournalArchive * getFileJournal() const
FoundIncrementalArchiveEvent foundIncrementalArchiveEvent
ProgressEvent progressEvent
bool jumpToFrame(agx::UInt frameIndex)
Jump to a specified frame during playback.
void setSceneLoader(SceneLoaderCallback loader)
void flush(bool force=false)
Flush the journal.
agx::UInt16 getSerializationVersion() const
Find what serialization version a Journal was stored with.
agx::Event1< Journal * > FoundIncrementalArchiveEvent
bool sanityCheck(const agxSDK::Simulation *simulation, agxData::JournalArchive::Session *session) const
const agxData::JournalArchive::SessionTable & getSessions() const
void setTargetPath(const agx::String &path)
void setFrameStride(agx::UInt stride)
RenderLoaderCallback getRenderLoader()
agx::Event1< SessionHeader > SessionEvent
void detach()
Detach from the currently attached simulation.
FrameJumpEvent journalFrameJumpEvent
Journal(const String &diskPath="Journal.agxJournal", ArchiveFormat archiveFormat=AUTO, bool loadPlotFromJournal=true, bool readOnlyIfExists=false)
agx::Callback2< Journal *, std::exception & > ExceptionHandler
SessionEvent sessionEndEvent
agx::Real getEndTime() const
agxData::FrameRef readFrameAtTime(agx::Real time)
Explicitly read a frame from the journal.
Callback2< agxSDK::Assembly *, bool > RenderLoaderCallback
agx::Event1< Journal * > FrameJumpEvent
agx::UInt getFrameStride() const
ArchiveFormat getTargetFormat() const
void setCurrentSession(agxData::JournalArchive::Session *session, bool saveSceneOnNextPreTick=true)
Change the active session to the given session.
void setSourcePath(const agx::String &path)
const ExceptionHandler & getExceptionHandler() const
void clearDataBindings()
Remove all data bindings.
agx::Bool getExpand() const
ArchiveFormat getArchiveFormat() const
void extractScene(const agx::String &sessionName)
agxData::FrameRef readFrameWithIndex(agx::UInt index)
Explicitly read a frame from the journal.
const agx::String & getTargetPath() const
void setExpand(agx::Bool expand)
agxData::JournalArchive::Session * loadNewestSession()
Load the most recent session.
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/restore...
bool jumpToTime(agx::Real time)
Jump to a specified time during playback.
void setExceptionHandler(const ExceptionHandler &handler)
Specify an exception handler.
bool loadConfiguration(const String &configurationFilePath)
Load data bindings from a configuration file.
void setStartTime(agx::Real startTime)
void addDataBinding(const agx::Object *object, bool recursive=false)
bool getEnableIncrementalStructure() const
bool removeDataBinding(const agx::Object *object)
agx::Real getStartTime() const
bool removeDataBinding(const agx::Path &path)
Remove a data binding from the journal.
void setEndTime(agx::Real endTime)
bool renameCurrentSession(const agx::String &newName)
Change the name of the current session.
agxData::JournalArchive::Session * createNewSession()
Create a new session within the current Journal archive.
void attach(agxSDK::Simulation *simulation, Mode mode, agxData::Track *frameCache=nullptr, bool passive=false)
Attach the journal to a simulation.
agxData::JournalArchive::Session * createNewSession(const Name &name)
agx::Event1< UInt > ProgressEvent
const agx::String & getSourcePath() const
agxData::JournalArchive::Session * getSession(const agx::Name &name)
void setEnableIncrementalStructure(bool flag)
Enable/disable incremental simulation structure recording.
bool removeSession(const agx::Name &sessionName)
Remove a session from the journal.
static void convert(const String &targetPath, const String &sourcePath, ArchiveFormat targetFormat, bool expand=false)
Convert journal from one format to another.
void startRecordingAtTime(agx::Real time)
Specify time stamp when journal recording should begin.
agxData::JournalArchive::Session * setCurrentSession(const agx::Name &sessionName, bool saveSceneOnNextPreTick=true)
Change the active session to the session with the given name.
void setRenderLoader(RenderLoaderCallback loader)
void setMode(Mode mode)
Set the journal mode, RECORD or PLAYBACK.
SessionEvent sessionStartEvent
static bool findNewestSession(const agx::String &diskPath, agx::JournalRef &journal, agxData::JournalArchive::SessionRef &session)
Inheritance with partial specialization due to bug with ref_ptr containers.
Representation of a name string.
agx::Object is a refcounted object with a name.
Representation of a path, a list of name components.
Base class providing referencing counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Contains classes for low level data storage for AGX.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.