synfig-core  1.0.3
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
synfig::ValueNode_Animated Class Reference

Virtual class for the derived ValueNode Animated implementations. More...

#include <valuenode_animated.h>

Inheritance diagram for synfig::ValueNode_Animated:
synfig::ValueNode synfig::Node

Public Types

typedef etl::handle
< ValueNode_Animated
Handle
typedef etl::handle< const
ValueNode_Animated
ConstHandle
typedef synfig::Waypoint Waypoint
typedef synfig::WaypointList WaypointList
typedef std::pair
< WaypointList::iterator, bool > 
findresult
typedef std::pair
< WaypointList::const_iterator,
bool > 
const_findresult
- Public Types inherited from synfig::ValueNode
typedef etl::handle< ValueNodeHandle
typedef etl::loose_handle
< ValueNode
LooseHandle
typedef etl::handle< const
ValueNode
ConstHandle
typedef etl::rhandle< ValueNodeRHandle
- Public Types inherited from synfig::Node
typedef TimePointSet time_set

Public Member Functions

WaypointListeditable_waypoint_list ()
const WaypointListwaypoint_list () const
virtual WaypointList::iterator new_waypoint (Time t, ValueBase value)=0
virtual WaypointList::iterator new_waypoint (Time t, ValueNode::Handle value_node)=0
Waypoint new_waypoint_at_time (const Time &t) const
 Returns a new waypoint at a given time but it is not inserted in the Waypoint List.
WaypointList::iterator add (const Waypoint &x)
bool waypoint_is_only_use_of_valuenode (Waypoint &waypoint)
void erase (const UniqueID &x)
 Removes a waypoint based on its UniqueId from the waypoint list.
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 UniqueID.
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 Waypoint iterator and associated boolean if found. Find by Time.
WaypointList::iterator find (const UniqueID &x)
 Finds a Waypoint by given UniqueID .
WaypointList::const_iterator find (const UniqueID &x) const
 Finds a Waypoint by given UniqueID .
WaypointList::iterator find (const Time &x)
 Finds a Waypoint by given Time .
WaypointList::const_iterator find (const Time &x) const
 Finds a Waypoint by given Time .
WaypointList::iterator find_next (const Time &x)
 Finds next Waypoint at a given time starting from current waypoint.
WaypointList::const_iterator find_next (const Time &x) const
 Finds next Waypoint at a given time starting from current waypoint.
WaypointList::iterator find_prev (const Time &x)
 Finds previous Waypoint at a given time starting from current waypoint.
WaypointList::const_iterator find_prev (const Time &x) const
 Finds previous Waypoint at a given time starting from current waypoint.
virtual ~ValueNode_Animated ()
virtual String get_name () const
 Virtual member to be filled by inherited classes.
virtual String get_local_name () const
 Virtual member to be filled by inherited classes.
int find (const Time &begin, const Time &end, std::vector< Waypoint * > &list)
 Fills the with the waypoints between and .
void insert_time (const Time &location, const Time &delta)
String get_string () const
virtual Interpolation get_interpolation () const
 Get/Set the default interpolation for Value Nodes.
virtual void set_interpolation (Interpolation i)
 Set the default interpolation for Value Nodes.
- Public Member Functions inherited from synfig::ValueNode
sigc::signal< void > & signal_value_changed ()
 ValueBase Changed.
sigc::signal< void, int * > & signal_children_reordered ()
 Children Reordered.
sigc::signal< void, int > & signal_child_changed ()
 Child Changed.
sigc::signal< void, int > & signal_child_removed ()
 Child Removed.
sigc::signal< void, int > & signal_child_inserted ()
 Child Inserted.
sigc::signal< void > & signal_id_changed ()
 ID Changed.
virtual ~ValueNode ()
virtual ValueBase operator() (Time) const
 Returns the value of the ValueNode at time t.
void set_id (const String &x)
const Stringget_id () const
 Returns the id of the ValueNode.
virtual String get_description (bool show_exported_name=true) const
 Return a full description of the ValueNode and its parentage.
virtual ValueNode::Handle clone (etl::loose_handle< Canvas > canvas, const GUID &deriv_guid=GUID()) const =0
 Clones a Value Node.
bool is_exported () const
 Returns if the Value Node has an ID (has been exported)
bool is_descendant (ValueNode::Handle value_node_dest)
 Check recursively if is a descendant of the Value Node.
Typeget_type () const
 Returns the type of the ValueNode.
etl::loose_handle< Canvasget_parent_canvas () const
 Returns a handle to the parent canvas, if it has one.
etl::loose_handle< Canvasget_root_canvas () const
 Returns a handle to the parent canvas, if it has one.
etl::loose_handle< Canvasget_non_inline_ancestor_canvas () const
 Returns a handle to the parent canvas, if it has one.
