gwinding.h File Reference

(r1785/r751)

Go to the source code of this file.

Functions

BOOL GWinding (PPOINT pPoints, PBYTE Types, INT32 Length, UINT32 pFlatness, UINT32 &BottomLeftOffset, POINT &BottomLeft)


Function Documentation

BOOL GWinding PPOINT  pPoints,
PBYTE  Types,
INT32  Length,
UINT32  pFlatness,
UINT32 BottomLeftOffset,
POINT BottomLeft
 

BOOL GWinding( PPOINT pPoints, Path PBYTE Types, UINT32 Length, UINT32 pFlatness, Flatness UINT32 &BottomLeftOffset, Offset to bottom left point. POINT &BottomLeft Bottom left most point. ) ;

This call returns information about the winding of a path. The boolean result indicates a clockwise or anticlockwise winding at the bottom left most point. This point is returned and also the offset to either this point or the offset to the curve that contains this point.

No errors should occur as the path is expected to be in a legal state.

Definition at line 237 of file gwinding.cpp.

00245 {
00246     Flatness = pFlatness*27/2 ;
00247     StartPoint = Points = pPoints ;
00248     BottomLeft = PrevPoint = LastPoint = *Points++ ; Types++ ; --Length ;
00249     BottomLeftOffset = 0 ;
00250     Flags = 03 ;
00251     while ( Length>0 )
00252     {
00253         if ( (*Types & PT_MOVETO)==PT_LINETO )
00254         {
00255             DoLine( Points[0] ) ;
00256             Points++ ; Types++ ; --Length ;
00257         }
00258         else /* Curve */
00259         {
00260             FlattenCurve( Points[-1],Points[0],Points[1],Points[2] ) ;
00261             Points+=3 ; Types+=3 ; Length-=3 ;
00262         }
00263     }
00264     if ( BottomLeft.x!=LastPoint.x || BottomLeft.y!=LastPoint.y )
00265         PrevPoint = LastPoint ;
00266     if ( Flags & 01 )
00267         Prev_Point = PrevPoint ;
00268     else if ( Flags & 02 )
00269         Next_Point = *StartPoint ;
00270     pBottomLeftOffset = BottomLeftOffset ;
00271     pBottomLeft = BottomLeft ;
00272     INT32 Sgn = GWSgnMulSubMul( Next_Point.x-BottomLeft.x, Prev_Point.y-BottomLeft.y,
00273                              Prev_Point.x-BottomLeft.x, Next_Point.y-BottomLeft.y ) ;
00274     if ( Sgn )
00275         return Sgn<0 ;
00276     Sgn = Next_Point.x-Prev_Point.x ;
00277     if ( Sgn )
00278         return Sgn<0 ;
00279     Sgn = Prev_Point.y-Next_Point.y ;
00280     return Sgn<0 ;
00281 }


Generated on Sat Nov 10 03:49:11 2007 for Camelot by  doxygen 1.4.4