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;
38class LSEQ;
39
40
46{
47public:
49 PLOT_CONTROLLER( BOARD *aBoard );
50
55
60
61 void SetLayer( int aLayer ) { m_plotLayer = aLayer; }
62 int GetLayer() { return m_plotLayer; }
63
64
68 bool IsPlotOpen() const { return m_plotter != nullptr; }
69
73 void ClosePlot();
74
83 bool OpenPlotfile( const wxString& aSuffix, PLOT_FORMAT aFormat,
84 const wxString& aSheetName = wxEmptyString,
85 const wxString& aSheetPath = wxEmptyString );
86
90 bool PlotLayer();
91
99 bool PlotLayers( const LSEQ& aLayerSequence );
100
104 const wxString GetPlotFileName() { return m_plotFile.GetFullPath(); }
105
109 const wxString GetPlotDirName() { return m_plotFile.GetPathWithSep(); }
110
116 void SetColorMode( bool aColorMode );
117
122 bool GetColorMode();
123
125
126private:
129
131 // requested
133
135 wxFileName m_plotFile;
136};
137
138#endif
139
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: lseq.h:47
Parameters and options when plotting/printing a board.
Base plotter engine class.
Definition: plotter.h:105
Batch plotter state object.
bool IsPlotOpen() const
~PLOT_CONTROLLER()
Ensure that the last plot is closed.
Definition: pcbplot.cpp:419
PLOTTER * GetPlotter()
bool GetColorMode()
Definition: pcbplot.cpp:541
wxFileName m_plotFile
bool PlotLayer()
Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
Definition: pcbplot.cpp:502
PCB_PLOT_PARAMS m_plotOptions
void SetColorMode(bool aColorMode)
Choose color or bland and white plot mode.
Definition: pcbplot.cpp:532
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:445
bool PlotLayers(const LSEQ &aLayerSequence)
Plot a sequence of board layer IDs in the given order.
Definition: pcbplot.cpp:517
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:429
const wxString GetPlotDirName()
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:65