You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: LgGeometry.h
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of LgGeometry.h
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __LG__GEOMETRY__H__INCLUDED__
|
|
#define __LG__GEOMETRY__H__INCLUDED__
|
|
|
|
#include "LgAux.h"
|
|
|
|
class CLgGeometry
|
|
{
|
|
public:
|
|
static BOOL PtInLine( CLgDPoint p1, CLgDPoint p2, CLgDPoint p3, double nQuality );
|
|
|
|
#ifdef _AFXDLL
|
|
static BOOL PtInLine( CPoint p1, CPoint p2, CPoint p3, INT nQuality )
|
|
{
|
|
CLgDPoint dp1( p1.x, p1.y );
|
|
CLgDPoint dp2( p2.x, p2.y );
|
|
CLgDPoint dp3( p3.x, p3.y );
|
|
return PtInLine( dp1, dp2, dp3, (double)nQuality );
|
|
}
|
|
#endif
|
|
|
|
public:
|
|
typedef enum
|
|
{
|
|
LGCT_ERROR = -4,
|
|
LGCT_NOCROSS = -3,
|
|
LGCT_PARALLEL = -2,
|
|
LGCT_COLINEAR = -1,
|
|
LGCT_CROSS = 0,
|
|
LGCT_CROSS_P11 = 0x01,
|
|
LGCT_CROSS_P12 = 0x02,
|
|
LGCT_CROSS_P21 = 0x04,
|
|
LGCT_CROSS_P22 = 0x08,
|
|
}LG_CROSSTYPE;
|
|
|
|
public:
|
|
static LG_CROSSTYPE CrossProduct( CLgDPoint &p11, CLgDPoint &p12, CLgDPoint &p21, CLgDPoint &p22, CLgDPoint *pP, BOOL bCheckBounds = TRUE );
|
|
static LG_CROSSTYPE CrossLines( CLgDPoint &dp11, CLgDPoint &dp12, CLgDPoint &dp21, CLgDPoint &dp22, CLgDPoint *pDP );
|
|
|
|
public:
|
|
static BOOL CmpE( double a, double b, double q );
|
|
static BOOL CmpL( double a, double b, double q );
|
|
static BOOL CmpB( double a, double b, double q );
|
|
|
|
private:
|
|
static LG_CROSSTYPE CrossProduct_( CLgDPoint &p11, CLgDPoint &p12, CLgDPoint &p21, CLgDPoint &p22, CLgDPoint *pP, BOOL bCheckBounds );
|
|
static BOOL PtInLine_( CLgDPoint p1, CLgDPoint p2, CLgDPoint p3, double nQuality );
|
|
};
|
|
|
|
#endif
|