KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_export_step.cpp
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) 2016 Cirilo Bernardo
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include "dialog_export_step.h"
27
28#include <wx/log.h>
29#include <wx/stdpaths.h>
30#include <wx/process.h>
31#include <wx/string.h>
32#include <wx/filedlg.h>
33
34#include <pgm_base.h>
35#include <board.h>
36#include <confirm.h>
37#include <kidialog.h>
39#include <footprint.h>
40#include <kiface_base.h>
41#include <locale_io.h>
42#include <math/vector3.h>
43#include <pcb_edit_frame.h>
45#include <project/project_file.h> // LAST_PATH_TYPE
46#include <reporter.h>
47#include <string_utils.h>
48#include <trace_helpers.h>
51#include <filename_resolver.h>
52#include <core/map_helpers.h>
55
56
57// Maps m_choiceFormat selection to extension (and kicad-cli command)
68
69// Maps file extensions to m_choiceFormat selection
80
81
82DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aEditFrame, const wxString& aBoardPath ) :
83 DIALOG_EXPORT_STEP( aEditFrame, aEditFrame, aBoardPath )
84{
85}
86
87
89 const wxString& aBoardPath, JOB_EXPORT_PCB_3D* aJob ) :
90 DIALOG_EXPORT_STEP_BASE( aEditFrame ),
91 m_editFrame( aEditFrame ),
92 m_job( aJob ),
95 m_boardPath( aBoardPath )
96{
97 if( !m_job )
98 {
100 SetupStandardButtons( { { wxID_OK, _( "Export" ) },
101 { wxID_CANCEL, _( "Close" ) } } );
102 }
103 else
104 {
105 SetTitle( m_job->GetSettingsDialogTitle() );
106
107 m_browseButton->Hide();
109 }
110
111 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
112 // non-job versions.
113 m_hash_key = TO_UTF8( GetTitle() );
114
115 Layout();
116 bSizerSTEPFile->Fit( this );
117
118 SetFocus();
119
120 wxString bad_scales;
121 size_t bad_count = 0;
122
123 for( FOOTPRINT* fp : m_editFrame->GetBoard()->Footprints() )
124 {
125 for( const FP_3DMODEL& model : fp->Models() )
126 {
127 if( model.m_Scale.x != 1.0 || model.m_Scale.y != 1.0 || model.m_Scale.z != 1.0 )
128 {
129 bad_scales.Append( wxS("\n") );
130 bad_scales.Append( model.m_Filename );
131 bad_count++;
132 }
133 }
134
135 if( bad_count >= 5 )
136 break;
137 }
138
139 if( !bad_scales.empty() && !Pgm().GetCommonSettings()->m_DoNotShowAgain.scaled_3d_models_warning )
140 {
141 wxString extendedMsg = _( "Non-unity scaled models:" ) + wxT( "\n" ) + bad_scales;
142
143 KIDIALOG msgDlg( m_editFrame, _( "Scaled models detected. Model scaling is not reliable for "
144 "mechanical export." ),
145 _( "Model Scale Warning" ), wxOK | wxICON_WARNING );
146 msgDlg.SetExtendedMessage( extendedMsg );
147 msgDlg.DoNotShowCheckbox( __FILE__, __LINE__ );
148
149 msgDlg.ShowModal();
150
151 if( msgDlg.DoNotShowAgain() )
153 }
154
156
157 // Now all widgets have the size fixed, call FinishDialogSettings
159}
160
161
163{
164 if( !m_job )
165 {
166 if( m_outputFileName->GetValue().IsEmpty() )
167 {
168 wxFileName brdFile( m_editFrame->GetBoard()->GetFileName() );
169 brdFile.SetExt( wxT( "step" ) );
170 m_outputFileName->SetValue( brdFile.GetFullPath() );
171 }
172 }
173 else
174 {
175 m_rbBoardCenterOrigin->SetValue( true ); // Default
176
177 if( m_job->m_3dparams.m_UseDrillOrigin )
178 m_rbDrillAndPlotOrigin->SetValue( true );
179 else if( m_job->m_3dparams.m_UseGridOrigin )
180 m_rbGridOrigin->SetValue( true );
181 else if( m_job->m_3dparams.m_UseDefinedOrigin )
182 m_rbUserDefinedOrigin->SetValue( true );
183 else if( m_job->m_3dparams.m_UsePcbCenterOrigin )
184 m_rbBoardCenterOrigin->SetValue( true );
185
186 m_originX.SetValue( pcbIUScale.mmToIU( m_job->m_3dparams.m_Origin.x ) );
187 m_originY.SetValue( pcbIUScale.mmToIU( m_job->m_3dparams.m_Origin.y ) );
188
189 m_txtNetFilter->SetValue( m_job->m_3dparams.m_NetFilter );
190 m_cbOptimizeStep->SetValue( m_job->m_3dparams.m_OptimizeStep );
191 m_cbExportBody->SetValue( m_job->m_3dparams.m_ExportBoardBody );
192 m_cbExportComponents->SetValue( m_job->m_3dparams.m_ExportComponents );
193 m_cbExportTracks->SetValue( m_job->m_3dparams.m_ExportTracksVias );
194 m_cbExportPads->SetValue( m_job->m_3dparams.m_ExportPads );
195 m_cbExportZones->SetValue( m_job->m_3dparams.m_ExportZones );
196 m_cbExportInnerCopper->SetValue( m_job->m_3dparams.m_ExportInnerCopper );
197 m_cbExportSilkscreen->SetValue( m_job->m_3dparams.m_ExportSilkscreen );
198 m_cbExportSoldermask->SetValue( m_job->m_3dparams.m_ExportSoldermask );
199 m_cbFuseShapes->SetValue( m_job->m_3dparams.m_FuseShapes );
200 m_cbCutViasInBody->SetValue( m_job->m_3dparams.m_CutViasInBody );
201 m_cbFillAllVias->SetValue( m_job->m_3dparams.m_FillAllVias );
202 m_cbRemoveUnspecified->SetValue( !m_job->m_3dparams.m_IncludeUnspecified );
203 m_cbRemoveDNP->SetValue( !m_job->m_3dparams.m_IncludeDNP );
204 m_cbSubstModels->SetValue( m_job->m_3dparams.m_SubstModels );
205 m_cbOverwriteFile->SetValue( m_job->m_3dparams.m_Overwrite );
206
207 if( m_job->m_3dparams.m_BoardOutlinesChainingEpsilon > 0.05 )
208 m_choiceTolerance->SetSelection( 2 );
209 else if( m_job->m_3dparams.m_BoardOutlinesChainingEpsilon < 0.005 )
210 m_choiceTolerance->SetSelection( 0 );
211 else
212 m_choiceTolerance->SetSelection( 1 );
213
214 m_txtComponentFilter->SetValue( m_job->m_3dparams.m_ComponentFilter );
215 m_outputFileName->SetValue( m_job->GetConfiguredOutputPath() );
216 }
217
218 // Sync the enabled states
219 wxCommandEvent dummy;
221
222 return true;
223}
224
225
227{
228 BOARD* board = m_frame->GetBoard();
229 wxFileName brdFile = board->GetFileName();
230
231 DIALOG_EXPORT_STEP dlg( m_frame, brdFile.GetFullPath() );
232 dlg.ShowModal();
233
234 return 0;
235}
236
237
238void DIALOG_EXPORT_STEP::onUpdateXPos( wxUpdateUIEvent& aEvent )
239{
240 aEvent.Enable( m_rbUserDefinedOrigin->GetValue() );
241}
242
243
244void DIALOG_EXPORT_STEP::onUpdateYPos( wxUpdateUIEvent& aEvent )
245{
246 aEvent.Enable( m_rbUserDefinedOrigin->GetValue() );
247}
248
249
250void DIALOG_EXPORT_STEP::onBrowseClicked( wxCommandEvent& aEvent )
251{
252 // clang-format off
253 wxString filter = _( "STEP files" )
255 + _( "Binary glTF files" )
257 + _( "XAO files" )
259 + _( "BREP (OCCT) files" )
261 + _( "PLY files" )
263 + _( "STL files" )
265 + _( "Universal 3D files" )
267 + _( "PDF files" )
269 // clang-format on
270
271 // Build the absolute path of current output directory to preselect it in the file browser.
272 wxString path = ExpandEnvVarSubstitutions( m_outputFileName->GetValue(), &Prj() );
273 wxFileName fn( Prj().AbsolutePath( path ) );
274
275 wxFileDialog dlg( this, _( "3D Model Output File" ), fn.GetPath(), fn.GetFullName(), filter, wxFD_SAVE );
276
277 if( dlg.ShowModal() == wxID_CANCEL )
278 return;
279
280 path = dlg.GetPath();
281 m_outputFileName->SetValue( path );
282
283 fn = wxFileName( path );
284
285 if( auto formatChoice = get_opt( c_formatExtToChoice, fn.GetExt().Lower() ) )
286 m_choiceFormat->SetSelection( *formatChoice );
287}
288
289
290void DIALOG_EXPORT_STEP::onFormatChoice( wxCommandEvent& event )
291{
293}
294
295
297{
298 wxString newExt;
299 int idx = m_choiceFormat->GetSelection();
300
301 for( auto& choices : c_formatExtToChoice )
302 {
303 if( choices.second == idx )
304 {
305 newExt = choices.first;
306 break;
307 }
308 }
309
310 wxString path = m_outputFileName->GetValue();
311
312 int sepIdx = std::max( path.Find( '/', true ), path.Find( '\\', true ) );
313 int dotIdx = path.Find( '.', true );
314
315 if( dotIdx == -1 || dotIdx < sepIdx )
316 path << '.' << newExt;
317 else
318 path = path.Mid( 0, dotIdx ) << '.' << newExt;
319
320 m_outputFileName->SetValue( path );
321}
322
323
324void DIALOG_EXPORT_STEP::onCbExportComponents( wxCommandEvent& event )
325{
326 bool enable = m_cbExportComponents->GetValue();
327
328 m_rbAllComponents->Enable( enable );
329 m_rbOnlySelected->Enable( enable );
330 m_rbFilteredComponents->Enable( enable );
331 m_txtComponentFilter->Enable( enable && m_rbFilteredComponents->GetValue() );
332}
333
334
335void DIALOG_EXPORT_STEP::OnComponentModeChange( wxCommandEvent& event )
336{
337 m_txtComponentFilter->Enable( m_rbFilteredComponents->GetValue() );
338}
339
340
341void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
342{
343 wxString path = m_outputFileName->GetValue();
344 double tolerance; // default value in mm
345
346 switch( m_choiceTolerance->GetSelection() )
347 {
348 case 0: tolerance = 0.001; break;
349 default:
350 case 1: tolerance = 0.01; break;
351 case 2: tolerance = 0.1; break;
352 }
353
354 if( !m_job )
355 {
356 // Build the absolute path of current output directory to preselect it in the file browser.
357 std::function<bool( wxString* )> textResolver =
358 [&]( wxString* token ) -> bool
359 {
360 return m_editFrame->GetBoard()->ResolveTextVar( token, 0 );
361 };
362
363 path = ExpandTextVars( path, &textResolver );
365 path = Prj().AbsolutePath( path );
366
367 if( path.IsEmpty() )
368 {
369 DisplayErrorMessage( this, _( "No filename for output file" ) );
370 return;
371 }
372
373 SHAPE_POLY_SET outline;
374 wxString msg;
375
376 // Check if the board outline is continuous
377 // max dist from one endPt to next startPt to build a closed shape:
378 int chainingEpsilon = pcbIUScale.mmToIU( tolerance );
379
380 // Arc to segment approximation error (not critical here: we do not use the outline shape):
381 int maxError = pcbIUScale.mmToIU( 0.05 );
382
383 if( !BuildBoardPolygonOutlines( m_editFrame->GetBoard(), outline, maxError, chainingEpsilon ) )
384 {
385 DisplayErrorMessage( this, wxString::Format( _( "Board outline is missing or not closed using "
386 "%.3f mm tolerance.\n"
387 "Run DRC for a full analysis." ),
388 tolerance ) );
389 return;
390 }
391
392 wxFileName fn( Prj().AbsolutePath( path ) );
393
394 if( fn.FileExists() && !m_cbOverwriteFile->GetValue() )
395 {
396 msg.Printf( _( "File '%s' already exists. Do you want overwrite this file?" ), fn.GetFullPath() );
397
398 if( wxMessageBox( msg, _( "STEP/GLTF Export" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
399 return;
400 }
401
402 wxFileName appK2S( wxStandardPaths::Get().GetExecutablePath() );
403 #ifdef __WXMAC__
404 // On macOS, we have standalone applications inside the main bundle, so we handle that here:
405 if( appK2S.GetPath().Find( "/Contents/Applications/pcbnew.app/Contents/MacOS" ) != wxNOT_FOUND )
406 {
407 appK2S.AppendDir( wxT( ".." ) );
408 appK2S.AppendDir( wxT( ".." ) );
409 appK2S.AppendDir( wxT( ".." ) );
410 appK2S.AppendDir( wxT( ".." ) );
411 appK2S.AppendDir( wxT( "MacOS" ) );
412 }
413 #else
414 if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
415 {
416 appK2S.RemoveLastDir();
417 appK2S.AppendDir( "kicad" );
418 }
419 #endif
420
421 appK2S.SetName( wxT( "kicad-cli" ) );
422 appK2S.Normalize( FN_NORMALIZE_FLAGS );
423
424 wxString cmdK2S = wxT( "\"" );
425 cmdK2S.Append( appK2S.GetFullPath() );
426 cmdK2S.Append( wxT( "\"" ) );
427
428 cmdK2S.Append( wxT( " pcb" ) );
429 cmdK2S.Append( wxT( " export" ) );
430
431 cmdK2S.Append( wxT( " " ) );
432 cmdK2S.Append( c_formatCommand[m_choiceFormat->GetSelection()] );
433
434 if( m_cbRemoveUnspecified->GetValue() )
435 cmdK2S.Append( wxT( " --no-unspecified" ) );
436
437 if( m_cbRemoveDNP->GetValue() )
438 cmdK2S.Append( wxT( " --no-dnp" ) );
439
440 if( m_cbSubstModels->GetValue() )
441 cmdK2S.Append( wxT( " --subst-models" ) );
442
443 if( !m_cbOptimizeStep->GetValue() )
444 cmdK2S.Append( wxT( " --no-optimize-step" ) );
445
446 if( !m_cbExportBody->GetValue() )
447 cmdK2S.Append( wxT( " --no-board-body" ) );
448
449 if( !m_cbExportComponents->GetValue() )
450 cmdK2S.Append( wxT( " --no-components" ) );
451
452 if( m_cbExportTracks->GetValue() )
453 cmdK2S.Append( wxT( " --include-tracks" ) );
454
455 if( m_cbExportPads->GetValue() )
456 cmdK2S.Append( wxT( " --include-pads" ) );
457
458 if( m_cbExportZones->GetValue() )
459 cmdK2S.Append( wxT( " --include-zones" ) );
460
461 if( m_cbExportInnerCopper->GetValue() )
462 cmdK2S.Append( wxT( " --include-inner-copper" ) );
463
464 if( m_cbExportSilkscreen->GetValue() )
465 cmdK2S.Append( wxT( " --include-silkscreen" ) );
466
467 if( m_cbExportSoldermask->GetValue() )
468 cmdK2S.Append( wxT( " --include-soldermask" ) );
469
470 if( m_cbFuseShapes->GetValue() )
471 cmdK2S.Append( wxT( " --fuse-shapes" ) );
472
473 if( m_cbCutViasInBody->GetValue() )
474 cmdK2S.Append( wxT( " --cut-vias-in-body" ) );
475
476 if( m_cbFillAllVias->GetValue() )
477 cmdK2S.Append( wxT( " --fill-all-vias" ) );
478
479 // Note: for some reason, using \" to insert a quote in a format string, under MacOS
480 // wxString::Format does not work. So use a %c format in string
481 int quote = '\'';
482 int dblquote = '"';
483
484 if( !m_txtNetFilter->GetValue().empty() )
485 {
486 cmdK2S.Append( wxString::Format( wxT( " --net-filter %c%s%c" ),
487 dblquote, m_txtNetFilter->GetValue(), dblquote ) );
488 }
489
490 if( m_rbOnlySelected->GetValue() )
491 {
492 wxArrayString components;
493 SELECTION& selection = m_editFrame->GetCurrentSelection();
494
495 std::for_each( selection.begin(), selection.end(),
496 [&components]( EDA_ITEM* item )
497 {
498 if( item->Type() == PCB_FOOTPRINT_T )
499 components.push_back( static_cast<FOOTPRINT*>( item )->GetReference() );
500 } );
501
502 cmdK2S.Append( wxString::Format( wxT( " --component-filter %c%s%c" ),
503 dblquote, wxJoin( components, ',' ), dblquote ) );
504 }
505 else if( m_rbFilteredComponents->GetValue() )
506 {
507 cmdK2S.Append( wxString::Format( wxT( " --component-filter %c%s%c" ),
508 dblquote, m_txtComponentFilter->GetValue(), dblquote ) );
509 }
510
511 if( m_rbDrillAndPlotOrigin->GetValue() )
512 {
513 cmdK2S.Append( wxT( " --drill-origin" ) );
514 }
515 else if( m_rbGridOrigin->GetValue() )
516 {
517 cmdK2S.Append( wxT( " --grid-origin" ) );
518 }
519 else if( m_rbUserDefinedOrigin->GetValue() )
520 {
521 double xOrg = pcbIUScale.IUTomm( m_originX.GetIntValue() );
522 double yOrg = pcbIUScale.IUTomm( m_originY.GetIntValue() );
523
525 cmdK2S.Append( wxString::Format( wxT( " --user-origin=%c%.6fx%.6fmm%c" ),
526 quote, xOrg, yOrg, quote ) );
527 }
528 else if( m_rbBoardCenterOrigin->GetValue() )
529 {
530 BOX2I bbox = m_editFrame->GetBoard()->ComputeBoundingBox( true );
531 double xOrg = pcbIUScale.IUTomm( bbox.GetCenter().x );
532 double yOrg = pcbIUScale.IUTomm( bbox.GetCenter().y );
534
535 cmdK2S.Append( wxString::Format( wxT( " --user-origin=%c%.6fx%.6fmm%c" ),
536 quote, xOrg, yOrg, quote ) );
537 }
538 else
539 {
540 wxFAIL_MSG( wxT( "Unsupported origin option: how did we get here?" ) );
541 }
542
543 {
545 cmdK2S.Append( wxString::Format( wxT( " --min-distance=%c%.3fmm%c" ),
546 quote, tolerance, quote ) );
547 }
548
549 // Output file path.
550 cmdK2S.Append( wxString::Format( wxT( " -f -o %c%s%c" ),
551 dblquote, fn.GetFullPath(), dblquote ) );
552
553
554 // Input file path.
555 cmdK2S.Append( wxString::Format( wxT( " %c%s%c" ), dblquote, m_boardPath, dblquote ) );
556
557 wxLogTrace( traceKiCad2Step, wxT( "export step command: %s" ), cmdK2S );
558
559 DIALOG_EXPORT_STEP_LOG* log = new DIALOG_EXPORT_STEP_LOG( this, cmdK2S );
560 log->ShowModal();
561 }
562 else
563 {
564 m_job->SetConfiguredOutputPath( path );
565 m_job->m_3dparams.m_NetFilter = m_txtNetFilter->GetValue();
566 m_job->m_3dparams.m_ComponentFilter = m_txtComponentFilter->GetValue();
567 m_job->m_3dparams.m_ExportBoardBody = m_cbExportBody->GetValue();
568 m_job->m_3dparams.m_ExportComponents = m_cbExportComponents->GetValue();
569 m_job->m_3dparams.m_ExportTracksVias = m_cbExportTracks->GetValue();
570 m_job->m_3dparams.m_ExportPads = m_cbExportPads->GetValue();
571 m_job->m_3dparams.m_ExportZones = m_cbExportZones->GetValue();
572 m_job->m_3dparams.m_ExportInnerCopper = m_cbExportInnerCopper->GetValue();
573 m_job->m_3dparams.m_ExportSilkscreen = m_cbExportSilkscreen->GetValue();
574 m_job->m_3dparams.m_ExportSoldermask = m_cbExportSoldermask->GetValue();
575 m_job->m_3dparams.m_FuseShapes = m_cbFuseShapes->GetValue();
576 m_job->m_3dparams.m_CutViasInBody = m_cbCutViasInBody->GetValue();
577 m_job->m_3dparams.m_FillAllVias = m_cbFillAllVias->GetValue();
578 m_job->m_3dparams.m_OptimizeStep = m_cbOptimizeStep->GetValue();
579 m_job->m_3dparams.m_Overwrite = m_cbOverwriteFile->GetValue();
580 m_job->m_3dparams.m_IncludeUnspecified = !m_cbRemoveUnspecified->GetValue();
581 m_job->m_3dparams.m_IncludeDNP = !m_cbRemoveDNP->GetValue();
582 m_job->m_3dparams.m_SubstModels = m_cbSubstModels->GetValue();
583 m_job->m_3dparams.m_BoardOutlinesChainingEpsilon = tolerance;
584
585 m_job->SetStepFormat( static_cast<EXPORTER_STEP_PARAMS::FORMAT>( m_choiceFormat->GetSelection() ) );
586
587 // ensure the main format on the job is populated
588 switch( m_job->m_3dparams.m_Format )
589 {
599 }
600
601 m_job->m_3dparams.m_UseDrillOrigin = false;
602 m_job->m_3dparams.m_UseGridOrigin = false;
603 m_job->m_3dparams.m_UseDefinedOrigin = false;
604 m_job->m_3dparams.m_UsePcbCenterOrigin = false;
605
606 if( m_rbDrillAndPlotOrigin->GetValue() )
607 {
608 m_job->m_3dparams.m_UseDrillOrigin = true;
609 }
610 else if( m_rbGridOrigin->GetValue() )
611 {
612 m_job->m_3dparams.m_UseGridOrigin = true;
613 }
614 else if( m_rbUserDefinedOrigin->GetValue() )
615 {
616 double xOrg = pcbIUScale.IUTomm( m_originX.GetIntValue() );
617 double yOrg = pcbIUScale.IUTomm( m_originY.GetIntValue() );
618
619 m_job->m_3dparams.m_UseDefinedOrigin = true;
620 m_job->m_3dparams.m_Origin = VECTOR2D( xOrg, yOrg );
621 }
622 else if( m_rbBoardCenterOrigin->GetValue() )
623 {
624 BOX2I bbox = m_editFrame->GetBoard()->ComputeBoundingBox( true );
625 double xOrg = pcbIUScale.IUTomm( bbox.GetCenter().x );
626 double yOrg = pcbIUScale.IUTomm( bbox.GetCenter().y );
628
629 m_job->m_3dparams.m_UsePcbCenterOrigin = true;
630 m_job->m_3dparams.m_Origin = VECTOR2D( xOrg, yOrg );
631 }
632
633 EndModal( wxID_OK );
634 }
635}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:110
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
int ExportSTEP(const TOOL_EVENT &aEvent)
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
constexpr const Vec GetCenter() const
Definition box2.h:230
DO_NOT_SHOW_AGAIN m_DoNotShowAgain
DIALOG_EXPORT_STEP_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Export 3D Model"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
STD_BITMAP_BUTTON * m_browseButton
void onFormatChoice(wxCommandEvent &event) override
void onCbExportComponents(wxCommandEvent &event) override
PCB_EDIT_FRAME * m_editFrame
void OnComponentModeChange(wxCommandEvent &event) override
DIALOG_EXPORT_STEP(PCB_EDIT_FRAME *aEditFrame, const wxString &aBoardPath)
void onUpdateXPos(wxUpdateUIEvent &aEvent) override
JOB_EXPORT_PCB_3D * m_job
bool TransferDataToWindow() override
void onExportButton(wxCommandEvent &aEvent) override
void onUpdateYPos(wxUpdateUIEvent &aEvent) override
void onBrowseClicked(wxCommandEvent &aEvent) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::string m_hash_key
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int ShowModal() override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition kidialog.h:42
bool DoNotShowAgain() const
Checks the 'do not show again' setting for the dialog.
Definition kidialog.cpp:63
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
Definition kidialog.cpp:55
int ShowModal() override
Definition kidialog.cpp:93
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition locale_io.h:41
The main frame for Pcbnew.
BOARD * board() const
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:537
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition project.cpp:389
ITER end()
Definition selection.h:80
ITER begin()
Definition selection.h:79
Represent a set of closed polygons.
Generic, UI-independent tool event.
Definition tool_event.h:171
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition common.cpp:365
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition common.cpp:60
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:202
This file is part of the common library.
bool BuildBoardPolygonOutlines(BOARD *aBoard, SHAPE_POLY_SET &aOutlines, int aErrorMax, int aChainingEpsilon, OUTLINE_ERROR_HANDLER *aErrorHandler, bool aAllowUseArcsInPolygons)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
static const std::map< wxString, int > c_formatExtToChoice
static const std::vector< wxString > c_formatCommand
#define _(s)
static const std::string BrepFileExtension
static const std::string StepFileAbrvExtension
static const std::string XaoFileExtension
static const std::string GltfBinaryFileExtension
static const std::string U3DFileExtension
static const std::string PdfFileExtension
static const std::string StlFileExtension
static const std::string PlyFileExtension
static const std::string StepFileExtension
static const std::string StepZFileAbrvExtension
const wxChar *const traceKiCad2Step
Flag to enable KiCad2Step debug tracing.
std::optional< V > get_opt(const std::map< wxString, V > &aMap, const wxString &aKey)
Definition map_helpers.h:34
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:946
see class PGM_BASE
std::vector< FAB_LAYER_COLOR > dummy
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
wxLogTrace helper definitions.
VECTOR2< double > VECTOR2D
Definition vector2d.h:694
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
Definition of file extensions used in Kicad.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().
Definition wx_filename.h:39