ShapePolygonCPTest02.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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/Shape/ShapePolygonCP/Tests/ShapePolygonCPTest02.js
  21. // Timestamp : 2011-02-28 10:26:03
  22. // Description : Regular polygons with 3 up to 8 lines, defined by center
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function ShapePolygonCPTest02() {
  25. TdbTest.call(this, 'scripts/Draw/Shape/ShapePolygonCP/Tests/ShapePolygonCPTest02.js');
  26. }
  27. ShapePolygonCPTest02.prototype = new TdbTest();
  28. ShapePolygonCPTest02.prototype.test00 = function() {
  29. qDebug('running ShapePolygonCPTest02.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::ShapeToolsPanelButton');
  32. this.clickOnWidget('MainWindow::ShapeToolsPanel::ShapePolygonCPButton');
  33. this.setToolOption('ShapePolygonCP/Corners', '3');
  34. this.setToolOption('Shape/CreatePolyline', 'true');
  35. this.setToolOption('Shape/Fill', 'true');
  36. this.updateToolOptions();
  37. this.setZoom(10, new RVector(5, 5, 0) );
  38. var p = new RVector(10, 20);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  40. var p = new RVector(10, 20);
  41. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  42. this.setZoom(10, new RVector(5, 5, 0) );
  43. var p = new RVector(10, 10);
  44. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  45. var p = new RVector(10, 10);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  47. this.setToolOption('ShapePolygonCP/Corners', '4');
  48. this.setToolOption('Shape/CreatePolyline', 'true');
  49. this.setToolOption('Shape/Fill', 'true');
  50. this.updateToolOptions();
  51. this.setZoom(10, new RVector(5, 5, 0) );
  52. var p = new RVector(30, 20);
  53. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  54. var p = new RVector(30, 20);
  55. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  56. this.setZoom(10, new RVector(5, 5, 0) );
  57. var p = new RVector(30, 10);
  58. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  59. var p = new RVector(30, 10);
  60. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  61. this.setToolOption('ShapePolygonCP/Corners', '5');
  62. this.setToolOption('Shape/CreatePolyline', 'true');
  63. this.setToolOption('Shape/Fill', 'true');
  64. this.updateToolOptions();
  65. this.setZoom(10, new RVector(-7.2, 5.2, 0) );
  66. var p = new RVector(50, 20);
  67. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  68. var p = new RVector(50, 20);
  69. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  70. this.setZoom(10, new RVector(-7.2, 5.2, 0) );
  71. var p = new RVector(50, 10);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  73. var p = new RVector(50, 10);
  74. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  75. this.setToolOption('ShapePolygonCP/Corners', '6');
  76. this.setToolOption('Shape/CreatePolyline', 'true');
  77. this.setToolOption('Shape/Fill', 'true');
  78. this.updateToolOptions();
  79. this.setZoom(10, new RVector(1.7, 13.3, 0) );
  80. var p = new RVector(10, -10);
  81. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  82. var p = new RVector(10, -10);
  83. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  84. this.setZoom(10, new RVector(1.7, 13.3, 0) );
  85. var p = new RVector(10, -20);
  86. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  87. var p = new RVector(10, -20);
  88. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  89. this.setToolOption('ShapePolygonCP/Corners', '7');
  90. this.setToolOption('Shape/CreatePolyline', 'true');
  91. this.setToolOption('Shape/Fill', 'true');
  92. this.updateToolOptions();
  93. this.setZoom(10, new RVector(1.7, 13.3, 0) );
  94. var p = new RVector(30, -10);
  95. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  96. var p = new RVector(30, -10);
  97. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  98. this.setZoom(10, new RVector(1.7, 13.3, 0) );
  99. var p = new RVector(30, -20);
  100. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  101. var p = new RVector(30, -20);
  102. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  103. this.setToolOption('ShapePolygonCP/Corners', '8');
  104. this.setToolOption('Shape/CreatePolyline', 'true');
  105. this.setToolOption('Shape/Fill', 'true');
  106. this.updateToolOptions();
  107. this.setZoom(10, new RVector(-13.4, 14.3, 0) );
  108. var p = new RVector(50, -10);
  109. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  110. var p = new RVector(50, -10);
  111. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  112. this.setZoom(10, new RVector(-13.4, 14.3, 0) );
  113. var p = new RVector(50, -20);
  114. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  115. var p = new RVector(50, -20);
  116. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  117. var p = new RVector(56.6, 1.9);
  118. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  119. var p = new RVector(56.6, 1.9);
  120. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  121. this.verifyDrawing('ShapePolygonCPTest02_000.dxf');
  122. this.tearDown();
  123. qDebug('finished ShapePolygonCPTest02.test00()');
  124. };