KiCad PCB EDA Suite
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 GBR_LAYOUT_H
32 #define GBR_LAYOUT_H
33 
34 
35 #include <dlist.h>
36 
37 #include <colors_design_settings.h>
38 #include <common.h> // PAGE_INFO
39 #include <gerbview.h> // GERBER_DRAWLAYERS_COUNT
40 #include <title_block.h>
41 #include <gerber_draw_item.h>
42 #include <gbr_display_options.h>
43 
44 #include <gr_basic.h>
45 #include <eda_rect.h>
46 
48 
53 class GBR_LAYOUT : public EDA_ITEM
54 {
55 private:
59 
60 public:
61 
62  GBR_LAYOUT();
63  ~GBR_LAYOUT();
64 
65  wxString GetClass() const override
66  {
67  return wxT( "GBR_LAYOUT" );
68  }
69 
70  // Accessor to the GERBER_FILE_IMAGE_LIST,
71  // which handles the list of gerber files (and drill files) images loaded
73 
74  const wxPoint& GetAuxOrigin() const
75  {
76  return m_originAxisPosition;
77  }
78 
79  void SetAuxOrigin( const wxPoint& aPosition )
80  {
81  m_originAxisPosition = aPosition;
82  }
83 
85  {
86  return m_titles;
87  }
88 
89  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
90  {
91  m_titles = aTitleBlock;
92  }
93 
100 
104  const EDA_RECT GetBoundingBox() const override
105  {
106  return ComputeBoundingBox();
107  }
108 
109  void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
110 
120  void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
121  GR_DRAWMODE aDrawMode, const wxPoint& aOffset,
122  GBR_DISPLAY_OPTIONS* aDisplayOptions );
123 
133  void DrawItemsDCodeID( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
134  GR_DRAWMODE aDrawMode, COLOR4D aDrawColor );
135 
137  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
138 
139 
140 #if defined(DEBUG)
141 
142  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
143 
144 #endif
145 };
146 
147 #endif // #ifndef GBR_LAYOUT_H
Class GBR_DISPLAY_OPTIONS is a helper class to handle display options (filling modes and afew other o...
Class GBR_LAYOUT holds list of GERBER_DRAW_ITEM currently loaded.
Definition: gbr_layout.h:53
wxString GetClass() const override
Function GetClass returns the class name.
Definition: gbr_layout.h:65
EDA_RECT m_BoundingBox
Definition: gbr_layout.h:56
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox.
Definition: gbr_layout.h:104
Handle colors used to draw all items or layers.
const wxPoint & GetAuxOrigin() const
Definition: gbr_layout.h:74
void SetAuxOrigin(const wxPoint &aPosition)
Definition: gbr_layout.h:79
void SetBoundingBox(const EDA_RECT &aBox)
Definition: gbr_layout.h:109
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.
Definition: title_block.h:40
wxPoint m_originAxisPosition
Definition: gbr_layout.h:58
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 ...
Definition: gbr_layout.cpp:352
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
EDA_RECT ComputeBoundingBox() const
Function ComputeBoundingBox calculates the bounding box containing all Gerber items.
Definition: gbr_layout.cpp:56
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:102
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
TITLE_BLOCK & GetTitleBlock()
Definition: gbr_layout.h:84
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Definition: gbr_layout.cpp:50
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
The common library.
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
>
Definition: gbr_layout.cpp:397
SEARCH_RESULT
Definition: base_struct.h:66
TITLE_BLOCK m_titles
Definition: gbr_layout.h:57
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: gbr_layout.h:89
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.
Definition: gbr_layout.cpp:88