AGX Dynamics  2.35.0.1
DiskTrack.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXDATA_DISKTRACK_H
18 #define AGXDATA_DISKTRACK_H
19 
20 
21 #include <agxData/FrameIO.h>
22 #include <agxData/JournalArchive.h>
23 
24 
25 namespace agxData
26 {
28 
35  {
36  public:
37 
42  virtual Frame* readFrame() override;
43 
44  virtual agx::UInt getNextFrameIndex() override;
45  virtual void advanceToNextFrame() override;
46 
52  virtual const JournalArchive::Session* getSession() const = 0;
53 
54 
58 
59  virtual bool shouldExtract(const agx::Path& path) override;
60 
61  virtual agx::Real getTimeStep() override;
62  virtual agx::UInt getFrameStride() override;
63 
64 
69 
70  protected:
72 
76  virtual agxData::Frame* readFrame( agx::UInt frameIndex ) = 0;
77 
78  virtual void prepareSequence(agx::UInt startFrame, agx::UInt lastFrame);
79  virtual void endSequence();
80 
81  private:
82  void initBindTables();
83  void updateExclusions(const Frame *frame, const Object *frameNode);
84  agxData::Frame* mergeFrameSequence(agx::UInt startFrame);
85  agx::UInt getSequenceStartFrame(agx::UInt lowerBound = 0) const;
86 
87  protected:
91 
92  FrameRefVector m_frameMergeSequence;
93 
95 
96 
99  };
100 
101 
103 
108  {
109  public:
111 
117  virtual const JournalArchive::Session* getSession() const = 0;
118 
119  protected:
120  };
121 }
122 
123 #endif /* AGXDATA_DISKTRACK_H */
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXCORE_EXPORT
Helper class for the FrameReaders that are backed by a file on disk.
Definition: DiskTrack.h:35
virtual agx::UInt getNextFrameIndex() override
BindingTable m_exclusions
Definition: DiskTrack.h:98
virtual agxData::Frame * readFrame(agx::UInt frameIndex)=0
Read a frame from disk.
agx::UInt getFrameIndexToRead() const
virtual agx::Real getTimeStep() override
agx::HashSet< agx::Path > BindingTable
Definition: DiskTrack.h:94
agx::UInt findFrameAtTime(agx::Real time) const
virtual bool shouldExtract(const agx::Path &path) override
virtual Frame * readFrame() override
Reads the next frame from disk using the virtual readFrame(UInt) method.
virtual const JournalArchive::Session * getSession() const =0
BindingTable m_bindingTable
Definition: DiskTrack.h:97
virtual agx::UInt getFrameStride() override
FrameRefVector m_frameMergeSequence
Definition: DiskTrack.h:92
virtual void prepareSequence(agx::UInt startFrame, agx::UInt lastFrame)
virtual void endSequence()
virtual void advanceToNextFrame() override
Base class for the FrameReaders that are backed by a file on disk.
Definition: DiskTrack.h:108
virtual const JournalArchive::Session * getSession() const =0
The FrameReader reads frames from an external source.
Definition: FrameIO.h:127
The FrameWriter writes frames to an external target.
Definition: FrameIO.h:169
Session(const agx::Name &name)
Representation of a path, a list of name components.
Definition: Path.h:34
Contains classes for low level data storage for AGX.
Definition: Container.h:23
std::mutex Mutex
Definition: Referenced.h:93
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42
agx::ref_ptr< Frame > FrameRef
Definition: agx/Frame.h:52