Moved FTPoint to it's own file
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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index 7fe2f1d..902066c 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -5,69 +5,15 @@
#include FT_FREETYPE_H
#include FT_GLYPH_H
+#include "FTPoint.h"
+#include "FTVector.h"
#include "FTGL.h"
-#include "FTVector.h"
#ifndef CALLBACK
#define CALLBACK
#endif
-/**
- * ftPoint class is a basic 3 dimensional point for holding vector font
- * point data.
- *
- * @see FTOutlineGlyph
- * @see FTPolyGlyph
- *
- */
-class FTGL_EXPORT ftPoint
-{
- public:
- /**
- * Default constructor. Point is set to zero.
- */
- ftPoint()
- : x(0), y(0), z(0)
- {}
-
- /**
- * Constructor.
- *
- * @param X
- * @param Y
- * @param Z
- */
- ftPoint( const FTGL_DOUBLE X, const FTGL_DOUBLE Y, const FTGL_DOUBLE Z)
- : x(X), y(Y), z(Z)
- {}
-
- /**
- * Operator == Tests for eqaulity
- *
- * @param a
- * @param b
- * @return
- */
- friend bool operator == ( const ftPoint &a, const ftPoint &b);
-
- /**
- * Operator != Tests for non equality
- *
- * @param a
- * @param b
- * @return
- */
- friend bool operator != ( const ftPoint &a, const ftPoint &b);
-
- /**
- * The point data
- */
- FTGL_DOUBLE x, y, z; // FIXME make private
-
- private:
-};
-
/**
* FTContour class is a container of points that describe a vector font
@@ -128,7 +74,7 @@ class FTGL_EXPORT FTContour
/**
* The list of points in this contour
*/
- typedef FTVector<ftPoint> PointVector;
+ typedef FTVector<FTPoint> PointVector;
PointVector pointList;
private:
@@ -157,14 +103,14 @@ class FTGL_EXPORT FTTesselation
void AddPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
{
- pointList.push_back( ftPoint( x, y, z));
+ pointList.push_back( FTPoint( x, y, z));
}
size_t size() const { return pointList.size();}
GLenum meshType;
- typedef FTVector<ftPoint> PointVector;
+ typedef FTVector<FTPoint> PointVector;
PointVector pointList;
private:
@@ -188,7 +134,7 @@ class FTGL_EXPORT FTMesh
void Error( GLenum e) { err = e;}
GLenum Error() const { return err;}
- typedef FTVector<ftPoint> PointVector;
+ typedef FTVector<FTPoint> PointVector;
PointVector tempPool;
typedef FTVector<FTTesselation*> TesselationVector;
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index d4fac13..cc9dc25 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -7,7 +7,6 @@
#endif
-
void CALLBACK ftglError( GLenum errCode, FTMesh* mesh)
{
mesh->Error( errCode);
@@ -35,23 +34,10 @@ void CALLBACK ftglEnd( FTMesh* mesh)
void CALLBACK ftglCombine( FTGL_DOUBLE coords[3], void* vertex_data[4], GLfloat weight[4], void** outData, FTMesh* mesh)
{
FTGL_DOUBLE* vertex = (FTGL_DOUBLE*)coords;
- mesh->tempPool.push_back( ftPoint( vertex[0], vertex[1], vertex[2]));
+ mesh->tempPool.push_back( FTPoint( vertex[0], vertex[1], vertex[2]));
*outData = &mesh->tempPool[ mesh->tempPool.size() - 1].x;
}
-
-
-//=============================================================================
-
-bool operator == ( const ftPoint &a, const ftPoint &b)
-{
- return((a.x == b.x) && (a.y == b.y) && (a.z == b.z));
-}
-
-bool operator != ( const ftPoint &a, const ftPoint &b)
-{
- return((a.x != b.x) || (a.y != b.y) || (a.z != b.z));
-}
FTMesh::FTMesh()