AGX Dynamics  2.37.2.0
DiskTrack.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
57  agx::UInt getFrameIndexToRead() const;
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 
68  agx::UInt findFrameAtTime(agx::Real time) const;
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 
97  BindingTable m_bindingTable;
98  BindingTable m_exclusions;
99  };
100 
101 
103 
108  {
109  public:
110  DiskFrameWriter();
111 
117  virtual const JournalArchive::Session* getSession() const = 0;
118 
119  protected:
120  };
121 }
122 
123 #endif /* AGXDATA_DISKTRACK_H */
Helper class for the FrameReaders that are backed by a file on disk.
Definition: DiskTrack.h:34
Representation of a path, a list of name components.
Definition: Path.h:32
agx::HashSet< agx::Path > BindingTable
Definition: DiskTrack.h:94
Session(const agx::Name &name)
Base class for the FrameReaders that are backed by a file on disk.
Definition: DiskTrack.h:107
The FrameReader reads frames from an external source.
Definition: FrameIO.h:126
agx::ref_ptr< Frame > FrameRef
Definition: Frame.h:52
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
The FrameWriter writes frames to an external target.
Definition: FrameIO.h:168
uint32_t UInt
Definition: Integer.h:34
Contains classes for low level data storage for AGX.
Definition: Container.h:23
BindingTable m_exclusions
Definition: DiskTrack.h:98
BindingTable m_bindingTable
Definition: DiskTrack.h:97
FrameRefVector m_frameMergeSequence
Definition: DiskTrack.h:92
std::mutex Mutex
Definition: Referenced.h:99
double Real
Definition: Real.h:42
#define AGXCORE_EXPORT