DrawPolylineTest01.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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/Polyline/DrawPolyline/Tests/DrawPolylineTest01.js
  21. // Timestamp : 2011-03-01 14:04:01
  22. // Description : opened polyline with arc segments, radii from 2 to 8
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function DrawPolylineTest01() {
  25. TdbTest.call(this, 'scripts/Draw/Polyline/DrawPolyline/Tests/DrawPolylineTest01.js');
  26. }
  27. DrawPolylineTest01.prototype = new TdbTest();
  28. DrawPolylineTest01.prototype.test00 = function() {
  29. qDebug('running DrawPolylineTest01.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::PolylineToolsPanelButton');
  32. this.clickOnWidget('MainWindow::PolylineToolsPanel::DrawPolylineButton');
  33. this.setToolOption('DrawPolyline/ArcSegment', 'false');
  34. this.setToolOption('DrawPolyline/Radius', [ 6, 0 ] );
  35. this.updateToolOptions();
  36. this.setZoom(10, new RVector(5, 5, 0) );
  37. var p = new RVector(20.1, 19.9);
  38. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  39. var p = new RVector(20.1, 19.9);
  40. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  41. this.setZoom(10, new RVector(5, 5, 0) );
  42. var p = new RVector(29.9, 19.8);
  43. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  44. var p = new RVector(29.9, 19.8);
  45. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  46. this.setToolOption('DrawPolyline/ArcSegment', 'true');
  47. this.setToolOption('DrawPolyline/Radius', [ 2, 0 ] );
  48. this.updateToolOptions();
  49. this.setZoom(10, new RVector(5, 5, 0) );
  50. var p = new RVector(30, 15.9);
  51. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  52. var p = new RVector(30, 15.9);
  53. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  54. this.setZoom(10, new RVector(5, 5, 0) );
  55. var p = new RVector(20.1, 15.9);
  56. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  57. var p = new RVector(20.1, 15.9);
  58. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  59. this.setToolOption('DrawPolyline/ArcSegment', 'true');
  60. this.setToolOption('DrawPolyline/Radius', [ 4, 0 ] );
  61. this.updateToolOptions();
  62. this.setZoom(10, new RVector(5, 5, 0) );
  63. var p = new RVector(19.9, 23.9);
  64. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  65. var p = new RVector(19.9, 23.9);
  66. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  67. this.setZoom(10, new RVector(5, 5, 0) );
  68. var p = new RVector(30, 23.9);
  69. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  70. var p = new RVector(30, 23.9);
  71. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  72. this.setToolOption('DrawPolyline/ArcSegment', 'true');
  73. this.setToolOption('DrawPolyline/Radius', [ 6, 0 ] );
  74. this.updateToolOptions();
  75. this.setZoom(10, new RVector(5, 5, 0) );
  76. var p = new RVector(30, 12);
  77. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  78. var p = new RVector(30, 12);
  79. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  80. this.setZoom(10, new RVector(5, 5, 0) );
  81. var p = new RVector(20.1, 12);
  82. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  83. var p = new RVector(20.1, 12);
  84. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  85. this.setToolOption('DrawPolyline/ArcSegment', 'true');
  86. this.setToolOption('DrawPolyline/Radius', [ 8, 0 ] );
  87. this.updateToolOptions();
  88. this.setZoom(10, new RVector(5, 5, 0) );
  89. var p = new RVector(20, 27.7);
  90. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  91. var p = new RVector(20, 27.7);
  92. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  93. var p = new RVector(23.4, 27.3);
  94. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  95. var p = new RVector(23.4, 27.3);
  96. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  97. var p = new RVector(26.6, 26.2);
  98. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  99. var p = new RVector(26.6, 26.2);
  100. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  101. this.verifyDrawing('DrawPolylineTest01_000.dxf');
  102. this.tearDown();
  103. qDebug('finished DrawPolylineTest01.test00()');
  104. };