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)); }
protected void PictureMoving(int dx, int dy) { float zoom = Zoom; Single2 moveVector = new Single2(-dx / (zoom * _pixelsPerUnit), dy / (zoom * _pixelsPerUnit)); Origin = _mouseDownOrigin + moveVector; }
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); }
public static Single2 getInstance() { if (instance == null) { return instance = new Single2(); } return instance; }
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); }
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)); }
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)); }
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; }
public static Single2 GetInstance() { if (_mSingle != null) { return(_mSingle); } lock (MyLock) { _mSingle = new Single2(); } return(_mSingle); }
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; }
public Func2(T4 t4, Single1 single1, Single2 single2) { T4 = t4; Single1 = single1; Single2 = single2; }
public Single1(Single2 single2, Single3 single3) { Single2 = single2; Single3 = single3; }
public static void WriteSingle2(this Stream stream, Single2 value, bool reverse = false) { stream.WriteSingle(value.X, reverse); stream.WriteSingle(value.Y, reverse); }
protected override void ImageMouseDown(int x0, int y0, MouseButtons buttons) { base.ImageMouseDown(x0, y0, buttons); _mouseDownOrigin = Origin; }