Files

48 lines
899 B
C++
Raw Permalink Normal View History

2026-10-04 00:04:20 +08:00
//-----------------------------------------------------------------------------+
2026-09-28 15:28:50 +08:00
// Copyright (C), 1998-2007, SH Software Co. Ltd.
2026-10-04 00:04:20 +08:00
// = FileName : XLineDist 类
2026-09-28 15:28:50 +08:00
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
2026-10-04 00:04:20 +08:00
// = Description: XLineDist 类定义
2026-09-28 15:28:50 +08:00
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "XLineDist.h"
int XLineDist::Compare(const XLineDist *p1, const XLineDist *p2)
{
if (p1->nDist < _DIST_SNAP)
{
return 1;
}
if (p2->nDist < _DIST_SNAP)
{
return -1;
}
if (fabs(p1->nDist - p2->nDist) < _DIST_SNAP)
{
return 0;
}
if (p1->nDist > p2->nDist)
{
return 1;
}
return -1;
}
XLineDist::XLineDist(ads_real nD, const XPoint &pt1, const XPoint &pt2)
: nDist(nD), ptLocation1(pt1), ptLocation2(pt2)
{
}
XLineDist::~XLineDist()
{
}