38 #include <wx/filedlg.h> 44 FP_3DMODEL* aModelItem, wxString& prevModelSelectDir,
45 int& prevModelWildcard ) :
47 m_model( aModelItem ),
48 m_cache( aCacheManager ),
49 m_resolver( aCacheManager ? aCacheManager->GetResolver() : nullptr ),
50 m_previousDir( prevModelSelectDir ),
51 m_modelViewer( nullptr )
63 std::list< wxString >::const_iterator sL = fl->begin();
71 while( sL != fl->end() )
78 if( !ext_list.IsEmpty() )
79 ext_list.Append(
";" );
81 wxString ext = sL->AfterLast(
'|' );
84 ext_list.Append( ext );
91 if( !ext_list.empty() )
94 full_filter.Printf(
_(
"All supported files (%s)" ), ext_list );
95 full_filter <<
'|' << ext_list <<
'|' <<
filter;
105 m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
108 if( prevModelWildcard >= 0 && prevModelWildcard < (
int)fl->size() )
110 m_FileTree->SetFilterIndex( prevModelWildcard );
114 prevModelWildcard = 0;
120 m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
121 prevModelWildcard = 0;
128 wxChoice* filterBox =
m_FileTree->GetFilterListCtrl();
186 EmulateButtonClickIfPresent( wxID_OK );
210 std::list< SEARCH_PATH >::const_iterator sL = md->begin();
211 std::set< wxString > cl;
215 if( sL != md->end() )
217 prjDir = sL->m_Pathexp;
221 while( sL != md->end() )
223 if( !sL->m_Pathexp.empty() && sL->m_Pathexp.compare( prjDir ) )
224 cl.insert( sL->m_Pathexp );
231 unsigned int choice = 0;
235 if( !prjDir.empty() )
243 std::set< wxString >::const_iterator sI = cl.begin();
245 while( sI != cl.end() )
Class DIALOG_SELECT_3D_MODEL_BASE.
void updateDirChoiceList(void)
void OnFileActivated(wxCommandEvent &event) override
std::list< wxString > const * GetFileFilters() const
Return the list of file filters retrieved from the plugins.
Implement a canvas based on a wxGLCanvas.
Declaration of the cogl_att_list class.
Cache for storing the 3D shapes.
defines the basic data associated with a single 3D model.
void SetRootDir(wxCommandEvent &event) override
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
VECTOR3D m_Offset
3D model offset (mm)
bool TransferDataFromWindow() override
wxString ShortenPath(const wxString &aFullPathName)
Produce a relative path based on the existing search directories or returns the same path if the path...
void OnSelectionChanged(wxCommandEvent &event) override
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
const std::list< SEARCH_PATH > * GetPaths() const
Return a pointer to the internal path list; the items in:load.
FILENAME_RESOLVER * m_resolver
wxBoxSizer * m_Sizer3Dviewer
EDA_3D_MODEL_VIEWER * m_modelViewer
wxString m_Filename
The 3D shape filename in 3D library.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
bool Configure3DPaths(wxWindow *aParent, FILENAME_RESOLVER *aResolver)
VECTOR3D m_Rotation
3D model rotation (degrees)
void Cfg3DPaths(wxCommandEvent &event) override
void Set3DModel(const S3DMODEL &a3DModel)
Set this model to be displayed.
wxGenericDirCtrl * m_FileTree
DIALOG_SELECT_3DMODEL(wxWindow *aParent, S3D_CACHE *aCacheManager, FP_3DMODEL *aModelItem, wxString &prevModelSelectDir, int &prevModelWildcard)