RotateTest00.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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/Modify/Rotate/Tests/RotateTest00.js
  21. // Timestamp : 2011-08-08 17:18:06
  22. // Description :
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function RotateTest00() {
  25. TdbTest.call(this, 'scripts/Modify/Rotate/Tests/RotateTest00.js');
  26. }
  27. RotateTest00.prototype = new TdbTest();
  28. RotateTest00.prototype.test00 = function() {
  29. qDebug('running RotateTest00.test00()...');
  30. this.setUp();
  31. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  32. this.sendMouseEvent(w, QEvent.MouseButtonPress, new QPoint(84, 423), Qt.LeftButton, 1, 0);
  33. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  34. this.sendMouseEvent(w, QEvent.MouseButtonRelease, new QPoint(83, 423), Qt.LeftButton, 0, 0);
  35. this.importFile('scripts/Modify/Rotate/Tests/data/entities.dxf');
  36. this.selectAll();
  37. var p = new RVector(3.379811, 62.195574);
  38. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.MidButton, 4, 0);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.MidButton, 0, 0);
  40. var p = new RVector(15.486662, 19.512725);
  41. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.MidButton, 4, 0);
  42. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.MidButton, 0, 0);
  43. this.triggerCommand('rotate');
  44. this.setZoom(1.6150558288984582, new RVector(163.455, 145.187, 0) );
  45. var p = new RVector(0.626495, 3.41421);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  47. this.dlgStart();
  48. this.dlgAppendCode('var map = new Map()');
  49. this.dlgAppendCode("map.put('DialogOpenedByTdb/Mode', 'MultipleCopies')");
  50. this.dlgAppendCode("map.put('DialogOpenedByTdb/NumberOfCopies', [ 7, 0 ] )");
  51. this.dlgAppendCode("map.put('DialogOpenedByTdb/Angle', [ 45, 0 ] )");
  52. this.dlgAppendCode("map.put('DialogOpenedByTdb/AngleByMouse', false)");
  53. this.dlgAppendCode("map.put('DialogOpenedByTdb/UseCurrentAttributes', false)");
  54. this.dlgAppendCode("WidgetFactory.restoreState(dialog, 'DialogOpenedByTdb', undefined, false, undefined, map)");
  55. this.dlgEnd();
  56. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  57. this.setZoom(1.6150558288984582, new RVector(163.455, 145.187, 0) );
  58. var p = new RVector(108.981882, -64.075717);
  59. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  60. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  61. this.verifyDrawing('RotateTest00_000.dxf');
  62. this.tearDown();
  63. qDebug('finished RotateTest00.test00()');
  64. };