You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.7 KiB

  1. /**
  2. * @file pl_editor_layout.h
  3. */
  4. /*
  5. * This program source code file is part of KiCad, a free EDA CAD application.
  6. *
  7. * Copyright (C) 2013 CERN
  8. * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
  9. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version 2
  14. * of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, you may find one here:
  23. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  24. * or you may search the http://www.gnu.org website for the version 2 license,
  25. * or you may write to the Free Software Foundation, Inc.,
  26. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  27. */
  28. #ifndef CLASS_PL_EDITOR_LAYOUT_H
  29. #define CLASS_PL_EDITOR_LAYOUT_H
  30. #include <page_info.h>
  31. #include <title_block.h>
  32. #include <drawing_sheet/ds_draw_item.h>
  33. class PL_EDITOR_LAYOUT
  34. {
  35. public:
  36. PL_EDITOR_LAYOUT();
  37. ~PL_EDITOR_LAYOUT();
  38. PAGE_INFO& GetPageSettings() { return m_paper; }
  39. const PAGE_INFO& GetPageSettings() const { return m_paper; }
  40. void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
  41. const wxPoint& GetAuxOrigin() const
  42. {
  43. static wxPoint zero( 0, 0 );
  44. return zero;
  45. }
  46. TITLE_BLOCK& GetTitleBlock() { return m_titles; }
  47. const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
  48. void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
  49. DS_DRAW_ITEM_LIST& GetDrawItems()
  50. {
  51. return m_drawItemList;
  52. }
  53. /**
  54. * Calculate the bounding box containing all Gerber items.
  55. *
  56. * @return the full item list bounding box.
  57. */
  58. EDA_RECT ComputeBoundingBox();
  59. /**
  60. * Called soon after ComputeBoundingBox() to return the same EDA_RECT,
  61. * as long as the CLASS_PL_EDITOR_LAYOUT has not changed.
  62. */
  63. const EDA_RECT GetBoundingBox() const { return m_boundingBox; }
  64. void SetBoundingBox( const EDA_RECT& aBox ) { m_boundingBox = aBox; }
  65. #if defined(DEBUG)
  66. void Show( int nestLevel, std::ostream& os ) const;
  67. #endif
  68. private:
  69. EDA_RECT m_boundingBox;
  70. PAGE_INFO m_paper;
  71. TITLE_BLOCK m_titles;
  72. DS_DRAW_ITEM_LIST m_drawItemList;
  73. };
  74. #endif // #ifndef CLASS_PL_EDITOR_LAYOUT_H