bool
Action::ActivepointAdd::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- // We need either a activepoint or a time.
- if(x.count("activepoint") || x.count("time"))
- return true;
- }
- 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")));
}
bool
bool
Action::ActivepointRemove::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ActivepointSet::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ActivepointSetOff::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- // We are only a candidate if this canvas is animated.
- Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
- if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end())
- return false;
+ ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- // We need either a activepoint or a time.
- if(x.count("activepoint") || x.count("time"))
- return true;
- }
- return false;
+ 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")));
}
bool
bool
Action::ActivepointSetOn::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- // We are only a candidate if this canvas is animated.
- Canvas::Handle canvas(x.find("canvas")->second.get_canvas());
- if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end())
- return false;
+ ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- // We need either a activepoint or a time.
- if(x.count("activepoint") || x.count("time"))
- return true;
- }
- return false;
+ 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")));
}
bool
bool
Action::ActivepointSetSmart::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- // We need either a activepoint or a time.
- if(x.count("activepoint") || x.count("time"))
- return true;
- }
- 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")));
}
bool
bool
Action::ValueDescDisconnect::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-
- // don't allow the Index parameter of the Duplicate layer to be disconnected
- if(value_desc.parent_is_layer_param() && value_desc.get_layer()->get_name() == "duplicate" && value_desc.get_param_name() == "index")
- return false;
- if(!value_desc.parent_is_canvas() && value_desc.is_value_node() && value_desc.get_value_node()->rcount()>1)
- return true;
- if(value_desc.is_const())
- return false;
- if(value_desc.is_value_node() && ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
- return false;
- // don't allow Duplicate ValueNodes in the Children dialog to be disconnected
- if(value_desc.is_value_node() &&
- ValueNode_Duplicate::Handle::cast_dynamic(value_desc.get_value_node()) &&
- !value_desc.parent_is_layer_param() &&
- !value_desc.parent_is_value_node())
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
+
+ ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+
+ // don't allow the Index parameter of the Duplicate layer to be disconnected
+ if(value_desc.parent_is_layer_param() && value_desc.get_layer()->get_name() == "duplicate" && value_desc.get_param_name() == "index")
+ return false;
+ if(!value_desc.parent_is_canvas() && value_desc.is_value_node() && value_desc.get_value_node()->rcount()>1)
return true;
- }
- return false;
+ if(value_desc.is_const())
+ return false;
+ if(value_desc.is_value_node() && ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
+ return false;
+ // don't allow Duplicate ValueNodes in the Children dialog to be disconnected
+ if(value_desc.is_value_node() &&
+ ValueNode_Duplicate::Handle::cast_dynamic(value_desc.get_value_node()) &&
+ !value_desc.parent_is_layer_param() &&
+ !value_desc.parent_is_value_node())
+ return false;
+ return true;
}
bool
bool
Action::ValueNodeDynamicListInsert::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ValueNodeDynamicListInsertSmart::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ValueNodeDynamicListLoop::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueNode::Handle value_node;
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(value_desc.parent_is_value_node())
- value_node = value_desc.get_parent_value_node();
- else
- value_node = x.find("value_node")->second.get_value_node();
- if(!ValueNode_DynamicList::Handle::cast_dynamic(value_node))
- return false;
- if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop()==true)
- return false;
- return true;
- }
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
+
+ ValueNode::Handle value_node;
+ ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+
+ if(value_desc.parent_is_value_node())
+ value_node = value_desc.get_parent_value_node();
+ else
+ value_node = x.find("value_node")->second.get_value_node();
+
+ // We need a dynamic list.
+ return (ValueNode_DynamicList::Handle::cast_dynamic(value_node) &&
+ // We need the list not to be looped.
+ !ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop());
}
bool
bool
Action::ValueNodeDynamicListRemove::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ValueNodeDynamicListRemoveSmart::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ValueNodeDynamicListRotateOrder::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
- return true;
- }
- 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()));
}
bool
bool
Action::ValueNodeDynamicListUnLoop::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- ValueNode::Handle value_node;
- ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
- if(value_desc.parent_is_value_node())
- value_node = value_desc.get_parent_value_node();
- else
- value_node = x.find("value_node")->second.get_value_node();
- if(!ValueNode_DynamicList::Handle::cast_dynamic(value_node))
- return false;
- if(ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop()==false)
- return false;
- return true;
- }
- return false;
+ if (!candidate_check(get_param_vocab(),x))
+ return false;
+
+ ValueNode::Handle value_node;
+ ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+
+ if(value_desc.parent_is_value_node())
+ value_node = value_desc.get_parent_value_node();
+ else
+ value_node = x.find("value_node")->second.get_value_node();
+
+ // We need a dynamic list.
+ return (ValueNode_DynamicList::Handle::cast_dynamic(value_node) &&
+ // We need the list to be looped.
+ ValueNode_DynamicList::Handle::cast_dynamic(value_node)->get_loop());
}
bool
bool
Action::WaypointAdd::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
- return false;
-
- // We need either a waypoint or a time.
- if(x.count("waypoint") || x.count("time"))
- return true;
- }
- return false;
+ 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")));
}
bool
bool
Action::WaypointSetSmart::is_candidate(const ParamList &x)
{
- if(candidate_check(get_param_vocab(),x))
- {
- if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
- return false;
- // We need either a waypoint or a time.
- if(x.count("waypoint") || x.count("time"))
- return true;
- return false;
- }
- return false;
+ 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")));
}
bool