ccstruct/vecfuncs.cpp File Reference

#include "mfcpch.h"
#include "vecfuncs.h"

Go to the source code of this file.

Functions


Function Documentation

int direction ( EDGEPT point  ) 

Show if the line is going in the positive or negative X direction.

direction to return

prev point

next point

Definition at line 34 of file vecfuncs.cpp.

References edgeptstruct::next, edgeptstruct::pos, edgeptstruct::prev, and TPOINT::x.

Referenced by add_new_edge(), new_max_point(), new_min_point(), print_dawg_node(), and prioritize_points().

00034                              {
00035   int dir;                       
00036   EDGEPT *prev;                  
00037   EDGEPT *next;                  
00039   dir = 0;
00040   prev = point->prev;
00041   next = point->next;
00042 
00043   if (((prev->pos.x <= point->pos.x) &&
00044     (point->pos.x < next->pos.x)) ||
00045     ((prev->pos.x < point->pos.x) && (point->pos.x <= next->pos.x)))
00046     dir = 1;
00047 
00048   if (((prev->pos.x >= point->pos.x) &&
00049     (point->pos.x > next->pos.x)) ||
00050     ((prev->pos.x > point->pos.x) && (point->pos.x >= next->pos.x)))
00051     dir = -1;
00052 
00053   return dir;
00054 }


Generated on Wed Feb 28 19:49:16 2007 for Tesseract by  doxygen 1.5.1