KiCad PCB EDA Suite
class_gbr_layout.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2012-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2014 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
31 #ifndef CLASS_GBR_LAYOUT_H
32 #define CLASS_GBR_LAYOUT_H
33 
34 
35 #include <dlist.h>
36 
38 #include <common.h> // PAGE_INFO
39 #include <gerbview.h> // GERBER_DRAWLAYERS_COUNT
40 #include <class_title_block.h>
41 #include <class_gerber_draw_item.h>
43 
44 #include <gr_basic.h>
45 #include <class_eda_rect.h>
46 
48 
54 {
55 private:
59  std::vector<int> m_printLayersList; // When printing: the list of graphic layers Id to print
60 
61 public:
62 
63  GBR_LAYOUT();
64  ~GBR_LAYOUT();
65 
66  // Accessor to the GERBER_FILE_IMAGE_LIST,
67  // which handles the list of gerber files (and drill files) images loaded
69 
70  const wxPoint& GetAuxOrigin() const
71  {
72  return m_originAxisPosition;
73  }
74 
75  void SetAuxOrigin( const wxPoint& aPosition )
76  {
77  m_originAxisPosition = aPosition;
78  }
79 
81  {
82  return m_titles;
83  }
84 
85  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
86  {
87  m_titles = aTitleBlock;
88  }
89 
96 
103 
104  void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
105 
115  void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
116  GR_DRAWMODE aDrawMode, const wxPoint& aOffset,
117  GBR_DISPLAY_OPTIONS* aDisplayOptions );
118 
128  void DrawItemsDCodeID( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
129  GR_DRAWMODE aDrawMode, COLOR4D aDrawColor );
130 
131 
137  void SetPrintableLayers( const std::vector<int>& aLayerList )
138  {
139  m_printLayersList = aLayerList;
140  }
141 
146  std::vector<int> GetPrintableLayers()
147  {
148  return m_printLayersList;
149  }
150 
156  {
157  m_printLayersList.clear();
158  }
159 
165  void AddLayerToPrintableList( int aLayer)
166  {
167  m_printLayersList.push_back( aLayer );
168  }
169 
170 
177  bool IsLayerPrintable( int aLayer ) const;
178 
179 #if defined(DEBUG)
180  void Show( int nestLevel, std::ostream& os ) const;
181 
182 #endif
183 };
184 
185 #endif // #ifndef CLASS_GBR_LAYOUT_H
Class GBR_LAYOUT holds list of GERBER_DRAW_ITEM currently loaded.
GERBER_FILE_IMAGE_LIST * GetImagesList()
EDA_RECT m_BoundingBox
bool IsLayerPrintable(int aLayer) const
Function IsLayerPrintable tests whether a given layer is visible.
void AddLayerToPrintableList(int aLayer)
Function AddLayerToPrintableList Add a layer to the list of graphic layers to print.
const wxPoint & GetAuxOrigin() const
void SetPrintableLayers(const std::vector< int > &aLayerList)
Function SetPrintableLayers Set the list of printable graphic layers.
void SetAuxOrigin(const wxPoint &aPosition)
void SetBoundingBox(const EDA_RECT &aBox)
EDA_RECT ComputeBoundingBox()
Function ComputeBoundingBox calculates the bounding box containing all Gerber items.
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
wxPoint m_originAxisPosition
std::vector< int > GetPrintableLayers()
Function GetPrintableLayers.
void DrawItemsDCodeID(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, COLOR4D aDrawColor)
Function DrawItemsDCodeID Draw the DCode value (if exists) corresponding to gerber item (polygons do ...
void ClearPrintableLayers()
Function ClearPrintableLayers Clear the list of graphic layers to print.
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
Class GBR_DISPLAY_OPTIONS is a helper class to handle display options (filling modes and afew other o...
std::vector< int > m_printLayersList
TITLE_BLOCK & GetTitleBlock()
Class EDA_RECT handles the component boundary box.
The common library.
EDA_RECT GetBoundingBox() const
Function GetBoundingBox may be called soon after ComputeBoundingBox() to return the same EDA_RECT...
Handle colors used to draw all items or layers.
TITLE_BLOCK m_titles
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset, GBR_DISPLAY_OPTIONS *aDisplayOptions)
Function Draw.