IsoProjectTest01.js 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/Projection/IsometricProjection/IsoProject/Tests/IsoProjectTest01.js
  21. // Timestamp : 2011-08-05 11:35:30
  22. // Description : isometric projection of a spline using segment length 1
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function IsoProjectTest01() {
  25. TdbTest.call(this, 'scripts/Projection/IsometricProjection/IsoProject/Tests/IsoProjectTest01.js');
  26. }
  27. IsoProjectTest01.prototype = new TdbTest();
  28. IsoProjectTest01.prototype.test00 = function() {
  29. qDebug('running IsoProjectTest01.test00()...');
  30. this.setUp();
  31. this.importFile('scripts/Projection/IsometricProjection/IsoProject/Tests/data/cube_spline.dxf');
  32. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  33. this.sendMouseEvent(w, QEvent.MouseButtonPress, new QPoint(43, 453), Qt.LeftButton, 1, 0);
  34. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  35. this.sendMouseEvent(w, QEvent.MouseButtonRelease, new QPoint(43, 453), Qt.LeftButton, 0, 0);
  36. this.setZoom(5.762495258019454, new RVector(7.22036, 22.0504, 0) );
  37. var p = new RVector(15.339311, 13.003826);
  38. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  40. TdbTest.clickOnWidget('MainWindow::CadToolBar::MainToolsPanel::ProjectionToolsPanelButton');
  41. TdbTest.clickOnWidget('MainWindow::CadToolBar::ProjectionToolsPanel::IsoProjectButton');
  42. this.setZoom(5.762495258019454, new RVector(7.22036, 22.0504, 0) );
  43. var p = new RVector(0.415221, 19.424656);
  44. RDebug.startTimer();
  45. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  47. RDebug.stopTimer("choose ref point");
  48. this.setToolOption('IsoProject/ProjectionType', 'Top');
  49. this.setToolOption('IsoProject/Method', RS.Isometric);
  50. this.updateToolOptions();
  51. this.updateToolOptions();
  52. this.setZoom(5.762495258019454, new RVector(7.22036, 22.0504, 0) );
  53. var p = new RVector(49.525891, 31.745707);
  54. RDebug.startTimer();
  55. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  56. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  57. RDebug.stopTimer("choose dest point");
  58. this.setToolOption('IsoProject/ProjectionType', 'Right');
  59. this.setToolOption('IsoProject/Method', RS.Isometric);
  60. this.updateToolOptions();
  61. this.updateToolOptions();
  62. this.setZoom(5.762495258019454, new RVector(7.22036, 22.0504, 0) );
  63. var p = new RVector(49.872962, 16.301009);
  64. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  65. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  66. this.setToolOption('IsoProject/ProjectionType', 'Left');
  67. this.setToolOption('IsoProject/Method', RS.Isometric);
  68. this.updateToolOptions();
  69. this.updateToolOptions();
  70. this.setZoom(5.762495258019454, new RVector(7.22036, 22.0504, 0) );
  71. var p = new RVector(35.816552, 23.415982);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  73. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  74. var p = new RVector(29.395722, 7.450676);
  75. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  76. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  77. var p = new RVector(30.263402, 2.938742);
  78. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  79. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  80. this.verifyDrawing('IsoProjectTest01_000.dxf');
  81. this.tearDown();
  82. qDebug('finished IsoProjectTest01.test00()');
  83. };