assert(max_->get_type()==id);
assert(link_->get_type()==id);
assert(get_type()==id);
-
- DCAST_HACK_ENABLE();
}
LinkableValueNode*
switch (get_type())
{
default:
- // Notice that target_value is the rotation between the current
- // 'link' value and the target angle in the canvas, so we need
- // to add it to 'link'
- if(Angle::rad(maximum).get()>=Angle::rad(link+target_value).get() && Angle::rad(link+target_value).get()>=Angle::rad(minimum).get())
- return link + target_value;
+
+ if(Angle::rad(maximum).get()>=Angle::rad(target_value).get() && Angle::rad(target_value).get()>=Angle::rad(minimum).get())
+ return target_value;
else if (Angle::rad(minimum).get()>Angle::rad(target_value).get())
return minimum;
else
|| type==ValueBase::TYPE_REAL
|| type==ValueBase::TYPE_TIME;
}
+
+LinkableValueNode::Vocab
+ValueNode_Range::get_param_vocab()const
+{
+ LinkableValueNode::Vocab ret;
+
+ ret.push_back(ParamDesc(ValueBase(),"min")
+ .set_local_name(_("Min"))
+ .set_description(_("Returned value when 'Link' is smaller"))
+ );
+
+ ret.push_back(ParamDesc(ValueBase(),"max")
+ .set_local_name(_("Max"))
+ .set_description(_("Returned value when 'Link' is greater"))
+ );
+
+ ret.push_back(ParamDesc(ValueBase(),"link")
+ .set_local_name(_("Link"))
+ .set_description(_("The value node to limit its range"))
+ );
+
+ return ret;
+}