KiCad PCB EDA Suite
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, <l.marcantonio@logossrl.com>
5  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
6  * Copyright (C) 1992-2015 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>
35 
36 class PLOTTER;
37 class BOARD;
38 
39 
46 {
47 public:
49  PLOT_CONTROLLER( BOARD *aBoard );
50 
54 
59 
60  void SetLayer( LAYER_NUM aLayer ) { m_plotLayer = aLayer; }
62 
63 
67  bool IsPlotOpen() const { return m_plotter != NULL; }
68 
71  void ClosePlot();
72 
79  bool OpenPlotfile( const wxString &aSuffix, PlotFormat aFormat,
80  const wxString &aSheetDesc );
81 
85  bool PlotLayer();
86 
90  const wxString GetPlotFileName() { return m_plotFile.GetFullPath(); }
91 
95  const wxString GetPlotDirName() { return m_plotFile.GetPathWithSep(); }
96 
102  void SetColorMode( bool );
103 
108  bool GetColorMode();
109 
110 private:
113 
116 
120 
123 
125  wxFileName m_plotFile;
126 };
127 
128 #endif
129 
PCB_PLOT_PARAMS & GetPlotOptions()
Accessor to the plot parameters and options.
LAYER_NUM GetLayer()
const wxString GetPlotDirName()
~PLOT_CONTROLLER()
Batch plotter destructor, ensures that the last plot is closed.
Definition: pcbplot.cpp:525
bool IsPlotOpen() const
void ClosePlot()
Close the current plot, nothing happens if it isn't open.
Definition: pcbplot.cpp:535
PLOTTER * m_plotter
This is the plotter object; it starts NULL and become instantiated when a plotfile is requested...
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: plot_common.h:49
PCB_PLOT_PARAMS m_plotOptions
Option bank.
bool GetColorMode()
Definition: pcbplot.cpp:616
wxFileName m_plotFile
The current plot filename, set by OpenPlotfile.
BOARD * m_board
The board we're plotting.
PLOT_CONTROLLER(BOARD *aBoard)
Batch plotter constructor, nothing interesting here.
Definition: pcbplot.cpp:517
Batch plotter state object.
void SetLayer(LAYER_NUM aLayer)
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Base plotter engine class.
Definition: plot_common.h:86
const wxString GetPlotFileName()
void SetColorMode(bool)
Plotters can plot in Black and White mode or Color mode SetColorMode activate/de-actiavte the Color m...
Definition: pcbplot.cpp:607
Board layer functions and definitions.
bool OpenPlotfile(const wxString &aSuffix, PlotFormat aFormat, const wxString &aSheetDesc)
Open a new plotfile; works as a factory for plotter objects.
Definition: pcbplot.cpp:548
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
bool PlotLayer()
Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
Definition: pcbplot.cpp:592
LAYER_NUM m_plotLayer
the layer to plot