Commit 942a5d6f305aef6674ed5c9f9b78639f9ca531bf

henry 2002-12-16T23:24:22

Made ProcessContours Private and removed GetOutline

diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index 4e965f3..5a5025d 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -148,18 +148,6 @@ class FTGL_EXPORT FTVectoriser
         virtual ~FTVectoriser();
 
         /**
-         * Process the freetype outline data into contours of points
-         */
-        void ProcessContours();
-
-        /**
-         * Copy the outline data into a block of <code>FTGL_DOUBLEs</code>
-         *
-         * @param d a pointer to the memory to copy the data into.
-         */
-        void GetOutline( FTGL_DOUBLE* d);
-
-        /**
          * Build an FTMesh from the vector outline data. 
          *
          * @param zNormal   The direction of the z axis of the normal
@@ -195,6 +183,13 @@ class FTGL_EXPORT FTVectoriser
         size_t contours() const { return ftContourCount;}
 
         /**
+         * Get the count of contours in this outline
+         *
+         * @return the number of contours
+         */
+         FTContour* Contour( unsigned int index) const { return contourList[index];}
+
+        /**
          * Get the number of points in a specific contour in this outline
          *
          * @param c     The contour index
@@ -211,6 +206,11 @@ class FTGL_EXPORT FTVectoriser
         
     private:
         /**
+         * Process the freetype outline data into contours of points
+         */
+        void ProcessContours();
+
+        /**
          * The list of contours in the glyph
          */
         FTContour** contourList;
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 3468da4..48a6234 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -102,7 +102,8 @@ int FTMesh::size() const
 
 
 FTVectoriser::FTVectoriser( const FT_Glyph glyph)
-:   mesh(0),
+:   contourList(0),
+    mesh(0),
     ftContourCount(0),
     contourFlag(0),
     kBSTEPSIZE( 0.2f)
@@ -115,6 +116,8 @@ FTVectoriser::FTVectoriser( const FT_Glyph glyph)
         ftContourCount = ftOutline.n_contours;;
         contourList = 0;
         contourFlag = ftOutline.flags;
+        
+        ProcessContours();
     }
 }
 
@@ -128,8 +131,7 @@ FTVectoriser::~FTVectoriser()
 
     delete [] contourList;
     
-    if( mesh)
-        delete mesh;
+    delete mesh;
 }
 
 
@@ -170,24 +172,6 @@ int FTVectoriser::points()
 }
 
 
-void FTVectoriser::GetOutline( FTGL_DOUBLE* data)
-{
-    int i = 0;
-    for( size_t c= 0; c < contours(); ++c)
-    {
-        const FTContour* contour = contourList[c];
-        
-        for( size_t p = 0; p < contour->Points(); ++p)
-        {
-            data[i] = static_cast<FTGL_DOUBLE>(contour->Point(p).x / 64.0f);
-            data[i + 1] = static_cast<FTGL_DOUBLE>(contour->Point(p).y / 64.0f);
-            data[i + 2] = 0.0f;
-            i += 3;
-        }
-    }
-}
-
-
 void FTVectoriser::MakeMesh( FTGL_DOUBLE zNormal)
 {
     if( mesh)