Commit 52e2616095b431fbf8f6e1038df71d310acfe00a

henry 2002-12-15T08:20:58

Removed contourPoint struct

diff --git a/include/FTContour.h b/include/FTContour.h
index 2f30f1c..3cb06e0 100644
--- a/include/FTContour.h
+++ b/include/FTContour.h
@@ -6,19 +6,6 @@
 #include "FTGL.h"
 
 
-struct ContourPoint
-{
-    ContourPoint(){}
-    
-    ContourPoint( FTPoint p, char t)
-    :   point(p),
-        tag(t)
-    {}
-    
-    FTPoint point;
-    char tag;
-};
-
 /**
  * FTContour class is a container of points that describe a vector font
  * outline. It is used as a container for the output of the bezier curve
@@ -76,7 +63,7 @@ class FTGL_EXPORT FTContour
          *
          * @param point The point to be added to the contour.
          */
-        void AddPoint( FTPoint point);
+        inline void AddPoint( FTPoint point);
         
         /**
          * De Casteljau (bezier) algorithm contributed by Jed Soane
@@ -85,7 +72,7 @@ class FTGL_EXPORT FTContour
          * @param curveOrder The order of the curve to be evaluated.
          * <code>2</code> equals conic (quadratic) and <code>3</code> equals cubic
          */
-        void deCasteljau( const float t, const int curveOrder);
+        inline void deCasteljau( const float t, const int curveOrder);
 
         /**
          * De Casteljau (bezier) algorithm contributed by Jed Soane
@@ -93,19 +80,13 @@ class FTGL_EXPORT FTContour
          * @param curveOrder The order of the curve to be evaluated.
          * <code>2</code> equals conic (quadratic) and <code>3</code> equals cubic
          */
-        void evaluateCurve( const int curveOrder);
+        inline void evaluateCurve( const int curveOrder);
 
         /**
          */
          // Magic numbers -- #define MAX_DEG 4
         float bValues[4][4][2];  //3D array storing values of de Casteljau algorithm.
         float ctrlPtArray[4][2]; // Magic numbers
-        
-        /**
-         * Parameterisation step size for De Casteljau algorithm
-         */
-        const float kBSTEPSIZE;
-
 };
 
 #endif // __FTContour__
diff --git a/src/FTContour.cpp b/src/FTContour.cpp
index c812a3b..6863d51 100644
--- a/src/FTContour.cpp
+++ b/src/FTContour.cpp
@@ -2,10 +2,10 @@
 
 static const unsigned int SECOND_ORDER_CURVE = 2;
 static const unsigned int THIRD_ORDER_CURVE = 3;
+static const float BEZIER_STEP_SIZE = 0.2f;
 
 
 FTContour::FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOfPoints)
-:   kBSTEPSIZE( 0.2f)
 {
     for( unsigned int pointIndex = 0; pointIndex < numberOfPoints; ++ pointIndex)
     {
@@ -104,8 +104,7 @@ void FTContour::deCasteljau( const float t, const int n)
             bValues[i][k][1] = (1 - t) * bValues[i - 1][k][1] + t * bValues[i - 1][k + 1][1];
         }
     }
-       
-    //Specify next vertex to be included on curve
+
     AddPoint( FTPoint( bValues[n][0][0], bValues[n][0][1], 0.0f));
 }
 
@@ -121,9 +120,9 @@ void FTContour::evaluateCurve( const int n)
 
     float t; //parameter for curve point calc. [0.0, 1.0]
 
-    for( int m = 0; m <= ( 1 / kBSTEPSIZE); m++)
+    for( int m = 0; m <= ( 1 / BEZIER_STEP_SIZE); m++)
     {
-        t = m * kBSTEPSIZE;
+        t = m * BEZIER_STEP_SIZE;
         deCasteljau( t, n);  //calls to evaluate point on curve at t.
     }
 }