protected static void SetCpbAngleDiffLt(CPolyBase cpb) { var cedgelt = cpb.CEdgeLt; var dblAngleDiffLt = new List <double>(cedgelt.Count); dblAngleDiffLt.Add(CGeoFunc.CalAngle_Counterclockwise (cedgelt.Last().dblAxisAngle, cedgelt[0].dblAxisAngle)); for (int i = 0; i < cedgelt.Count - 1; i++) { dblAngleDiffLt.Add(CGeoFunc.CalAngle_Counterclockwise (cedgelt[i].dblAxisAngle, cedgelt[i + 1].dblAxisAngle)); } cpb.dblAngleDiffLt = dblAngleDiffLt; }
public virtual bool IsIntersectWith(CPolyBase pGeo, bool blnTouchBothEnds = false, bool blnTouchEndEdge = false, bool blnOverlap = false) { foreach (var cedge in this.CEdgeLt) { foreach (var othercedge in pGeo.CEdgeLt) { if (cedge.IsIntersectWith(othercedge, blnTouchBothEnds, blnTouchEndEdge, blnOverlap)) { return(true); } } } return(false); }
public virtual CptEdgeDis CalMinDis(CPolyBase pGeo, bool blnCheckIntersect = true, bool blnTouchBothEnds = false, bool blnTouchEndEdge = false, bool blnOverlap = false) { if (blnCheckIntersect == true) { if (IsIntersectWith(pGeo, blnTouchBothEnds, blnTouchEndEdge, blnOverlap)) { throw new ArgumentOutOfRangeException("I haven't considered this case!"); } } return(CHelpFunc.Min( CalMinDisCptLtCEdgeLt(this.CptLt, pGeo.CEdgeLt), CalMinDisCptLtCEdgeLt(pGeo.CptLt, this.CEdgeLt), ptedgedis => ptedgedis.dblDis)); }