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.

86 lines
2.7 KiB

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