FTContour.h

Go to the documentation of this file.
00001 #ifndef     __FTContour__
00002 #define     __FTContour__
00003 
00004 #include "FTPoint.h"
00005 #include "FTVector.h"
00006 #include "FTGL.h"
00007 
00008 
00009 /**
00010  * FTContour class is a container of points that describe a vector font
00011  * outline. It is used as a container for the output of the bezier curve
00012  * evaluator in FTVectoriser.
00013  *
00014  * @see FTOutlineGlyph
00015  * @see FTPolyGlyph
00016  * @see FTPoint
00017  */
00018 class FTGL_EXPORT FTContour
00019 {
00020     public:
00021         /**
00022          * Constructor
00023          *
00024          * @param contour
00025          * @param pointTags
00026          * @param numberOfPoints
00027          */
00028         FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOfPoints);
00029 
00030         /**
00031          * Destructor
00032          */
00033         ~FTContour()
00034         {
00035             pointList.clear();
00036         }
00037         
00038         /**
00039          * Return a point at index.
00040          *
00041          * @param index of the point in the curve.
00042          * @return const point reference
00043          */
00044         const FTPoint& Point( unsigned int index) const { return pointList[index];}
00045 
00046         /**
00047          * How many points define this contour
00048          *
00049          * @return the number of points in this contour
00050          */
00051         size_t PointCount() const { return pointList.size();}
00052 
00053     private:
00054         /**
00055          * Add a point to this contour. This function tests for duplicate
00056          * points.
00057          *
00058          * @param point The point to be added to the contour.
00059          */
00060         inline void AddPoint( FTPoint point);
00061         
00062         inline void AddPoint( float x, float y);
00063         
00064         /**
00065          * De Casteljau (bezier) algorithm contributed by Jed Soane
00066          * Evaluates a quadratic or conic (second degree) curve
00067          */
00068         inline void evaluateQuadraticCurve();
00069 
00070         /**
00071          * De Casteljau (bezier) algorithm contributed by Jed Soane
00072          * Evaluates a cubic (third degree) curve
00073          */
00074         inline void evaluateCubicCurve();
00075 
00076         /**
00077          *  The list of points in this contour
00078          */
00079         typedef FTVector<FTPoint> PointVector;
00080         PointVector pointList;
00081         
00082         /**
00083          * 2D array storing values of de Casteljau algorithm.
00084          */
00085         float controlPoints[4][2];
00086 };
00087 
00088 #endif // __FTContour__

Generated on Tue Jul 5 14:16:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1