void set_parent_canvas (etl::loose_handle< Canvas > x)
 Sets the parent canvas for the Value Node.
virtual void set_root_canvas (etl::loose_handle< Canvas > x)
 Sets the root canvas parent for the Value Node.
String get_relative_id (etl::loose_handle< const Canvas > x) const
 Returns the relative ID of a Node when accessed form the Canvas.
int replace (etl::handle< ValueNode > x)
- Public Member Functions inherited from synfig::Node
sigc::signal< void > & signal_deleted ()
sigc::signal< void > & signal_changed ()
sigc::signal< void, GUID > & signal_guid_changed ()
 GUID Changed.
virtual ~Node ()
void changed ()
const GUIDget_guid () const
 Gets the GUID for this Node.
virtual void set_guid (const GUID &x)
 Sets the GUID for this Node.
int get_time_last_changed () const
 Gets the time when the Node was changed.
void add_child (Node *x)
 Adds the parameter as the child of the current Node.
void remove_child (Node *x)
 Removes the parameter as a child of the current Node.
int parent_count () const
 Returns how many parenst has the current Node.
const time_setget_times () const
 Returns the cached times values for all the children.
RWLockget_rw_lock () const
 Writeme!

Static Public Member Functions

static Handle create (Type &type)
 Creates a Valuenode_Animated by type.
static Handle create (const ValueBase &value, const Time &time)
 Creates a Valuenode_Animated by ValueBase and Time.
static Handle create (ValueNode::Handle value_node, const Time &time)
 Creates a Valuenode_Animated by ValueNode and Time.
- Static Public Member Functions inherited from synfig::ValueNode
static bool subsys_init ()
 Instantiates the book of ValaueNodes and register all the valid valuenodes on it.
static bool subsys_stop ()
 Deletes the book of ValueNodes.
static void breakpoint ()

Protected Member Functions

 ValueNode_Animated ()
void set_type (Type &t)
 Sets the type of the Animated Value Node.
virtual void get_times_vfunc (Node::time_set &set) const
- Protected Member Functions inherited from synfig::ValueNode
 ValueNode (Type &type=type_nil)
virtual void on_changed ()
- Protected Member Functions inherited from synfig::Node
 Node ()
void begin_delete ()
virtual void on_guid_changed (GUID guid)

Protected Attributes

WaypointList waypoint_list_
 List of Waypoints.

Additional Inherited Members

- Public Attributes inherited from synfig::Node
std::set< Node * > parent_set

Detailed Description

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.

Member Typedef Documentation

typedef std::pair<WaypointList::iterator,bool> synfig::ValueNode_Animated::findresult
typedef std::pair<WaypointList::const_iterator,bool> synfig::ValueNode_Animated::const_findresult

Constructor & Destructor Documentation

ValueNode_Animated::~ValueNode_Animated ( )
virtual
ValueNode_Animated::ValueNode_Animated ( )
protected

Member Function Documentation

WaypointList& synfig::ValueNode_Animated::editable_waypoint_list ( )
inline

References waypoint_list_.

const WaypointList& synfig::ValueNode_Animated::waypoint_list ( ) const
inline

References waypoint_list_.

virtual WaypointList::iterator synfig::ValueNode_Animated::new_waypoint ( Time  t,
ValueBase  value 
)
pure virtual

Creates a new waypoint at a Time with a given ValueBase Must be redefined in the inherited class

virtual WaypointList::iterator synfig::ValueNode_Animated::new_waypoint ( Time  t,
ValueNode::Handle  value_node 
)
pure virtual

Creates a new waypoint at a Time with a given ValueNode handle Must be redefined in the inherited class

Waypoint ValueNode_Animated::new_waypoint_at_time ( const Time time) const

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!
This code seems to be designed to move selected waypoints to other

