public void UnionCpl(CPolyline other, ref bool isUnioned) { isUnioned = true; var fcptlt = this.CptLt; var ocptlt = other.CptLt; var newcptlt = new List <CPoint>(); if (CCmpMethods.CmpCptYX(fcptlt.Last(), ocptlt.First()) == 0) { newcptlt.AddRange(fcptlt); newcptlt.RemoveLastT(); newcptlt.AddRange(ocptlt); } else if (CCmpMethods.CmpCptYX(fcptlt.Last(), ocptlt.Last()) == 0) { newcptlt.AddRange(fcptlt); newcptlt.RemoveLastT(); var copiedreversedcptlt = CHelpFunc.CopyCptLt(ocptlt); copiedreversedcptlt.Reverse(); newcptlt.AddRange(copiedreversedcptlt); } else if (CCmpMethods.CmpCptYX(fcptlt.First(), ocptlt.First()) == 0) { var copiedreversedcptlt = CHelpFunc.CopyCptLt(ocptlt); copiedreversedcptlt.Reverse(); newcptlt.AddRange(copiedreversedcptlt); newcptlt.RemoveLastT(); newcptlt.AddRange(fcptlt); } else if (CCmpMethods.CmpCptYX(fcptlt.First(), ocptlt.Last()) == 0) { //CPolyline cplCopyOther = other.CopyCpl(); newcptlt.AddRange(ocptlt); newcptlt.RemoveLastT(); newcptlt.AddRange(fcptlt); } else { isUnioned = false; return; } for (int i = 0; i < newcptlt.Count; i++) { newcptlt[i].ID = i; } FormPolyBase(newcptlt); }
/// <summary> /// /// </summary> /// <param name="cedgeComponent"></param> /// <param name="blnNext"></param> /// <returns></returns> private static CEdge TraverseToGetCorrectCEdgeComponent(CEdge cedgeComponent, CPoint cpt) { var currentcedge = cedgeComponent; do { if (CCmpMethods.CmpCptYX(currentcedge.FrCpt, cpt) == 0) { return(currentcedge); } currentcedge = currentcedge.cedgeNext; } while (currentcedge.GID != cedgeComponent.GID); throw new ArgumentException("we cannot find an appropriate edge!"); }
/// <summary> /// Makes a planar checks for if the points is spatially equal to another point. /// </summary> /// <param name="other">Point to check against</param> /// <returns>True if X and Y values are the same</returns> public bool Equals2D(CPoint other) { return(CCmpMethods.ConvertCmpToBool(CCmpMethods.CmpCptYX(this, other))); }
/// <summary> /// Makes a planar checks for if the points is spatially equal to another point. /// </summary> /// <param name="other">Point to check against</param> /// <returns>True if X and Y values are the same</returns> public bool Equals2D(CPoint other, double dblVerySmall) { return(CCmpMethods.ConvertCmpToBool(CCmpMethods.CmpCptYX(this, other))); }
//public virtual void JudgeAndSetZToZero() //{ // _pPoint.Z = 0; // this.Z = 0; //} public int Compare(CPoint other) { return(CCmpMethods.CmpCptYX(this, other)); }