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#include <kiplatform/ui.h>
34
35#include <pgm_base.h>
36#include <board.h>
37#include <confirm.h>
38#include <kidialog.h>
40#include <footprint.h>
41#include <kiface_base.h>
42#include <locale_io.h>
43#include <math/vector3.h>
44#include <pcb_edit_frame.h>
46#include <project/project_file.h> // LAST_PATH_TYPE
47#include <reporter.h>
48#include <string_utils.h>
49#include <trace_helpers.h>
52#include <filename_resolver.h>
53#include <core/map_helpers.h>
56
57
58// Maps m_choiceFormat selection to extension (and kicad-cli command)
69
70// Maps file extensions to m_choiceFormat selection
81
82
83DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aEditFrame, const wxString& aBoardPath ) :
84 DIALOG_EXPORT_STEP( aEditFrame, aEditFrame, aBoardPath )
85{
86}
87
88
90 const wxString& aBoardPath, JOB_EXPORT_PCB_3D* aJob ) :
91 DIALOG_EXPORT_STEP_BASE( aEditFrame ),
92 m_editFrame( aEditFrame ),
93 m_job( aJob ),
96 m_boardPath( aBoardPath )
97{
98 if( !m_job )
99 {
101 SetupStandardButtons( { { wxID_OK, _( "Export" ) },
102 { wxID_CANCEL, _( "Close" ) } } );
103 }
104 else
105 {
106 SetTitle( m_job->GetSettingsDialogTitle() );
107
108 m_browseButton->Hide();
110 }
111
112 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
113 // non-job versions.
114 m_hash_key = TO_UTF8( GetTitle() );
115
116 Layout();
117 bSizerSTEPFile->Fit( this );
118
119 SetFocus();
120
121 wxString bad_scales;
122 size_t bad_count = 0;
123
124 for( FOOTPRINT* fp : m_editFrame->GetBoard()->Footprints() )
125 {
126 for( const FP_3DMODEL& model : fp->Models() )
127 {
128 if( model.m_Scale.x != 1.0 || model.m_Scale.y != 1.0 || model.m_Scale.z != 1.0 )
129 {
130 bad_scales.Append( wxS("\n") );
131 bad_scales.Append( model.m_Filename );
132 bad_count++;
133 }
134 }
135
136 if( bad_count >= 5 )
137 break;
138 }
139
140 if( !bad_scales.empty() && !Pgm().GetCommonSettings()->m_DoNotShowAgain.scaled_3d_models_warning )
141 {
142 wxString extendedMsg = _( "Non-unity scaled models:" ) + wxT( "\n" ) + bad_scales;
143
144 KIDIALOG msgDlg( m_editFrame, _( "Scaled models detected. Model scaling is not reliable for "
145 "mechanical export." ),
146 _( "Model Scale Warning" ), wxOK | wxICON_WARNING );
147 msgDlg.SetExtendedMessage( extendedMsg );
148 msgDlg.DoNotShowCheckbox( __FILE__, __LINE__ );
149
150 msgDlg.ShowModal();
151
152 if( msgDlg.DoNotShowAgain() )
154 }
155
157
158 // Now all widgets have the size fixed, call FinishDialogSettings
160}
161
162
164{
165 if( !m_job )
166 {
167 if( m_outputFileName->GetValue().IsEmpty() )
168 {
169 wxFileName brdFile( m_editFrame->GetBoard()->GetFileName() );
170 brdFile.SetExt( wxT( "step" ) );
171 m_outputFileName->SetValue( brdFile.GetFullPath() );
172 }
173 }
174 else
175 {
176 m_rbBoardCenterOrigin->SetValue( true ); // Default
177
178 if( m_job->m_3dparams.m_UseDrillOrigin )
179 m_rbDrillAndPlotOrigin->SetValue( true );
180 else if( m_job->m_3dparams.m_UseGridOrigin )
181 m_rbGridOrigin->SetValue( true );
182 else if( m_job->m_3dparams.m_UseDefinedOrigin )
183 m_rbUserDefinedOrigin->SetValue( true );
184 else if( m_job->m_3dparams.m_UsePcbCenterOrigin )
185 m_rbBoardCenterOrigin->SetValue( true );
186
187 m_originX.SetValue( pcbIUScale.mmToIU( m_job->m_3dparams.m_Origin.x ) );
188 m_originY.SetValue( pcbIUScale.mmToIU( m_job->m_3dparams.m_Origin.y ) );
189
190 m_txtNetFilter->SetValue( m_job->m_3dparams.m_NetFilter );
191 m_cbOptimizeStep->SetValue( m_job->m_3dparams.m_OptimizeStep );
192 m_cbExportBody->SetValue( m_job->m_3dparams.m_ExportBoardBody );
193 m_cbExportComponents->SetValue( m_job->m_3dparams.m_ExportComponents );
194 m_cbExportTracks->SetValue( m_job->m_3dparams.m_ExportTracksVias );
195 m_cbExportPads->SetValue( m_job->m_3dparams.m_ExportPads );
196 m_cbExportZones->SetValue( m_job->m_3dparams.m_ExportZones );
197 m_cbExportInnerCopper->SetValue( m_job->m_3dparams.m_ExportInnerCopper );
198 m_cbExportSilkscreen->SetValue( m_job->m_3dparams.m_ExportSilkscreen );
199 m_cbExportSoldermask->SetValue( m_job->m_3dparams.m_ExportSoldermask );
200 m_cbFuseShapes->SetValue( m_job->m_3dparams.m_FuseShapes );
201 m_cbCutViasInBody->SetValue( m_job->m_3dparams.m_CutViasInBody );
202 m_cbFillAllVias->SetValue( m_job->m_3dparams.m_FillAllVias );
203 m_cbRemoveUnspecified->SetValue( !m_job->m_3dparams.m_IncludeUnspecified );
204 m_cbRemoveDNP->SetValue( !m_job->m_3dparams.m_IncludeDNP );
205 m_cbSubstModels->SetValue( m_job->m_3dparams.m_SubstModels );
206 m_cbOverwriteFile->SetValue( m_job->m_3dparams.m_Overwrite );
207
208 if( m_job->m_3dparams.m_BoardOutlinesChainingEpsilon > 0.05 )
209 m_choiceTolerance->SetSelection( 2 );
210 else if( m_job->m_3dparams.m_BoardOutlinesChainingEpsilon < 0.005 )
211 m_choiceTolerance->SetSelection( 0 );
212 else
213 m_choiceTolerance->SetSelection( 1 );
214
215 m_txtComponentFilter->SetValue( m_job->m_3dparams.m_ComponentFilter );
216 m_outputFileName->SetValue( m_job->GetConfiguredOutputPath() );
217 }
218
219 // Sync the enabled states
220 wxCommandEvent dummy;
222
223 return true;
224}
225
226
228{
229 BOARD* board = m_frame->GetBoard();
230 wxFileName brdFile = board->GetFileName();
231
232 DIALOG_EXPORT_STEP dlg( m_frame, brdFile.GetFullPath() );
233 dlg.ShowModal();
234
235 return 0;
236}
237
238
239void DIALOG_EXPORT_STEP::onUpdateXPos( wxUpdateUIEvent& aEvent )
240{
241 aEvent.Enable( m_rbUserDefinedOrigin->GetValue() );
242}
243
244
245void DIALOG_EXPORT_STEP::onUpdateYPos( wxUpdateUIEvent& aEvent )
246{
247 aEvent.Enable( m_rbUserDefinedOrigin->GetValue() );
248}
249
250
251void DIALOG_EXPORT_STEP::onBrowseClicked( wxCommandEvent& aEvent )
252{
253 // clang-format off
254 wxString filter = _( "STEP files" )
256 + _( "Binary glTF files" )
258 + _( "XAO files" )
260 + _( "BREP (OCCT) files" )
262 + _( "PLY files" )
264 + _( "STL files" )
266 + _( "Universal 3D files" )
268 + _( "PDF files" )
270 // clang-format on
271
272 // Build the absolute path of current output directory to preselect it in the file browser.
273 wxString path = ExpandEnvVarSubstitutions( m_outputFileName->GetValue(), &Prj() );
274 wxFileName fn( Prj().AbsolutePath( path ) );
275
276 wxFileDialog dlg( this, _( "3D Model Output File" ), fn.GetPath(), fn.GetFullName(), filter, wxFD_SAVE );
277
279
280 if( dlg.ShowModal() == wxID_CANCEL )
281 return;
282
283 path = dlg.GetPath();
284 m_outputFileName->SetValue( path );
285
286 fn = wxFileName( path );
287
288 if( auto formatChoice = get_opt( c_formatExtToChoice, fn.GetExt().Lower() ) )
289 m_choiceFormat->SetSelection( *formatChoice );
290}
291
292
293void DIALOG_EXPORT_STEP::onFormatChoice( wxCommandEvent& event )
294{
296}
297
298
300{
301 wxString newExt;
302 int idx = m_choiceFormat->GetSelection();
303
304 for( auto& choices : c_formatExtToChoice )
305 {
306 if( choices.second == idx )
307 {
308 newExt = choices.first;
309 break;
310 }
311 }
312
313 wxString path = m_outputFileName->GetValue();
314
315 int sepIdx = std::max( path.Find( '/', true ), path.Find( '\\', true ) );
316 int dotIdx = path.Find( '.', true );
317
318 if( dotIdx == -1 || dotIdx < sepIdx )
319 path << '.' << newExt;
320 else
321 path = path.Mid( 0, dotIdx ) << '.' << newExt;
322
323 m_outputFileName->SetValue( path );
324}
325
326
327void DIALOG_EXPORT_STEP::onCbExportComponents( wxCommandEvent& event )
328{
329 bool enable = m_cbExportComponents->GetValue();
330
331 m_rbAllComponents->Enable( enable );
332 m_rbOnlySelected->Enable( enable );
333 m_rbFilteredComponents->Enable( enable );
334 m_txtComponentFilter->Enable( enable && m_rbFilteredComponents->GetValue() );
335}
336
337
338void DIALOG_EXPORT_STEP::OnComponentModeChange( wxCommandEvent& event )
339{
340 m_txtComponentFilter->Enable( m_rbFilteredComponents->GetValue() );
341}
342
343
344void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
345{
346 wxString path = m_outputFileName->GetValue();
347 double tolerance; // default value in mm
348
349 switch( m_choiceTolerance->GetSelection() )
350 {
351 case 0: tolerance = 0.001; break;
352 default:
353 case 1: tolerance = 0.01; break;
354 case 2: tolerance = 0.1; break;
355 }
356
357 if( !m_job )
358 {
359 // Build the absolute path of current output directory to preselect it in the file browser.
360 std::function<bool( wxString* )> textResolver =
361 [&]( wxString* token ) -> bool
362 {
363 return m_editFrame->GetBoard()->ResolveTextVar( token, 0 );
364 };
365
366 path = ExpandTextVars( path, &textResolver );
368 path = Prj().AbsolutePath( path );
369
370 if( path.IsEmpty() )
371 {
372 DisplayErrorMessage( this, _( "No filename for output file" ) );
373 return;
374 }
375
376 SHAPE_POLY_SET outline;
377 wxString msg;
378
379 // Check if the board outline is continuous
380 // max dist from one endPt to next startPt to build a closed shape:
381 int chainingEpsilon = pcbIUScale.mmToIU( tolerance );
382
383 // Arc to segment approximation error (not critical here: we do not use the outline shape):
384 int maxError = pcbIUScale.mmToIU( 0.05 );
385
386 if( !BuildBoardPolygonOutlines( m_editFrame->GetBoard(), outline, maxError, chainingEpsilon, false ) )
387 {
388 DisplayErrorMessage( this, wxString::Format( _( "Board outline is missing or not closed using "
389 "%.3f mm tolerance.\n"
390 "Run DRC for a full analysis." ),
391 tolerance ) );
392 return;
393 }
394
395 wxFileName fn( Prj().AbsolutePath( path ) );
396
397 if( fn.FileExists() && !m_cbOverwriteFile->GetValue() )
398 {
399 msg.Printf( _( "File '%s' already exists. Do you want overwrite this file?" ), fn.GetFullPath() );
400
401 if( wxMessageBox( msg, _( "STEP/GLTF Export" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
402 return;
403 }
404
405 wxFileName appK2S( wxStandardPaths::Get().GetExecutablePath() );
406 #ifdef __WXMAC__
407 // On macOS, we have standalone applications inside the main bundle, so we handle that here:
408 if( appK2S.GetPath().Find( "/Contents/Applications/pcbnew.app/Contents/MacOS" ) != wxNOT_FOUND )
409 {
410 appK2S.AppendDir( wxT( ".." ) );
411 appK2S.AppendDir( wxT( ".." ) );
412 appK2S.AppendDir( wxT( ".." ) );
413 appK2S.AppendDir( wxT( ".." ) );
414 appK2S.AppendDir( wxT( "MacOS" ) );
415 }
416 #else
417 if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
418 {
419 appK2S.RemoveLastDir();
420 appK2S.AppendDir( "kicad" );
421 }
422 #endif
423
424 appK2S.SetName( wxT( "kicad-cli" ) );
425 appK2S.Normalize( FN_NORMALIZE_FLAGS );
426
427 wxString cmdK2S = wxT( "\"" );
428 cmdK2S.Append( appK2S.GetFullPath() );
429 cmdK2S.Append( wxT( "\"" ) );
430
431 cmdK2S.Append( wxT( " pcb" ) );
432 cmdK2S.Append( wxT( " export" ) );
433
434 cmdK2S.Append( wxT( " " ) );
435 cmdK2S.Append( c_formatCommand[m_choiceFormat->GetSelection()] );
436
437 if( m_cbRemoveUnspecified->GetValue() )
438 cmdK2S.Append( wxT( " --no-unspecified" ) );
439
440 if( m_cbRemoveDNP->GetValue() )
441 cmdK2S.Append( wxT( " --no-dnp" ) );
442
443 if( m_cbSubstModels->GetValue() )
444 cmdK2S.Append( wxT( " --subst-models" ) );
445
446 if( !m_cbOptimizeStep->GetValue() )
447 cmdK2S.Append( wxT( " --no-optimize-step" ) );
448
449 if( !m_cbExportBody->GetValue() )
450 cmdK2S.Append( wxT( " --no-board-body" ) );
451
452 if( !m_cbExportComponents->GetValue() )
453 cmdK2S.Append( wxT( " --no-components" ) );
454
455 if( m_cbExportTracks->GetValue() )
456 cmdK2S.Append( wxT( " --include-tracks" ) );
457
458 if( m_cbExportPads->GetValue() )
459 cmdK2S.Append( wxT( " --include-pads" ) );
460
461 if( m_cbExportZones->GetValue() )
462 cmdK2S.Append( wxT( " --include-zones" ) );
463
464 if( m_cbExportInnerCopper->GetValue() )
465 cmdK2S.Append( wxT( " --include-inner-copper" ) );
466
467 if( m_cbExportSilkscreen->GetValue() )
468 cmdK2S.Append( wxT( " --include-silkscreen" ) );
469
470 if( m_cbExportSoldermask->GetValue() )
471 cmdK2S.Append( wxT( " --include-soldermask" ) );
472
473 if( m_cbFuseShapes->GetValue() )
474 cmdK2S.Append( wxT( " --fuse-shapes" ) );
475
476 if( m_cbCutViasInBody->GetValue() )
477 cmdK2S.Append( wxT( " --cut-vias-in-body" ) );
478
479 if( m_cbFillAllVias->GetValue() )
480 cmdK2S.Append( wxT( " --fill-all-vias" ) );
481
482 // Note: for some reason, using \" to insert a quote in a format string, under MacOS
483 // wxString::Format does not work. So use a %c format in string
484 int quote = '\'';
485 int dblquote = '"';
486
487 if( !m_txtNetFilter->GetValue().empty() )
488 {
489 cmdK2S.Append( wxString::Format( wxT( " --net-filter %c%s%c" ),
490 dblquote, m_txtNetFilter->GetValue(), dblquote ) );
491 }
492
493 if( m_rbOnlySelected->GetValue() )
494 {
495 wxArrayString components;
496 SELECTION& selection = m_editFrame->GetCurrentSelection();
497
498 std::for_each( selection.begin(), selection.end(),
499 [&components]( EDA_ITEM* item )
500 {
501 if( item->Type() == PCB_FOOTPRINT_T )
502 components.push_back( static_cast<FOOTPRINT*>( item )->GetReference() );
503 } );
504
505 cmdK2S.Append( wxString::Format( wxT( " --component-filter %c%s%c" ),
506 dblquote, wxJoin( components, ',' ), dblquote ) );
507 }
508 else if( m_rbFilteredComponents->GetValue() )
509 {
510 cmdK2S.Append( wxString::Format( wxT( " --component-filter %c%s%c" ),
511 dblquote, m_txtComponentFilter->GetValue(), dblquote ) );
512 }
513
514 if( m_rbDrillAndPlotOrigin->GetValue() )
515 {
516 cmdK2S.Append( wxT( " --drill-origin" ) );
517 }
518 else if( m_rbGridOrigin->GetValue() )
519 {
520 cmdK2S.Append( wxT( " --grid-origin" ) );
521 }
522 else if( m_rbUserDefinedOrigin->GetValue() )
523 {
524 double xOrg = pcbIUScale.IUTomm( m_originX.GetIntValue() );
525 double yOrg = pcbIUScale.IUTomm( m_originY.GetIntValue() );
526
528 cmdK2S.Append( wxString::Format( wxT( " --user-origin=%c%.6fx%.6fmm%c" ),
529 quote, xOrg, yOrg, quote ) );
530 }
531 else if( m_rbBoardCenterOrigin->GetValue() )
532 {
533 BOX2I bbox = m_editFrame->GetBoard()->ComputeBoundingBox( true );
534 double xOrg = pcbIUScale.IUTomm( bbox.GetCenter().x );
535 double yOrg = pcbIUScale.IUTomm( bbox.GetCenter().y );
537
538 cmdK2S.Append( wxString::Format( wxT( " --user-origin=%c%.6fx%.6fmm%c" ),
539 quote, xOrg, yOrg, quote ) );
540 }
541 else
542 {
543 wxFAIL_MSG( wxT( "Unsupported origin option: how did we get here?" ) );
544 }
545
546 {
548 cmdK2S.Append( wxString::Format( wxT( " --min-distance=%c%.3fmm%c" ),
549 quote, tolerance, quote ) );
550 }
551
552 // Output file path.
553 cmdK2S.Append( wxString::Format( wxT( " -f -o %c%s%c" ),
554 dblquote, fn.GetFullPath(), dblquote ) );
555
556
557 // Input file path.
558 cmdK2S.Append( wxString::Format( wxT( " %c%s%c" ), dblquote, m_boardPath, dblquote ) );
559
560 wxLogTrace( traceKiCad2Step, wxT( "export step command: %s" ), cmdK2S );
561
562 DIALOG_EXPORT_STEP_LOG* log = new DIALOG_EXPORT_STEP_LOG( this, cmdK2S );
563 log->ShowModal();
564 }
565 else
566 {
567 m_job->SetConfiguredOutputPath( path );
568 m_job->m_3dparams.m_NetFilter = m_txtNetFilter->GetValue();
569 m_job->m_3dparams.m_ComponentFilter = m_txtComponentFilter->GetValue();
570 m_job->m_3dparams.m_ExportBoardBody = m_cbExportBody->GetValue();
571 m_job->m_3dparams.m_ExportComponents = m_cbExportComponents->GetValue();
572 m_job->m_3dparams.m_ExportTracksVias = m_cbExportTracks->GetValue();
573 m_job->m_3dparams.m_ExportPads = m_cbExportPads->GetValue();
574 m_job->m_3dparams.m_ExportZones = m_cbExportZones->GetValue();
575 m_job->m_3dparams.m_ExportInnerCopper = m_cbExportInnerCopper->GetValue();
576 m_job->m_3dparams.m_ExportSilkscreen = m_cbExportSilkscreen->GetValue();
577 m_job->m_3dparams.m_ExportSoldermask = m_cbExportSoldermask->GetValue();
578 m_job->m_3dparams.m_FuseShapes = m_cbFuseShapes->GetValue();
579 m_job->m_3dparams.m_CutViasInBody = m_cbCutViasInBody->GetValue();
580 m_job->m_3dparams.m_FillAllVias = m_cbFillAllVias->GetValue();
581 m_job->m_3dparams.m_OptimizeStep = m_cbOptimizeStep->GetValue();
582 m_job->m_3dparams.m_Overwrite = m_cbOverwriteFile->GetValue();
583 m_job->m_3dparams.m_IncludeUnspecified = !m_cbRemoveUnspecified->GetValue();
584 m_job->m_3dparams.m_IncludeDNP = !m_cbRemoveDNP->GetValue();
585 m_job->m_3dparams.m_SubstModels = m_cbSubstModels->GetValue();
586 m_job->m_3dparams.m_BoardOutlinesChainingEpsilon = tolerance;
587
588 m_job->SetStepFormat( static_cast<EXPORTER_STEP_PARAMS::FORMAT>( m_choiceFormat->GetSelection() ) );
589
590 // ensure the main format on the job is populated
591 switch( m_job->m_3dparams.m_Format )
592 {
602 }
603
604 m_job->m_3dparams.m_UseDrillOrigin = false;
605 m_job->m_3dparams.m_UseGridOrigin = false;
606 m_job->m_3dparams.m_UseDefinedOrigin = false;
607 m_job->m_3dparams.m_UsePcbCenterOrigin = false;
608
609 if( m_rbDrillAndPlotOrigin->GetValue() )
610 {
611 m_job->m_3dparams.m_UseDrillOrigin = true;
612 }
613 else if( m_rbGridOrigin->GetValue() )
614 {
615 m_job->m_3dparams.m_UseGridOrigin = true;
616 }
617 else if( m_rbUserDefinedOrigin->GetValue() )
618 {
619 double xOrg = pcbIUScale.IUTomm( m_originX.GetIntValue() );
620 double yOrg = pcbIUScale.IUTomm( m_originY.GetIntValue() );
621
622 m_job->m_3dparams.m_UseDefinedOrigin = true;
623 m_job->m_3dparams.m_Origin = VECTOR2D( xOrg, yOrg );
624 }
625 else if( m_rbBoardCenterOrigin->GetValue() )
626 {
627 BOX2I bbox = m_editFrame->GetBoard()->ComputeBoundingBox( true );
628 double xOrg = pcbIUScale.IUTomm( bbox.GetCenter().x );
629 double yOrg = pcbIUScale.IUTomm( bbox.GetCenter().y );
631
632 m_job->m_3dparams.m_UsePcbCenterOrigin = true;
633 m_job->m_3dparams.m_Origin = VECTOR2D( xOrg, yOrg );
634 }
635
636 EndModal( wxID_OK );
637 }
638}
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:535
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:392
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:558
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition common.cpp:62
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, bool aInferOutlineIfNecessary, 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
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:717
PGM_BASE & Pgm()
The global program "get" accessor.
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.
std::string path
KIBIS_MODEL * model
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