Esempio n. 1
0
        public override int Compare(CEdge cedge1, CEdge cedge2)
        {
            int intResultDiff = (cedge1.ToCpt.indexID - cedge1.FrCpt.indexID)
                                .CompareTo(cedge2.ToCpt.indexID - cedge2.FrCpt.indexID);
            int intResultFF = cedge1.FrCpt.indexID.CompareTo(cedge2.FrCpt.indexID);

            return(CCmpMethods.HandleTwoResults(intResultDiff, intResultFF));
        }
Esempio n. 2
0
        /// <summary>
        /// Compare two cedges, by coordinates
        /// </summary>
        /// <returns>1, if the first parameter larger than the second one; -1, smaller; 0, equal</returns>
        /// <remarks>First comapre FrCpts. If the two cedges have the same FrCpts, then compare ToCpts.
        /// If they neither have the same FrCpts nor have the same ToCpts,
        /// then compare FrCpt with ToCpt as well as ToCpt with FrCpt to find whether they are equal</remarks>
        public static int CmpCEdgeCoord(CEdge cedge1, CEdge cedge2, bool blnMayFlip = false)
        {
            GetCpts(cedge1, blnMayFlip, out CPoint frcpt1, out CPoint tocpt1);
            GetCpts(cedge2, blnMayFlip, out CPoint frcpt2, out CPoint tocpt2);

            int intResultFF = CmpCptYX(frcpt1, frcpt2);
            int intResultTT = CmpCptYX(tocpt1, tocpt2);

            return(CCmpMethods.HandleTwoResults(intResultFF, intResultTT));
        }
Esempio n. 3
0
        public override int Compare(CEdge cedge1, CEdge cedge2)
        {
            int intSmallGID1 = Math.Min(cedge1.FrCpt.GID, cedge1.ToCpt.GID);
            int intLargeGID1 = Math.Max(cedge1.FrCpt.GID, cedge1.ToCpt.GID);
            int intSmallGID2 = Math.Min(cedge2.FrCpt.GID, cedge2.ToCpt.GID);
            int intLargeGID2 = Math.Max(cedge2.FrCpt.GID, cedge2.ToCpt.GID);

            int intSmallResult = intSmallGID1.CompareTo(intSmallGID2);
            int intLargeResult = intLargeGID1.CompareTo(intLargeGID2);

            return(CCmpMethods.HandleTwoResults(intSmallResult, intLargeResult));
        }
Esempio n. 4
0
        public static int CmpCEdgeGID(CEdge cedge1, CEdge cedge2, bool blnMayFlip = false)
        {
            CPoint frcpt1;
            CPoint tocpt1;

            GetCpts(cedge1, blnMayFlip, out frcpt1, out tocpt1);

            CPoint frcpt2;
            CPoint tocpt2;

            GetCpts(cedge2, blnMayFlip, out frcpt2, out tocpt2);

            int intResultFF = frcpt1.GID.CompareTo(frcpt2.GID);
            int intResultTT = tocpt1.GID.CompareTo(tocpt2.GID);

            return(CCmpMethods.HandleTwoResults(intResultFF, intResultTT));
        }