/// <summary>
        /// 通过弯曲上两节点的点号获取该弯曲的子弯曲
        /// </summary>
        /// <param name="ID1">需获取的子弯曲上的终点之一的点号</param>
        /// <param name="ID1">需获取的子弯曲上的终点之一的点号 2</param>
        public CBend GetSubBend(int ID1, int ID2, string strSide)
        {
            if (ID1 == ID2)
            {
                MessageBox.Show("两个点相同,无法提取弯曲");
                return(null);
            }

            List <CPoint> ptlt     = new List <CPoint>();
            int           intBegin = 0;

            for (int i = 0; i < _CptLt.Count; i++)
            {
                //第一次遇到相同点的时候(intBegin==1),即是需提取弯曲的初始点;第二次遇到相同点时(intBegin==2),即是需提取弯曲的终点
                if (_CptLt[i].ID == ID1 || _CptLt[i].ID == ID2)
                {
                    intBegin = intBegin + 1;
                }
                if (intBegin > 0)
                {
                    ptlt.Add(_CptLt[i]);
                }
                if (intBegin == 2)
                {
                    break;
                }
            }

            CBend CSubBend = new CBend(ptlt, strSide);

            return(CSubBend);
        }
        /// <summary>
        /// 通过弯曲上两节点获取该弯曲的子弯曲
        /// </summary>
        /// <param name="cpt1">需获取的子弯曲上的终点之一</param>
        /// <param name="cpt2">需获取的子弯曲上的终点之一 2</param>
        public CBend GetSubBend(CPoint cpt1, CPoint cpt2, string strSide, double dblVerySmall)
        {
            if (cpt1.Equals2D(cpt2) == true)
            {
                MessageBox.Show("两个点相同,无法提取弯曲");
                return(null);
            }

            List <CPoint> ptlt     = new List <CPoint>();
            int           intBegin = 0;

            for (int i = 0; i < _CptLt.Count; i++)
            {
                //第一次遇到相同点的时候(intBegin==1),即是需提取弯曲的初始点;第二次遇到相同点时(intBegin==2),即是需提取弯曲的终点
                if (_CptLt[i].Equals2D(cpt1, dblVerySmall) == true || _CptLt[i].Equals2D(cpt2, dblVerySmall) == true)
                {
                    intBegin = intBegin + 1;
                }
                if (intBegin > 0)
                {
                    ptlt.Add(_CptLt[i]);
                }
                if (intBegin == 2)
                {
                    break;
                }
            }

            CBend CSubBend = new CBend(ptlt, strSide);

            return(CSubBend);
        }
Beispiel #3
0
 public CPolyline(int intID, CBend pBend, bool blnSetPolyline = false)
     : this(intID, pBend.CptLt, blnSetPolyline)
 {
 }