You.i Engine
YiTimelineTrack.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_TIMELINE_TRACK_H_
3 #define _YI_TIMELINE_TRACK_H_
4 
6 #include "animation/YiVariant.h"
7 
12 class CYIString;
13 class CYITimelineKeyTime;
14 class CYITimelineTrackPriv;
15 
26 {
27 public:
31  enum class AttributeType : uint8_t
32  {
33  Invalid = 0,
34  Position,
38  RotationX,
39  RotationY,
40  RotationZ,
42  Scale,
43  Opacity,
44  Visibility,
49  ShapeScale,
53  ShapeSize,
54  ShapeSkew,
57  ShapeColor,
65  ShapePath,
66  Custom
67  };
68 
73  {
74  int32_t targetID;
75  int32_t subTargetID;
77  };
78 
82  CYITimelineTrack(uint32_t trackID, AttributeType attributeType, const CYIString &targetName);
83  virtual ~CYITimelineTrack();
84 
88  void Reserve(size_t keytimes);
89 
93  void AddKeytime(CYITimelineKeyTime::KEYTIME_SETUP &&keytimeSetup);
94 
102  void AddKeytime(const CYITimelineKeyTime::KEYTIME_SETUP *pKeytimeSetup);
103 
109  std::vector<const CYITimelineKeyTime *> GetKeyTimes() const;
110 
117  AttributeType GetAttribute() const;
118 
124  const char *GetAttributeName() const;
125 
133 
140  int32_t GetTargetID() const;
141 
148  int32_t GetSubTargetID() const;
149 
153  const CYIString &GetTargetName() const;
154 
160  uint64_t GetTotalTime() const;
161 
165  uint32_t GetTrackID() const;
166 
170  CYIVariant ReadStream(uint64_t time) const;
171 
177  void SetTargetID(int32_t id);
178 
184  void SetSubTargetID(int32_t id);
185 
192  const CYIString &GetName() const;
193 
199  void SetName(const CYIString &trackName);
200 
206  void SetNewAttributeType(AttributeType attributeType);
207 
211  size_t GetApproximateSize() const;
212 
213 private:
214  std::unique_ptr<CYITimelineTrackPriv> m_pPriv;
215 };
216 
219 #endif // _YI_TIMELINE_TRACK_H_
A container class for common data types.
Definition: YiVariant.h:33
CYITimelineTrack(uint32_t trackID, AttributeType attributeType, const CYIString &targetName)
const CYIString & GetName() const
void SetNewAttributeType(AttributeType attributeType)
size_t GetApproximateSize() const
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
AttributeType GetAttribute() const
AttributeType
Definition: YiTimelineTrack.h:31
Definition: YiTimelineKeyTime.h:58
An individual point in a CYITimelineTrack which represents a CYISceneNode property value for a specif...
Definition: YiTimelineKeyTime.h:19
A representation of a single track of a CYITimeline.
Definition: YiTimelineTrack.h:25
AttributeType attributeType
Definition: YiTimelineTrack.h:76
CYIVariant::Type GetDataType() const
int32_t targetID
Definition: YiTimelineTrack.h:74
void AddKeytime(CYITimelineKeyTime::KEYTIME_SETUP &&keytimeSetup)
void SetName(const CYIString &trackName)
Definition: YiTimelineTrack.h:72
int32_t GetTargetID() const
void SetSubTargetID(int32_t id)
Type
Definition: YiVariant.h:39
const CYIString & GetTargetName() const
uint32_t GetTrackID() const
int32_t subTargetID
Definition: YiTimelineTrack.h:75
void Reserve(size_t keytimes)
void SetTargetID(int32_t id)
CYIVariant ReadStream(uint64_t time) const
virtual ~CYITimelineTrack()
const char * GetAttributeName() const
uint64_t GetTotalTime() const
std::vector< const CYITimelineKeyTime * > GetKeyTimes() const
int32_t GetSubTargetID() const