LineParallelTest00.js 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/LineParallel/Tests/LineParallelTest00.js
  21. // Timestamp : 2011-02-28 10:07:14
  22. // Description : Parallel lines with different distances on both sides of a line
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function LineParallelTest00() {
  25. TdbTest.call(this, 'scripts/Draw/Line/LineParallel/Tests/LineParallelTest00.js');
  26. }
  27. LineParallelTest00.prototype = new TdbTest();
  28. LineParallelTest00.prototype.test00 = function() {
  29. qDebug('running LineParallelTest00.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::LineToolsPanelButton');
  32. this.clickOnWidget('MainWindow::LineToolsPanel::Line2PButton');
  33. this.setZoom(10, new RVector(5, 5, 0) );
  34. var p = new RVector(40, 30);
  35. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  36. var p = new RVector(40, 30);
  37. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  38. this.setZoom(10, new RVector(5, 5, 0) );
  39. var p = new RVector(10, 10);
  40. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  41. var p = new RVector(10, 10);
  42. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  43. var p = new RVector(8.8, 3.9);
  44. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  45. var p = new RVector(8.8, 3.9);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  47. var p = new RVector(4.3, 27.7);
  48. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  49. var p = new RVector(4.3, 27.7);
  50. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  51. this.clickOnWidget('MainWindow::MainToolsPanel::LineToolsPanelButton');
  52. this.clickOnWidget('MainWindow::LineToolsPanel::LineParallelButton');
  53. this.setToolOption('LineParallel/Distance', [ 1, 0 ] );
  54. this.setToolOption('LineParallel/Number', '1');
  55. this.updateToolOptions();
  56. this.setZoom(10, new RVector(5, 5, 0) );
  57. var p = new RVector(16.5, 13.3);
  58. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  59. var p = new RVector(16.5, 13.3);
  60. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  61. this.setToolOption('LineParallel/Distance', [ 2, 0 ] );
  62. this.setToolOption('LineParallel/Number', '2');
  63. this.updateToolOptions();
  64. this.setZoom(10, new RVector(5, 5, 0) );
  65. var p = new RVector(24.8, 17.6);
  66. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  67. var p = new RVector(24.8, 17.6);
  68. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  69. this.setToolOption('LineParallel/Distance', [ 3, 0 ] );
  70. this.setToolOption('LineParallel/Number', '3');
  71. this.updateToolOptions();
  72. this.setZoom(10, new RVector(5, 5, 0) );
  73. var p = new RVector(18.3, 16.1);
  74. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  75. var p = new RVector(18.3, 16.1);
  76. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  77. this.setToolOption('LineParallel/Distance', [ 4, 0 ] );
  78. this.setToolOption('LineParallel/Number', '4');
  79. this.updateToolOptions();
  80. this.setZoom(10, new RVector(5, 5, 0) );
  81. var p = new RVector(29, 15.7);
  82. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  83. var p = new RVector(29, 15.7);
  84. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  85. var p = new RVector(29.5, 14.6);
  86. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  87. var p = new RVector(29.5, 14.6);
  88. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  89. this.verifyDrawing('LineParallelTest00_000.dxf');
  90. this.tearDown();
  91. qDebug('finished LineParallelTest00.test00()');
  92. };