KiCad PCB EDA Suite
Loading...
Searching...
No Matches
plotcontroller.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 Lorenzo Marcantonio, <[email protected]>
5 * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
30#ifndef PLOTCONTROLLER_H_
31#define PLOTCONTROLLER_H_
32
33#include <pcb_plot_params.h>
34#include <layer_ids.h>
35
36class PLOTTER;
37class BOARD;
38
39
45{
46public:
48 PLOT_CONTROLLER( BOARD *aBoard );
49
54
59
60 void SetLayer( int aLayer ) { m_plotLayer = aLayer; }
61 int GetLayer() { return m_plotLayer; }
62
63
67 bool IsPlotOpen() const { return m_plotter != nullptr; }
68
72 void ClosePlot();
73
82 bool OpenPlotfile( const wxString& aSuffix, PLOT_FORMAT aFormat,
83 const wxString& aSheetName = wxEmptyString,
84 const wxString& aSheetPath = wxEmptyString );
85
89 bool PlotLayer();
90
98 bool PlotLayers( const LSEQ& aLayerSequence );
99
103 const wxString GetPlotFileName() { return m_plotFile.GetFullPath(); }
104
108 const wxString GetPlotDirName() { return m_plotFile.GetPathWithSep(); }
109
115 void SetColorMode( bool aColorMode );
116
121 bool GetColorMode();
122
124
125private:
128
130 // requested
132
134 wxFileName m_plotFile;
135};
136
137#endif
138
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:520
Parameters and options when plotting/printing a board.
Base plotter engine class.
Definition: plotter.h:104
Batch plotter state object.
bool IsPlotOpen() const
~PLOT_CONTROLLER()
Ensure that the last plot is closed.
Definition: pcbplot.cpp:401
PLOTTER * GetPlotter()
bool GetColorMode()
Definition: pcbplot.cpp:521
wxFileName m_plotFile
bool PlotLayer()
Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
Definition: pcbplot.cpp:482
PCB_PLOT_PARAMS m_plotOptions
void SetColorMode(bool aColorMode)
Choose color or bland and white plot mode.
Definition: pcbplot.cpp:512
bool OpenPlotfile(const wxString &aSuffix, PLOT_FORMAT aFormat, const wxString &aSheetName=wxEmptyString, const wxString &aSheetPath=wxEmptyString)
Open a new plotfile; works as a factory for plotter objects/.
Definition: pcbplot.cpp:427
bool PlotLayers(const LSEQ &aLayerSequence)
Plot a sequence of board layer IDs in the given order.
Definition: pcbplot.cpp:497
PLOTTER * m_plotter
This is the plotter object; it starts NULL and become instantiated when a plotfile is.
PCB_PLOT_PARAMS & GetPlotOptions()
Accessor to the plot parameters and options.
void SetLayer(int aLayer)
const wxString GetPlotFileName()
void ClosePlot()
Close the current plot, nothing happens if it isn't open.
Definition: pcbplot.cpp:411
const wxString GetPlotDirName()
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:64