00001 /* === S Y N F I G ========================================================= */ 00021 /* ========================================================================= */ 00022 00023 /* === S T A R T =========================================================== */ 00024 00025 #ifndef __SYNFIG_VALUENODE_ANIMATED_H 00026 #define __SYNFIG_VALUENODE_ANIMATED_H 00027 00028 /* === H E A D E R S ======================================================= */ 00029 00030 #include <list> 00031 00032 #include "valuenode.h" 00033 #include "uniqueid.h" 00034 #include "waypoint.h" 00035 00036 /* === M A C R O S ========================================================= */ 00037 00038 /* === C L A S S E S & S T R U C T S ======================================= */ 00039 00040 namespace synfig { 00041 00042 struct ValueNode_Animated : public ValueNode 00043 { 00044 public: 00045 typedef etl::handle<ValueNode_Animated> Handle; 00046 typedef etl::handle<const ValueNode_Animated> ConstHandle; 00047 00048 typedef synfig::Waypoint Waypoint; 00049 typedef synfig::WaypointList WaypointList; 00050 00051 typedef std::pair<WaypointList::iterator,bool> findresult; 00052 typedef std::pair<WaypointList::const_iterator,bool> const_findresult; 00053 00054 protected: 00055 WaypointList waypoint_list_; 00056 00057 public: 00058 WaypointList &waypoint_list() { return waypoint_list_; } 00059 00060 const WaypointList &waypoint_list()const { return waypoint_list_; } 00061 00062 virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)=0; 00063 00064 virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)=0; 00065 00067 Waypoint new_waypoint_at_time(const Time& t)const; 00068 00069 WaypointList::iterator add(const Waypoint &x); 00070 00071 void erase(const UniqueID &x); 00072 00073 //either use find result (return bool and iterator) or 00074 findresult find_uid(const UniqueID &x); 00075 const_findresult find_uid(const UniqueID &x)const; 00076 findresult find_time(const Time &x); 00077 const_findresult find_time(const Time &x)const; 00078 00079 WaypointList::iterator find(const UniqueID &x); 00080 WaypointList::const_iterator find(const UniqueID &x)const; 00081 WaypointList::iterator find(const Time &x); 00082 WaypointList::const_iterator find(const Time &x)const; 00083 00084 WaypointList::iterator find_next(const Time &x); 00085 WaypointList::const_iterator find_next(const Time &x)const; 00086 WaypointList::iterator find_prev(const Time &x); 00087 WaypointList::const_iterator find_prev(const Time &x)const; 00088 00089 virtual ~ValueNode_Animated(); 00090 00091 virtual String get_name()const; 00092 virtual String get_local_name()const; 00093 00094 static Handle create(ValueBase::Type type); 00095 00096 static Handle create(const ValueBase& value, const Time& time); 00097 00098 static Handle create(ValueNode::Handle value_node, const Time& time); 00099 00100 int find(const Time& begin,const Time& end,std::vector<Waypoint*>& list); 00101 00102 void insert_time(const Time& location, const Time& delta); 00103 00104 protected: 00105 ValueNode_Animated(); 00106 00107 void set_type(ValueBase::Type t); 00108 virtual void get_times_vfunc(Node::time_set &set) const; 00109 public: 00110 DCAST_HACK_ID(4); 00111 }; 00112 00113 }; // END of namespace synfig 00114 00115 /* === E N D =============================================================== */ 00116 00117 #endif