79#include <wx/wfstream.h>
80#include <wx/zipstrm.h>
105 m_cliBoard( nullptr )
108 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
115 wxCHECK( svgJob && editFrame,
false );
122 [](
JOB* job, wxWindow* aParent ) ->
bool
128 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
135 wxCHECK( svgJob && editFrame,
false );
142 [](
JOB* job, wxWindow* aParent ) ->
bool
147 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
154 wxCHECK( dxfJob && editFrame,
false );
160 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
167 wxCHECK( pdfJob && editFrame,
false );
174 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
181 wxCHECK( gJob && editFrame,
false );
188 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
195 wxCHECK( gJob && editFrame,
false );
202 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
209 wxCHECK( drillJob && editFrame,
false );
215 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
222 wxCHECK( posJob && editFrame,
false );
229 [](
JOB* job, wxWindow* aParent ) ->
bool
235 [](
JOB* job, wxWindow* aParent ) ->
bool
240 [](
JOB* job, wxWindow* aParent ) ->
bool
248 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
255 wxCHECK( ipcJob && editFrame,
false );
262 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
269 wxCHECK( odbJob && editFrame,
false );
279 BOARD* brd =
nullptr;
283 wxString pcbPath = aPath;
285 if( pcbPath.IsEmpty() )
290 pcbPath =
path.GetFullPath();
321 if( aStepJob ==
nullptr )
336 fn.SetName( fn.GetName() );
445 if( !stepExporter.
Export() )
457 if( aRenderJob ==
nullptr )
493 fn.SetName( wxString::Format(
"%s-%d", fn.GetName(),
static_cast<int>( aRenderJob->
m_side ) ) );
570 lightColor, lightColor, lightColor, lightColor,
571 lightColor, lightColor, lightColor, lightColor,
577 sideElevation, sideElevation, sideElevation, sideElevation,
578 -sideElevation, -sideElevation, -sideElevation, -sideElevation,
582 45, 135, 225, 315, 45, 135, 225, 315,
586 boardAdapter.
m_Cfg = cfg;
598 static std::map<JOB_PCB_RENDER::SIDE, VIEW3D_TYPE> s_viewCmdMap = {
608 : PROJECTION_TYPE::ORTHO;
648 uint8_t* rgbaBuffer = raytrace.
GetBuffer();
650 bool success = !!rgbaBuffer;
654 const unsigned int wxh = realSize.x * realSize.y;
656 unsigned char* rgbBuffer = (
unsigned char*) malloc( wxh * 3 );
657 unsigned char* alphaBuffer = (
unsigned char*) malloc( wxh );
659 unsigned char* rgbaPtr = rgbaBuffer;
660 unsigned char* rgbPtr = rgbBuffer;
661 unsigned char* alphaPtr = alphaBuffer;
663 for(
int y = 0; y < realSize.y; y++ )
665 for(
int x = 0; x < realSize.x; x++ )
667 rgbPtr[0] = rgbaPtr[0];
668 rgbPtr[1] = rgbaPtr[1];
669 rgbPtr[2] = rgbaPtr[2];
670 alphaPtr[0] = rgbaPtr[3];
678 wxImage
image( realSize );
679 image.SetData( rgbBuffer );
680 image.SetAlpha( alphaBuffer );
683 image.SetOption( wxIMAGE_OPTION_QUALITY, 90 );
684 image.SaveFile( outPath,
686 : wxBITMAP_TYPE_JPEG );
708 if( aSvgJob ==
nullptr )
723 fn.SetName( fn.GetName() );
747 std::optional<wxString> layerName;
748 std::optional<wxString> sheetName;
749 std::optional<wxString> sheetPath;
781 if( aDxfJob ==
nullptr )
800 fn.SetName( fn.GetName() );
820 std::optional<wxString> layerName;
821 std::optional<wxString> sheetName;
822 std::optional<wxString> sheetPath;
839 sheetName, sheetPath ) )
852 if( aPdfJob ==
nullptr )
869 fn.SetName( fn.GetName() );
896 std::optional<wxString> layerName;
897 std::optional<wxString> sheetName;
898 std::optional<wxString> sheetPath;
933 if( aGerberJob ==
nullptr )
989 plotSequence.push_back( layer );
995 if(
find( plotSequence.begin(), plotSequence.end(), layer_all ) != plotSequence.end() )
998 plotSequence.push_back( layer_all );
1009 plotOpts = boardPlotOptions;
1019 wxString fullname = fn.GetFullName();
1021 jobfile_writer.
AddGbrFile( layer, fullname );
1037 fn.GetFullPath(), sheetName, sheetPath );
1042 m_reporter->
Report( wxString::Format(
_(
"Plotted to '%s'.\n" ), fn.GetFullPath() ),
1072 if( aGencadJob ==
nullptr )
1077 if( brd ==
nullptr )
1096 fn.SetName( fn.GetName() );
1112 m_reporter->
Report( wxString::Format(
_(
"Failed to create file '%s'.\n" ), outPath ),
1127 aPlotOpts.
SetFormat( PLOT_FORMAT::GERBER );
1152 if( aGerberJob ==
nullptr )
1167 fn.SetName( fn.GetName() );
1204 sheetName, sheetPath );
1232 if( aDrillJob ==
nullptr )
1250 std::unique_ptr<GENDRILL_WRITER_BASE> drillWriter;
1253 drillWriter = std::make_unique<EXCELLON_WRITER>( brd );
1255 drillWriter = std::make_unique<GERBER_WRITER>( brd );
1305 if( excellonWriter ==
nullptr )
1327 if( gerberWriter ==
nullptr )
1352 if( aPosJob ==
nullptr )
1365 fn.SetName( fn.GetName() );
1388 wxFileName fn( outPath );
1389 wxString baseName = fn.GetName();
1391 auto exportPlaceFile =
1392 [&](
bool frontSide,
bool backSide,
const wxString& curr_outPath ) ->
bool
1394 FILE* file = wxFopen( curr_outPath, wxS(
"wt" ) );
1395 wxCHECK( file,
false );
1409 fputs( data.c_str(), file );
1422 if( exportPlaceFile(
true,
false, fn.GetFullPath() ) )
1424 m_reporter->
Report( wxString::Format(
_(
"Wrote front position data to '%s'.\n" ),
1440 if( exportPlaceFile(
false,
true, fn.GetFullPath() ) )
1442 m_reporter->
Report( wxString::Format(
_(
"Wrote back position data to '%s'.\n" ),
1469 if( exportPlaceFile( front, back, fn.GetFullPath() ) )
1487 wxString outPath_base = outPath;
1497 m_reporter->
Report( wxString::Format(
_(
"Wrote front position data to '%s'.\n" ),
1514 outPath = outPath_base;
1521 m_reporter->
Report( wxString::Format(
_(
"Wrote back position data to '%s'.\n" ),
1538 const wxString& aName );
1545 if( upgradeJob ==
nullptr )
1562 m_reporter->
Report(
_(
"Output path must be specified to convert legacy and non-KiCad libraries\n" ),
1572 m_reporter->
Report(
_(
"Footprint library path does not exist or is not accessible\n" ),
1590 bool shouldSave = upgradeJob->
m_force;
1594 if( footprint.second->GetFootprint()->GetFileFormatVersionAtLoad()
1639 if( svgJob ==
nullptr )
1665 bool singleFpPlotted =
false;
1666 for( FP_CACHE_FOOTPRINT_MAP::iterator it = footprintMap.begin(); it != footprintMap.end();
1669 const FOOTPRINT* fp = it->second->GetFootprint();
1679 singleFpPlotted =
true;
1688 if( !svgJob->
m_footprint.IsEmpty() && !singleFpPlotted )
1690 m_reporter->
Report(
_(
"The given footprint could not be found to export." ) + wxS(
"\n" ),
1702 std::unique_ptr<BOARD> brd;
1705 brd->SynchronizeProperties();
1718 pad->SetLocalRatsnestVisible(
false );
1719 pad->SetNetCode( 0 );
1725 brd->Add( fp, ADD_MODE::INSERT,
true );
1727 wxFileName outputFile;
1734 outputFile.GetFullPath() ),
1741 svgPlotOptions.
m_outputFile = outputFile.GetFullPath();
1762 if( drcJob ==
nullptr )
1777 fn.SetName( fn.GetName() + wxS(
"-drc" ) );
1802 default: units = EDA_UNITS::MILLIMETRES;
break;
1806 std::unique_ptr<NETLIST>
netlist = std::make_unique<NETLIST>();
1815 bool checkParity = drcJob->
m_parity;
1816 std::string netlist_str;
1820 wxString annotateMsg =
_(
"Schematic parity tests require a fully annotated schematic." );
1821 netlist_str = annotateMsg;
1825 if( netlist_str == annotateMsg )
1828 checkParity =
false;
1837 _(
"Eeschema netlist" ) );
1844 m_reporter->
Report(
_(
"Failed to fetch schematic netlist for parity tests.\n" ),
1846 checkParity =
false;
1849 drcEngine->SetSchematicNetlist(
netlist.get() );
1852 drcEngine->SetProgressReporter(
nullptr );
1853 drcEngine->SetViolationHandler(
1854 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer,
1858 commit.
Add( marker );
1864 drcEngine->ClearViolationHandler();
1871 std::shared_ptr<DRC_ITEMS_PROVIDER> markersProvider = std::make_shared<DRC_ITEMS_PROVIDER>(
1874 std::shared_ptr<DRC_ITEMS_PROVIDER> ratsnestProvider =
1877 std::shared_ptr<DRC_ITEMS_PROVIDER> fpWarningsProvider =
1880 markersProvider->SetSeverities( drcJob->
m_severity );
1881 ratsnestProvider->SetSeverities( drcJob->
m_severity );
1882 fpWarningsProvider->SetSeverities( drcJob->
m_severity );
1885 markersProvider->GetCount() ),
1888 ratsnestProvider->GetCount() ),
1893 m_reporter->
Report( wxString::Format(
_(
"Found %d schematic parity issues\n" ),
1894 fpWarningsProvider->GetCount() ),
1898 DRC_REPORT reportWriter( brd, units, markersProvider, ratsnestProvider, fpWarningsProvider );
1900 bool wroteReport =
false;
1909 m_reporter->
Report( wxString::Format(
_(
"Unable to save DRC report to %s\n" ), outPath ),
1914 m_reporter->
Report( wxString::Format(
_(
"Saved DRC Report to %s\n" ), outPath ),
1919 if( markersProvider->GetCount() > 0 || ratsnestProvider->GetCount() > 0
1920 || fpWarningsProvider->GetCount() > 0 )
1934 if( job ==
nullptr )
1947 fn.SetName( fn.GetName() );
1961 std::map<std::string, UTF8> props;
1964 props[
"sigfig"] = wxString::Format(
"%d", job->
m_precision );
1972 wxString tempFile = wxFileName::CreateTempFileName( wxS(
"pcbnew_ipc" ) );
1977 pi->SaveBoard( tempFile, brd, &props );
1981 m_reporter->
Report( wxString::Format(
_(
"Error generating IPC2581 file '%s'.\n%s" ),
1986 wxRemoveFile( tempFile );
1993 wxFileName tempfn = outPath;
1995 wxFileName zipfn = tempFile;
1996 zipfn.SetExt(
"zip" );
1998 wxFFileOutputStream fnout( zipfn.GetFullPath() );
1999 wxZipOutputStream
zip( fnout );
2000 wxFFileInputStream fnin( tempFile );
2002 zip.PutNextEntry( tempfn.GetFullName() );
2007 wxRemoveFile( tempFile );
2008 tempFile = zipfn.GetFullPath();
2012 if( !wxRenameFile( tempFile, outPath ) )
2014 m_reporter->
Report( wxString::Format(
_(
"Error generating IPC2581 file '%s'.\n"
2015 "Failed to rename temporary file '%s." )
2017 outPath, tempFile ),
2029 if( job ==
nullptr )
2051 fn.SetName( fn.GetName() + wxS(
"-odb" ) );
2088 return drawingSheet;
2095 if( aSheetPath.IsEmpty() )
2099 [&](
const wxString&
path ) ->
bool
2115 + wxS(
"\n" ) + msg + wxS(
"\n" ),
2123 if( loadSheet( aSheetPath ) )
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
Helper class to handle information needed to display 3D board.
double BiuTo3dUnits() const noexcept
Board integer units To 3D units.
bool m_IsPreviewer
true if we're in a 3D preview panel, false for the standard 3D viewer
void SetBoard(BOARD *aBoard) noexcept
Set current board to be rendered.
EDA_3D_VIEWER_SETTINGS * m_Cfg
std::map< int, COLOR4D > m_ColorOverrides
allows to override color scheme colors
void Set3dCacheManager(S3D_CACHE *aCacheMgr) noexcept
Update the cache manager pointer.
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
const VECTOR2I & GetAuxOrigin()
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
EMBEDDED_FILES * GetEmbeddedFiles() override
const PAGE_INFO & GetPageSettings() const
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
TITLE_BLOCK & GetTitleBlock()
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
const std::map< wxString, wxString > & GetProperties() const
const wxString & GetFileName() const
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
const PCB_PLOT_PARAMS & GetPlotOptions() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
PROJECT * GetProject() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
void DeleteMARKERs()
Delete all MARKERS from the board.
constexpr const Vec GetCenter() const
void SetProjection(PROJECTION_TYPE aProjection)
void RotateY_T1(float aAngleInRadians)
bool Zoom_T1(float aFactor)
bool SetCurWindowSize(const wxSize &aSize)
Update the windows size of the camera.
bool ViewCommand_T1(VIEW3D_TYPE aRequestedView)
void RotateX_T1(float aAngleInRadians)
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
const SFVEC3F & GetLookAtPos_T1() const
void RotateZ_T1(float aAngleInRadians)
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
static void GenerateODBPPFiles(const JOB_EXPORT_PCB_ODB &aJob, BOARD *aBoard, PCB_EDIT_FRAME *aParentFrame=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr, REPORTER *aErrorReporter=nullptr)
A dialog to set the plot options and create plot files in various formats.
bool WriteJsonReport(const wxString &aFullFileName)
bool WriteTextReport(const wxString &aFullFileName)
Helper to handle drill precision format in excellon files.
bool LoadDrawingSheet(const wxString &aFullFileName, wxString *aMsg, bool aAppend=false)
Populate the list with a custom layout or the default layout if no custom layout is available.
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
void SetSheetPath(const std::string &aSheetPath)
Set the sheet path displayed in the title block.
void SetSheetName(const std::string &aSheetName)
Set the sheet name displayed in the title block.
void SetIsFirstPage(bool aIsFirstPage)
Change if this is first page.
void SetFileName(const std::string &aFileName)
Set the file name displayed in the title block.
void SetFlags(EDA_ITEM_FLAGS aMask)
virtual void SetParent(EDA_ITEM *aParent)
Create Excellon drill, drill map, and drill report files.
void SetFormat(bool aMetric, ZEROS_FMT aZerosFmt=DECIMAL_FORMAT, int aLeftDigits=0, int aRightDigits=0)
Initialize internal parameters to match the given format.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board.
void SetOptions(bool aMirror, bool aMinimalHeader, const VECTOR2I &aOffset, bool aMerge_PTH_NPTH)
Initialize internal parameters to match drill options.
void SetRouteModeForOvalHoles(bool aUseRouteModeForOvalHoles)
bool m_IncludeUnspecified
Wrapper to expose an API for writing VRML files, without exposing all the many structures used in the...
bool ExportVRML_File(PROJECT *aProject, wxString *aMessages, const wxString &aFullFileName, double aMMtoWRMLunit, bool aIncludeUnspecified, bool aIncludeDNP, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Exports the board and its footprint shapes 3D (vrml files only) as a vrml file.
static bool Plot(BOARD *aBoard, const PCB_PLOT_SVG_OPTIONS &aSvgPlotOptions)
Provide an extensible class to resolve 3D model paths.
bool SetProject(PROJECT *aProject, bool *flgChanged=nullptr)
Set the current KiCad project directory as the first entry in the model path list.
void SetProgramBase(PGM_BASE *aBase)
Set a pointer to the application's PGM_BASE instance used to extract the local env vars.
wxString ResolvePath(const wxString &aFileName, const wxString &aWorkingPath, const EMBEDDED_FILES *aFiles)
Determine the full path of the given file name.
FP_CACHE_FOOTPRINT_MAP & GetFootprints()
void Save(FOOTPRINT *aFootprint=nullptr)
Save the footprint cache or a single footprint from it to disk.
void SetPath(const wxString &aPath)
void UseIndividualShapes(bool aUnique)
Make pad shapes unique.
void UsePinNamesUnique(bool aUnique)
Make pin names unique.
void StoreOriginCoordsInFile(bool aStore)
Store coord origin in genCAD file.
void FlipBottomPads(bool aFlip)
Flip pad shapes on the bottom side.
void SetPlotOffet(VECTOR2I aOffset)
Set the coordinates offet when exporting items.
bool WriteFile(const wxString &aFullFileName)
Export a genCAD file.
void SetMapFileFormat(PLOT_FORMAT aMapFmt)
Initialize the format for the drill map file.
GERBER_JOBFILE_WRITER is a class used to create Gerber job file a Gerber job file stores info to make...
bool CreateJobFile(const wxString &aFullFilename)
Creates a Gerber job file.
void AddGbrFile(PCB_LAYER_ID aLayer, wxString &aFilename)
add a gerber file name and type in job file list
virtual bool EndPlot() override
Used to create Gerber drill files.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board filenames are computed from the board name,...
void SetOptions(const VECTOR2I &aOffset)
Initialize internal parameters to match drill options.
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
void Register(const std::string &aJobTypeName, std::function< int(JOB *job)> aHandler, std::function< bool(JOB *job, wxWindow *aParent)> aConfigHandler)
PROGRESS_REPORTER * m_progressReporter
JOB_EXPORT_PCB_3D::FORMAT m_format
EXPORTER_STEP_PARAMS m_3dparams
Despite the name; also used for other formats.
ZEROS_FORMAT m_zeroFormat
bool m_excellonOvalDrillRoute
DRILL_ORIGIN m_drillOrigin
bool m_excellonCombinePTHNPTH
bool m_excellonMinimalHeader
bool m_useIndividualShapes
bool m_useBoardPlotParams
LSEQ m_layersIncludeOnAll
bool m_layersIncludeOnAllSet
bool m_useProtelFileExtension
bool m_includeNetlistAttributes
bool m_disableApertureMacros
bool m_subtractSolderMaskFromSilk
IPC2581_VERSION m_version
ODB_COMPRESSION m_compressionMode
@ ALL_LAYERS_ONE_FILE
DEPRECATED MODE.
@ ONE_PAGE_PER_LAYER_ONE_FILE
The most traditional output mode KiCad has had.
bool m_plotFootprintValues
LSEQ m_printMaskLayersToIncludeOnAllLayers
LSEQ m_printMaskLayer
Layers to include on all individual layer prints.
bool m_useDrillPlaceFileOrigin
bool m_excludeFootprintsWithTh
bool m_sketchDNPFPsOnFabLayers
bool m_hideDNPFPsOnFabLayers
bool m_sketchPadsOnFabLayers
bool m_crossoutDNPFPsOnFabLayers
wxString m_outputDirectory
wxString m_outputLibraryPath
bool m_reportAllTrackErrors
VECTOR3D m_lightBottomIntensity
VECTOR3D m_lightTopIntensity
VECTOR3D m_lightCameraIntensity
VECTOR3D m_lightSideIntensity
std::string m_colorPreset
bool m_exitCodeViolations
An simple container class that lets us dispatch output jobs to kifaces.
void AddOutput(wxString aOutputPath)
wxString GetFullOutputPath(PROJECT *aProject) const
Returns the full output path for the job, taking into account the configured output path,...
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
void SetWorkingOutputPath(const wxString &aPath)
Sets a transient output path for the job, it takes priority over the configured output path when GetF...
const std::map< wxString, wxString > & GetVarOverrides() const
Read the new s-expression based KiCad netlist format.
virtual void LoadNetlist() override
Load the contents of the netlist file into aNetlist.
A color representation with 4 components: red, green, blue, alpha.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
const UTF8 & GetLibItemName() const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
LSEQ SeqStackupForPlotting() const
Return the sequence that is typical for a bottom-to-top stack-up.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static bool EnsurePathExists(const wxString &aPath, bool aPathToFile=false)
Attempts to create a given path if it does not exist.
int JobExportStep(JOB *aJob)
int JobExportPos(JOB *aJob)
int JobExportFpSvg(JOB *aJob)
void populateGerberPlotOptionsFromJob(PCB_PLOT_PARAMS &aPlotOpts, JOB_EXPORT_PCB_GERBER *aJob)
int JobExportOdb(JOB *aJob)
int JobExportDrc(JOB *aJob)
int JobExportFpUpgrade(JOB *aJob)
int JobExportGerber(JOB *aJob)
DS_PROXY_VIEW_ITEM * getDrawingSheetProxyView(BOARD *aBrd)
int JobExportDxf(JOB *aJob)
int JobExportPdf(JOB *aJob)
int JobExportDrill(JOB *aJob)
int JobExportSvg(JOB *aJob)
void loadOverrideDrawingSheet(BOARD *brd, const wxString &aSheetPath)
PCBNEW_JOBS_HANDLER(KIWAY *aKiway)
int JobExportGerbers(JOB *aJob)
int JobExportGencad(JOB *aJob)
BOARD * getBoard(const wxString &aPath=wxEmptyString)
int JobExportIpc2581(JOB *aJob)
int JobExportRender(JOB *aJob)
int doFpExportSvg(JOB_FP_EXPORT_SVG *aSvgJob, const FOOTPRINT *aFootprint)
The main frame for Pcbnew.
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
static PCB_IO * PluginFind(PCB_FILE_T aFileType)
Return a #PLUGIN which the caller can use to import, export, save, or load design documents.
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
@ KICAD_SEXP
S-expression Pcbnew file format.
static bool ConvertLibrary(std::map< std::string, UTF8 > *aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilePath, REPORTER *aReporter)
Convert a schematic symbol library to the latest KiCad format.
static PCB_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath, int aCtl=0)
Return a plugin type given a footprint library's libPath.
bool Plot(const wxString &aOutputPath, const LSEQ &aLayersToPlot, const LSEQ &aCommonLayers, bool aUseGerberFileExtensions, bool aOutputPathIsSingle=false, std::optional< wxString > aLayerName=std::nullopt, std::optional< wxString > aSheetName=std::nullopt, std::optional< wxString > aSheetPath=std::nullopt)
static void PlotJobToPlotOpts(PCB_PLOT_PARAMS &aOpts, JOB_EXPORT_PCB_PLOT *aJob)
Translate a JOB to PCB_PLOT_PARAMS.
Parameters and options when plotting/printing a board.
void SetDrillMarksType(DRILL_MARKS aVal)
void SetLayerSelection(LSET aSelection)
void SetPlotReference(bool aFlag)
void SetUseGerberX2format(bool aUse)
void SetPlotFrameRef(bool aFlag)
LSET GetLayerSelection() const
void SetPlotOnAllLayersSelection(LSET aSelection)
LSET GetPlotOnAllLayersSelection() const
void SetDisableGerberMacros(bool aDisable)
void SetGerberPrecision(int aPrecision)
void SetSubtractMaskFromSilk(bool aSubtract)
void SetPlotValue(bool aFlag)
void SetUseGerberProtelExtensions(bool aUse)
void SetIncludeGerberNetlistInfo(bool aUse)
bool m_PDFSingle
Generate a single PDF file for all layers.
void SetUseAuxOrigin(bool aAux)
bool GetUseGerberProtelExtensions() const
void SetFormat(PLOT_FORMAT aFormat)
virtual SETTINGS_MANAGER & GetSettingsManager() const
Used to create Gerber drill files.
const wxString GetPlaceFileName(const wxString &aFullBaseFilename, PCB_LAYER_ID aLayer) const
int CreatePlaceFile(const wxString &aFullFilename, PCB_LAYER_ID aLayer, bool aIncludeBrdEdges)
Create an pnp gerber file.
The ASCII format of the kicad place file is:
static wxString DecorateFilename(const wxString &aBaseName, bool aFront, bool aBack)
std::string GenPositionData()
build a string filled with the position data
wxString m_BoardDrawingSheetFile
PcbNew params.
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
virtual const wxString GetProjectPath() const
Return the full path of the project.
virtual void ApplyTextVars(const std::map< wxString, wxString > &aVarsMap)
Applies the given var map, it will create or update existing vars.
virtual PROJECT_FILE & GetProjectFile() const
bool Redraw(bool aIsMoving, REPORTER *aStatusReporter, REPORTER *aWarningReporter) override
Redraw the view.
wxSize GetRealBufferSize()
void SetCurWindowSize(const wxSize &aSize) override
Before each render, the canvas will tell the render what is the size of its windows,...
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
void Pan_T1(const SFVEC3F &aDeltaOffsetInc) override
void SetT0_and_T1_current_T() override
This will set T0 and T1 with the current values.
void Interpolate(float t) override
It will update the matrix to interpolate between T0 and T1 values.
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Return the default plot extension for a format.
static DRILL_PRECISION precisionListForInches(2, 4)
static DRILL_PRECISION precisionListForMetric(3, 3)
std::function< void(PCB_MARKER *aMarker)> DRC_CUSTOM_MARKER_HANDLER
static constexpr EDA_ANGLE ANGLE_0
#define IS_NEW
New item, just created.
static FILENAME_RESOLVER * resolver
Classes used in drill files, map files and report files generation.
Classes used in drill files, map files and report files generation.
Classes used to generate a Gerber job file in JSON.
Classes used in place file generation.
static const std::string BrepFileExtension
static const std::string JpegFileExtension
static const std::string GerberJobFileExtension
static const std::string GerberFileExtension
static const std::string XaoFileExtension
static const std::string ReportFileExtension
static const std::string GltfBinaryFileExtension
static const std::string PngFileExtension
static const std::string FootprintPlaceFileExtension
static const std::string JsonFileExtension
static const std::string CsvFileExtension
static const std::string Ipc2581FileExtension
static const std::string GencadFileExtension
static const std::string StlFileExtension
static const std::string PlyFileExtension
static const std::string StepFileExtension
static const std::string SVGFileExtension
static const std::string VrmlFileExtension
static const std::string ArchiveFileExtension
static const std::string KiCadPcbFileExtension
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
@ LAYER_3D_BACKGROUND_TOP
@ LAYER_3D_BACKGROUND_BOTTOM
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
static const int ERR_RC_VIOLATIONS
Rules check violation count was greater than 0.
static const int ERR_INVALID_INPUT_FILE
static const int ERR_INVALID_OUTPUT_CONFLICT
static const int ERR_UNKNOWN
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
boost::ptr_map< wxString, FP_CACHE_ITEM > FP_CACHE_FOOTPRINT_MAP
#define CTL_FOR_LIBRARY
Format output for a footprint library instead of clipboard or BOARD.
static DRILL_PRECISION precisionListForInches(2, 4)
static DRILL_PRECISION precisionListForMetric(3, 3)
FOOTPRINT * try_load_footprint(const wxFileName &aFileName, PCB_IO_MGR::PCB_FILE_T aFileType, const wxString &aName)
SETTINGS_MANAGER * GetSettingsManager()
BOARD * CreateEmptyBoard()
Construct a default BOARD with a temporary (no filename) project.
BOARD * LoadBoard(const wxString &aFileName, bool aSetActive)
Loads a board from file This function identifies the file type by extension and determines the correc...
const wxString GetGerberProtelExtension(int aLayer)
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aLayerName, const wxString &aFullFileName, const wxString &aSheetName, const wxString &aSheetPath, const wxString &aPageName=wxT("1"), const wxString &aPageNumber=wxEmptyString, const int aPageCount=1)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
void PlotBoardLayers(BOARD *aBoard, PLOTTER *aPlotter, const LSEQ &aLayerSequence, const PCB_PLOT_PARAMS &aPlotOptions)
Plot a sequence of board layer IDs.
PGM_BASE & Pgm()
The global program "get" accessor.
PLOT_FORMAT
The set of supported output plot formats.
Plotting engines similar to ps (PostScript, Gerber, svg)
std::vector< FAB_LAYER_COLOR > dummy
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
std::vector< int > raytrace_lightElevation
KIGFX::COLOR4D raytrace_lightColorCamera
bool raytrace_post_processing
std::vector< KIGFX::COLOR4D > raytrace_lightColor
KIGFX::COLOR4D raytrace_lightColorBottom
bool raytrace_reflections
bool differentiate_plated_copper
std::vector< int > raytrace_lightAzimuth
bool raytrace_refractions
bool raytrace_procedural_textures
int raytrace_recursivelevel_refractions
KIGFX::COLOR4D raytrace_lightColorTop
bool raytrace_anti_aliasing
constexpr double IUTomm(int iu) const
constexpr int mmToIU(double mm) const
bool m_sketchPadsOnFabLayers
bool m_sketchDNPFPsOnFabLayers
bool m_crossoutDNPFPsOnFabLayers
bool m_hideDNPFPsOnFabLayers
Declaration for a track ball camera.
double DEG2RAD(double deg)
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.