#include "camtypes.h"
#include <math.h>
#include "pathutil.h"
#include "pathproc.h"
#include "vector.h"
#include "osrndrgn.h"
#include "pen.h"
#include "blobs.h"
#include "fitcurve.h"
#include "layermgr.h"
#include "gclip.h"
#include "grndrgn.h"
#include "XaDraw.h"
#include "cstroke.h"
Go to the source code of this file.
Functions | |
DECLARE_SOURCE ("$Revision: 1492 $") | |
INT32 | FindNonColinear (const DocCoord CoordArray[], const UINT32 &ulNumCoords) |
Support function for IsIsometric Finds the first of three points in the given CoordArray that are not in a straight line. | |
template<class T> | |
BOOL | IsNear (const T &x1, const T &x2, const T &Tolerance) |
Support function for IsIsometric Determines whether two values are near enough to each other to be considered equal. Notes: This is a templated function with <class t>="">. | |
BOOL | Solve3Simultaneous (const CCVector3 &constsX0, const CCVector3 &constsX1, const CCVector3 &constsY0, double &v0, double &v1, double &v2) |
Support function for IsIsometric Determines whether two values are near enough to each other to be considered equal. Notes: This is a templated function with <class t>="">Support function for IsIsometric Solves 3 simultaneous equations for the three values v1,v2,v3. |
|
|
|
Support function for IsIsometric Finds the first of three points in the given CoordArray that are not in a straight line.
Definition at line 9890 of file paths.cpp. 09891 { 09892 UINT32 index = 0; 09893 UINT32 x1,y1,x2,y2; 09894 // Three points are colinear if the vectors between them have a zero cross-product 09895 09896 while (index < ulNumCoords - 2) 09897 { 09898 // Might save time to work out the first two outside the loop 09899 // Depends on number of linear paths really 09900 x1 = CoordArray[index + 1].x - CoordArray[index].x; 09901 y1 = CoordArray[index + 1].y - CoordArray[index].y; 09902 09903 x2 = CoordArray[index + 2].x - CoordArray[index + 1].x; 09904 y2 = CoordArray[index + 2].y - CoordArray[index + 1].y; 09905 09906 if (x1 * y2 != x2 * y1) 09907 { 09908 return index; 09909 } 09910 ++index; 09911 } 09912 09913 return -1; 09914 }
|
|
Support function for IsIsometric Determines whether two values are near enough to each other to be considered equal. Notes: This is a templated function with <class t>="">.
Definition at line 9936 of file paths.cpp.
|
|
Support function for IsIsometric Determines whether two values are near enough to each other to be considered equal. Notes: This is a templated function with <class t>="">Support function for IsIsometric Solves 3 simultaneous equations for the three values v1,v2,v3.
Definition at line 9979 of file paths.cpp. 09980 { 09981 const double Tolerance = 1e-10; 09982 09983 double DivA = (constsX0.v0 - constsX0.v1) * (constsY0.v0 - constsY0.v2) - (constsX0.v0 - constsX0.v2) * (constsY0.v0 - constsY0.v1); 09984 if (IsNear(DivA, 0.0, Tolerance)) 09985 { 09986 return FALSE; 09987 } 09988 09989 double DivB = (constsY0.v0 - constsY0.v1) * (constsX0.v0 - constsX0.v2) - (constsY0.v0 - constsY0.v2) * (constsX0.v0 - constsX0.v1); 09990 if (IsNear(DivB, 0.0, Tolerance)) 09991 { 09992 return FALSE; 09993 } 09994 09995 v0 = ((constsY0.v0 - constsY0.v2) * (constsX1.v0 - constsX1.v1) - (constsY0.v0 - constsY0.v1) * (constsX1.v0 - constsX1.v2)) / DivA; 09996 09997 09998 v1 = ((constsX1.v0 - constsX1.v1) * (constsX0.v0 - constsX0.v2) - (constsX1.v0 - constsX1.v2) * (constsX0.v0 - constsX0.v1)) / DivB; 09999 10000 10001 v2 = constsX1.v0 - v0 * constsX0.v0 - v1 * constsY0.v0; 10002 10003 return TRUE; 10004 }
|