本文整理汇总了C++中linkablevaluenode::Vocab::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Vocab::begin方法的具体用法?C++ Vocab::begin怎么用?C++ Vocab::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类linkablevaluenode::Vocab
的用法示例。
在下文中一共展示了Vocab::begin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: value_desc
bool
Action::ValueDescLink::set_param(const synfig::String& name, const Action::Param ¶m)
{
if(name=="time" && param.get_type()==Param::TYPE_TIME)
{
time=param.get_time();
return true;
}
// don't bother looking for the best value to use if there's already been an error
if (poison==true) return false;
if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
{
ValueDesc value_desc(param.get_value_desc());
// If we are handling a Composite WidthPoint then use its position as param
if(value_desc.is_value_node() && value_desc.parent_is_linkable_value_node())
{
synfig::ValueNode_Composite::Handle compo(synfig::ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()));
if(compo)
{
String param_name;
if (value_desc.parent_is_value_desc() && !value_desc.get_sub_name().empty())
{
LinkableValueNode::Vocab vocab = compo->get_children_vocab();
for(LinkableValueNode::Vocab::const_iterator i = vocab.begin(); i != vocab.end(); ++i)
if (i->get_name() == value_desc.get_sub_name())
param_name = value_desc.get_sub_name();
}
//! Test used for with point handle
if (param_name.empty() && compo->get_type() == type_width_point)
param_name = "position";
if (param_name.empty() && compo->get_type() == type_bline_point)
param_name = "point";
if ( compo->get_type() == type_bline_point
&& param_name == "t2"
&& (*compo)(time).get(BLinePoint()).get_merge_tangent_both())
{
param_name = "t1";
}
if (!param_name.empty())
{
synfigapp::Action::Param param(synfigapp::ValueDesc(compo, compo->get_link_index_from_name(param_name)));
return set_param("value_desc", param);
}
}
}
if(value_desc.is_value_node() && value_desc.get_value_node()->is_exported())
{
if(link_value_node==value_desc.get_value_node())
return true;
if(link_value_node && link_value_node->is_exported())
{
poison=true;
status_message = (_("Cannot link two different exported values ('") +
value_desc.get_value_node()->get_id() + _("' and '") +
link_value_node->get_id()) + _("')");
return false;
}
link_value_node=value_desc.get_value_node();
link_scalar=value_desc.parent_is_linkable_value_node()?value_desc.get_scalar():1.0;
status_message = _("Used exported ValueNode ('") + link_value_node->get_id() + _("').");
}
else if(value_desc.is_value_node())
{
if(!link_value_node)
{
status_level = 1;
status_message = _("Using the only available ValueNode.");
link_value_node=value_desc.get_value_node();
link_scalar=value_desc.parent_is_linkable_value_node()?value_desc.get_scalar():1.0;
}
else if(link_value_node->is_exported())
{
// we've already seen an exported value, so use that rather than the current value
}
// Use the one that is referenced more
else if(link_value_node->rcount()!=value_desc.get_value_node()->rcount())
{
if(link_value_node->rcount()<value_desc.get_value_node()->rcount())
{
status_level = 2;
status_message = _("Using the most referenced ValueNode.");
link_value_node=value_desc.get_value_node();
link_scalar=value_desc.parent_is_linkable_value_node()?value_desc.get_scalar():1.0;
}
else if (status_level <= 2)
{
status_level = 2;
status_message = _("Using the most referenced ValueNode.");
}
}
// If the current link value node is a constant and
//.........这里部分代码省略.........