# synfig::ValueNode_DynamicList Class Reference

Animated List ValueNode. More...

`#include <valuenode_dynamiclist.h>`

Inheritance diagram for synfig::ValueNode_DynamicList:

List of all members.

## Public Types

typedef etl::handle < ValueNode_DynamicList > | Handle
typedef etl::handle< const ValueNode_DynamicList > | ConstHandle

## 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 int | link_count () const
virtual String | link_name (int i) const
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
virtual int | get_link_index_from_name (const String &name) const
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 >)
ValueBase::Type | get_contained_type () const
void | insert_time (const Time &location, const Time &delta)
virtual ValueNode * | clone (const GUID &deriv_guid=GUID()) const
virtual ListEntry | create_list_entry (int index, Time time=0, Real origin=0.5)

## Static Public Member Functions

template<typename iterator>
static Handle | create (iterator begin, iterator end)
static Handle | create (ValueBase::Type id=ValueBase::TYPE_NIL)
static bool | check_type (ValueBase::Type type)
static ValueNode_DynamicList * | create_from (const ValueBase &x=ValueBase::TYPE_GRADIENT)

## Public Attributes

std::vector< ListEntry > | list

## Protected Member Functions

| ValueNode_DynamicList (ValueBase::Type container_type=ValueBase::TYPE_NIL)
virtual bool | set_link_vfunc (int i, ValueNode::Handle x)
LinkableValueNode * | create_new () const
virtual void | get_times_vfunc (Node::time_set &set) const

## Protected Attributes

ValueBase::Type | container_type
bool | loop_

## Classes

class | ListEntry
| Contains a potential list item, and associated timing information. More...

## Detailed Description

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".

## Member Typedef Documentation

typedef etl::handle<ValueNode_DynamicList> synfig::ValueNode_DynamicList::Handle

Reimplemented from synfig::LinkableValueNode.

Reimplemented in synfig::ValueNode_BLine.

typedef etl::handle<const ValueNode_DynamicList> synfig::ValueNode_DynamicList::ConstHandle

Reimplemented from synfig::LinkableValueNode.

Reimplemented in synfig::ValueNode_BLine.

## Constructor & Destructor Documentation

ValueNode_DynamicList::ValueNode_DynamicList | ( | ValueBase::Type | container_type = `ValueBase::TYPE_NIL` | ) | `[protected]`

References DCAST_HACK_ENABLE.

Referenced by create(), create_from(), and create_new().

ValueNode_DynamicList::~ValueNode_DynamicList | ( |  | ) | `[virtual]`

References synfig::LinkableValueNode::unlink_all().

## Member Function Documentation

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_BLine::create(), and create_from().

void ValueNode_DynamicList::add | ( | const ListEntry & | 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::value_node.

void ValueNode_DynamicList::erase | ( | const ValueNode::Handle & | value_node | ) |

References synfig::ValueNode::get_root_canvas(), list, reindex(), and synfig::Node::remove_child().

void ValueNode_DynamicList::reindex | ( |  | ) |

References list.

Referenced by add(), and erase().

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_BLine::create_list_entry().

ValueNode::LooseHandle ValueNode_DynamicList::get_link_vfunc | ( | int | i | ) | const`[virtual]`

Implements synfig::LinkableValueNode.

References list.

int ValueNode_DynamicList::link_count | ( |  | ) | const`[virtual]`

Implements synfig::LinkableValueNode.

References list.

Referenced by create_list_entry(), synfig::ValueNode_BLine::create_list_entry(), and link_local_name().

String ValueNode_DynamicList::link_name | ( | int | i | ) | const`[virtual]`

Implements synfig::LinkableValueNode.

ValueBase ValueNode_DynamicList::operator() | ( | Time |  | ) | const`[virtual]`

Returns the value of the ValueNode at time t.

Reimplemented from synfig::ValueNode.

Reimplemented in synfig::ValueNode_BLine.

References _, container_type, list, and synfig::warning().

String ValueNode_DynamicList::link_local_name | ( | int | i | ) | const`[virtual]`

Implements synfig::LinkableValueNode.

Reimplemented in synfig::ValueNode_BLine.

References _, and link_count().

int ValueNode_DynamicList::get_link_index_from_name | ( | const String & | name | ) | const`[virtual]`

Implements synfig::LinkableValueNode.

String ValueNode_DynamicList::get_name | ( |  | ) | const`[virtual]`

Returns the name of the ValueNode type.

Implements synfig::ValueNode.

Reimplemented in synfig::ValueNode_BLine.

String ValueNode_DynamicList::get_local_name | ( |  | ) | const`[virtual]`

Returns the localized name of the ValueNode type.

Implements synfig::ValueNode.

Reimplemented in synfig::ValueNode_BLine.

References _.

bool synfig::ValueNode_DynamicList::get_loop | ( |  | ) | const`[inline]`

References loop_.

Referenced by clone(), create_list_entry(), and synfig::ValueNode_BLine::operator()().

void synfig::ValueNode_DynamicList::set_loop | ( | bool | x | ) | `[inline]`

References loop_.

Referenced by clone(), synfig::ValueNode_BLine::create(), and create_from().

void ValueNode_DynamicList::set_member_canvas | ( | etl::loose_handle< Canvas > | canvas | ) |

References list.

ValueBase::Type ValueNode_DynamicList::get_contained_type | ( |  | ) | const

References container_type.

Referenced by create_from(), and create_list_entry().

template<typename iterator>

static Handle synfig::ValueNode_DynamicList::create | ( | iterator | begin,
|  | iterator | end |
| ) |  |  | `[inline, static]`

void ValueNode_DynamicList::insert_time | ( | const Time & | location,
|  | const Time & | delta |
| ) |  |  |

References synfig::Node::changed(), synfig::ValueNode_DynamicList::ListEntry::find_next(), list, and synfig::ValueNode_DynamicList::ListEntry::timing_info.

ValueNode * ValueNode_DynamicList::clone | ( | const GUID & | deriv_guid = `GUID()` | ) | const`[virtual]`

Todo:
  This needs to be documented further.

Reimplemented from synfig::LinkableValueNode.

References add(), create_new(), synfig::find_value_node(), synfig::Node::get_guid(), get_loop(), list, synfig::Node::set_guid(), set_loop(), and synfig::ValueNode_DynamicList::ListEntry::value_node.

ValueNode_DynamicList::ListEntry ValueNode_DynamicList::create_list_entry | ( | int | index,
|  | Time | time = `0`,
|  | Real | origin = `0.5` |
| ) |  |  | `[virtual]`

Reimplemented in synfig::ValueNode_BLine.

References synfig::ValueNode_Composite::create(), synfig::ValueNode_Const::create(), synfig::ValueBase::get(), get_contained_type(), get_loop(), synfig::ValueNode_DynamicList::ListEntry::index, link_count(), list, synfig::ValueNode_DynamicList::ListEntry::set_parent_value_node(), synfig::ValueBase::TYPE_ANGLE, synfig::ValueBase::TYPE_COLOR, synfig::ValueBase::TYPE_REAL, synfig::ValueBase::TYPE_TIME, synfig::ValueBase::TYPE_VECTOR, and synfig::ValueNode_DynamicList::ListEntry::value_node.

bool ValueNode_DynamicList::set_link_vfunc | ( | int | i,
|  | ValueNode::Handle | x |
| ) |  |  | `[protected, virtual]`

Implements synfig::LinkableValueNode.

References container_type, and list.

LinkableValueNode * ValueNode_DynamicList::create_new | ( |  | ) | const`[protected, virtual]`

Implements synfig::LinkableValueNode.

Reimplemented in synfig::ValueNode_BLine.

References container_type, and ValueNode_DynamicList().

Referenced by clone().

void ValueNode_DynamicList::get_times_vfunc | ( | Node::time_set & | set | ) | const`[protected, virtual]`

Function to be overloaded that fills

Reimplemented from synfig::LinkableValueNode.

References list.

ValueNode_DynamicList::Handle ValueNode_DynamicList::create | ( | ValueBase::Type | id = `ValueBase::TYPE_NIL` | ) | `[static]`

Note:
  The construction parameter (id) is the type that the list contains, rather than the type that it will yield (which is ValueBase::TYPE_LIST)

References ValueNode_DynamicList().

bool ValueNode_DynamicList::check_type | ( | ValueBase::Type | type | ) | `[static]`

Reimplemented in synfig::ValueNode_BLine.

References synfig::ValueBase::TYPE_LIST.

ValueNode_DynamicList * ValueNode_DynamicList::create_from | ( | const ValueBase & | x = `ValueBase::TYPE_GRADIENT` | ) | `[static]`

References add(), synfig::ValueNode_Const::create(), get_contained_type(), synfig::ValueBase::get_list(), list, set_loop(), synfig::ValueBase::TYPE_VECTOR, and ValueNode_DynamicList().

## Member Data Documentation

ValueBase::Type synfig::ValueNode_DynamicList::container_type `[protected]`

Referenced by create_new(), get_contained_type(), operator()(), and set_link_vfunc().

bool synfig::ValueNode_DynamicList::loop_ `[protected]`

Referenced by get_loop(), and set_loop().

std::vector<ListEntry> synfig::ValueNode_DynamicList::list

Referenced by add(), clone(), create_from(), create_list_entry(), synfig::ValueNode_BLine::create_list_entry(), erase(), find_next_valid_entry(), find_prev_valid_entry(), get_link_vfunc(), get_times_vfunc(), insert_time(), link_count(), synfig::ValueNode_BLine::link_local_name(), operator()(), synfig::ValueNode_BLine::operator()(), reindex(), set_link_vfunc(), and set_member_canvas().

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

- valuenode_dynamiclist.h
- valuenode_dynamiclist.cpp