Beispiel #1
0
 public void AddRange(IntPolyline pt)
 {
     int sign = 0;
     for (int i = MidLength; i < _MidPoints.Length; i++)
     {
         if (sign < pt.GetMidLength())
         {
             _MidPoints[i] = pt.MidPoints[sign];
             sign++; MidLength++;
         }
         else
         {
             return;
         }
     }
 }
Beispiel #2
0
        public int Connet(IntPolyline pl2)
        {
            //this func does nothing for colosed polyline(return 4 or 5)
            if (pl2.GetMidLength() + this.GetMidLength() > this._MidPoints.Length) return 0;
            if (pl2.From == this.To)
            {
                if (pl2.To == this.From) return 5;
                this.To = pl2.To;
                this.Add(pl2.From);
                this.AddRange(pl2);

                return 1;
            }
            if (pl2.To == this.From)
            {
                if (pl2.From == this.To) return 5;
                pl2.To = this.To;
                pl2.Add(this.From);
                pl2.AddRange(this);
                this.From = pl2.From;
                this.To = pl2.To;
                this._MidPoints = pl2.MidPoints;
                this.MidLength = pl2.GetMidLength();
                return 2;
            }
            if (pl2.To == this.To)
            {
                if (pl2.From == this.From) return 6;
                pl2.Reverse();
                this.To = pl2.To;
                this.Add(pl2.From);
                this.AddRange(pl2);

                return 3;
            }
            if (pl2.From == this.From)
            {
                if (pl2.To == this.To) return 6;
                pl2.Reverse();
                pl2.To = this.To;
                pl2.Add(this.From);
                pl2.AddRange(this);
                this.From = pl2.From;
                this.To = pl2.To;
                this._MidPoints = pl2.MidPoints;
                this.MidLength = pl2.GetMidLength();
                return 4;
            }

            return 7;
        }
Beispiel #3
0
 public IntPolyline(IntPolyline pl2)
 {
     this.From = pl2.From;
     this.To = pl2.To;
     this._MidPoints = pl2.MidPoints;
     this.MidLength = pl2.GetMidLength();
 }