ValueNode_DotProduct::ValueNode_DotProduct(const ValueBase &value):
LinkableValueNode(value.get_type())
{
+ Vocab ret(get_children_vocab());
+ set_children_vocab(ret);
switch(value.get_type())
{
case ValueBase::TYPE_REAL:
return 0;
}
-int
-ValueNode_DotProduct::link_count()const
-{
- return 2;
-}
-
-String
-ValueNode_DotProduct::link_name(int i)const
+bool
+ValueNode_DotProduct::check_type(ValueBase::Type type)
{
- assert(i>=0 && i<link_count());
-
- switch(i)
- {
- case 0: return "lhs";
- case 1: return "rhs";
- }
- return String();
+ return
+ type==ValueBase::TYPE_ANGLE ||
+ type==ValueBase::TYPE_REAL;
}
-String
-ValueNode_DotProduct::link_local_name(int i)const
+LinkableValueNode::Vocab
+ValueNode_DotProduct::get_children_vocab_vfunc()const
{
- assert(i>=0 && i<link_count());
+ if(children_vocab.size())
+ return children_vocab;
- switch(i)
- {
- case 0: return _("LHS");
- case 1: return _("RHS");
- }
- return String();
-}
+ LinkableValueNode::Vocab ret;
-int
-ValueNode_DotProduct::get_link_index_from_name(const String &name)const
-{
- if (name=="lhs") return 0;
- if (name=="rhs") return 1;
+ ret.push_back(ParamDesc(ValueBase(),"lhs")
+ .set_local_name(_("LHS"))
+ .set_description(_("The left side of the dot product"))
+ );
- throw Exception::BadLinkName(name);
-}
+ ret.push_back(ParamDesc(ValueBase(),"rhs")
+ .set_local_name(_("RHS"))
+ .set_description(_("The right side of the dot product"))
+ );
-bool
-ValueNode_DotProduct::check_type(ValueBase::Type type)
-{
- return
- type==ValueBase::TYPE_ANGLE ||
- type==ValueBase::TYPE_REAL;
+ return ret;
}