Rename get_param_vocab to get_children_vocab and use a wrapper for the pure virtual...
[synfig.git] / synfig-core / src / synfig / valuenode_pow.cpp
index fa00618..0b9d319 100644 (file)
@@ -170,14 +170,17 @@ ValueNode_Pow::operator()(Time t)const
        if (abs(power) < epsilon) //x^0 = 1
                return 1;
        if (abs(base) < epsilon)
+       {
                if (power > 0) //0^x=0
                        return Real(0);
                else
+               {
                        if ( ( ((int) power) % 2 != 0) && (base < 0) ) //(-0)^(-odd)=-inf
                                return -infinite;
                        else
                                return infinite;
-
+               }
+       }
        if (base <= epsilon && ((int) power) != power) //negative number to fractional power -> undefined
                power = ((int) power);  //so round off power to nearest integer
 
@@ -202,3 +205,31 @@ ValueNode_Pow::check_type(ValueBase::Type type)
 {
        return type==ValueBase::TYPE_REAL;
 }
+
+LinkableValueNode::Vocab
+ValueNode_Pow::get_children_vocab_vfunc()const
+{
+       LinkableValueNode::Vocab ret;
+
+       ret.push_back(ParamDesc(ValueBase(),"base")
+               .set_local_name(_("Base"))
+               .set_description(_("The base to be raised to the power"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"power")
+               .set_local_name(_("Power"))
+               .set_description(_("The power used to raise the base"))
+       );
+
+               ret.push_back(ParamDesc(ValueBase(),"epsilon")
+               .set_local_name(_("Epsilon"))
+               .set_description(_("Value used to compare base or power with zero "))
+       );
+
+               ret.push_back(ParamDesc(ValueBase(),"infinite")
+               .set_local_name(_("Infinite"))
+               .set_description(_("Returned value when result tends to infinite"))
+       );
+
+       return ret;
+}