Esempio n. 1
0
        public static Transform ReadTransform(this Stream stream, bool reverse = false)
        {
            Single2   translation = ReadSingle2(stream, reverse);
            Single2x2 rotation    = ReadSingle2x2(stream, reverse);

            return(new Transform(translation, rotation));
        }
Esempio n. 2
0
        protected void PictureMoving(int dx, int dy)
        {
            float   zoom       = Zoom;
            Single2 moveVector = new Single2(-dx / (zoom * _pixelsPerUnit), dy / (zoom * _pixelsPerUnit));

            Origin = _mouseDownOrigin + moveVector;
        }
Esempio n. 3
0
        public static void WriteSingle2(this XmlElement rootElement, string name, Single2 value)
        {
            XmlElement element = rootElement.GetOrCreateElement(name);

            element.WriteSingle(_XId, value.X);
            element.WriteSingle(_YId, value.Y);
        }
Esempio n. 4
0
 public static Single2 getInstance()
 {
     if (instance == null)
     {
         return instance = new Single2();
     }
     return instance;
 }
Esempio n. 5
0
 public Scoped2(T4 t4, Scoped3 scoped3, Func2 func2, Single2 single2, Single3 single3)
 {
     T4      = t4;
     Scoped3 = scoped3;
     Func2   = func2;
     Single2 = single2;
     Single3 = single3;
 }
 public static Single2 getInstance()
 {
     if (instance == null)
     {
         return(instance = new Single2());
     }
     return(instance);
 }
Esempio n. 7
0
        public PointF ToScreen(Single2 pos)
        {
            Size  size = pictureBox.Size;
            float x    = 0.5f * size.Width + (_zoom * _pixelsPerUnit * (pos.X - _origin.X));
            float y    = 0.5f * size.Height - (_zoom * _pixelsPerUnit * (pos.Y - _origin.Y));

            return(new PointF(x, y));
        }
Esempio n. 8
0
        public static Single2 ReadSingle2(this XmlElement rootElement, string name, Single2 defaultValue)
        {
            XmlElement element = rootElement.GetOrCreateElement(name);
            float      x       = element.ReadSingle(_XId, defaultValue.X);
            float      y       = element.ReadSingle(_YId, defaultValue.Y);

            return(new Single2(x, y));
        }
Esempio n. 9
0
 public T2(T3 t3, T4 t4, Scoped1 scoped1, Scoped3 scoped3, Single1 single1, Single2 single2)
 {
     T3      = t3;
     T4      = t4;
     Scoped1 = scoped1;
     Scoped3 = scoped3;
     Single1 = single1;
     Single2 = single2;
 }
Esempio n. 10
0
 public static Single2 GetInstance()
 {
     if (_mSingle != null)
     {
         return(_mSingle);
     }
     lock (MyLock)
     {
         _mSingle = new Single2();
     }
     return(_mSingle);
 }
Esempio n. 11
0
        private PointF ToScreenOld(Single2 pos)
        {
            const float margin = 3f;
            Size        size = pictureBox.Size;
            float       a = (size.Width - 2f * margin) / (World.XHi - World.XLo);
            float       b = (size.Height - 2f * margin) / (World.YHi - World.YLo);
            float       x, y;

            if (a > b)
            {
                x = margin + b * (pos.X - World.XLo);
                y = margin + b * (pos.Y - World.YLo);
            }
            else
            {
                x = margin + a * (pos.X - World.XLo);
                y = margin + a * (pos.Y - World.YLo);
            }
            return(new PointF(x, y));
        }
 public R(
     Single1 single1,
     Single2 single2,
     Scoped1 scoped1,
     Scoped2 scoped2,
     Trans1 trans1,
     Trans2 trans2,
     ScopedFac1 scopedFac1,
     ScopedFac2 scopedFac2,
     SingleObj1 singleObj1,
     SingleObj2 singleObj2
     )
 {
     Single1    = single1;
     Single2    = single2;
     Scoped1    = scoped1;
     Scoped2    = scoped2;
     Trans1     = trans1;
     Trans2     = trans2;
     ScopedFac1 = scopedFac1;
     ScopedFac2 = scopedFac2;
     SingleObj1 = singleObj1;
     SingleObj2 = singleObj2;
 }
Esempio n. 13
0
 public Func2(T4 t4, Single1 single1, Single2 single2)
 {
     T4      = t4;
     Single1 = single1;
     Single2 = single2;
 }
Esempio n. 14
0
 public Single1(Single2 single2, Single3 single3)
 {
     Single2 = single2;
     Single3 = single3;
 }
Esempio n. 15
0
 public static void WriteSingle2(this Stream stream, Single2 value, bool reverse = false)
 {
     stream.WriteSingle(value.X, reverse);
     stream.WriteSingle(value.Y, reverse);
 }
Esempio n. 16
0
 protected override void ImageMouseDown(int x0, int y0, MouseButtons buttons)
 {
     base.ImageMouseDown(x0, y0, buttons);
     _mouseDownOrigin = Origin;
 }