X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fsynfig%2Fvaluenode_animated.h;h=093236afbb02d54b9b89e0fd04f9766f9f88709c;hb=d4cb326591ea23f82d341eb368b3d183b46f56c7;hp=c15352643f9d730675d1842d1602e23a5e6ef6f8;hpb=adfc80c126f482d7ea2bac38001a2c4a7c7df88c;p=synfig.git diff --git a/synfig-core/src/synfig/valuenode_animated.h b/synfig-core/src/synfig/valuenode_animated.h index c153526..093236a 100644 --- a/synfig-core/src/synfig/valuenode_animated.h +++ b/synfig-core/src/synfig/valuenode_animated.h @@ -39,6 +39,17 @@ namespace synfig { +/*! \class ValueNode_Animated + * \brief Virtual class for the derived ValueNode Animated implementations. + * + * It stores the list of waypoints and defines the base methods for: + * add a given waypoint, return a new waypoint at a given time, some find + * functions to find waypoints in the list, and to create a handles to + * ValueNode_Animated based on the ValueBase Type of the given value node. + * Also defines virtual methods to add a new waypoint at a given time using + * a value node. They must be redefined by the inherited classes and will + * be different depending on the type of value being animated. +*/ struct ValueNode_Animated : public ValueNode { public: @@ -52,6 +63,7 @@ public: typedef std::pair const_findresult; protected: + //! List of Waypoints. \see waypoint.h WaypointList waypoint_list_; public: @@ -59,55 +71,81 @@ public: const WaypointList &waypoint_list()const { return waypoint_list_; } + //! Creates a new waypoint at a Time \t with a given ValueBase \value + //! Must be redefined in the inherited class virtual WaypointList::iterator new_waypoint(Time t, ValueBase value)=0; - + //! Creates a new waypoint at a Time \t with a given ValueNode handle \value_node + //! Must be redefined in the inherited class virtual WaypointList::iterator new_waypoint(Time t, ValueNode::Handle value_node)=0; + //! Returns a new waypoint at a given time but it is not inserted in the Waypoint List. /*! \note this does not add any waypoint to the ValueNode! */ Waypoint new_waypoint_at_time(const Time& t)const; + //! Adds a waypoint \x + //! \see : Waypoint new_waypoint_at_time(const Time& t)const; WaypointList::iterator add(const Waypoint &x); + //! Removes a waypoint based on its UniqueId from the waypoint list void erase(const UniqueID &x); - //either use find result (return bool and iterator) or + //! Finds Waypoint iterator and associated boolean if found. Find by UniqueID findresult find_uid(const UniqueID &x); + //! Finds Waypoint iterator and associated boolean if found. Find by UniqueID const_findresult find_uid(const UniqueID &x)const; + //! Finds Waypoint iterator and associated boolean if found. Find by Time findresult find_time(const Time &x); + //! Finds Waypoint iterator and associated boolean if found. Find by Time const_findresult find_time(const Time &x)const; + //! Finds a Waypoint by given UniqueID \x WaypointList::iterator find(const UniqueID &x); + //! Finds a Waypoint by given UniqueID \x WaypointList::const_iterator find(const UniqueID &x)const; + //! Finds a Waypoint by given Time \x WaypointList::iterator find(const Time &x); + //! Finds a Waypoint by given Time \x WaypointList::const_iterator find(const Time &x)const; + //! Finds next Waypoint at a given time \x starting from current waypoint WaypointList::iterator find_next(const Time &x); + //! Finds next Waypoint at a given time \x starting from current waypoint WaypointList::const_iterator find_next(const Time &x)const; + //! Finds previous Waypoint at a given time \x starting from current waypoint WaypointList::iterator find_prev(const Time &x); + //! Finds previous Waypoint at a given time \x starting from current waypoint WaypointList::const_iterator find_prev(const Time &x)const; virtual ~ValueNode_Animated(); + //! Virtual member to be filled by inherited classes virtual String get_name()const; + //! Virtual member to be filled by inherited classes virtual String get_local_name()const; + //! Creates a Valuenode_Animated by type static Handle create(ValueBase::Type type); - + //! Creates a Valuenode_Animated by ValueBase and Time static Handle create(const ValueBase& value, const Time& time); - + //! Creates a Valuenode_Animated by ValueNode and Time static Handle create(ValueNode::Handle value_node, const Time& time); + //! Fills the \list with the waypoints between \begin and \end int find(const Time& begin,const Time& end,std::vector& list); + //! Inserts time \delta from time \location to the waypoints. + //! used to move waypoints in the time line. void insert_time(const Time& location, const Time& delta); protected: ValueNode_Animated(); + //! Sets thee type of the Animated Value Node void set_type(ValueBase::Type t); + //! Function to be overloaded that fills the Time Point Set with + //! all the children Time Points. Time Point is like Waypoint but + //! without value node virtual void get_times_vfunc(Node::time_set &set) const; -public: - DCAST_HACK_ID(4); }; }; // END of namespace synfig