//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, SH Software Co. Ltd. // = FileName : XPolyDist 类 // = Version : ver2.0 // = Author : zjq // = CreateDate : 2002-09-09 // = Description: XPolyDist 类定义 // = Maintainers: // //-----------------------------------------------------------------------------+ #include "StdAfx.h" #include "XPolyDist.h" XPolyDist::XPolyDist(ads_real nD, int n1, int n2, const XPoint &pt1, const XPoint &pt2) : nDist(nD), nIndex1(n1), nIndex2(n2), ptLocation1(pt1), ptLocation2(pt2) { } XPolyDist::XPolyDist() { } XPolyDist::~XPolyDist() { } // nDist=0.0 为最小 int XPolyDist::Compare(const XPolyDist *p1, const XPolyDist *p2) { if (fabs(p1->nDist - p2->nDist) < _DIST_SNAP) { return 0; } if(p1->nDist > p2->nDist) { return 1; } return -1; }