00001 #ifndef __FTPoint__
00002 #define __FTPoint__
00003
00004 #include <ft2build.h>
00005 #include FT_FREETYPE_H
00006 #include FT_GLYPH_H
00007
00008 #include "FTGL.h"
00009
00013 class FTGL_EXPORT FTPoint
00014 {
00015 public:
00019 FTPoint()
00020 {
00021 values[0] = 0;
00022 values[1] = 0;
00023 values[2] = 0;
00024 }
00025
00033 FTPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
00034 {
00035 values[0] = x;
00036 values[1] = y;
00037 values[2] = z;
00038 }
00039
00045 FTPoint( const FT_Vector& ft_vector)
00046 {
00047 values[0] = ft_vector.x;
00048 values[1] = ft_vector.y;
00049 values[2] = 0;
00050 }
00051
00058 FTPoint& operator += ( const FTPoint& point)
00059 {
00060 values[0] += point.values[0];
00061 values[1] += point.values[1];
00062 values[2] += point.values[2];
00063
00064 return *this;
00065 }
00066
00073 FTPoint operator + ( const FTPoint& point)
00074 {
00075 FTPoint temp;
00076 temp.values[0] = values[0] + point.values[0];
00077 temp.values[1] = values[1] + point.values[1];
00078 temp.values[2] = values[2] + point.values[2];
00079
00080 return temp;
00081 }
00082
00083
00090 FTPoint operator * ( double multiplier)
00091 {
00092 FTPoint temp;
00093 temp.values[0] = values[0] * multiplier;
00094 temp.values[1] = values[1] * multiplier;
00095 temp.values[2] = values[2] * multiplier;
00096
00097 return temp;
00098 }
00099
00100
00108 friend FTPoint operator*( double multiplier, FTPoint& point);
00109
00110
00118 friend bool operator == ( const FTPoint &a, const FTPoint &b);
00119
00127 friend bool operator != ( const FTPoint &a, const FTPoint &b);
00128
00129
00133 operator FTGL_DOUBLE*()
00134 {
00135 return values;
00136 }
00137
00138
00142 void X( FTGL_DOUBLE x) { values[0] = x;};
00143 void Y( FTGL_DOUBLE y) { values[1] = y;};
00144 void Z( FTGL_DOUBLE z) { values[2] = z;};
00145
00146
00150 FTGL_DOUBLE X() const { return values[0];};
00151 FTGL_DOUBLE Y() const { return values[1];};
00152 FTGL_DOUBLE Z() const { return values[2];};
00153
00154 private:
00158 FTGL_DOUBLE values[3];
00159 };
00160
00161 #endif // __FTPoint__
00162