2013-05-10 19:22:29 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Lorenzo Marcantonio, <l.marcantonio@logossrl.com>
|
|
|
|
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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 2
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
/**
|
|
|
|
* @file pcbnew/pcbplot.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLOTCONTROLLER_H_
|
|
|
|
#define PLOTCONTROLLER_H_
|
|
|
|
|
|
|
|
#include <pcb_plot_params.h>
|
|
|
|
#include <layers_id_colors_and_visibility.h>
|
|
|
|
|
|
|
|
class PLOTTER;
|
|
|
|
class BOARD;
|
2013-05-10 19:22:29 +00:00
|
|
|
class REPORTER;
|
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
|
2013-05-10 19:22:29 +00:00
|
|
|
/**
|
2012-08-29 16:59:50 +00:00
|
|
|
* Batch plotter state object. Keeps the plot options and handles multiple
|
|
|
|
* plot requests
|
|
|
|
*/
|
|
|
|
class PLOT_CONTROLLER
|
|
|
|
{
|
|
|
|
public:
|
2013-05-10 19:22:29 +00:00
|
|
|
/** Batch plotter constructor, nothing interesting here */
|
2012-08-29 16:59:50 +00:00
|
|
|
PLOT_CONTROLLER( BOARD *aBoard );
|
2013-05-10 19:22:29 +00:00
|
|
|
|
|
|
|
/** Batch plotter destructor, ensures that the last plot is closed */
|
2012-08-29 16:59:50 +00:00
|
|
|
~PLOT_CONTROLLER();
|
2013-05-10 19:22:29 +00:00
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
PCB_PLOT_PARAMS *AccessPlotOpts() { return &m_plotOpts; }
|
|
|
|
bool IsPlotOpen() const { return m_plotter != NULL; }
|
2013-05-10 19:22:29 +00:00
|
|
|
|
|
|
|
/** Close the current plot, nothing happens if it isn't open */
|
2012-08-29 16:59:50 +00:00
|
|
|
void ClosePlot();
|
2013-05-10 19:22:29 +00:00
|
|
|
|
|
|
|
/** Open a new plotfile; works as a factory for plotter objects
|
|
|
|
*/
|
2012-08-29 16:59:50 +00:00
|
|
|
bool OpenPlotfile( const wxString &aSuffix, PlotFormat aFormat,
|
|
|
|
const wxString &aSheetDesc );
|
2013-05-10 19:22:29 +00:00
|
|
|
|
|
|
|
/** Plot a single layer on the current plotfile */
|
2013-03-31 13:27:46 +00:00
|
|
|
bool PlotLayer( LAYER_NUM layer );
|
2013-05-10 19:22:29 +00:00
|
|
|
|
2013-04-18 21:21:26 +00:00
|
|
|
void SetColorMode( bool aColorMode );
|
|
|
|
bool GetColorMode();
|
2012-08-29 16:59:50 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// Option bank
|
|
|
|
PCB_PLOT_PARAMS m_plotOpts;
|
2013-05-10 19:22:29 +00:00
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
/// This is the plotter object; it starts NULL and become instantiated
|
2013-05-10 19:22:29 +00:00
|
|
|
/// when a plotfile is requested
|
|
|
|
PLOTTER* m_plotter;
|
2012-08-29 16:59:50 +00:00
|
|
|
|
|
|
|
/// The board we're plotting
|
|
|
|
BOARD* m_board;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|