AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
FrameTranspose.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXDATA_FRAMETRANSPOSE_H
18#define AGXDATA_FRAMETRANSPOSE_H
19
20#include <agxData/FrameIO.h>
21#include <agxData/FileTrack.h>
22#include <agxData/Track.h>
23#include <agx/Range.h>
24
25namespace agxData
26{
29 {
30 public:
33
36
37 public:
38
39 FrameTranspose(bool active = true);
40
42
46 void registerTrack(Track *track);
47 AttributeTrack *registerTrack(const agx::Path& storagePath, const agx::Name& attributeName, agx::Index instanceId);
48 ValueTrack *registerTrack(const agx::Path& valuePath);
49
53 const TrackRefVector& getTracks() const;
54
60
66
67
73
80
81
83
84 protected:
85 virtual ~FrameTranspose();
86
87 virtual void writeFrame(const Frame *frame);
88 virtual Frame::DataBinding *createDataBinding(const agx::Path& internalPath, const agx::Path& externalPath);
89
90 private:
91 void updateTrack(Track *track, const Frame *frame);
92 void updateAttributeTrack(AttributeTrack *track, const Frame *frame);
93 void updateValueTrack(ValueTrack *track, const Frame *frame);
94
95
96 private:
97 TrackRefVector m_tracks;
98 agxData::BufferRef m_timeTrack;
99 agxData::BufferRef m_indexTrack;
100 agxData::TrackRef m_ownedTrack;
101 agxData::DiskFrameReaderRef m_fileReader;
102 };
103
104
105 class AGXCORE_EXPORT FrameTranspose::Track : public Referenced
106 {
107 public:
109 Track(const agx::Path& dataPath);
110
115
119 const agx::Path& getDataPath() const;
120
125
129 const agxData::Buffer *getData() const;
130
131 protected:
132 virtual ~Track();
133
134 private:
135 friend class FrameTranspose;
136 agxData::BufferRef m_idToIndexBuffer;
137
138 agx::RangeReal m_timeRange;
139 BufferRef m_data;
140 agx::Path m_dataPath;
141 };
142
143
144 class AGXCORE_EXPORT FrameTranspose::AttributeTrack : public Track
145 {
146 public:
147 AttributeTrack(const agx::Path& storagePath, const agx::Name& attributeName, agx::Index instanceId);
148
149 const agx::Path& getStoragePath() const;
152
153 protected:
155
156 private:
157 friend class FrameTranspose;
158 agx::Path m_storagePath;
159 agx::Name m_attributeName;
160 agx::Index m_instanceId;
161 agxData::BufferRef m_currentFrameAttributeBuffer;
162 };
163
164 class AGXCORE_EXPORT FrameTranspose::ValueTrack : public Track
165 {
166 public:
167 ValueTrack(const agx::Path& valuePath);
168 protected:
169 virtual ~ValueTrack();
170
171 private:
172 friend class FrameTranspose;
173
174 agxData::ValueRef m_currentFrameValue;
175 };
176
177
178 /* Implementation */
179
181 AGX_FORCE_INLINE const FrameTranspose::TrackRefVector& FrameTranspose::getTracks() const { return m_tracks; }
184 AGX_FORCE_INLINE const agxData::Buffer *FrameTranspose::getTimeTrack() const { return m_timeTrack; }
185 AGX_FORCE_INLINE const agxData::Buffer *FrameTranspose::getIndexTrack() const { return m_indexTrack; }
186
187 //---------------------------------------------------------------
188
189 AGX_FORCE_INLINE agx::RangeReal FrameTranspose::Track::getTimeRange() const { return m_timeRange; }
190 AGX_FORCE_INLINE agxData::Buffer *FrameTranspose::Track::getData() { return m_data; }
191 AGX_FORCE_INLINE const agxData::Buffer *FrameTranspose::Track::getData() const { return m_data; }
192 AGX_FORCE_INLINE const agx::Path& FrameTranspose::Track::getDataPath() const { return m_dataPath; }
193
194 //---------------------------------------------------------------
195
196 AGX_FORCE_INLINE const agx::Path& FrameTranspose::AttributeTrack::getStoragePath() const { return m_storagePath; }
197 AGX_FORCE_INLINE const agx::Name& FrameTranspose::AttributeTrack::getAttributeName() const { return m_attributeName; }
198 AGX_FORCE_INLINE agx::Index FrameTranspose::AttributeTrack::getInstanceId() const { return m_instanceId; }
199
200 //---------------------------------------------------------------
202}
203
204
205#endif /* AGXDATA_FRAMETRANSPOSE_H */
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXCORE_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
Abstract representation of a data buffer.
Definition: Buffer.h:56
ValueTrack * registerTrack(const agx::Path &valuePath)
const agxData::Buffer * getIndexTrack() const
agx::RangeReal getTimeRange() const
const agx::Path & getStoragePath() const
void extractFrames()
Extract all frames from track.
const agxData::Buffer * getData() const
const agxData::Buffer * getTimeTrack() const
void setFrameStride(agx::UInt stride)
FrameTranspose(agxData::JournalArchive::Session *session)
const TrackRefVector & getTracks() const
const agx::Path & getDataPath() const
AttributeTrack(const agx::Path &storagePath, const agx::Name &attributeName, agx::Index instanceId)
agxData::Buffer * getIndexTrack()
agx::Index getInstanceId() const
ValueTrack(const agx::Path &valuePath)
FrameTranspose(bool active=true)
void extractFrames(agx::RangeReal timeRange)
Extract all frames from track within a time range.
agxData::Buffer * getData()
Track(const agx::Path &dataPath)
agxData::Buffer * getTimeTrack()
virtual Frame::DataBinding * createDataBinding(const agx::Path &internalPath, const agx::Path &externalPath)
const agx::Name & getAttributeName() const
virtual void writeFrame(const Frame *frame)
Export a frame the implementation-specific format.
AttributeTrack * registerTrack(const agx::Path &storagePath, const agx::Name &attributeName, agx::Index instanceId)
void registerTrack(Track *track)
Register a track to be filled with transpose data.
The FrameWriter writes frames to an external target.
Definition: FrameIO.h:169
Session(const agx::Name &name)
Representation of a name string.
Definition: Name.h:33
Representation of a path, a list of name components.
Definition: Path.h:33
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
#define AGX_FORCE_INLINE
Definition: macros.h:58
Contains classes for low level data storage for AGX.
Definition: Container.h:23
uint64_t UInt
Definition: Integer.h:27
UInt32 Index
Definition: Integer.h:44