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 m_modelsGrid->SetDefaultRowSize( m_modelsGrid->GetDefaultRowSize() + 4 );
83
84 GRID_TRICKS* trick = new GRID_TRICKS( m_modelsGrid, [this]( wxCommandEvent& aEvent )
85 {
86 OnAdd3DRow( aEvent );
87 } );
89
90 m_modelsGrid->PushEventHandler( trick );
91
92 // Get the last 3D directory
94 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
95
96 if( cfg->m_lastFootprint3dDir.IsEmpty() )
97 {
98 wxGetEnv( ENV_VAR::GetVersionedEnvVarName( wxS( "3DMODEL_DIR" ) ),
100 }
101
102 // Icon showing warning/error information
103 wxGridCellAttr* attr = new wxGridCellAttr;
104 attr->SetReadOnly();
105 m_modelsGrid->SetColAttr( COL_PROBLEM, attr );
106
107 // Filename
108 attr = new wxGridCellAttr;
110 &cfg->m_lastFootprint3dDir, wxT( "*.*" ), true,
111 m_frame->Prj().GetProjectPath() ) );
112 m_modelsGrid->SetColAttr( COL_FILENAME, attr );
113
114 // Show checkbox
115 attr = new wxGridCellAttr;
116 attr->SetRenderer( new wxGridCellBoolRenderer() );
117 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
118 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
119 m_modelsGrid->SetColAttr( COL_SHOWN, attr );
120 m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );
121
123
126
127 m_LowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
128
129 // Configure button logos
130 m_button3DShapeAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
131 m_button3DShapeBrowse->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
132 m_button3DShapeRemove->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
133
134 Bind( wxEVT_SHOW, &PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent, this );
136 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
347 DIALOG_SELECT_3DMODEL dm( m_parentDialog, cache, &model, initialpath, filter );
348
349 // Use QuasiModal so that Configure3DPaths (and its help window) will work
350 int retval = dm.ShowQuasiModal();
351
352 if( retval != wxID_OK || model.m_Filename.empty() )
353 {
354 if( selected >= 0 )
355 {
356 select3DModel( selected );
357 updateValidateStatus( selected );
358 }
359
360 return;
361 }
362
363 if( dm.IsEmbedded3DModel() )
364 {
365 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
366 const FP_LIB_TABLE_ROW* fpRow = nullptr;
367
368 wxString footprintBasePath = wxEmptyString;
369
370 try
371 {
372 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
373
374 if( fpRow )
375 footprintBasePath = fpRow->GetFullURI( true );
376 }
377 catch( ... )
378 {
379 // if libraryName is not found in table, do nothing
380 }
381
382 std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
383 embeddedFilesStack.push_back( m_filesPanel->GetLocalFiles() );
384 embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
385
386 wxString fullPath = res->ResolvePath( model.m_Filename, footprintBasePath, embeddedFilesStack );
387 wxFileName fname( fullPath );
388
389 EMBEDDED_FILES::EMBEDDED_FILE* result = m_filesPanel->AddEmbeddedFile( fname.GetFullPath() ); ;
390
391 if( !result )
392 {
393
394 wxString msg = wxString::Format( _( "Error adding 3D model" ) );
395 wxMessageBox( msg, _( "Error" ), wxICON_ERROR | wxOK, this );
396 return;
397 }
398
399 model.m_Filename = result->GetLink();
400 }
401
402
403 prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
404 sidx = wxString::Format( wxT( "%i" ), filter );
406
407 wxString alias;
408 wxString shortPath;
409 wxString filename = model.m_Filename;
410
411 if( res && res->SplitAlias( filename, alias, shortPath ) )
412 filename = alias + wxT( ":" ) + shortPath;
413
414#ifdef __WINDOWS__
415 // In KiCad files, filenames and paths are stored using Unix notation
416 model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) );
417#endif
418
419 model.m_Show = true;
420 m_shapes3D_list.push_back( model );
421
422 int idx = m_modelsGrid->GetNumberRows();
423 m_modelsGrid->AppendRows( 1 );
424 m_modelsGrid->SetCellValue( idx, COL_FILENAME, filename );
425 m_modelsGrid->SetCellValue( idx, COL_SHOWN, wxT( "1" ) );
426
427 select3DModel( idx );
429
431 onModify();
432}
433
434
436{
438 return;
439
440 FP_3DMODEL model;
441
442 model.m_Show = true;
443 m_shapes3D_list.push_back( model );
444
445 int row = m_modelsGrid->GetNumberRows();
446 m_modelsGrid->AppendRows( 1 );
447 m_modelsGrid->SetCellValue( row, COL_SHOWN, wxT( "1" ) );
448 m_modelsGrid->SetCellValue( row, COL_PROBLEM, "" );
449
450 select3DModel( row );
451
452 m_modelsGrid->SetFocus();
453 m_modelsGrid->MakeCellVisible( row, COL_FILENAME );
454 m_modelsGrid->SetGridCursor( row, COL_FILENAME );
455
456 m_modelsGrid->EnableCellEditControl( true );
457 m_modelsGrid->ShowCellEditControl();
458
460 onModify();
461}
462
463
465{
466 int icon = 0;
467 wxString errStr;
468
469 switch( validateModelExists( m_modelsGrid->GetCellValue( aRow, COL_FILENAME) ) )
470 {
471 case MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR:
472 icon = 0;
473 errStr = "";
474 break;
475
476 case MODEL_VALIDATE_ERRORS::NO_FILENAME:
477 icon = wxICON_WARNING;
478 errStr = _( "No filename entered" );
479 break;
480
481 case MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME:
482 icon = wxICON_ERROR;
483 errStr = _( "Illegal filename" );
484 break;
485
486 case MODEL_VALIDATE_ERRORS::RESOLVE_FAIL:
487 icon = wxICON_ERROR;
488 errStr = _( "File not found" );
489 break;
490
491 case MODEL_VALIDATE_ERRORS::OPEN_FAIL:
492 icon = wxICON_ERROR;
493 errStr = _( "Unable to open file" );
494 break;
495
496 default:
497 icon = wxICON_ERROR;
498 errStr = _( "Unknown error" );
499 break;
500 }
501
502 m_modelsGrid->SetCellValue( aRow, COL_PROBLEM, errStr );
503 m_modelsGrid->SetCellRenderer( aRow, COL_PROBLEM,
504 new GRID_CELL_STATUS_ICON_RENDERER( icon ) );
505}
506
507
509{
510 if( aFilename.empty() )
511 return MODEL_VALIDATE_ERRORS::NO_FILENAME;
512
513 bool hasAlias = false;
515
516 if( !resolv )
517 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
518
519 if( !resolv->ValidateFileName( aFilename, hasAlias ) )
520 return MODEL_VALIDATE_ERRORS::ILLEGAL_FILENAME;
521
522 wxString libraryName = m_footprint->GetFPID().GetLibNickname();
523 const FP_LIB_TABLE_ROW* fpRow = nullptr;
524 try
525 {
526 fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
527 }
528 catch( ... )
529 {
530 // if libraryName is not found in table, do nothing
531 }
532
533 wxString footprintBasePath = wxEmptyString;
534
535 if( fpRow )
536 footprintBasePath = fpRow->GetFullURI( true );
537
538 std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
539 embeddedFilesStack.push_back( m_filesPanel->GetLocalFiles() );
540 embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
541
542 wxString fullPath = resolv->ResolvePath( aFilename, footprintBasePath, embeddedFilesStack );
543
544 if( fullPath.IsEmpty() )
545 return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;
546
547 if( !wxFileName::IsFileReadable( fullPath ) )
548 return MODEL_VALIDATE_ERRORS::OPEN_FAIL;
549
550 return MODEL_VALIDATE_ERRORS::MODEL_NO_ERROR;
551}
552
553
554void PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath( wxCommandEvent& event )
555{
556 DIALOG_CONFIGURE_PATHS dlg( this );
557
558 if( dlg.ShowQuasiModal() == wxID_OK )
560}
561
562
564{
565 // Account for scroll bars
566 int modelsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_modelsGrid ).x;
567
568 int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN )
569 - m_modelsGrid->GetColSize( COL_PROBLEM );
570
571 if( width > 0 )
572 m_modelsGrid->SetColSize( COL_FILENAME, width );
573}
574
575
577{
579
580 event.Skip();
581}
582
583
584void PANEL_FP_PROPERTIES_3D_MODEL::OnUpdateUI( wxUpdateUIEvent& event )
585{
586 m_button3DShapeRemove->Enable( m_modelsGrid->GetNumberRows() > 0 );
587}
588
589
591{
592 if( DIALOG_SHIM* dlg = dynamic_cast<DIALOG_SHIM*>( wxGetTopLevelParent( this ) ) )
593 dlg->OnModify();
594}
595
596
598{
599 postCustomPanelShownEventWithPredicate( static_cast<int>( aEvent.IsShown() ) );
600 aEvent.Skip();
601}
602
603
605{
607 && m_previewPane->IsShownOnScreen() );
608 aEvent.Skip();
609}
610
611
613{
614 wxCommandEvent event( wxCUSTOM_PANEL_SHOWN_EVENT );
615 event.SetEventObject( m_previewPane );
616 event.SetInt( static_cast<int>( predicate ) );
617 m_previewPane->ProcessWindowEvent( event );
618}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: board.cpp:2573
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:52
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
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
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:148
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:320
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:331
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
T * GetAppSettings(const char *aFilename)
Return a handle to the a given settings by type.
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:785
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
Definition: wx_grid.h:203
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:649
#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:83
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: wxgtk/ui.cpp:252
wxDEFINE_EVENT(wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent)
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:893
see class PGM_BASE
VECTOR3I res