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