LinesSnapIntersection.js 5.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * Copyright (c) 2011-2013 by Andrew Mustun. All rights reserved.
  3. *
  4. * This file is part of the QCAD project.
  5. *
  6. * QCAD is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * QCAD is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with QCAD.
  18. */
  19. // Auto generated by Testing Dashboard
  20. // File : scripts/Draw/Line/Line2P/Tests/LinesSnapIntersection.js
  21. // Timestamp : 2011-02-11 14:56:16
  22. // Description : Lines drawn with intersection snap
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function LinesSnapIntersection() {
  25. TdbTest.call(this, 'scripts/Draw/Line/Line2P/Tests/LinesSnapIntersection.js');
  26. }
  27. LinesSnapIntersection.prototype = new TdbTest();
  28. LinesSnapIntersection.prototype.test00 = function() {
  29. qDebug('running LinesSnapIntersection.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::LineToolsPanelButton');
  32. this.clickOnWidget('MainWindow::LineToolsPanel::Line2PButton');
  33. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  34. var p = new RVector(0, 20);
  35. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  36. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  37. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  38. var p = new RVector(-10, 10);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  40. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  41. this.sendMouseEventToGv(QEvent.MouseButtonPress, new QPoint(194, 55), Qt.RightButton, 2, 0);
  42. this.sendMouseEventToGv(QEvent.MouseButtonRelease, new QPoint(194, 55), Qt.RightButton, 0, 0);
  43. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  44. var p = new RVector(-10, 20);
  45. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  47. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  48. var p = new RVector(0, 0);
  49. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  50. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  51. this.sendMouseEventToGv(QEvent.MouseButtonPress, new QPoint(441, 204), Qt.RightButton, 2, 0);
  52. this.sendMouseEventToGv(QEvent.MouseButtonRelease, new QPoint(441, 204), Qt.RightButton, 0, 0);
  53. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  54. var p = new RVector(-20, -10);
  55. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  56. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  57. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  58. var p = new RVector(20, -20);
  59. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  60. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  61. this.sendMouseEventToGv(QEvent.MouseButtonPress, new QPoint(346, 357), Qt.RightButton, 2, 0);
  62. this.sendMouseEventToGv(QEvent.MouseButtonRelease, new QPoint(346, 357), Qt.RightButton, 0, 0);
  63. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  64. var p = new RVector(-20, -20);
  65. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  66. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  67. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  68. var p = new RVector(0, -10);
  69. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  70. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  71. this.sendMouseEventToGv(QEvent.MouseButtonPress, new QPoint(322, 320), Qt.RightButton, 2, 0);
  72. this.sendMouseEventToGv(QEvent.MouseButtonRelease, new QPoint(322, 320), Qt.RightButton, 0, 0);
  73. this.clickOnWidget('MainWindow::SnapToolsPanel::SnapIntersectionButton');
  74. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  75. var p = new RVector(-6.666666666666667, 13.333333333333334);
  76. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  77. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  78. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  79. var p = new RVector(-6.666666666666667, -13.333333333333334);
  80. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  81. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  82. this.sendMouseEventToGv(QEvent.MouseButtonPress, new QPoint(449, 221), Qt.RightButton, 2, 0);
  83. this.sendMouseEventToGv(QEvent.MouseButtonRelease, new QPoint(449, 221), Qt.RightButton, 0, 0);
  84. this.sendMouseEventToGv(QEvent.MouseButtonPress, new QPoint(143, 300), Qt.RightButton, 2, 0);
  85. this.sendMouseEventToGv(QEvent.MouseButtonRelease, new QPoint(143, 300), Qt.RightButton, 0, 0);
  86. this.verifyDrawing('LinesSnapIntersection_000.dxf');
  87. this.tearDown();
  88. qDebug('finished LinesSnapIntersection.test00()');
  89. };