Ejemplo n.º 1
0
        //Загрузить в бинарном формате
        public static Shape LoadBinary(BinaryReader br, DelegateContainer _dlc)
        {
            byte Signature = br.ReadByte();

            switch (Signature)
            {
            case 0:
                return(new sCross(_dlc, br.ReadDouble(), br.ReadDouble()));

            case 1:
                return(new sLine(_dlc, br.ReadDouble(), br.ReadDouble(), br.ReadDouble(), br.ReadDouble()));

            case 2:
                return(new sCircle(_dlc, br.ReadDouble(), br.ReadDouble(), br.ReadDouble()));

            case 3:
                return(new sRect(_dlc, br.ReadDouble(), br.ReadDouble(), br.ReadDouble(), br.ReadDouble()));

            default: return(null);
            }
        }
Ejemplo n.º 2
0
 //Загрузить в бинарном формате
 public static Shape LoadBinary(BinaryReader br, DelegateContainer _dlc)
 {
     byte Signature = br.ReadByte();
     switch (Signature)
     {
         case 0:
             return new sCross(_dlc, br.ReadDouble(), br.ReadDouble());
         case 1:
             return new sLine(_dlc, br.ReadDouble(), br.ReadDouble(), br.ReadDouble(), br.ReadDouble());
         case 2:
             return new sCircle(_dlc, br.ReadDouble(), br.ReadDouble(), br.ReadDouble());
         case 3:
             return new sRect(_dlc, br.ReadDouble(), br.ReadDouble(), br.ReadDouble(), br.ReadDouble());
         default: return null;
     }
 }
Ejemplo n.º 3
0
 protected Shape(DelegateContainer _dlc)
 {
     this.dlc = _dlc;
 }
Ejemplo n.º 4
0
 public sCross(DelegateContainer _dlc, double x, double y)
     : base(_dlc)
 {
     Center = new fpoint(x, y);
 }
Ejemplo n.º 5
0
 public sCross(DelegateContainer _dlc, int x, int y)
     : base(_dlc)
 {
     Center = base.dlc.fScreenToReal(new Point(x, y));
 }
Ejemplo n.º 6
0
 public sCross(DelegateContainer _dlc, double x, double y)
     : base(_dlc)
 {
     Center = new fpoint(x, y);
 }
Ejemplo n.º 7
0
 public sCircle(DelegateContainer _dlc, Point Down, Point Up)
     : base(_dlc)
 {
     this.Center = base.dlc.fScreenToReal(Down);
     this.Radius = fpoint.GetRasst(base.dlc.fScreenToReal(Down), base.dlc.fScreenToReal(Up));
 }
Ejemplo n.º 8
0
 public sRect(DelegateContainer _dlc, Point Down, Point Up)
     : base(_dlc)
 {
     this.Up = base.dlc.fScreenToReal(Down);
     this.Down = base.dlc.fScreenToReal(Up);
 }
Ejemplo n.º 9
0
 public sRect(DelegateContainer _dlc, double x1, double y1, double x2, double y2)
     : base(_dlc)
 {
     this.Up   = new fpoint(x1, y1);
     this.Down = new fpoint(x2, y2);
 }
Ejemplo n.º 10
0
 public sRect(DelegateContainer _dlc, Point Down, Point Up)
     : base(_dlc)
 {
     this.Up   = base.dlc.fScreenToReal(Down);
     this.Down = base.dlc.fScreenToReal(Up);
 }
Ejemplo n.º 11
0
 public sCircle(DelegateContainer _dlc, double x1, double y1, double r)
     : base(_dlc)
 {
     this.Center = new fpoint(x1, y1);
     this.Radius = r;
 }
Ejemplo n.º 12
0
 public sCircle(DelegateContainer _dlc, Point Down, Point Up)
     : base(_dlc)
 {
     this.Center = base.dlc.fScreenToReal(Down);
     this.Radius = fpoint.GetRasst(base.dlc.fScreenToReal(Down), base.dlc.fScreenToReal(Up));
 }
Ejemplo n.º 13
0
 public sLine(DelegateContainer _dlc, double x1, double y1, double x2, double y2)
     : base(_dlc)
 {
     fpBeg = new fpoint(x1, y1);
     fpEnd = new fpoint(x2, y2);
 }
Ejemplo n.º 14
0
 public sLine(DelegateContainer _dlc, Point p1, Point p2)
     : base(_dlc)
 {
     fpBeg = base.dlc.fScreenToReal(p1);
     fpEnd = base.dlc.fScreenToReal(p2);
 }
Ejemplo n.º 15
0
 public sLine(DelegateContainer _dlc, Point p1, Point p2)
     : base(_dlc)
 {
     fpBeg = base.dlc.fScreenToReal(p1);
     fpEnd = base.dlc.fScreenToReal(p2);
 }
Ejemplo n.º 16
0
 public sLine(DelegateContainer _dlc, double x1, double y1, double x2, double y2)
     : base(_dlc)
 {
     fpBeg = new fpoint(x1, y1);
     fpEnd = new fpoint(x2, y2);
 }
Ejemplo n.º 17
0
 protected Shape(DelegateContainer _dlc)
 {
     this.dlc = _dlc;
 }
Ejemplo n.º 18
0
 public sRect(DelegateContainer _dlc, double x1, double y1, double x2, double y2)
     : base(_dlc)
 {
     this.Up = new fpoint(x1, y1);
     this.Down = new fpoint(x2, y2);
 }
Ejemplo n.º 19
0
        //Формирует контейнер с функциями, которые нужны для отрисовки фигур
        private DelegateContainer GetDeleateContainer()
        {
            DelegateContainer dlc = new DelegateContainer();
            dlc.fGetGraphics = new DelegateContainer.dGetGraphics(GetGraphics);
            dlc.fRealToSreeen = new DelegateContainer.dRealToScreen(RealToScreen);
            dlc.fScreenToReal = new DelegateContainer.dScreenToReal(ScreenToReal);

            return dlc;
        }
Ejemplo n.º 20
0
 public sCircle(DelegateContainer _dlc, double x1, double y1, double r)
     : base(_dlc)
 {
     this.Center = new fpoint(x1, y1);
     this.Radius = r;
 }
Ejemplo n.º 21
0
 public sCross(DelegateContainer _dlc, int x, int y)
     : base(_dlc)
 {
     Center = base.dlc.fScreenToReal(new Point(x, y));
 }