public void TestEqualOperator() { var s1 = new QPointF(3, 7); var s2 = new QPointF(3, 7); Assert.AreEqual(s1, s2); }
public void TestEmptyConstructor() { var s = new QPointF(); Assert.AreEqual(0, s.X); Assert.AreEqual(0, s.Y); }
public void TestIntegerConstructor() { var s = new QPointF(5, 10); Assert.AreEqual(5, s.X); Assert.AreEqual(10, s.Y); }
public void TestManhattanLength() { var s1 = new QPointF(3, 7); var res = s1.ManhattanLength; Assert.AreEqual(10, res); }
public void BeginMove(QPointF pos) { m_MoveAnimationTimeLine.Stop(); m_MoveAnimation.SetPosAt(0, base.Pos()); m_MoveAnimation.SetPosAt(1, pos); m_MoveAnimationTimeLine.Start(); }
public unsafe void TestRy() { var s1 = new QPointF(3, 7); double *res = s1.Ry; Assert.AreEqual(7, *res); }
public void TestDotProduct() { var s1 = new QPointF(3, 7); var s2 = new QPointF(-1, 4); var dot = QPointF.DotProduct(s1, s2); Assert.AreEqual(25, dot); }
public void TestX() { var s1 = new QPointF(3, 7); var res = s1.X; Assert.AreEqual(3, res); }
public void TestY() { var s1 = new QPointF(3, 7); var res = s1.Y; Assert.AreEqual(7, res); }
public void TestDivOperator() { var s1 = new QPointF(3, 7); var res = s1 / 1.0; Assert.AreEqual(3, res.X); Assert.AreEqual(7, res.Y); }
public void TestSubQPointFOperator() { var s1 = new QPointF(3, 7); var res = -s1; Assert.AreEqual(-3, res.X); Assert.AreEqual(-7, res.Y); }
public void TestAddQPointFOperator() { var s1 = new QPointF(3, 7); var res = +s1; Assert.AreEqual(3, res.X); Assert.AreEqual(7, res.Y); }
public void TestMultIntRevOperator() { var s1 = new QPointF(3, 7); var res = 5 * s1; Assert.AreEqual(15, res.X); Assert.AreEqual(35, res.Y); }
public void TestMultDoubleOperator() { var s1 = new QPointF(3, 7); var res = s1 * 5.0; Assert.AreEqual(15, res.X); Assert.AreEqual(35, res.Y); }
public void TestDivEqualOperator() { var s1 = new QPointF(-3, 10); s1 /= 2.5; Assert.AreEqual(-1.2, s1.X); Assert.AreEqual(4, s1.Y); }
public void TestMultiEqualDoubleOperator() { var s1 = new QPointF(3, 7); s1 *= 5.0; Assert.AreEqual(15, s1.X); Assert.AreEqual(35, s1.Y); }
void DrawShapes(QPainter painter) { painter.SetRenderHint(QPainter.RenderHint.Antialiasing); painter.Pen = new QPen(new QBrush(new QColor("Gray")), 1); painter.Brush = new QColor("Gray"); var path = new QPainterPath(); path.MoveTo(5, 5); path.CubicTo(40, 5, 50, 50, 99, 99); path.CubicTo(5, 99, 50, 50, 5, 5); painter.DrawPath(path); painter.DrawPie(130, 20, 90, 60, 30 * 16, 120 * 16); painter.DrawChord(240, 30, 90, 60, 0, 16 * 180); var rectangle = new QRect(new QPoint(20, 120), new QSize(80, 50)); painter.DrawRoundedRect(rect: rectangle, xRadius: 10, yRadius: 10); // to be implemented //var points = new List<QPoint>(); //points.Add ( new QPoint ( 130, 140 ) ); //points.Add ( new QPoint ( 180, 170 ) ); //points.Add ( new QPoint ( 180, 140 ) ); //points.Add ( new QPoint ( 220, 110 ) ); //points.Add ( new QPoint ( 140, 100 ) ); //// http://doc.qt.io/qt-5/qpolygon.html#QPolygon-2 , we should be able to pase point list //var polygon = new QPolygon(points); //painter.DrawPolygon ( polygon ); // this is workaround for DrawPolygon unsafe { var polygon = new QPolygon(); var points = new int[] { 130, 140, 180, 170, 180, 140, 220, 110, 140, 100 }; fixed(int *point = points) { polygon.SetPoints(points.Length / 2, ref *point); } painter.DrawPolygon(polygon); } painter.DrawRect(250, 110, 60, 60); var baseline = new QPointF(20, 250); var font = new QFont("Georgia", 55); var forntPath = new QPainterPath(); forntPath.AddText(baseline, font, "Q"); painter.DrawPath(forntPath); painter.DrawEllipse(140, 200, 60, 60); painter.DrawEllipse(240, 200, 90, 60); }
public void TestAddEqualOperator() { var s1 = new QPointF(3, 7); var s2 = new QPointF(-1, 4); s1 += s2; Assert.AreEqual(2, s1.X); Assert.AreEqual(11, s1.Y); }
public void TestAddQPointFsOperator() { var s1 = new QPointF(3, 7); var s2 = new QPointF(-1, 4); var res = s1 + s2; Assert.AreEqual(2, res.X); Assert.AreEqual(11, res.Y); }
public void TestSubQPointFsOperator() { var s1 = new QPointF(3, 7); var s2 = new QPointF(-1, 4); var res = s1 - s2; Assert.AreEqual(4, res.X); Assert.AreEqual(3, res.Y); }
public void TestSubEqualOperator() { var s1 = new QPointF(3, 7); var s2 = new QPointF(-1, 4); s1 -= s2; Assert.AreEqual(4, s1.X); Assert.AreEqual(3, s1.Y); }
public void TestPointSizeConstructor() { var p1 = new QPointF(50, 100); var p2 = new QSizeF(200, 150); var s = new QRectF(p1, p2); Assert.AreEqual(50, s.Left); Assert.AreEqual(100, s.Top); Assert.AreEqual(200, s.Width); Assert.AreEqual(150, s.Height); }
public void TestSetPoints() { var s = new QLineF(); var p1 = new QPointF(5.0, 5.0); var p2 = new QPointF(10.0, 10.0); s.SetPoints(p1, p2); Assert.AreEqual(5.0, s.P1.X); Assert.AreEqual(5.0, s.P1.Y); Assert.AreEqual(10.0, s.P2.X); Assert.AreEqual(10.0, s.P2.Y); }
public void TestContainsWithQPointF() { var s = new QRectF(); s.X = 50; s.Y = 150; s.Width = 500; s.Height = 600; var p = new QPointF(275, 375); var n = s.Contains(p); Assert.IsTrue(n); }
public void TestMultiEqualIntOperator() { var s1 = new QPointF(3, 7); s1 *= 5; Assert.AreEqual(15, s1.X); Assert.AreEqual(35, s1.Y); }
public void TestSetPoints() { using (var s = new QLineF()) { var p1 = new QPointF(5.0, 5.0); var p2 = new QPointF(10.0, 10.0); s.SetPoints(p1, p2); Assert.AreEqual(5.0, s.P1.X); Assert.AreEqual(5.0, s.P1.Y); Assert.AreEqual(10.0, s.P2.X); Assert.AreEqual(10.0, s.P2.Y); } }
public unsafe void TestRy() { var s1 = new QPointF(3, 7); double* res = s1.Ry; Assert.AreEqual(7, *res); }
public void TestIsNull() { var s = new QPointF(); Assert.IsTrue(s.IsNull); }
public void TestNotEqualOperator() { var s1 = new QPointF(3, 7); var s2 = new QPointF(-1, 4); Assert.AreNotEqual(s1, s2); }
public void TestMultFloatOperator() { var s1 = new QPointF(3, 7); var res = s1 * 5.0f; Assert.AreEqual(15, res.X); Assert.AreEqual(35, res.Y); }