Esempio n. 1
0
 public PointHandle(Ele e, string o, PointWrapper p)
 {
     op          = o;
     FillColor   = Color.BlueViolet;
     linkedPoint = p;
     el          = e;
     RePosition(e);
 }
Esempio n. 2
0
 public NewPointHandle(Ele e, string o, PointWrapper p, int i)
 {
     index       = i;
     op          = o;
     FillColor   = Color.YellowGreen;
     linkedPoint = p;
     el          = e;
     RePosition(e);
 }
Esempio n. 3
0
        public void Setup(PointSet el)
        {
            if (rot)
            {
                handles.Add(new RotHandle(this, "ROT"));
            }

            PointWrapper prec = null;
            int          c    = 0;
            int          minx = 0;
            int          miny = 0;
            int          maxx = 0;
            int          maxy = 0;

            foreach (PointWrapper p in el.points)
            {
                c++;
                handles.Add(new PointHandle(this, "POLY", p));
                if (prec != null)
                {
                    minx = Math.Min(p.X, prec.X);
                    miny = Math.Min(p.Y, prec.Y);
                    maxx = Math.Max(p.X, prec.X);
                    maxy = Math.Max(p.Y, prec.Y);
                    PointWrapper newP = new PointWrapper(minx + ((maxx - minx) / 2), miny + ((maxy - miny) / 2));
                    handles.Add(new NewPointHandle(this, "NEWP", newP, c));
                }
                prec = p;
            }

            if (c > 0)
            {
                PointWrapper newP = new PointWrapper(prec.X + 7, prec.Y + 7);
                handles.Add(new NewPointHandle(this, "NEWP", newP, c + 1));
            }

            //SE
            handles.Add(new RedimHandle(this, "SE"));
            //S
            handles.Add(new RedimHandle(this, "S"));
            //E
            handles.Add(new RedimHandle(this, "E"));
            //W
            handles.Add(new RedimHandle(this, "W"));
            //SW
            handles.Add(new RedimHandle(this, "SW"));
            //NW
            handles.Add(new RedimHandle(this, "NW"));
            //N
            handles.Add(new RedimHandle(this, "N"));
            //NE
            handles.Add(new RedimHandle(this, "NE"));
        }
Esempio n. 4
0
        public void ReCreateCreationHandles(PointSet el)
        {
            ArrayList tmp = new ArrayList();

            foreach (Handle h in handles)
            {
                if (h is NewPointHandle)
                {
                    tmp.Add(h);
                }
            }
            foreach (Handle h in tmp)
            {
                handles.Remove(h);
            }

            PointWrapper prec = null;
            int          c    = 0;
            int          minx = 0;
            int          miny = 0;
            int          maxx = 0;
            int          maxy = 0;

            foreach (PointWrapper p in el.points)
            {
                c++;
                if (prec != null)
                {
                    minx = Math.Min(p.X, prec.X);
                    miny = Math.Min(p.Y, prec.Y);
                    maxx = Math.Max(p.X, prec.X);
                    maxy = Math.Max(p.Y, prec.Y);
                    PointWrapper newP = new PointWrapper(minx + (int)((maxx - minx) / 2), miny + (int)((maxy - miny) / 2));
                    handles.Add(new NewPointHandle(this, "NEWP", newP, c));
                }
                prec = p;
            }

            if (c > 0)
            {
                PointWrapper newP = new PointWrapper(prec.X + 7, prec.Y + 7);
                handles.Add(new NewPointHandle(this, "NEWP", newP, c + 1));
            }
        }
Esempio n. 5
0
 public void SetRealPoint(PointWrapper p)
 {
     realPoint = p;
 }