2018-09-19 13:06:29 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 CERN
|
2022-08-30 23:28:18 +00:00
|
|
|
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2021-01-27 22:15:38 +00:00
|
|
|
*
|
|
|
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
2018-09-19 13:06:29 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PCBNEW_PRINTOUT_H
|
|
|
|
#define PCBNEW_PRINTOUT_H
|
|
|
|
|
|
|
|
#include <board_printout.h>
|
2018-09-28 21:45:48 +00:00
|
|
|
#include <pcb_painter.h>
|
2022-11-12 07:48:25 +00:00
|
|
|
#include <plotprint_opts.h>
|
2018-09-19 13:06:29 +00:00
|
|
|
|
|
|
|
class BOARD;
|
|
|
|
|
2018-10-05 14:41:17 +00:00
|
|
|
struct PCBNEW_PRINTOUT_SETTINGS : BOARD_PRINTOUT_SETTINGS
|
|
|
|
{
|
|
|
|
PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo );
|
|
|
|
|
2022-11-12 07:48:25 +00:00
|
|
|
enum DRILL_MARKS m_DrillMarks;
|
2018-10-05 14:41:17 +00:00
|
|
|
|
|
|
|
enum PAGINATION_T {
|
|
|
|
LAYER_PER_PAGE,
|
|
|
|
ALL_LAYERS
|
2021-04-16 12:12:55 +00:00
|
|
|
} m_Pagination;
|
2018-10-05 14:41:17 +00:00
|
|
|
|
2021-04-16 12:12:55 +00:00
|
|
|
bool m_PrintEdgeCutsOnAllPages; ///< Print board outline on each page
|
|
|
|
bool m_AsItemCheckboxes; ///< Honor checkboxes in the Items tab of the Layers Manager
|
2018-10-05 14:41:17 +00:00
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
void Load( APP_SETTINGS_BASE* aConfig ) override;
|
|
|
|
void Save( APP_SETTINGS_BASE* aConfig ) override;
|
2018-10-05 14:41:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-09-19 13:06:29 +00:00
|
|
|
class PCBNEW_PRINTOUT : public BOARD_PRINTOUT
|
|
|
|
{
|
|
|
|
public:
|
2018-10-05 14:41:17 +00:00
|
|
|
PCBNEW_PRINTOUT( BOARD* aBoard, const PCBNEW_PRINTOUT_SETTINGS& aParams,
|
2018-10-06 16:51:46 +00:00
|
|
|
const KIGFX::VIEW* aView, const wxString& aTitle );
|
2018-09-19 13:06:29 +00:00
|
|
|
|
|
|
|
bool OnPrintPage( int aPage ) override;
|
|
|
|
|
|
|
|
protected:
|
2018-10-06 16:51:46 +00:00
|
|
|
int milsToIU( double aMils ) const override;
|
|
|
|
|
2020-01-17 11:56:07 +00:00
|
|
|
void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet ) override;
|
2018-09-28 08:10:08 +00:00
|
|
|
|
2020-01-17 11:56:07 +00:00
|
|
|
void setupPainter( KIGFX::PAINTER& aPainter ) override;
|
2018-09-28 21:45:48 +00:00
|
|
|
|
2018-09-29 10:13:06 +00:00
|
|
|
void setupGal( KIGFX::GAL* aGal ) override;
|
|
|
|
|
2022-08-30 23:28:18 +00:00
|
|
|
BOX2I getBoundingBox() override;
|
2018-09-19 13:06:29 +00:00
|
|
|
|
|
|
|
std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
BOARD* m_board;
|
2018-10-05 14:41:17 +00:00
|
|
|
|
|
|
|
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings;
|
2018-09-19 13:06:29 +00:00
|
|
|
};
|
|
|
|
|
2018-09-28 21:45:48 +00:00
|
|
|
|
|
|
|
namespace KIGFX {
|
2021-01-27 22:15:38 +00:00
|
|
|
|
2018-09-28 21:45:48 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Special flavor of PCB_PAINTER that contains modifications to handle printing options.
|
2018-09-28 21:45:48 +00:00
|
|
|
*/
|
|
|
|
class PCB_PRINT_PAINTER : public PCB_PAINTER
|
|
|
|
{
|
|
|
|
public:
|
2018-10-08 13:50:59 +00:00
|
|
|
PCB_PRINT_PAINTER( GAL* aGal );
|
2018-09-28 21:45:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set drill marks visibility and options.
|
2021-01-27 22:15:38 +00:00
|
|
|
*
|
2018-09-28 21:45:48 +00:00
|
|
|
* @param aRealSize when enabled, drill marks represent actual holes. Otherwise aSize
|
2021-01-27 22:15:38 +00:00
|
|
|
* parameter is used.
|
2018-09-28 21:45:48 +00:00
|
|
|
* @param aSize is drill mark size (internal units), valid only when aRealSize == false.
|
|
|
|
*/
|
|
|
|
void SetDrillMarks( bool aRealSize, unsigned int aSize = 0 )
|
|
|
|
{
|
|
|
|
m_drillMarkReal = aRealSize;
|
|
|
|
m_drillMarkSize = aSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2020-11-12 22:30:02 +00:00
|
|
|
int getDrillShape( const PAD* aPad ) const override;
|
2018-09-28 21:45:48 +00:00
|
|
|
|
2022-11-12 14:23:46 +00:00
|
|
|
SHAPE_SEGMENT getPadHoleShape( const PAD* aPad ) const override;
|
2018-09-28 21:45:48 +00:00
|
|
|
|
2022-11-12 14:23:46 +00:00
|
|
|
int getViaDrillSize( const PCB_VIA* aVia ) const override;
|
2018-09-28 21:45:48 +00:00
|
|
|
|
2021-01-27 22:15:38 +00:00
|
|
|
///< Flag deciding whether use the actual hole size or user-specified size for drill marks
|
2018-09-28 21:45:48 +00:00
|
|
|
bool m_drillMarkReal;
|
|
|
|
|
2021-01-27 22:15:38 +00:00
|
|
|
///< User-specified size for drill marks (expressed in internal units)
|
2018-09-28 21:45:48 +00:00
|
|
|
int m_drillMarkSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace KIGFX
|
|
|
|
|
2018-09-19 13:06:29 +00:00
|
|
|
#endif /* PCBNEW_PRINTOUT_H */
|