place. Probably it was commented out because the conflict when other waypoints are found in the target time. It was also defined and now commented in valuenode_dynamiclist.h void ValueNode_Animated::manipulate_time(const Time& old_begin,const Time& old_end,const Time& new_begin,const Time& new_end) { #define old_2_new(x) (((x)-old_begin)/(old_end-old_begin)*(new_end-new_begin)+new_begin) std::vector<Waypoint*> selected; std::vector<Waypoint*>::iterator iter;

if(find(old_begin,old_end,selected)) { check to make sure this operation is OK for(iter=selected.begin();iter!=selected.end();++iter) { try { Time new_time(old_2_new((*iter)->get_time())); if(new_time>=old_begin && new_time<old_end) continue; find(new_time); If we found a waypoint already at that time, then we need to abort throw Exception::BadTime(_("Waypoint Conflict")); } catch(Exception::NotFound) { }

selected.back()->set_time(old_2_new(selected.back()->get_time())); selected.pop_back(); }

while(!selected.empty()) { selected.back()->set_time(old_2_new(selected.back()->get_time())); selected.pop_back(); }

changed(); } #undef old_2_new }

References synfig::UniqueID::make_unique(), synfig::Waypoint::set_parent_value_node(), synfig::Waypoint::set_time(), synfig::Waypoint::set_value(), and synfig::Waypoint::set_value_node().

ValueNode_Animated::WaypointList::iterator ValueNode_Animated::add ( const Waypoint x)
bool ValueNode_Animated::waypoint_is_only_use_of_valuenode ( Waypoint waypoint)
void ValueNode_Animated::erase ( const UniqueID x)

Removes a waypoint based on its UniqueId from the waypoint list.

References synfig::Waypoint::get_value_node().

ValueNode_Animated::findresult ValueNode_Animated::find_uid ( const UniqueID x)

Finds Waypoint iterator and associated boolean if found. Find by UniqueID.

References f.

ValueNode_Animated::const_findresult ValueNode_Animated::find_uid ( const UniqueID x) const

Finds Waypoint iterator and associated boolean if found. Find by UniqueID.

References f.

ValueNode_Animated::findresult ValueNode_Animated::find_time ( const Time x)

Finds Waypoint iterator and associated boolean if found. Find by Time.

References f.

ValueNode_Animated::const_findresult ValueNode_Animated::find_time ( const Time x) const

Finds Waypoint iterator and associated boolean if found. Find by Time.

References f.

ValueNode_Animated::WaypointList::iterator ValueNode_Animated::find ( const UniqueID x)

Finds a Waypoint by given UniqueID .

References synfig::UniqueID::get_uid().

ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find ( const UniqueID x) const

Finds a Waypoint by given UniqueID .

ValueNode_Animated::WaypointList::iterator ValueNode_Animated::find ( const Time x)
ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find ( const Time x) const

Finds a Waypoint by given Time .

ValueNode_Animated::WaypointList::iterator ValueNode_Animated::find_next ( const Time x)

Finds next Waypoint at a given time starting from current waypoint.

References synfig::Time::get_string().

ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find_next ( const Time x) const

Finds next Waypoint at a given time starting from current waypoint.

ValueNode_Animated::WaypointList::iterator ValueNode_Animated::find_prev ( const Time x)

Finds previous Waypoint at a given time starting from current waypoint.

References synfig::Time::get_string().

ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find_prev ( const Time x) const

Finds previous Waypoint at a given time starting from current waypoint.

String ValueNode_Animated::get_name ( ) const
virtual

Virtual member to be filled by inherited classes.

Implements synfig::ValueNode.

String ValueNode_Animated::get_local_name ( ) const
virtual

Virtual member to be filled by inherited classes.

Implements synfig::ValueNode.

References _.

ValueNode_Animated::Handle synfig::ValueNode_Animated::create ( Type type)
static
ValueNode_Animated::Handle ValueNode_Animated::create ( const ValueBase value,
const Time time 
)
static

Creates a Valuenode_Animated by ValueBase and Time.

ValueNode_Animated::Handle ValueNode_Animated::create ( ValueNode::Handle  value_node,
const Time time 
)
static

Creates a Valuenode_Animated by ValueNode and Time.

int ValueNode_Animated::find ( const Time begin,
const Time end,
std::vector< Waypoint * > &  list 
)

Fills the with the waypoints between and .

void ValueNode_Animated::insert_time ( const Time location,
const Time delta 
)

Inserts time from time to the waypoints. used to move waypoints in the time line.

String ValueNode_Animated::get_string ( void  ) const
virtual

Reimplemented from synfig::ValueNode.

virtual Interpolation synfig::ValueNode_Animated::get_interpolation ( ) const
inlinevirtual

Get/Set the default interpolation for Value Nodes.

Reimplemented from synfig::ValueNode.

virtual void synfig::ValueNode_Animated::set_interpolation ( Interpolation  )
inlinevirtual

Set the default interpolation for Value Nodes.

Reimplemented from synfig::ValueNode.

void ValueNode_Animated::set_type ( Type t)
protected

Sets the type of the Animated Value Node.

Reimplemented from synfig::ValueNode.

void ValueNode_Animated::get_times_vfunc ( Node::time_set set) const
protectedvirtual

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

Implements synfig::Node.

References synfig::TimePoint::set_after(), synfig::TimePoint::set_before(), synfig::TimePoint::set_guid(), and synfig::TimePoint::set_time().

Member Data Documentation

WaypointList synfig::ValueNode_Animated::waypoint_list_
protected

List of Waypoints.

See Also
waypoint.h

Referenced by editable_waypoint_list(), and waypoint_list().


The documentation for this class was generated from the following files: