Use LinkableValueNode members functions when possible in the derived valuenodes.
[synfig.git] / synfig-core / src / synfig / valuenode_blinecalctangent.cpp
index e595915..e6d67f5 100644 (file)
@@ -58,6 +58,8 @@ using namespace synfig;
 ValueNode_BLineCalcTangent::ValueNode_BLineCalcTangent(const ValueBase::Type &x):
        LinkableValueNode(x)
 {
+       Vocab ret(get_children_vocab());
+       set_children_vocab(ret);
        if(x!=ValueBase::TYPE_ANGLE && x!=ValueBase::TYPE_REAL && x!=ValueBase::TYPE_VECTOR)
                throw Exception::BadType(ValueBase::type_local_name(x));
 
@@ -210,58 +212,6 @@ ValueNode_BLineCalcTangent::get_link_vfunc(int i)const
        return 0;
 }
 
-int
-ValueNode_BLineCalcTangent::link_count()const
-{
-       return 6;
-}
-
-String
-ValueNode_BLineCalcTangent::link_name(int i)const
-{
-       assert(i>=0 && i<link_count());
-
-       switch(i)
-       {
-               case 0: return "bline";
-               case 1: return "loop";
-               case 2: return "amount";
-               case 3: return "offset";
-               case 4: return "scale";
-               case 5: return "fixed_length";
-       }
-       return String();
-}
-
-String
-ValueNode_BLineCalcTangent::link_local_name(int i)const
-{
-       assert(i>=0 && i<link_count());
-
-       switch(i)
-       {
-               case 0: return _("BLine");
-               case 1: return _("Loop");
-               case 2: return _("Amount");
-               case 3: return _("Offset");
-               case 4: return _("Scale");
-               case 5: return _("Fixed Length");
-       }
-       return String();
-}
-
-int
-ValueNode_BLineCalcTangent::get_link_index_from_name(const String &name)const
-{
-       if (name=="bline")                return 0;
-       if (name=="loop")                 return 1;
-       if (name=="amount")               return 2;
-       if (name=="offset")               return 3;
-       if (name=="scale")                return 4;
-       if (name=="fixed_length") return 5;
-       throw Exception::BadLinkName(name);
-}
-
 bool
 ValueNode_BLineCalcTangent::check_type(ValueBase::Type type)
 {
@@ -271,8 +221,11 @@ ValueNode_BLineCalcTangent::check_type(ValueBase::Type type)
 }
 
 LinkableValueNode::Vocab
-ValueNode_BLineCalcTangent::get_param_vocab()const
+ValueNode_BLineCalcTangent::get_children_vocab_vfunc()const
 {
+       if(children_vocab.size())
+               return children_vocab;
+
        LinkableValueNode::Vocab ret;
 
        ret.push_back(ParamDesc(ValueBase(),"bline")