Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_animated.cpp
index ea91cac..c2a32fc 100644 (file)
@@ -1,12 +1,12 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file valuenode_animated.cpp
-**     \brief Template File
+**     \brief Implementation of the "Animated" valuenode conversion.
 **
 **     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright (c) 2007 Chris Moore
+**     Copyright (c) 2007, 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -237,7 +237,7 @@ private:
        Time r,s;
 
 public:
-       ValueNode* clone(const GUID& deriv_guid)const
+       ValueNode* clone(const synfig::GUID& deriv_guid)const
        {
                { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
                _Hermite<T>* ret(new _Hermite<T>());
@@ -377,34 +377,36 @@ public:
                                                }
                                                else
                                                {
+                                                       const Real& t(iter->get_tension());             // Tension
+                                                       const Real& c(iter->get_continuity());  // Continuity
+                                                       const Real& b(iter->get_bias());                // Bias
 
-                                               const Real& t(iter->get_tension());             // Tension
-                                               const Real& c(iter->get_continuity());  // Continuity
-                                               const Real& b(iter->get_bias());                        // Bias
+                                                       // The following line works where the previous line fails.
+                                                       value_type Pp; Pp=curve_list.back().second.p1();        // P_{i-1}
 
-                                               // The following line works where the previous line fails.
-                                               value_type Pp; Pp=curve_list.back().second.p1();        // P_{i-1}
+                                                       const value_type& Pc(curve.second.p1());        // P_i
+                                                       const value_type& Pn(curve.second.p2());        // P_{i+1}
 
-                                               const value_type& Pc(curve.second.p1());        // P_i
-                                               const value_type& Pn(curve.second.p2());        // P_{i+1}
+                                                       // TCB
+                                                       value_type vect(static_cast<value_type>
+                                                                                       (subtract_func(Pc,Pp) *
+                                                                                                  (((1.0-t) * (1.0+c) * (1.0+b)) / 2.0) +
+                                                                                        (Pn-Pc) * (((1.0-t) * (1.0-c) * (1.0-b)) / 2.0)));
 
-                                               // TCB
-                                               value_type vect(static_cast<value_type>(subtract_func(Pc,Pp)*(((1.0-t)*(1.0+c)*(1.0+b))/2.0)+(Pn-Pc)*(((1.0-t)*(1.0-c)*(1.0-b))/2.0)));
-
-                                               // Tension Only
-                                               //value_type vect=(value_type)((Pn-Pp)*(1.0-t));
+                                                       // Tension Only
+                                                       //value_type vect=(value_type)((Pn-Pp)*(1.0-t));
 
-                                               // Linear
-                                               //value_type vect=(value_type)(Pn-Pc);
+                                                       // Linear
+                                                       //value_type vect=(value_type)(Pn-Pc);
 
-                                               // Debugging stuff
-                                               //synfig::info("%d:t1: %s",i,tangent_info(Pp,Pn,vect).c_str());
+                                                       // Debugging stuff
+                                                       //synfig::info("%d:t1: %s",i,tangent_info(Pp,Pn,vect).c_str());
 
-                                               // Adjust for time
-                                               //vect=value_type(vect*(curve.second.get_dt()*2.0)/(curve.second.get_dt()+curve_list.back().second.get_dt()));
-                                               //vect=value_type(vect*(curve.second.get_dt())/(curve_list.back().second.get_dt()));
+                                                       // Adjust for time
+                                                       //vect=value_type(vect*(curve.second.get_dt()*2.0)/(curve.second.get_dt()+curve_list.back().second.get_dt()));
+                                                       //vect=value_type(vect*(curve.second.get_dt())/(curve_list.back().second.get_dt()));
 
-                                               curve.second.t1()=vect;
+                                                       curve.second.t1()=vect;
                                                }
                                        }
                                        else if(
@@ -489,8 +491,8 @@ public:
                        curve.first.set_rs(iter->get_time(), next->get_time());
                        curve.first.p1()=iter->get_time();
                        curve.first.p2()=next->get_time();
-                       curve.first.t1()=(curve.first.p2()-curve.first.p1())*(1.0f-iter->get_time_tension());
-                       curve.first.t2()=(curve.first.p2()-curve.first.p1())*(1.0f-next->get_time_tension());
+                       curve.first.t1()=(curve.first.p2()-curve.first.p1())*(1.0f-iter->get_temporal_tension());
+                       curve.first.t2()=(curve.first.p2()-curve.first.p1())*(1.0f-next->get_temporal_tension());
 
 
                        curve.first.sync();
@@ -536,7 +538,7 @@ private:
        Time r,s;
 
 public:
-       ValueNode* clone(const GUID& deriv_guid)const
+       ValueNode* clone(const synfig::GUID& deriv_guid)const
        {
                { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
                _Constant<T>* ret(new _Constant<T>());
@@ -634,7 +636,7 @@ private:
        Time r,s;
 
 public:
-       ValueNode* clone(const GUID& deriv_guid)const
+       ValueNode* clone(const synfig::GUID& deriv_guid)const
        {
                { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; }
                _AnimBool* ret(new _AnimBool());
@@ -1052,7 +1054,7 @@ synfig::ValueNode_Animated::create(ValueBase::Type type)
                default:
                        throw
                                Exception::BadType(strprintf(_("%s: You cannot use a %s in an animated ValueNode"),"synfig::ValueNode_Animated::create()",
-                                       ValueBase::type_name(type).c_str())
+                                       ValueBase::type_local_name(type).c_str())
                                );
                        break;
        }