本文整理汇总了C++中ParamList::count方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::count方法的具体用法?C++ ParamList::count怎么用?C++ ParamList::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamList
的用法示例。
在下文中一共展示了ParamList::count方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
Action::ValueDescConnect::is_candidate(const ParamList &x)
{
if(candidate_check(get_param_vocab(),x))
{
// don't show the option of connecting to an existing Index parameter of the Duplicate layer
if(x.count("dest"))
{
ValueDesc value_desc=x.find("dest")->second.get_value_desc();
if (value_desc.parent_is_layer() &&
value_desc.get_layer()->get_name() == "duplicate" &&
value_desc.get_param_name() == "index")
return false;
}
if(x.count("src"))
{
ValueDesc value_desc=x.find("dest")->second.get_value_desc();
ValueNode::Handle value_node=x.find("src")->second.get_value_node();
if(value_desc.get_value_type()==value_node->get_type())
return true;
}
return true;
}
return false;
}
示例2: n
bool
Action::candidate_check(const ParamVocab& param_vocab, const ParamList& param_list)
{
ParamVocab::const_iterator iter;
for(iter=param_vocab.begin();iter!=param_vocab.end();++iter)
{
int n(param_list.count(iter->get_name()));
// if(n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
// return false;
if(!n && !iter->get_mutual_exclusion().empty() && param_list.count(iter->get_mutual_exclusion()))
continue;
if(iter->get_user_supplied() || iter->get_optional())
continue;
if(n==0)
return false;
if(n==1 && iter->get_requires_multiple())
return false;
if(n>1 && !iter->get_supports_multiple())
return false;
if(iter->get_type()!=param_list.find(iter->get_name())->second.get_type())
return false;
}
return true;
}
示例3: value_desc
bool
Action::ValueDescConnect::is_candidate(const ParamList &x)
{
if(candidate_check(get_param_vocab(),x))
{
ValueDesc value_desc(x.find("dest")->second.get_value_desc());
ValueNode::Handle value_node(x.find("src")->second.get_value_node());
//! forbid recursive linking (fix #48)
if (value_desc.parent_is_value_node())
{
ValueNode* vn = dynamic_cast<ValueNode*>(value_node.get());
if (vn && vn->is_descendant(value_desc.get_parent_value_node()))
return false;
}
// don't show the option of connecting to an existing Index parameter of the Duplicate layer
if(x.count("dest"))
{
if (value_desc.parent_is_layer() &&
value_desc.get_layer()->get_name() == "duplicate" &&
value_desc.get_param_name() == "index")
return false;
}
if(x.count("src"))
{
if(value_desc.get_value_type()==value_node->get_type())
return true;
}
return true;
}
return false;
}
示例4:
/*! Writes the param of the given \a params to \a dbg. */
QDebug operator<<(QDebug dbg, const ParamList ¶ms)
{
dbg.nospace() << "ParamList (count:" << params.count() << ")" << endl;
for (int i = 0; i < params.count(); i++ ) {
dbg.nospace() << " " << i << ": " << params.at(i) << endl;
}
return dbg.space();
}
示例5:
bool
Action::WaypointAdd::is_candidate(const ParamList &x)
{
return (candidate_check(get_param_vocab(),x) &&
// We need an animated valuenode.
ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()) &&
// We need either a waypoint or a time.
(x.count("waypoint") || x.count("time")));
}
示例6: value_desc
bool
Action::ActivepointSetSmart::is_candidate(const ParamList &x)
{
if (!candidate_check(get_param_vocab(),x))
return false;
ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
return (value_desc.parent_is_value_node() &&
// We need a dynamic list.
ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()) &&
// We need either an activepoint or a time.
(x.count("activepoint") || x.count("time")));
}
示例7: value_desc
bool
Action::ActivepointSetOff::is_candidate(const ParamList &x)
{
if (!candidate_check(get_param_vocab(),x))
return false;
ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
if (!(value_desc.parent_is_value_node() &&
// We need a dynamic list.
ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node())))
return false;
Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
// We are only a candidate if this canvas is animated.
return (canvas->rend_desc().get_time_start() != canvas->rend_desc().get_time_end() &&
// We need either an activepoint or a time.
(x.count("activepoint") || x.count("time")));
}
示例8:
bool
Action::LayerMakeBLine::is_candidate_for_make_bline(const ParamList &x, const char **possible_layer_names, size_t possible_layer_names_count)
{
if(!candidate_check(get_param_vocab(),x))
return false;
if(x.count("layer") == 1)
{
const Param ¶m = x.find("layer")->second;
if(param.get_type() == Param::TYPE_LAYER
&& param.get_layer()
&& param.get_layer()->dynamic_param_list().count("bline") == 1)
{
for(size_t i = 0; i < possible_layer_names_count; i++)
if (param.get_layer()->get_name() == possible_layer_names[i])
return true;
}
}
return false;
}