synfig-core  1.0.3
valuenode_animated.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
21 /* ========================================================================= */
22 
23 /* === S T A R T =========================================================== */
24 
25 #ifndef __SYNFIG_VALUENODE_ANIMATED_H
26 #define __SYNFIG_VALUENODE_ANIMATED_H
27 
28 /* === H E A D E R S ======================================================= */
29 
30 #include <list>
31 
32 #include <synfig/valuenode.h>
33 #include <synfig/uniqueid.h>
34 #include <synfig/waypoint.h>
35 
36 /* === M A C R O S ========================================================= */
37 
38 /* === C L A S S E S & S T R U C T S ======================================= */
39 
40 namespace synfig {
41 
54 {
55 private:
56  Interpolation interpolation_;
57 public:
58  typedef etl::handle<ValueNode_Animated> Handle;
59  typedef etl::handle<const ValueNode_Animated> ConstHandle;
60 
63 
64  typedef std::pair<WaypointList::iterator,bool> findresult;
65  typedef std::pair<WaypointList::const_iterator,bool> const_findresult;
66 
67 protected:
70 
71 public:
73 
74  const WaypointList &waypoint_list()const { return waypoint_list_; }
75 
78  virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)=0;
81  virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)=0;
82 
84 
85  Waypoint new_waypoint_at_time(const Time& t)const;
86 
89  WaypointList::iterator add(const Waypoint &x);
90 
92 
94  void erase(const UniqueID &x);
95 
97  findresult find_uid(const UniqueID &x);
99  const_findresult find_uid(const UniqueID &x)const;
101  findresult find_time(const Time &x);
103  const_findresult find_time(const Time &x)const;
104 
106  WaypointList::iterator find(const UniqueID &x);
108  WaypointList::const_iterator find(const UniqueID &x)const;
110  WaypointList::iterator find(const Time &x);
112  WaypointList::const_iterator find(const Time &x)const;
113 
115  WaypointList::iterator find_next(const Time &x);
117  WaypointList::const_iterator find_next(const Time &x)const;
119  WaypointList::iterator find_prev(const Time &x);
121  WaypointList::const_iterator find_prev(const Time &x)const;
122 
123  virtual ~ValueNode_Animated();
124 
126  virtual String get_name()const;
128  virtual String get_local_name()const;
129 
131  static Handle create(Type &type);
133  static Handle create(const ValueBase& value, const Time& time);
135  static Handle create(ValueNode::Handle value_node, const Time& time);
136 
138  int find(const Time& begin,const Time& end,std::vector<Waypoint*>& list);
139 
142  void insert_time(const Time& location, const Time& delta);
143 
144  String get_string()const;
145 
147  virtual Interpolation get_interpolation()const { return interpolation_; }
148  virtual void set_interpolation(Interpolation i) { interpolation_=i; }
149 
150 
151 
152 protected:
154 
156  void set_type(Type &t);
160  virtual void get_times_vfunc(Node::time_set &set) const;
161 };
162 
163 }; // END of namespace synfig
164 
165 /* === E N D =============================================================== */
166 
167 #endif