Sleeping Wombat GUI  0.100
swGUI
RelativeTimeline.h
Go to the documentation of this file.
1 #pragma once
2 
8 #include "TimelineBase.h"
9 #include "TimelineTypes.h"
10 
11 
14 {
15 private:
16 protected:
19  float m_factor;
22 
24  bool m_isPaused;
25 
26 public:
27  explicit RelativeTimeline ();
28  explicit RelativeTimeline ( TimelineBasePtr parent );
29  virtual ~RelativeTimeline () = default;
30 
31  void SetPreWrap ( WrapMode mode );
32  void SetPostWrap ( WrapMode mode );
33  void SetDuration ( TimeType duration );
34 
35  WrapMode GetPreWrap () { return m_preWrap; }
38 
39  // Inherited via TimelineBase
40  virtual void Update () override;
41  virtual void Start () override;
42  virtual void Stop () override;
43  virtual void Pause () override;
44 
45  virtual void SetTimeline ( TimelineBasePtr& parent ) override;
46  virtual bool IsPaused () override;
47 
48 protected:
49  TimeType EvalTime ( TimeType parentTime );
50  TimeType EvalElapsedTime ( TimeType parentTime );
51 };
52 
55 
56 
void SetDuration(TimeType duration)
Definition: RelativeTimeline.cpp:48
WrapMode m_postWrap
Definition: RelativeTimeline.h:21
virtual void Pause() override
Definition: RelativeTimeline.cpp:99
virtual void Stop() override
Definition: RelativeTimeline.cpp:90
WrapMode m_preWrap
Definition: RelativeTimeline.h:20
Base class for timelines.
Definition: TimelineBase.h:26
void SetPreWrap(WrapMode mode)
Definition: RelativeTimeline.cpp:38
bool m_isPaused
Definition: RelativeTimeline.h:24
TimeType GetDuration()
Definition: RelativeTimeline.h:37
DEFINE_PTR_TYPE(RelativeTimeline)
virtual ~RelativeTimeline()=default
WrapMode GetPreWrap()
Definition: RelativeTimeline.h:35
Definition: RelativeTimeline.h:13
WrapMode GetPostWrap()
Definition: RelativeTimeline.h:36
TimeType EvalElapsedTime(TimeType parentTime)
Definition: RelativeTimeline.cpp:119
virtual void Update() override
Definition: RelativeTimeline.cpp:53
DEFINE_WPTR_TYPE(RelativeTimeline)
virtual void SetTimeline(TimelineBasePtr &parent) override
Definition: RelativeTimeline.cpp:104
WrapMode
Wrapping mode at beginning or at the end of timelines.
Definition: TimelineTypes.h:13
void SetPostWrap(WrapMode mode)
Definition: RelativeTimeline.cpp:43
bool m_isStarted
Definition: RelativeTimeline.h:23
TimeType m_offset
Offset relative to parent.
Definition: RelativeTimeline.h:17
virtual void Start() override
Definition: RelativeTimeline.cpp:74
double TimeType
Definition: TypesDefinitions.h:39
RelativeTimeline()
Definition: RelativeTimeline.cpp:12
virtual bool IsPaused() override
Definition: RelativeTimeline.cpp:109
TimeType m_duration
Time after which timeline will be wrapped.
Definition: RelativeTimeline.h:18
float m_factor
Enables slow motion.
Definition: RelativeTimeline.h:19
TimeType EvalTime(TimeType parentTime)
Definition: RelativeTimeline.cpp:129