#include "stdafx.h" int XOsEnd(XPoint &ptPick, DList &lstCurves) { for(int i=0; i &lstCurves) { for(int i=0; i &lstCurves) { int len=lstCurves.Length(); for(int i=0; i &lstCurves) { for(int i=0; i &ss) { switch(nMode) { case OS_END: return XOsEnd(ptPick, ss); case OS_MID: return XOsMid(ptPick, ss); case OS_INT: return XOsInt(ptPick, ss); case OS_NEA: return XOsNea(ptPick, ss); } return OS_NON; } // return: the mode has been use // Now: // ptPick1(WCS) -- both IN/OUT // mask--support LINE,ARC,CIRCLE // mode--support END, MID, INT, NEA // nHalfSize--The aperture half size, when <=0, use last size // bInsideAperture -- Make sure the Osnap point must inside the aperture // bPrio -- 0 Descendent mode, 1 Ascendent TUTIL_IMPEXP int XOsnap(XPoint &ptPick1, int nMode, const RBList &rbMask, ads_real nHalfSize, int bInsideAperture, int bPrior) { static ads_real nHalfAperture=10.0; if(nHalfSize>0.0) nHalfAperture=nHalfSize; XPoint ptPick=ptPick1; XPoint ptLow=Wcs2Ucs(ptPick)-XPoint(nHalfAperture, nHalfAperture), ptUp=Wcs2Ucs(ptPick)+XPoint(nHalfAperture, nHalfAperture); PickSet ss(SS_FREE); if(ss.Get(_T("C"), ptLow, ptUp, rbMask)!=RTNORM) return OS_NON; DList lstCurves; long ssLen=ss.Length(); for(long n=0; n