KiCad PCB EDA Suite
pcbnew_printout.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 CERN
3  * Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
4  *
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef PCBNEW_PRINTOUT_H
22 #define PCBNEW_PRINTOUT_H
23 
24 #include <board_printout.h>
25 #include <pcb_painter.h>
26 
27 class BOARD;
28 
30 {
31  PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo );
32 
37  } m_DrillMarks;
38 
39  enum PAGINATION_T {
42  } m_Pagination;
43 
46 
47  void Load( APP_SETTINGS_BASE* aConfig ) override;
48  void Save( APP_SETTINGS_BASE* aConfig ) override;
49 };
50 
51 
53 {
54 public:
55  PCBNEW_PRINTOUT( BOARD* aBoard, const PCBNEW_PRINTOUT_SETTINGS& aParams,
56  const KIGFX::VIEW* aView, const wxString& aTitle );
57 
58  bool OnPrintPage( int aPage ) override;
59 
60 protected:
61  int milsToIU( double aMils ) const override;
62 
63  void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet ) override;
64 
65  void setupPainter( KIGFX::PAINTER& aPainter ) override;
66 
67  void setupGal( KIGFX::GAL* aGal ) override;
68 
69  EDA_RECT getBoundingBox() override;
70 
71  std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) override;
72 
73 private:
75 
77 };
78 
79 
80 namespace KIGFX {
81 
86 {
87 public:
88  PCB_PRINT_PAINTER( GAL* aGal );
89 
97  void SetDrillMarks( bool aRealSize, unsigned int aSize = 0 )
98  {
99  m_drillMarkReal = aRealSize;
100  m_drillMarkSize = aSize;
101  }
102 
103 protected:
104  int getDrillShape( const PAD* aPad ) const override;
105 
106  VECTOR2D getDrillSize( const PAD* aPad ) const override;
107 
108  int getDrillSize( const PCB_VIA* aVia ) const override;
109 
112 
115 };
116 
117 }; // namespace KIGFX
118 
119 #endif /* PCBNEW_PRINTOUT_H */
PCBNEW_PRINTOUT_SETTINGS(const PAGE_INFO &aPageInfo)
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:236
enum PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T m_DrillMarks
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)
Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:241
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
User-specified size for drill marks (expressed in internal units)
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.
Definition: layer_ids.h:504
bool m_AsItemCheckboxes
Honor checkboxes in the Items tab of the Layers Manager.
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
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
void Save(APP_SETTINGS_BASE *aConfig) override
bool m_PrintEdgeCutsOnAllPages
Print board outline on each page.
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:190
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).
EDA_RECT getBoundingBox() override
Returns a PAINTER instance used to draw the items.
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:68
void setupGal(KIGFX::GAL *aGal) override
Returns bounding box of the printed objects (excluding drawing-sheet frame)
Definition: pad.h:57
bool OnPrintPage(int aPage) override
void SetDrillMarks(bool aRealSize, unsigned int aSize=0)
Set drill marks visibility and options.
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_Pagination
Abstract interface for drawing on a 2D-surface.