KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_properties_3d_model.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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2015 Dick Hollenbeck, [email protected]
6 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
28
31#include <env_vars.h>
32#include <bitmaps.h>
35#include <widgets/wx_grid.h>
37#include <board.h>
38#include <footprint.h>
39#include <fp_lib_table.h>
43#include "filename_resolver.h"
44#include <pgm_base.h>
45#include <kiplatform/ui.h>
50#include <project_pcb.h>
51
52#include <wx/defs.h>
53#include <wx/msgdlg.h>
54
56{
59 COL_SHOWN = 2
60};
61
62wxDEFINE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
63
65 FOOTPRINT* aFootprint,
66 DIALOG_SHIM* aDialogParent,
67 PANEL_EMBEDDED_FILES* aFilesPanel,
68 wxWindow* aParent, wxWindowID aId,
69 const wxPoint& aPos,
70 const wxSize& aSize, long aStyle,
71 const wxString& aName ) :
72 PANEL_FP_PROPERTIES_3D_MODEL_BASE( aParent, aId, aPos, aSize, aStyle, aName ),
73 m_parentDialog( aDialogParent ),
74 m_frame( aFrame ),
75 m_footprint( aFootprint ),
76 m_filesPanel( aFilesPanel ),
77 m_inSelect( false )
78{
79 m_splitter1->SetSashPosition( FromDIP( m_splitter1->GetSashPosition() ) );
80 m_splitter1->SetMinimumPaneSize( FromDIP( m_splitter1->GetMinimumPaneSize() ) );
81
82 GRID_TRICKS* trick = new GRID_TRICKS( m_modelsGrid, [this]( wxCommandEvent& aEvent )
83 {
84 OnAdd3DRow( aEvent );
85 } );
87
88 m_modelsGrid->PushEventHandler( trick );
89
90 // Get the last 3D directory
91 PCBNEW_SETTINGS* cfg = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
92
93 if( cfg && cfg->m_LastFootprint3dDir.IsEmpty() )
94 {
95 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ),
97 }
98
99 // Icon showing warning/error information
100 wxGridCellAttr* attr = new wxGridCellAttr;
101 attr->SetReadOnly();
102 m_modelsGrid->SetColAttr( COL_PROBLEM, attr );
103
104 // Filename
105 attr = new wxGridCellAttr;
106
107 if( cfg )
108 {
110 &cfg->m_LastFootprint3dDir, wxT( "*.*" ), true,
111 m_frame->Prj().GetProjectPath() ) );
112 }
113
114 m_modelsGrid->SetColAttr( COL_FILENAME, attr );
115
116 // Show checkbox
117 attr = new wxGridCellAttr;
118 attr->SetRenderer( new wxGridCellBoolRenderer() );
119 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
120 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
121 m_modelsGrid->SetColAttr( COL_SHOWN, attr );
122 m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );
123
125
127
128 m_LowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
129
130 // Configure button logos
131 m_button3DShapeAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
132 m_button3DShapeBrowse->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
133 m_button3DShapeRemove->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
134
135 Bind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
137}
138
139
141{
142 // Delete the GRID_TRICKS.
143 m_modelsGrid->PopEventHandler( true );
144
145 // Unbind OnShowEvent to prevent unnecessary event handling.
146 Unbind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
147
148 // free the memory used by all models, otherwise models which were
149 // browsed but not used would consume memory
151
152 delete m_previewPane;
153}
154
155
157{
159 return true;
160}
161
162
164{
166}
167
168
170{
171 wxString default_path;
172 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ), &default_path );
173
174#ifdef __WINDOWS__
175 default_path.Replace( wxT( "/" ), wxT( "\\" ) );
176#endif
177
178 m_shapes3D_list.clear();
180
181 wxString origPath, alias, shortPath;
183
184 for( const FP_3DMODEL& model : m_footprint->Models() )
185 {
186 m_shapes3D_list.push_back( model );
187 origPath = model.m_Filename;
188
189 if( res && res->SplitAlias( origPath, alias, shortPath ) )
190 origPath = alias + wxT( ":" ) + shortPath;
191
192 m_modelsGrid->AppendRows( 1 );
193 int row = m_modelsGrid->GetNumberRows() - 1;
194 m_modelsGrid->SetCellValue( row, COL_FILENAME, origPath );
195 m_modelsGrid->SetCellValue( row, COL_SHOWN, model.m_Show ? wxT( "1" ) : wxT( "0" ) );
196
197 // Must be after the filename is set
199 }
200
201 select3DModel( 0 );
202
204 m_modelsGrid->SetColSize( COL_SHOWN, m_modelsGrid->GetVisibleWidth( COL_SHOWN, true, false ) );
205
206 Layout();
207}
208
209
211{
212 m_inSelect = true;
213
214 aModelIdx = std::max( 0, aModelIdx );
215 aModelIdx = std::min( aModelIdx, m_modelsGrid->GetNumberRows() - 1 );
216
217 if( m_modelsGrid->GetNumberRows() )
218 {
219 m_modelsGrid->SelectRow( aModelIdx );
220 m_modelsGrid->SetGridCursor( aModelIdx, COL_FILENAME );
221 }
222
223 m_previewPane->SetSelectedModel( aModelIdx );
224
225 m_inSelect = false;
226}
227
228
230{
231 if( !m_inSelect )
232 select3DModel( aEvent.GetRow() );
233}
234
235
237{
238 if( aEvent.GetCol() == COL_FILENAME )
239 {
240 bool hasAlias = false;
242 wxString filename = m_modelsGrid->GetCellValue( aEvent.GetRow(), COL_FILENAME );
243
244 // Perform cleanup and validation on the filename if it isn't empty
245 if( !filename.empty() )
246 {
247 filename.Replace( wxT( "\n" ), wxT( "" ) );
248 filename.Replace( wxT( "\r" ), wxT( "" ) );
249 filename.Replace( wxT( "\t" ), wxT( "" ) );
250
251 res->ValidateFileName( filename, hasAlias );
252
253 // If the user has specified an alias in the name then prepend ':'
254 if( hasAlias )
255 filename.insert( 0, wxT( ":" ) );
256
257#ifdef __WINDOWS__
258 // In KiCad files, filenames and paths are stored using Unix notation
259 filename.Replace( wxT( "\\" ), wxT( "/" ) );
260#endif
261
262 // Update the grid with the modified filename
263 m_modelsGrid->SetCellValue( aEvent.GetRow(), COL_FILENAME, filename );
264 }
265
266 // Save the filename in the 3D shapes table
267 m_shapes3D_list[ aEvent.GetRow() ].m_Filename = filename;
268
269 // Update the validation status
270 updateValidateStatus( aEvent.GetRow() );
271 }
272 else if( aEvent.GetCol() == COL_SHOWN )
273 {
274 wxString showValue = m_modelsGrid->GetCellValue( aEvent.GetRow(), COL_SHOWN );
275
276 m_shapes3D_list[ aEvent.GetRow() ].m_Show = ( showValue == wxT( "1" ) );
277 }
278
280 onModify();
281}
282
283
285{
287 return;
288
289 int idx = m_modelsGrid->GetGridCursorRow();
290
291 if( idx >= 0 && m_modelsGrid->GetNumberRows() && !m_shapes3D_list.empty() )
292 {
293 // Don't allow selection until we call select3DModel(), below. Otherwise wxWidgets
294 // has a tendency to get its knickers in a knot....
295 m_inSelect = true;
296
297 // Not all files are embedded but this will ignore the ones that are not
298 m_filesPanel->RemoveEmbeddedFile( m_shapes3D_list[ idx ].m_Filename );
299 m_shapes3D_list.erase( m_shapes3D_list.begin() + idx );
300 m_modelsGrid->DeleteRows( idx );
301
302 select3DModel( idx ); // will clamp idx within bounds
304 }
305
306 onModify();
307}
308
309
311{
313 return;
314
315 int selected = m_modelsGrid->GetGridCursorRow();
316
317 PROJECT& prj = m_frame->Prj();
318 FP_3DMODEL model;
321
322 wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
323 wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
324 int filter = 0;
325
326 // If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the 3DMODEL_DIR environment
327 // variable and fall back to the project path if necessary.
328 if( initialpath.IsEmpty() )
329 {
330 if( !wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ), &initialpath )
331 || initialpath.IsEmpty() )
332 {
333 initialpath = prj.GetProjectPath();
334 }
335 }
336
337 if( !sidx.empty() )
338 {
339 long tmp;
340 sidx.ToLong( &tmp );
341
342 if( tmp > 0 && tmp <= INT_MAX )
343 filter = (int) tmp;
344 }
345
346 DIALOG_SELECT_3DMODEL dm( m_parentDialog, cache, &model, initialpath, filter );
347
348 // Use QuasiModal so that Configure3DPaths (and its help window) will work
349 int retval = dm.ShowQuasiModal();
350
351 if( retval != wxID_OK || model.m_Filename.empty() )
352 {
353 if( selected >= 0 )
354 {
355 select3DModel( selected );
356 updateValidateStatus( selected );
357 }
358
359 return;
360 }
361
362 if( dm.IsEmbedded3DModel() )
363 {
364 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
365 const FP_LIB_TABLE_ROW* fpRow = nullptr;
366
367 wxString footprintBasePath = wxEmptyString;
368
369 try
370 {
371 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
372
373 if( fpRow )
374 footprintBasePath = fpRow->GetFullURI( true );
375 }
376 catch( ... )
377 {
378 // if libraryName is not found in table, do nothing
379 }
380
381 std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
382 embeddedFilesStack.push_back( m_filesPanel->GetLocalFiles() );
383 embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
384
385 wxString fullPath = res->ResolvePath( model.m_Filename, footprintBasePath, embeddedFilesStack );
386 wxFileName fname( fullPath );
387
388 EMBEDDED_FILES::EMBEDDED_FILE* result = m_filesPanel->AddEmbeddedFile( fname.GetFullPath() ); ;
389
390 if( !result )
391 {
392
393 wxString msg = wxString::Format( _( "Error adding 3D model" ) );
394 wxMessageBox( msg, _( "Error" ), wxICON_ERROR | wxOK, this );
395 return;
396 }
397
398 model.m_Filename = result->GetLink();
399 }
400
401 prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
402 sidx = wxString::Format( wxT( "%i" ), filter );
404
405 wxString alias;
406 wxString shortPath;
407 wxString filename = model.m_Filename;
408
409 if( res && res->SplitAlias( filename, alias, shortPath ) )
410 filename = alias + wxT( ":" ) + shortPath;
411
412#ifdef __WINDOWS__
413 // In KiCad files, filenames and paths are stored using Unix notation
414 model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) );
415#endif
416
417 model.m_Show = true;
418 m_shapes3D_list.push_back( model );
419
420 int idx = m_modelsGrid->GetNumberRows();
421 m_modelsGrid->AppendRows( 1 );
422 m_modelsGrid->SetCellValue( idx, COL_FILENAME, filename );
423 m_modelsGrid->SetCellValue( idx, COL_SHOWN, wxT( "1" ) );
424
425 select3DModel( idx );
427
429 onModify();
430}
431
432
434{
436 [&]() -> std::pair<int, int>
437 {
438 FP_3DMODEL model;
439
440 model.m_Show = true;
441 m_shapes3D_list.push_back( model );
442
443 int row = m_modelsGrid->GetNumberRows();
444 m_modelsGrid->AppendRows( 1 );
445 m_modelsGrid->SetCellValue( row, COL_SHOWN, wxT( "1" ) );
446 m_modelsGrid->SetCellValue( row, COL_PROBLEM, "" );
447
448 select3DModel( row );
450 onModify();
451
452 return { row, COL_FILENAME };
453 } );
454}
455
456
458{
459 int icon = 0;
460 wxString errStr;
461
462 switch( validateModelExists( m_modelsGrid->GetCellValue( aRow, COL_FILENAME) ) )
463 {
464 case MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR:
465 icon = 0;
466 errStr = "";
467 break;
468
469 case MODEL_VALIDATE_ERRORS::NO_FILENAME:
470 icon = wxICON_WARNING;
471 errStr = _( "No filename entered" );
472 break;
473
474 case MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME:
475 icon = wxICON_ERROR;
476 errStr = _( "Illegal filename" );
477 break;
478
479 case MODEL_VALIDATE_ERRORS::RESOLVE_FAIL:
480 icon = wxICON_ERROR;
481 errStr = _( "File not found" );
482 break;
483
484 case MODEL_VALIDATE_ERRORS::OPEN_FAIL:
485 icon = wxICON_ERROR;
486 errStr = _( "Unable to open file" );
487 break;
488
489 default:
490 icon = wxICON_ERROR;
491 errStr = _( "Unknown error" );
492 break;
493 }
494
495 m_modelsGrid->SetCellValue( aRow, COL_PROBLEM, errStr );
496 m_modelsGrid->SetCellRenderer( aRow, COL_PROBLEM, new GRID_CELL_STATUS_ICON_RENDERER( icon ) );
497}
498
499
501{
502 if( aFilename.empty() )
503 return MODEL_VALIDATE_ERRORS::NO_FILENAME;
504
505 bool hasAlias = false;
507
508 if( !resolv )
509 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
510
511 if( !resolv->ValidateFileName( aFilename, hasAlias ) )
512 return MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME;
513
514 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
515 const FP_LIB_TABLE_ROW* fpRow = nullptr;
516
517 try
518 {
519 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
520 }
521 catch( ... )
522 {
523 // if libraryName is not found in table, do nothing
524 }
525
526 wxString footprintBasePath = wxEmptyString;
527
528 if( fpRow )
529 footprintBasePath = fpRow->GetFullURI( true );
530
531 std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
532 embeddedFilesStack.push_back( m_filesPanel->GetLocalFiles() );
533 embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
534
535 wxString fullPath = resolv->ResolvePath( aFilename, footprintBasePath, embeddedFilesStack );
536
537 if( fullPath.IsEmpty() )
538 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
539
540 if( !wxFileName::IsFileReadable( fullPath ) )
541 return MODEL_VALIDATE_ERRORS::OPEN_FAIL;
542
543 return MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR;
544}
545
546
547void PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath( wxCommandEvent& event )
548{
549 DIALOG_CONFIGURE_PATHS dlg( this );
550
551 if( dlg.ShowQuasiModal() == wxID_OK )
553}
554
555
557{
558 // Account for scroll bars
559 int modelsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_modelsGrid ).x;
560
561 int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN ) - m_modelsGrid->GetColSize( COL_PROBLEM );
562
563 if( width > 0 )
564 m_modelsGrid->SetColSize( COL_FILENAME, width );
565}
566
567
569{
571
572 event.Skip();
573}
574
575
576void PANEL_FP_PROPERTIES_3D_MODEL::OnUpdateUI( wxUpdateUIEvent& event )
577{
578 m_button3DShapeRemove->Enable( m_modelsGrid->GetNumberRows() > 0 );
579}
580
581
583{
584 if( DIALOG_SHIM* dlg = dynamic_cast<DIALOG_SHIM*>( wxGetTopLevelParent( this ) ) )
585 dlg->OnModify();
586}
587
588
590{
591 postCustomPanelShownEventWithPredicate( static_cast<int>( aEvent.IsShown() ) );
592 aEvent.Skip();
593}
594
595
597{
598 postCustomPanelShownEventWithPredicate( aEvent.GetActive() && m_previewPane->IsShownOnScreen() );
599 aEvent.Skip();
600}
601
602
604{
605 wxCommandEvent event( wxCUSTOM_PANEL_SHOWN_EVENT );
606 event.SetEventObject( m_previewPane );
607 event.SetInt( static_cast<int>( predicate ) );
608 m_previewPane->ProcessWindowEvent( event );
609}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: board.cpp:2657
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:61
int ShowQuasiModal()
Provide an extensible class to resolve 3D model paths.
bool ValidateFileName(const wxString &aFileName, bool &hasAlias) const
Return true if the given path is a valid aliased relative path.
wxString ResolvePath(const wxString &aFileName, const wxString &aWorkingPath, std::vector< const EMBEDDED_FILES * > aEmbeddedFilesStack)
Determine the full path of the given file name.
void SetProgramBase(PGM_BASE *aBase)
Set a pointer to the application's PGM_BASE instance used to extract the local env vars.
const LIB_ID & GetFPID() const
Definition: footprint.h:251
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:223
wxString m_Filename
The 3D shape filename in 3D library.
Definition: footprint.h:106
bool m_Show
Include model in rendering.
Definition: footprint.h:107
Hold a record identifying a library accessed by the appropriate footprint library #PLUGIN object in t...
Definition: fp_lib_table.h:42
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an FP_LIB_TABLE_ROW if aNickName is found in this table or in any chained fall back table frag...
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
void SetTooltipEnable(int aCol, bool aEnable=true)
Enable the tooltip for a column.
Definition: grid_tricks.h:75
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
bool RemoveEmbeddedFile(const wxString &aFileName)
EMBEDDED_FILES * GetLocalFiles()
EMBEDDED_FILES::EMBEDDED_FILE * AddEmbeddedFile(const wxString &aFileName)
Class PANEL_FP_PROPERTIES_3D_MODEL_BASE.
void OnUpdateUI(wxUpdateUIEvent &event) override
void Cfg3DPath(wxCommandEvent &event) override
void OnRemove3DModel(wxCommandEvent &event) override
virtual void onShowEvent(wxShowEvent &aEvent)
void On3DModelCellChanged(wxGridEvent &aEvent) override
virtual void onDialogActivateEvent(wxActivateEvent &aEvent)
void OnGridSize(wxSizeEvent &event) override
void postCustomPanelShownEventWithPredicate(bool predicate)
MODEL_VALIDATE_ERRORS validateModelExists(const wxString &aFilename)
void OnAdd3DModel(wxCommandEvent &event) override
void OnAdd3DRow(wxCommandEvent &event) override
std::vector< FP_3DMODEL > m_shapes3D_list
PANEL_FP_PROPERTIES_3D_MODEL(PCB_BASE_EDIT_FRAME *aFrame, FOOTPRINT *aFootprint, DIALOG_SHIM *aDialogParent, PANEL_EMBEDDED_FILES *aFilesPanel, wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
void On3DModelSelected(wxGridEvent &) override
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
void SetSelectedModel(int idx)
Set the currently selected index in the model list so that the scale/rotation/offset controls can be ...
wxString m_LastFootprint3dDir
Common, abstract interface for edit frames.
BOARD * GetBoard() const
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
Definition: project_pcb.cpp:37
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
Definition: project_pcb.cpp:77
static FILENAME_RESOLVER * Get3DFilenameResolver(PROJECT *aProject)
Accessor for 3D path resolver.
Container for project specific data.
Definition: project.h:65
@ VIEWER_3D_FILTER_INDEX
Definition: project.h:226
@ VIEWER_3D_PATH
Definition: project.h:225
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:149
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
Definition: project.cpp:321
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
Definition: project.cpp:332
Cache for storing the 3D shapes.
Definition: 3d_cache.h:55
void FlushCache(bool closePlugins=true)
Free all data in the cache and by default closes all plugins.
Definition: 3d_cache.cpp:525
FILENAME_RESOLVER * GetResolver() noexcept
Definition: 3d_cache.cpp:513
bool Enable(bool aEnable=true) override
void SetBitmap(const wxBitmapBundle &aBmp)
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculate the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:916
void OnAddRow(const std::function< std::pair< int, int >()> &aAdder)
Definition: wx_grid.cpp:684
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
Definition: wx_grid.h:220
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:632
#define _(s)
Declaration of the eda_3d_viewer class.
Functions related to environment variables, including help functions.
KICOMMON_API wxString GetVersionedEnvVarName(const wxString &aBaseName)
Construct a versioned environment variable based on this KiCad major version.
Definition: env_vars.cpp:77
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: wxgtk/ui.cpp:258
wxDEFINE_EVENT(wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent)
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:902
see class PGM_BASE
VECTOR3I res