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 
45 
46  void Load( APP_SETTINGS_BASE* aConfig ) override;
47  void Save( APP_SETTINGS_BASE* aConfig ) override;
48 };
49 
50 
52 {
53 public:
54  PCBNEW_PRINTOUT( BOARD* aBoard, const PCBNEW_PRINTOUT_SETTINGS& aParams,
55  const KIGFX::VIEW* aView, const wxString& aTitle );
56 
57  bool OnPrintPage( int aPage ) override;
58 
59 protected:
60  int milsToIU( double aMils ) const override;
61 
62  void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet ) override;
63 
64  void setupPainter( KIGFX::PAINTER& aPainter ) override;
65 
66  void setupGal( KIGFX::GAL* aGal ) override;
67 
68  EDA_RECT getBoundingBox() override;
69 
70  std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) override;
71 
72 private:
74 
76 };
77 
78 
79 namespace KIGFX {
85 {
86 public:
87  PCB_PRINT_PAINTER( GAL* aGal );
88 
95  void SetDrillMarks( bool aRealSize, unsigned int aSize = 0 )
96  {
97  m_drillMarkReal = aRealSize;
98  m_drillMarkSize = aSize;
99  }
100 
101 protected:
102  int getDrillShape( const PAD* aPad ) const override;
103 
104  VECTOR2D getDrillSize( const PAD* aPad ) const override;
105 
106  int getDrillSize( const VIA* aVia ) const override;
107 
110 
113 };
114 
115 }; // namespace KIGFX
116 
117 #endif /* PCBNEW_PRINTOUT_H */
bool m_noEdgeLayer
Disable board outline on each page.
Definition: track.h:344
PCBNEW_PRINTOUT_SETTINGS(const PAGE_INFO &aPageInfo)
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:175
int getDrillShape(const PAD *aPad) const override
Return drill shape of a pad.
Special flavor of PCB_PAINTER that contains modifications to handle printing options.
PCBNEW_PRINTOUT(BOARD *aBoard, const PCBNEW_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:239
std::unique_ptr< KIGFX::PAINTER > getPainter(KIGFX::GAL *aGal) override
Source VIEW object (note that actual printing only refers to this object)
void setupPainter(KIGFX::PAINTER &aPainter) override
Configures GAL object for a printout.
bool m_drillMarkReal
Flag deciding whether use the actual hole size or user-specified size for drill marks
Contains all the knowledge about how to draw graphical object onto any particular output device.
Definition: painter.h:57
void Load(APP_SETTINGS_BASE *aConfig) override
void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet) override
Configures PAINTER object for a printout.
LSET is a set of PCB_LAYER_IDs.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
int milsToIU(double aMils) const override
< Convert mils to internal units
int m_drillMarkSize
User-specified size for drill marks (expressed in internal units)
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
bool m_asItemCheckboxes
Honor checkboxes in the Items tab of the Layers Manager.
void Save(APP_SETTINGS_BASE *aConfig) override
An object derived from wxPrintout to handle the necessary information to control a printer when print...
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
Handle the component boundary box.
Definition: eda_rect.h:42
VECTOR2D getDrillSize(const PAD *aPad) const override
Return drill size for a pad (internal units).
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_pagination
EDA_RECT getBoundingBox() override
Returns a PAINTER instance used to draw the items.
enum PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T m_drillMarks
Board print handler definition file.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
void setupGal(KIGFX::GAL *aGal) override
Returns bounding box of the printed objects (excluding worksheet frame)
Definition: pad.h:60
bool OnPrintPage(int aPage) override
void SetDrillMarks(bool aRealSize, unsigned int aSize=0)
Set drill marks visibility and options.
Abstract interface for drawing on a 2D-surface.