KiCad PCB EDA Suite
pcbnew_printout.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
3  * Copyright (C) 2018 CERN
4  * Author: Maciej Suminski <maciej.suminski@cern.ch>
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef PCBNEW_PRINTOUT_H
21 #define PCBNEW_PRINTOUT_H
22 
23 #include <board_printout.h>
24 #include <pcb_painter.h>
25 
26 class BOARD;
27 
29 {
30  PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo );
31 
36  } m_drillMarks;
37 
38  enum PAGINATION_T {
41  } m_pagination;
42 
44 
45  void Load( wxConfigBase* aConfig ) override;
46  void Save( wxConfigBase* aConfig ) override;
47 };
48 
49 
51 {
52 public:
53  PCBNEW_PRINTOUT( BOARD* aBoard, const PCBNEW_PRINTOUT_SETTINGS& aParams,
54  const KIGFX::VIEW* aView, const wxString& aTitle );
55 
56  bool OnPrintPage( int aPage ) override;
57 
58 protected:
59  int milsToIU( double aMils ) const override;
60 
61  void setupViewLayers( const std::unique_ptr<KIGFX::VIEW>& aView, const LSET& aLayerSet ) override;
62 
63  void setupPainter( const std::unique_ptr<KIGFX::PAINTER>& aPainter ) override;
64 
65  void setupGal( KIGFX::GAL* aGal ) override;
66 
67  EDA_RECT getBoundingBox() override;
68 
69  std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) override;
70 
71 private:
73 
75 };
76 
77 
78 namespace KIGFX {
84 {
85 public:
86  PCB_PRINT_PAINTER( GAL* aGal );
87 
94  void SetDrillMarks( bool aRealSize, unsigned int aSize = 0 )
95  {
96  m_drillMarkReal = aRealSize;
97  m_drillMarkSize = aSize;
98  }
99 
100 protected:
101  int getDrillShape( const D_PAD* aPad ) const override;
102 
103  VECTOR2D getDrillSize( const D_PAD* aPad ) const override;
104 
105  int getDrillSize( const VIA* aVia ) const override;
106 
109 
112 };
113 
114 }; // namespace KIGFX
115 
116 #endif /* PCBNEW_PRINTOUT_H */
bool m_noEdgeLayer
Disable board outline on each page.
PCBNEW_PRINTOUT_SETTINGS(const PAGE_INFO &aPageInfo)
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
void Save(wxConfigBase *aConfig) override
Special flavor of PCB_PAINTER that contains modifications to handle printing options.
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:211
bool m_drillMarkReal
Flag deciding whether use the actual hole size or user-specified size for drill marks ...
Class LSET is a set of PCB_LAYER_IDs.
void Load(wxConfigBase *aConfig) override
int m_drillMarkSize
User-specified size for drill marks (expressed in internal units)
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
Class BOARD_PRINTOUT is a class derived from wxPrintout to handle the necessary information to contro...
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_pagination
Pagination.
enum PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T m_drillMarks
Drill marks shape.
Board print handler definition file.
Class VIEW.
Definition: view.h:61
void SetDrillMarks(bool aRealSize, unsigned int aSize=0)
Set drill marks visibility and options.
Class GAL is the abstract interface for drawing on a 2D-surface.