39#include <wx/filedlg.h>
45 FP_3DMODEL* aModelItem, wxString& prevModelSelectDir,
46 int& prevModelWildcard ) :
48 m_model( aModelItem ),
49 m_cache( aCacheManager ),
50 m_resolver( aCacheManager ? aCacheManager->GetResolver() : nullptr ),
51 m_previousDir( prevModelSelectDir ),
52 m_modelViewer( nullptr )
64 std::list< wxString >::const_iterator sL = fl->begin();
72 while( sL != fl->end() )
79 if( !ext_list.IsEmpty() )
80 ext_list.Append(
";" );
82 wxString ext = sL->AfterLast(
'|' );
85 ext_list.Append( ext );
92 if( !ext_list.empty() )
95 full_filter.Printf(
_(
"All supported files (%s)" ), ext_list );
96 full_filter <<
'|' << ext_list <<
'|' <<
filter;
106 m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
109 if( prevModelWildcard >= 0 && prevModelWildcard < (
int)fl->size() )
111 m_FileTree->SetFilterIndex( prevModelWildcard );
115 prevModelWildcard = 0;
121 m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
122 prevModelWildcard = 0;
129 wxChoice* filterBox =
m_FileTree->GetFilterListCtrl();
187 EmulateButtonClickIfPresent( wxID_OK );
216 std::list< SEARCH_PATH >::const_iterator sL = md->begin();
217 std::set< wxString > cl;
221 if( sL != md->end() )
223 prjDir = sL->m_Pathexp;
227 while( sL != md->end() )
229 if( !sL->m_Pathexp.empty() && sL->m_Pathexp.compare( prjDir ) )
230 cl.insert( sL->m_Pathexp );
237 unsigned int choice = 0;
241 if( !prjDir.empty() )
249 std::set< wxString >::const_iterator sI = cl.begin();
251 while( sI != cl.end() )
defines the basic data associated with a single 3D model.
void OnSelectionChanged(wxCommandEvent &event) override
DIALOG_SELECT_3DMODEL(wxWindow *aParent, S3D_CACHE *aCacheManager, FP_3DMODEL *aModelItem, wxString &prevModelSelectDir, int &prevModelWildcard)
void SetRootDir(wxCommandEvent &event) override
FILENAME_RESOLVER * m_resolver
EDA_3D_MODEL_VIEWER * m_modelViewer
void updateDirChoiceList(void)
void OnFileActivated(wxCommandEvent &event) override
void Cfg3DPaths(wxCommandEvent &event) override
bool TransferDataFromWindow() override
Class DIALOG_SELECT_3D_MODEL_BASE.
wxBoxSizer * m_Sizer3Dviewer
wxGenericDirCtrl * m_FileTree
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Implement a canvas based on a wxGLCanvas.
void Set3DModel(const S3DMODEL &a3DModel)
Set this model to be displayed.
const std::list< SEARCH_PATH > * GetPaths() const
Return a pointer to the internal path list; the items in:load.
wxString ShortenPath(const wxString &aFullPathName)
Produce a relative path based on the existing search directories or returns the same path if the path...
VECTOR3D m_Offset
3D model offset (mm)
VECTOR3D m_Rotation
3D model rotation (degrees)
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
wxString m_Filename
The 3D shape filename in 3D library.
static const wxGLAttributes GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode, bool aAlpha=false)
Get a list of attributes to pass to wxGLCanvas.
Cache for storing the 3D shapes.
std::list< wxString > const * GetFileFilters() const
Return the list of file filters retrieved from the plugins.
Implements a model viewer canvas.
Declaration of the cogl_att_list class.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().