Made ProcessContours Private and removed GetOutline
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
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)