bool
ValueNode_Atan2::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
x_=x;
ValueNode::LooseHandle
ValueNode_Atan2::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return x_;
if(i==1)
String
ValueNode_Atan2::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "x";
if(i==1)
String
ValueNode_Atan2::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("X");
if(i==1)
bool
ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i>=0);
- assert(i<6);
+ assert(i>=0 && i<link_count());
if(PlaceholderValueNode::Handle::cast_dynamic(x))
{
switch(get_type())
{
case ValueBase::TYPE_VECTOR:
- assert(i<2);
if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
{
components[i]=x;
break;
case ValueBase::TYPE_COLOR:
- assert(i<4);
if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
{
components[i]=x;
break;
case ValueBase::TYPE_SEGMENT:
- assert(i<4);
if(x->get_type()==ValueBase(Point()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x))
{
components[i]=x;
break;
case ValueBase::TYPE_BLINEPOINT:
- assert(i<6);
if((i==0 || i==4 || i==5) && x->get_type()==ValueBase(Point()).get_type())
{
components[i]=x;
ValueNode::LooseHandle
ValueNode_Composite::get_link_vfunc(int i)const
{
- assert(i>=0 && i<6);
+ assert(i>=0 && i<link_count());
+
return components[i];
}
String
ValueNode_Composite::link_local_name(int i)const
{
- assert(i>=0 && i<6);
+ assert(i>=0 && i<link_count());
+
switch(get_type())
{
case ValueBase::TYPE_VECTOR:
String
ValueNode_Composite::link_name(int i)const
{
- assert(i>=0 && i<5);
+ assert(i>=0 && i<link_count());
+
+ printf("!!! link_name(%d)\n", i);
return strprintf("c%d",i);
}
bool
ValueNode_Cos::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
angle_=x;
ValueNode::LooseHandle
ValueNode_Cos::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return angle_;
if(i==1)
String
ValueNode_Cos::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "angle";
if(i==1)
String
ValueNode_Cos::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("Angle");
if(i==1)
bool
ValueNode_Duplicate::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: from_ = x; break;
ValueNode::LooseHandle
ValueNode_Duplicate::get_link_vfunc(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return from_;
if(i==1) return to_;
if(i==2) return step_;
String
ValueNode_Duplicate::link_local_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return _("From");
if(i==1) return _("To");
if(i==2) return _("Step");
String
ValueNode_Duplicate::link_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return "from";
if(i==1) return "to";
if(i==2) return "step";
ValueNode_DynamicList::set_link_vfunc(int i,ValueNode::Handle x)
{
assert(i>=0);
+
if((unsigned)i>=list.size())
return false;
if(x->get_type()!=container_type)
ValueNode_DynamicList::get_link_vfunc(int i)const
{
assert(i>=0);
+
if((unsigned)i>=list.size())
return 0;
return list[i].value_node;
String
ValueNode_DynamicList::link_local_name(int i)const
{
- assert(i>=0 && (unsigned)i<list.size());
+ assert(i>=0 && i<link_count());
+
return etl::strprintf(_("Item %03d"),i+1);
}
ValueNode_DynamicList::create_new()const
{
assert(0);
+
return 0;
}
bool
ValueNode_Exp::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
exp_=x;
ValueNode::LooseHandle
ValueNode_Exp::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return exp_;
if(i==1)
String
ValueNode_Exp::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "exp";
if(i==1)
String
ValueNode_Exp::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("Exponent");
if(i==1)
bool
ValueNode_GradientRotate::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode::LooseHandle
ValueNode_GradientRotate::get_link_vfunc(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
String
ValueNode_GradientRotate::link_local_name(int i)const
{
- assert(i>=0 && i<2);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
String
ValueNode_GradientRotate::link_name(int i)const
{
- assert(i>=0 && i<2);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
bool
ValueNode_Integer::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: integer_ = x; break;
ValueNode::LooseHandle
ValueNode_Integer::get_link_vfunc(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return integer_;
return 0;
String
ValueNode_Integer::link_local_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return _("Integer");
return String();
}
String
ValueNode_Integer::link_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return "integer";
return String();
}
bool
ValueNode_Linear::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
m_=x;
ValueNode::LooseHandle
ValueNode_Linear::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0) return m_;
if(i==1) return b_;
return 0;
String
ValueNode_Linear::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0) return "slope";
if(i==1) return "offset";
return String();
String
ValueNode_Linear::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
switch(get_type())
{
bool
ValueNode_RadialComposite::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i>=0);
- assert(i<6);
+ assert(i>=0 && i<link_count());
if(PlaceholderValueNode::Handle::cast_dynamic(x))
{
switch(get_type())
{
case ValueBase::TYPE_VECTOR:
- assert(i<2);
if(i==0 && x->get_type()!=ValueBase::TYPE_REAL)
return false;
if(i==1 && x->get_type()!=ValueBase::TYPE_ANGLE)
break;
case ValueBase::TYPE_COLOR:
- assert(i<4);
if((i==0 || i==1 || i==3) && x->get_type()!=ValueBase::TYPE_REAL)
return false;
if((i==2) && x->get_type()!=ValueBase::TYPE_ANGLE)
ValueNode::LooseHandle
ValueNode_RadialComposite::get_link_vfunc(int i)const
{
- assert(i>=0 && i<6);
+ assert(i>=0 && i<link_count());
+
return components[i];
}
String
ValueNode_RadialComposite::link_local_name(int i)const
{
- assert(i>=0 && i<6);
+ assert(i>=0 && i<link_count());
+
switch(get_type())
{
case ValueBase::TYPE_VECTOR:
String
ValueNode_RadialComposite::link_name(int i)const
{
- assert(i>=0 && i<5);
+ assert(i>=0 && i<link_count());
+
return strprintf("c%d",i);
}
bool
ValueNode_Range::set_link_vfunc(int i,ValueNode::Handle value)
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode::LooseHandle
ValueNode_Range::get_link_vfunc(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return min_;
String
ValueNode_Range::link_local_name(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return _("Min");
String
ValueNode_Range::link_name(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "min";
bool
ValueNode_Reciprocal::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: link_ = x; break;
ValueNode::LooseHandle
ValueNode_Reciprocal::get_link_vfunc(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return link_;
if(i==1) return epsilon_;
if(i==2) return infinite_;
String
ValueNode_Reciprocal::link_local_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return _("Link");
if(i==1) return _("Epsilon");
if(i==2) return _("Infinite");
String
ValueNode_Reciprocal::link_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return "link";
if(i==1) return "epsilon";
if(i==2) return "infinite";
bool
ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0);
+ assert(i>=0 && i<link_count());
+
if(x->get_type()!=get_type() && !PlaceholderValueNode::Handle::cast_dynamic(x))
return false;
link_=x;
ValueNode::LooseHandle
ValueNode_Reference::get_link_vfunc(int i)const
{
- assert(i==0);
+ assert(i>=0 && i<link_count());
+
return link_;
}
String
ValueNode_Reference::link_local_name(int i)const
{
- assert(i==0);
- return _("Link");
+ assert(i>=0 && i<link_count());
+
+ switch(i)
+ {
+ case 0: return _("Link");
+ }
+ return String();
}
String
-ValueNode_Reference::link_name(int /*i*/)const
+ValueNode_Reference::link_name(int i)const
{
- return "link";
+ assert(i>=0 && i<link_count());
+
+ switch(i)
+ {
+ case 0: return "link";
+ }
+ return String();
}
int
ValueNode_Repeat_Gradient::set_link_vfunc(int i,ValueNode::Handle x)
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode_Repeat_Gradient::get_link_vfunc(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return gradient_;
ValueNode_Repeat_Gradient::link_local_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return _("Gradient");
ValueNode_Repeat_Gradient::link_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "gradient";
#include "valuenode_scale.h"
#include "valuenode_const.h"
#include <stdexcept>
-#include <cassert>
#include "color.h"
#include "vector.h"
#include "time.h"
bool
ValueNode_Scale::set_link_vfunc(int i,ValueNode::Handle x)
{
- if(!(i==0 || i==1))
- return false;
+ assert(i>=0 && i<link_count());
if(i==0 && !set_value_node(x))
return false;
ValueNode::LooseHandle
ValueNode_Scale::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return value_node;
else if(i==1)
String
ValueNode_Scale::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("Link");
else if(i==1)
String
ValueNode_Scale::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "link";
else if(i==1)
bool
ValueNode_SegCalcTangent::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
segment_=x;
ValueNode::LooseHandle
ValueNode_SegCalcTangent::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return segment_;
if(i==1)
String
ValueNode_SegCalcTangent::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "segment";
if(i==1)
String
ValueNode_SegCalcTangent::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("Segment");
if(i==1)
bool
ValueNode_SegCalcVertex::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
segment_=x;
ValueNode::LooseHandle
ValueNode_SegCalcVertex::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return segment_;
if(i==1)
String
ValueNode_SegCalcVertex::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "segment";
if(i==1)
String
ValueNode_SegCalcVertex::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("Segment");
if(i==1)
bool
ValueNode_Sine::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
{
angle_=x;
ValueNode::LooseHandle
ValueNode_Sine::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return angle_;
if(i==1)
String
ValueNode_Sine::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "angle";
if(i==1)
String
ValueNode_Sine::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("Angle");
if(i==1)
ValueNode_Stripes::set_link_vfunc(int i,ValueNode::Handle x)
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode_Stripes::get_link_vfunc(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode_Stripes::link_local_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode_Stripes::link_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
bool
ValueNode_Subtract::set_link_vfunc(int i,ValueNode::Handle value)
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode::LooseHandle
ValueNode_Subtract::get_link_vfunc(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return ref_a;
String
ValueNode_Subtract::link_local_name(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return _("LHS");
String
ValueNode_Subtract::link_name(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "lhs";
ValueNode_Switch::set_link_vfunc(int i,ValueNode::Handle x)
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode_Switch::get_link_vfunc(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return link_off_;
ValueNode_Switch::link_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "link_off";
ValueNode_Switch::link_local_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "Link Off";
bool
ValueNode_TimedSwap::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i>=0 && i<4);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return set_before(x);
ValueNode::LooseHandle
ValueNode_TimedSwap::get_link_vfunc(int i)const
{
- assert(i>=0 && i<4);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return get_before();
String
ValueNode_TimedSwap::link_local_name(int i)const
{
- assert(i>=0 && i<4);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return _("Before");
String
ValueNode_TimedSwap::link_name(int i)const
{
- assert(i>=0 && i<4);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "before";
bool
ValueNode_TimeLoop::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: link_ = x; break;
ValueNode::LooseHandle
ValueNode_TimeLoop::get_link_vfunc(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return link_;
if(i==1) return link_time_;
if(i==2) return local_time_;
String
ValueNode_TimeLoop::link_local_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return _("Link");
if(i==1) return _("Link Time");
if(i==2) return _("Local Time");
String
ValueNode_TimeLoop::link_name(int i)const
{
- assert(i >= 0 && i < link_count());
+ assert(i>=0 && i<link_count());
+
if(i==0) return "link";
if(i==1) return "link_time";
if(i==2) return "local_time";
bool
ValueNode_TwoTone::set_link_vfunc(int i,ValueNode::Handle x)
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
ValueNode::LooseHandle
ValueNode_TwoTone::get_link_vfunc(int i)const
{
- assert(i>=0 && i<3);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
String
ValueNode_TwoTone::link_local_name(int i)const
{
- assert(i>=0 && i<2);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0:
String
ValueNode_TwoTone::link_name(int i)const
{
- assert(i>=0 && i<2);
+ assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: