KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PLOT_CONTROLLER Class Reference

Batch plotter state object. More...

#include <plotcontroller.h>

Public Member Functions

 PLOT_CONTROLLER (BOARD *aBoard)
 Batch plotter constructor, nothing interesting here.
 
 ~PLOT_CONTROLLER ()
 Ensure that the last plot is closed.
 
PCB_PLOT_PARAMSGetPlotOptions ()
 Accessor to the plot parameters and options.
 
void SetLayer (int aLayer)
 
int GetLayer ()
 
bool IsPlotOpen () const
 
void ClosePlot ()
 Close the current plot, nothing happens if it isn't open.
 
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/.
 
bool PlotLayer ()
 Plot a single layer on the current plotfile m_plotLayer is the layer to plot.
 
bool PlotLayers (const LSEQ &aLayerSequence)
 Plot a sequence of board layer IDs in the given order.
 
const wxString GetPlotFileName ()
 
const wxString GetPlotDirName ()
 
void SetColorMode (bool aColorMode)
 Choose color or bland and white plot mode.
 
bool GetColorMode ()
 
PLOTTERGetPlotter ()
 

Private Attributes

int m_plotLayer
 
PCB_PLOT_PARAMS m_plotOptions
 
PLOTTERm_plotter
 This is the plotter object; it starts NULL and become instantiated when a plotfile is.
 
BOARDm_board
 
wxFileName m_plotFile
 

Detailed Description

Batch plotter state object.

Keeps the plot options and handles multiple plot requests. Useful in Python scripts.

Definition at line 44 of file plotcontroller.h.

Constructor & Destructor Documentation

◆ PLOT_CONTROLLER()

PLOT_CONTROLLER::PLOT_CONTROLLER ( BOARD aBoard)

Batch plotter constructor, nothing interesting here.

Definition at line 393 of file pcbplot.cpp.

References m_board, m_plotLayer, m_plotter, and UNDEFINED_LAYER.

◆ ~PLOT_CONTROLLER()

PLOT_CONTROLLER::~PLOT_CONTROLLER ( )

Ensure that the last plot is closed.

Definition at line 401 of file pcbplot.cpp.

References ClosePlot().

Member Function Documentation

◆ ClosePlot()

void PLOT_CONTROLLER::ClosePlot ( )

Close the current plot, nothing happens if it isn't open.

Definition at line 411 of file pcbplot.cpp.

References PLOTTER::EndPlot(), m_plotter, and PLOTTER::RenderSettings().

Referenced by OpenPlotfile(), and ~PLOT_CONTROLLER().

◆ GetColorMode()

bool PLOT_CONTROLLER::GetColorMode ( )
Returns
true if the current plot color mode is color or false if the current plot color mode is black and white.

Definition at line 521 of file pcbplot.cpp.

References PLOTTER::GetColorMode(), and m_plotter.

◆ GetLayer()

int PLOT_CONTROLLER::GetLayer ( )
inline

Definition at line 61 of file plotcontroller.h.

References m_plotLayer.

Referenced by OpenPlotfile(), and PlotLayer().

◆ GetPlotDirName()

const wxString PLOT_CONTROLLER::GetPlotDirName ( )
inline
Returns
the current plot full filename, set by OpenPlotfile

Definition at line 108 of file plotcontroller.h.

References m_plotFile.

◆ GetPlotFileName()

const wxString PLOT_CONTROLLER::GetPlotFileName ( )
inline
Returns
the current plot full filename, set by OpenPlotfile

Definition at line 103 of file plotcontroller.h.

References m_plotFile.

◆ GetPlotOptions()

PCB_PLOT_PARAMS & PLOT_CONTROLLER::GetPlotOptions ( )
inline

Accessor to the plot parameters and options.

Definition at line 58 of file plotcontroller.h.

References m_plotOptions.

Referenced by OpenPlotfile(), PlotLayer(), and PlotLayers().

◆ GetPlotter()

PLOTTER * PLOT_CONTROLLER::GetPlotter ( )
inline

Definition at line 123 of file plotcontroller.h.

