Remove the ETL_FIXED_DERIVATIVE macro.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 3 Mar 2008 18:11:07 +0000 (18:11 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 3 Mar 2008 18:11:07 +0000 (18:11 +0000)
git-svn-id: http://svn.voria.com/code@1853 1f10aa63-cdf2-0310-b900-c93c546f37ac

ETL/trunk/ETL/_calculus.h
synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp
synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp
synfig-studio/trunk/src/gtkmm/state_bline.cpp

index a9c95ed..279ed91 100644 (file)
@@ -34,8 +34,6 @@
 //#define _EPSILON             0.0000001
 //#endif
 
-#define ETL_FIXED_DERIVATIVE 1
-
 /* === T Y P E D E F S ===================================================== */
 
 /* === C L A S S E S & S T R U C T S ======================================= */
@@ -53,11 +51,7 @@ public:
        typename T::result_type
        operator()(const typename T::argument_type &x)const
        {
-#ifdef ETL_FIXED_DERIVATIVE
                return (func(x+epsilon)-func(x))/epsilon;
-#else
-               return (func(x)-func(x+epsilon))/epsilon;
-#endif
        }
 };
 
index 671ce59..51bcafc 100644 (file)
@@ -127,21 +127,12 @@ ValueNode_BLineCalcTangent::operator()(Time t)const
                                                           blinepoint0.get_tangent2(), blinepoint1.get_tangent1());
        etl::derivative< etl::hermite<Vector> > deriv(curve);
 
-#ifdef ETL_FIXED_DERIVATIVE
        switch (get_type())
        {
                case ValueBase::TYPE_ANGLE:  return (deriv(amount-from_vertex)*(0.5)).angle();
                case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(0.5);
                default: assert(0); return ValueBase();
        }
-#else
-       switch (get_type())
-       {
-               case ValueBase::TYPE_ANGLE:  return (deriv(amount-from_vertex)*(-0.5)).angle();
-               case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(-0.5);
-               default: assert(0); return ValueBase();
-       }
-#endif
 }
 
 String
index 2159663..ab3f454 100644 (file)
@@ -84,12 +84,7 @@ ValueNode_SegCalcTangent::operator()(Time t)const
        etl::hermite<Vector> curve(segment.p1,segment.p2,segment.t1,segment.t2);
        etl::derivative< etl::hermite<Vector> > deriv(curve);
 
-#ifdef ETL_FIXED_DERIVATIVE
        return deriv((*amount_)(t).get(Real()))*(0.5);
-#else
-       return deriv((*amount_)(t).get(Real()))*(-0.5);
-#endif
-
 }
 
 
index 51afaff..cee1d8d 100644 (file)
@@ -1306,11 +1306,7 @@ StateBLine_Context::bline_insert_vertex(synfig::ValueNode_Const::Handle value_no
 
                        bline_point.set_vertex(curve(origin));
                        bline_point.set_width((next_bline_point.get_width()-prev_bline_point.get_width())*origin+prev_bline_point.get_width());
-#ifdef ETL_FIXED_DERIVATIVE
                        bline_point.set_tangent1(deriv(origin)*std::min(1.0f-origin,origin));
-#else
-                       bline_point.set_tangent1(-deriv(origin)*std::min(1.0f-origin,origin));
-#endif
                        bline_point.set_tangent2(bline_point.get_tangent1());
                        bline_point.set_split_tangent_flag(false);
                        bline_point.set_origin(origin);