public bool IsDiff(LineAAVertex val)
 {
     int dx = val.x - x;
     int dy = val.y - y;
     if ((dx + dy) == 0)
     {
         return false;
     }
     return (len = AggBasics.uround(Math.Sqrt(dx * dx + dy * dy))) > SIGDIFF;
 }
        public bool IsDiff(LineAAVertex val)
        {
            int dx = val.x - x;
            int dy = val.y - y;

            if ((dx + dy) == 0)
            {
                return(false);
            }
            return((len = AggBasics.uround(Math.Sqrt(dx * dx + dy * dy))) > SIGDIFF);
        }
Example #3
0
        public bool IsDiff(LineAAVertex val)
        {
            //*** NEED 64 bits long
            long dx = val.x - x;
            long dy = val.y - y;

            if ((dx + dy) == 0)
            {
                return(false);
            }
            return((len = AggMath.uround(Math.Sqrt(dx * dx + dy * dy))) > SIGDIFF);
        }
 public void AddVertex(LineAAVertex val)
 {
     int count = list.Count;
     if (count > 1)
     {
         var innerArray = list.Array;
         if (!innerArray[count - 2].IsDiff(innerArray[count - 1]))
         {
             list.RemoveLast();
         }
     }
     list.AddVertex(val);
 }
Example #5
0
        public void AddVertex(LineAAVertex val)
        {
            int count = list.Count;

            if (count > 1)
            {
                var innerArray = list.Array;
                if (!innerArray[count - 2].IsDiff(innerArray[count - 1]))
                {
                    list.RemoveLast();
                }
            }
            list.AddVertex(val);
        }
Example #6
0
        public void Close(bool closed)
        {
            //----------------------
            //iter backward
            int count      = list.Count;
            var innerArray = list.Array;

            while (count > 1)
            {
                if (innerArray[count - 2].IsDiff(innerArray[count - 1]))
                {
                    break;
                }
                else
                {
                    LineAAVertex t = list[count - 1];
                    list.RemoveLast();
                    ModifyLast(t);
                    count--;
                }
            }


            if (closed)
            {
                //if close figure
                count = list.Count;
                var first = innerArray[0];
                while (count > 1)
                {
                    if (innerArray[count - 1].IsDiff(first))
                    {
                        break;
                    }
                    count--;
                    list.RemoveLast();
                }
            }
        }
Example #7
0
 public void ModifyLast(LineAAVertex val)
 {
     list.RemoveLast();
     AddVertex(val);
 }
 public void ModifyLast(LineAAVertex val)
 {
     list.RemoveLast();
     AddVertex(val);
 }