References m_plotter.

◆ IsPlotOpen()

bool PLOT_CONTROLLER::IsPlotOpen ( ) const
inline
Returns
true if a plotter is initialized and can be used.

Definition at line 67 of file plotcontroller.h.

References m_plotter.

◆ OpenPlotfile()

bool PLOT_CONTROLLER::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/.

Parameters
aSuffixis a string added to the base filename (derived from the board filename) to identify the plot file.
aFormatis the plot file format identifier.
aSheetNameis the text to be displayed in the title block that replaces ${SHEETNAME}
aSheetPathis the text to be displayed in the title block that replaces ${SHEETPATH}

Definition at line 427 of file pcbplot.cpp.

References BuildPlotFileName(), ClosePlot(), EnsureFileDirectoryExists(), ExpandEnvVarSubstitutions(), ExpandTextVars(), GetDefaultPlotExtension(), BOARD::GetFileName(), GetGerberProtelExtension(), GetLayer(), PCB_PLOT_PARAMS::GetOutputDirectory(), GetPlotOptions(), m_board, m_plotFile, m_plotter, BOARD::ResolveTextVar(), PCB_PLOT_PARAMS::SetFormat(), StartPlotBoard(), and ToLAYER_ID().

◆ PlotLayer()

bool PLOT_CONTROLLER::PlotLayer ( )

Plot a single layer on the current plotfile m_plotLayer is the layer to plot.

Definition at line 482 of file pcbplot.cpp.

References GetLayer(), GetPlotOptions(), m_board, m_plotter, PlotInteractiveLayer(), PlotOneBoardLayer(), and ToLAYER_ID().

◆ PlotLayers()

bool PLOT_CONTROLLER::PlotLayers ( const LSEQ aLayerSequence)

Plot a sequence of board layer IDs in the given order.

Parameters
aLayerSequenceis the sequence of layer IDs to plot.
Returns
true if the layers plotted correctly othewise false.

Definition at line 497 of file pcbplot.cpp.

References GetPlotOptions(), m_board, m_plotter, PlotBoardLayers(), and PlotInteractiveLayer().

◆ SetColorMode()

void PLOT_CONTROLLER::SetColorMode ( bool  aColorMode)

Choose color or bland and white plot mode.

Parameters
aColorModeset to true to activate the plot color mode or false for black and white.

Definition at line 512 of file pcbplot.cpp.

References m_plotter, and PLOTTER::SetColorMode().

◆ SetLayer()

void PLOT_CONTROLLER::SetLayer ( int  aLayer)
inline

Definition at line 60 of file plotcontroller.h.

References m_plotLayer.

Member Data Documentation

◆ m_board

BOARD* PLOT_CONTROLLER::m_board
private

Definition at line 133 of file plotcontroller.h.

Referenced by OpenPlotfile(), PLOT_CONTROLLER(), PlotLayer(), and PlotLayers().

◆ m_plotFile

wxFileName PLOT_CONTROLLER::m_plotFile
private

Definition at line 134 of file plotcontroller.h.

Referenced by GetPlotDirName(), GetPlotFileName(), and OpenPlotfile().

◆ m_plotLayer

int PLOT_CONTROLLER::m_plotLayer
private

Definition at line 126 of file plotcontroller.h.

Referenced by GetLayer(), PLOT_CONTROLLER(), and SetLayer().

◆ m_plotOptions

PCB_PLOT_PARAMS PLOT_CONTROLLER::m_plotOptions
private

Definition at line 127 of file plotcontroller.h.

Referenced by GetPlotOptions().

◆ m_plotter

PLOTTER* PLOT_CONTROLLER::m_plotter
private

This is the plotter object; it starts NULL and become instantiated when a plotfile is.

Definition at line 131 of file plotcontroller.h.

Referenced by ClosePlot(), GetColorMode(), GetPlotter(), IsPlotOpen(), OpenPlotfile(), PLOT_CONTROLLER(), PlotLayer(), PlotLayers(), and SetColorMode().


The documentation for this class was generated from the following files: