LineParallel.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * Copyright (c) 2011-2018 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. include("scripts/Draw/Line/Line.js");
  20. include("scripts/Modify/Offset/Offset.js");
  21. include("scripts/ShapeAlgorithms.js");
  22. /**
  23. * \class LineParallel
  24. * \brief Line parallel to existing line with distance.
  25. * \ingroup ecma_draw_line
  26. */
  27. function LineParallel(guiAction) {
  28. Offset.call(this, guiAction);
  29. if (!isNull(guiAction)) {
  30. this.setUiOptions([LineParallel.includeBasePath + "/../Line.ui", LineParallel.includeBasePath + "/LineParallel.ui"]);
  31. }
  32. }
  33. LineParallel.prototype = new Offset();
  34. LineParallel.includeBasePath = includeBasePath;
  35. LineParallel.prototype.slotTypeAutoChanged = function(checked) {
  36. Line.slotTypeAutoChanged(this, checked);
  37. };
  38. LineParallel.prototype.slotTypeSegmentChanged = function(checked) {
  39. Line.slotTypeSegmentChanged(this, checked);
  40. };
  41. LineParallel.prototype.slotTypeRayChanged = function(checked) {
  42. Line.slotTypeRayChanged(this, checked);
  43. };
  44. LineParallel.prototype.slotTypeXLineChanged = function(checked) {
  45. Line.slotTypeXLineChanged(this, checked);
  46. };