synfig-core
1.0.3
|
Animated List ValueNode. More...
#include <valuenode_dynamiclist.h>
Classes | |
class | ListEntry |
Contains a potential list item, and associated timing information. More... |
Public Types | |
typedef etl::handle < ValueNode_DynamicList > | Handle |
typedef etl::handle< const ValueNode_DynamicList > | ConstHandle |
Public Types inherited from synfig::LinkableValueNode | |
typedef etl::handle < LinkableValueNode > | Handle |
typedef etl::loose_handle < LinkableValueNode > | LooseHandle |
typedef etl::handle< const LinkableValueNode > | ConstHandle |
typedef etl::rhandle < LinkableValueNode > | RHandle |
typedef LinkableValueNode *(* | Factory )(const ValueBase &, etl::loose_handle< Canvas > canvas) |
Type that represents a pointer to a ValueNode's constructor. | |
typedef bool(* | CheckType )(Type &type) |
This represents a pointer to a Type check member fucntion. | |
typedef std::map< String, BookEntry > | Book |
Book of types of linkable value nodes indexed by type name. | |
typedef ParamVocab | Vocab |
The vocabulary of the children. | |
Public Types inherited from synfig::ValueNode | |
typedef etl::handle< ValueNode > | Handle |
typedef etl::loose_handle < ValueNode > | LooseHandle |
typedef etl::handle< const ValueNode > | ConstHandle |
typedef etl::rhandle< ValueNode > | RHandle |
Public Types inherited from synfig::Node | |
typedef TimePointSet | time_set |
Public Member Functions | |
void | add (const ValueNode::Handle &value_node, int index=-1) |
void | add (const ListEntry &value_node, int index=-1) |
void | erase (const ValueNode::Handle &value_node) |
void | reindex () |
int | find_next_valid_entry (int x, Time t) const |
int | find_prev_valid_entry (int x, Time t) const |
virtual ValueNode::LooseHandle | get_link_vfunc (int i) const |
Virtual member to get the linked Value Node Handle. | |
virtual int | link_count () const |
Returns the number of linked Value Nodes. | |
virtual String | link_name (int i) const |
Returns the name of the 'i' linked Value Node. | |
virtual ValueBase | operator() (Time t) const |
Returns the value of the ValueNode at time t. | |
virtual | ~ValueNode_DynamicList () |
virtual String | link_local_name (int i) const |
Returns the local name of the 'i' linked Value Node. | |
virtual int | get_link_index_from_name (const String &name) const |
Returns the child index Value Node based on the name. | |
virtual String | get_name () const |
Returns the name of the ValueNode type. | |
virtual String | get_local_name () const |
Returns the localized name of the ValueNode type. | |
bool | get_loop () const |
void | set_loop (bool x) |
void | set_member_canvas (etl::loose_handle< Canvas >) |
Type & | get_contained_type () const |
void | insert_time (const Time &location, const Time &delta) |
virtual ValueNode::Handle | clone (etl::loose_handle< Canvas > canvas, const GUID &deriv_guid=GUID()) const |
Clones a Value Node. | |
virtual ListEntry | create_list_entry (int index, Time time=0, Real origin=0.5) |
virtual Vocab | get_children_vocab_vfunc () const |
Pure Virtual member to get the children vocabulary. | |
Public Member Functions inherited from synfig::LinkableValueNode | |
LinkableValueNode (Type &type=type_nil) | |
Member to store the children vocabulary. | |
bool | set_link (int i, ValueNode::Handle x) |
Sets a new Value Node link by its index. | |
bool | set_link (const String &name, ValueNode::Handle x) |
Sets a new Value Node link by its name. | |
ValueNode::LooseHandle | get_link (int i) const |
Returns a Loose Handle to the Value Node based on the link's index. | |
ValueNode::LooseHandle | get_link (const String &name) const |
Returns a Loose Handle to the Value Node based on the link's name. | |
String | get_description (int index=-1, bool show_exported_name=true) const |
Return a full description of the linked ValueNode given by the index. | |
String | get_description (bool show_exported_name=true) const |
virtual Vocab | get_children_vocab () const |
Gets the children vocabulary for linkable value nodes. | |
virtual void | set_root_canvas (etl::loose_handle< Canvas > x) |
Member to store the children vocabulary. |
Static Public Member Functions | |
template<typename iterator > | |
static Handle | create (iterator begin, iterator end) |
static Handle | create (Type &type=type_nil, etl::loose_handle< Canvas > canvas=0) |
static bool | check_type (Type &type) |
static ValueNode_DynamicList * | create_from (const ValueBase &x=type_gradient) |
Static Public Member Functions inherited from synfig::LinkableValueNode | |
static Book & | book () |
static Handle | create (const String &name, const ValueBase &x, etl::loose_handle< Canvas > canvas) |
static bool | check_type (const String &name, Type &x) |
Member to store the children vocabulary. | |
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 () |
Public Attributes | |
std::vector< ListEntry > | list |
Protected Member Functions | |
ValueNode_DynamicList (Type &container_type=type_nil, etl::loose_handle< Canvas > canvas=0) | |
ValueNode_DynamicList (Type &container_type, Type &type, etl::loose_handle< Canvas > canvas=0) | |
virtual bool | set_link_vfunc (int i, ValueNode::Handle x) |
LinkableValueNode * | create_new () const |
Wrapper for new operator, used by clone() | |
virtual void | get_times_vfunc (Node::time_set &set) const |
Returns the cached times values for all the children (linked Value Nodes) | |
Protected Member Functions inherited from synfig::LinkableValueNode | |
void | unlink_all () |
void | set_type (Type &t) |
Sets the type of the ValueNode. | |
virtual void | set_children_vocab (const Vocab &rvocab) |
Virtual memebr to set the children vocabulary to a given value. |
Protected Attributes | |
Type * | container_type |
bool | loop_ |
Protected Attributes inherited from synfig::LinkableValueNode | |
Vocab | children_vocab |
Member to store the children vocabulary. |
Animated List ValueNode.
This ValueNode was originally set up to have a list of ValueNodes and their associated "on" and "off" points. ie: Any time that was directly after an "on" point, the item would be "on", and any time that was directly after an "off" point would be "off". This is pretty intuitive. However, it does have its problems.
The problems arise when we introduce the concept of a Keyframe. Keyframes can be manipulated via the Synfig Application Library. They allow the user to quickly and "automagically" rearrange an animation by moving the associated keyframes. With the old way that the "on" and "off" points were handled, this task became overly complicated.
What is required is a "symmetric" system of describing "on" and "off" points. Instead of the point representing the state of the item after that point in time, we have the point represent only that frame. The state of the item is calculated by looking at the points around it: If either (or both) points are "on", then the current state is "on". Otherwise, the point is "off"
This may be a bit confusing at first, but it is required if we want the keyframe mechanism to "just work".
typedef etl::handle<ValueNode_DynamicList> synfig::ValueNode_DynamicList::Handle |
typedef etl::handle<const ValueNode_DynamicList> synfig::ValueNode_DynamicList::ConstHandle |
|
protected |
Referenced by create_from(), and create_new().
|
protected |
|
virtual |
References synfig::LinkableValueNode::unlink_all().
void ValueNode_DynamicList::add | ( | const ValueNode::Handle & | value_node, |
int | index = -1 |
||
) |
References synfig::Node::add_child(), synfig::ValueNode::get_parent_canvas(), synfig::ValueNode::get_root_canvas(), list, reindex(), and synfig::ValueNode_DynamicList::ListEntry::timing_info.
Referenced by clone(), synfig::ValueNode_WeightedAverage::create(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), and create_from().
void ValueNode_DynamicList::add | ( | const ListEntry & | value_node, |
int | index = -1 |
||
) |
void ValueNode_DynamicList::erase | ( | const ValueNode::Handle & | value_node | ) |
int ValueNode_DynamicList::find_next_valid_entry | ( | int | x, |
Time | t | ||
) | const |
References list.
Referenced by synfig::ValueNode_BLine::create_list_entry().
int ValueNode_DynamicList::find_prev_valid_entry | ( | int | x, |
Time | t | ||
) | const |
References list.
Referenced by synfig::ValueNode_DIList::create_list_entry(), and synfig::ValueNode_BLine::create_list_entry().
|
virtual |
Virtual member to get the linked Value Node Handle.
Implements synfig::LinkableValueNode.
References list.
|
virtual |
Returns the number of linked Value Nodes.
Reimplemented from synfig::LinkableValueNode.
References list.
Referenced by synfig::ValueNode_DIList::create_list_entry(), synfig::ValueNode_WPList::create_list_entry(), synfig::ValueNode_BLine::create_list_entry(), create_list_entry(), and link_local_name().
|
virtual |
Returns the name of the 'i' linked Value Node.
Reimplemented from synfig::LinkableValueNode.
Returns the value of the ValueNode at time t.
Reimplemented from synfig::ValueNode.
Reimplemented in synfig::ValueNode_BLine, synfig::ValueNode_WPList, synfig::ValueNode_DIList, synfig::ValueNode_Average, and synfig::ValueNode_WeightedAverage.
References _, container_type, list, and synfig::warning().
|
virtual |
Returns the local name of the 'i' linked Value Node.
Reimplemented from synfig::LinkableValueNode.
Reimplemented in synfig::ValueNode_BLine, synfig::ValueNode_WPList, and synfig::ValueNode_DIList.
References _, and link_count().
|
virtual |
Returns the child index Value Node based on the name.
Reimplemented from synfig::LinkableValueNode.
|
virtual |
Returns the name of the ValueNode type.
Implements synfig::ValueNode.
Reimplemented in synfig::ValueNode_BLine, synfig::ValueNode_WPList, synfig::ValueNode_DIList, synfig::ValueNode_Average, and synfig::ValueNode_WeightedAverage.
|
virtual |
Returns the localized name of the ValueNode type.
Implements synfig::ValueNode.
Reimplemented in synfig::ValueNode_BLine, synfig::ValueNode_WPList, synfig::ValueNode_DIList, synfig::ValueNode_Average, and synfig::ValueNode_WeightedAverage.
References _.
|
inline |
References loop_.
Referenced by clone(), synfig::ValueNode_WPList::create_list_entry(), create_list_entry(), synfig::ValueNode_WPList::find_next_valid_entry_by_position(), synfig::ValueNode_WPList::find_prev_valid_entry_by_position(), synfig::ValueNode_WPList::interpolated_width(), synfig::ValueNode_DIList::operator()(), synfig::ValueNode_WPList::operator()(), and synfig::ValueNode_BLine::operator()().
|
inline |
References loop_.
Referenced by clone(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), and create_from().
void ValueNode_DynamicList::set_member_canvas | ( | etl::loose_handle< Canvas > | canvas | ) |
References list.
Type & ValueNode_DynamicList::get_contained_type | ( | ) | const |
References container_type.
Referenced by create_from(), and create_list_entry().
|
inlinestatic |
Referenced by create_list_entry().
|
virtual |
|
virtual |
Reimplemented in synfig::ValueNode_BLine, synfig::ValueNode_WPList, and synfig::ValueNode_DIList.
References create(), synfig::ValueBase::get(), get_contained_type(), get_loop(), synfig::ValueNode::get_parent_canvas(), link_count(), list, synfig::type_angle, synfig::type_color, synfig::type_real, synfig::type_time, synfig::type_vector, and synfig::ValueNode_DynamicList::ListEntry::value_node.
|
protectedvirtual |
Stores the Value Node in the sub parameter i after check if the type is the same. It has to be defined by the derived class.
Implements synfig::LinkableValueNode.
References container_type, and list.
|
protectedvirtual |
Wrapper for new operator, used by clone()
Implements synfig::LinkableValueNode.
Reimplemented in synfig::ValueNode_WPList, synfig::ValueNode_BLine, synfig::ValueNode_DIList, synfig::ValueNode_Average, and synfig::ValueNode_WeightedAverage.
References ValueNode_DynamicList().
Referenced by clone().
|
protectedvirtual |
Returns the cached times values for all the children (linked Value Nodes)
Reimplemented from synfig::LinkableValueNode.
References list.
|
static |
|
static |
Reimplemented in synfig::ValueNode_WPList, synfig::ValueNode_BLine, synfig::ValueNode_DIList, synfig::ValueNode_Average, and synfig::ValueNode_WeightedAverage.
References synfig::type_list.
|
static |
|
virtual |
Pure Virtual member to get the children vocabulary.
Implements synfig::LinkableValueNode.
Reimplemented in synfig::ValueNode_BLine.
|
protected |
Referenced by get_contained_type(), operator()(), and set_link_vfunc().
|
protected |
Referenced by get_loop(), and set_loop().
std::vector<ListEntry> synfig::ValueNode_DynamicList::list |
Referenced by add(), clone(), synfig::ValueNode_DIList::create(), synfig::ValueNode_WPList::create(), create_from(), synfig::ValueNode_WPList::create_list_entry(), synfig::ValueNode_BLine::create_list_entry(), create_list_entry(), erase(), find_next_valid_entry(), synfig::ValueNode_WPList::find_next_valid_entry_by_position(), find_prev_valid_entry(), synfig::ValueNode_WPList::find_prev_valid_entry_by_position(), synfig::ValueNode_BLine::get_blinepoint(), synfig::ValueNode_BLine::get_children_vocab_vfunc(), get_children_vocab_vfunc(), get_link_vfunc(), get_times_vfunc(), insert_time(), link_count(), synfig::ValueNode_DIList::link_local_name(), synfig::ValueNode_WPList::link_local_name(), synfig::ValueNode_BLine::link_local_name(), synfig::ValueNode_DIList::operator()(), synfig::ValueNode_WPList::operator()(), synfig::ValueNode_BLine::operator()(), operator()(), reindex(), set_link_vfunc(), and set_member_canvas().