ScaleTest03.js 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/Scale/Tests/ScaleTest03.js
  21. // Timestamp : 2011-08-15 11:34:07
  22. // Description : scaling points, factor 0.5
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function ScaleTest03() {
  25. TdbTest.call(this, 'scripts/Modify/Scale/Tests/ScaleTest03.js');
  26. }
  27. ScaleTest03.prototype = new TdbTest();
  28. ScaleTest03.prototype.test00 = function() {
  29. qDebug('running ScaleTest03.test00()...');
  30. this.setUp();
  31. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  32. this.sendMouseEvent(w, QEvent.MouseButtonPress, new QPoint(48, 441), Qt.LeftButton, 1, 0);
  33. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  34. this.sendMouseEvent(w, QEvent.MouseButtonRelease, new QPoint(48, 441), Qt.LeftButton, 0, 0);
  35. this.importFile('scripts/Modify/Scale/Tests/data/points.dxf');
  36. this.setZoom(4.910179640718563, new RVector(0.0256098, -7.71341, 0) );
  37. var p = new RVector(19.321951, 15.045122);
  38. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  40. this.triggerCommand('scale');
  41. this.setZoom(4.910179640718563, new RVector(0.0256098, -7.71341, 0) );
  42. var p = new RVector(90.195122, 90.195122);
  43. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  44. this.dlgStart();
  45. this.dlgAppendCode('var map = new Map()');
  46. this.dlgAppendCode("map.put('DialogOpenedByTdb/groupBox', 'KeepOriginal')");
  47. this.dlgAppendCode("map.put('DialogOpenedByTdb/NumberOfCopies', [ 2, 0 ] )");
  48. this.dlgAppendCode("map.put('DialogOpenedByTdb/FactorX', [ 0.5, 0 ] )");
  49. this.dlgAppendCode("map.put('DialogOpenedByTdb/KeepProportions', true)");
  50. this.dlgAppendCode("map.put('DialogOpenedByTdb/FactorY', [ 0.5, 0 ] )");
  51. this.dlgAppendCode("map.put('DialogOpenedByTdb/FactorByMouse', false)");
  52. this.dlgAppendCode("map.put('DialogOpenedByTdb/UseCurrentAttributes', false)");
  53. this.dlgAppendCode("WidgetFactory.restoreState(dialog, 'DialogOpenedByTdb', undefined, false, undefined, map)");
  54. this.dlgEnd();
  55. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  56. this.verifyDrawing('ScaleTest03_000.dxf');
  57. this.tearDown();
  58. qDebug('finished ScaleTest03.test00()');
  59. };