70 Journal(
const String& diskPath =
"Journal.agxJournal",
ArchiveFormat archiveFormat = AUTO,
bool loadPlotFromJournal =
true,
bool readOnlyIfExists=
false);
75 const Name& getName()
const;
86 const String& getDiskPath()
const;
144 Mode getMode()
const;
308 void attachStandalone(
agxData::FrameReader* input,
agxData::FrameWriter* output );
324 void setSaveSceneToDisk(
bool flag );
329 bool getSaveSceneToDisk() const;
336 void preTickCallback(
Clock *clock);
338 void defaultSceneLoader(const
String& path);
340 void trackExceptionCallback(
agxData::Track *track, std::exception& e);
341 void createApiTrack();
350 agxData::JournalArchive::SessionRef m_currentSession;
369 Clock::TickEvent::CallbackType m_preTickCallback;
376 bool m_hasSavedScene;
379 bool m_saveSimulationToDisk;
382 Real m_recordStartTime;
385 bool m_enableIncrementalStructure;
436 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.
Generalized callback, using std::function.
Clock class keeps representation of virtual/simulated time.
Callback1< const agx::String & > SceneLoaderCallback
A callback that will be called when starting playback from a recording.
void setTargetFormat(ArchiveFormat format)
agxData::JournalArchive::Session * getCurrentSession()
agxData::DiskFrameWriter * getFileWriter()
agxData::JournalArchive::Session * createNewSession(const Name &name)
ProgressEvent progressEvent
agxData::JournalArchive::Session * loadNewestSession()
Load the most recent session.
bool jumpToFrame(agx::UInt frameIndex)
Jump to a specified frame during playback.
const agxData::JournalArchive::SessionTable & getSessions() const
agxData::JournalArchive * getFileJournal() const
void setSceneLoader(SceneLoaderCallback loader)
agxData::JournalArchive::Session * findNewestSession()
void flush(bool force=false)
Flush the journal.
agx::UInt16 getSerializationVersion() const
Find what serialization version a Journal was stored with.
agxSDK::SimulationFrameWriter * getSimulationWriter()
agxData::DiskFrameReader * getFileReader()
bool sanityCheck(const agxSDK::Simulation *simulation, agxData::JournalArchive::Session *session) const
const String & getDiskPath() const
Set the disk path.
const agx::String & getTargetPath() const
agxData::JournalArchive::Session * getSession(const agx::Name &name)
void setTargetPath(const agx::String &path)
agxData::JournalArchive::Session * createNewSession()
Create a new session within the current Journal archive.
void setFrameStride(agx::UInt stride)
const Name & getName() const
RenderLoaderCallback getRenderLoader()
agx::Event1< SessionHeader > SessionEvent
void detach()
Detach from the currently attached simulation.
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::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 agx::String & getSourcePath() 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.
void setExpand(agx::Bool expand)
agxData::Track * getTrack()
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.
agxSDK::Simulation * getSimulation()
void attach(agxSDK::Simulation *simulation, Mode mode, agxData::Track *frameCache=nullptr, bool passive=false)
Attach the journal to a simulation.
agx::Event1< UInt > ProgressEvent
const ExceptionHandler & getExceptionHandler() const
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.
void setRenderLoader(RenderLoaderCallback loader)
void setMode(Mode mode)
Set the journal mode, RECORD or PLAYBACK.
SessionEvent sessionStartEvent
agxData::JournalArchive::Session * setCurrentSession(const agx::Name &sessionName, bool saveSceneOnNextPreTick=true)
Change the active session to the session with the given name.
agxSDK::SimulationFrameReader * getSimulationReader()
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.
agx::ref_ptr< DiskFrameReader > DiskFrameReaderRef
agx::ref_ptr< DiskFrameWriter > DiskFrameWriterRef
agx::ref_ptr< Track > TrackRef
agx::ref_ptr< JournalArchive > JournalArchiveRef
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::ref_ptr< SimulationFrameReader > SimulationFrameReaderRef
agx::observer_ptr< Simulation > SimulationObserver
agx::ref_ptr< SimulationFrameWriter > SimulationFrameWriterRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< Frame > FrameRef