38 #include <wx/filedlg.h> 44 FP_3DMODEL* aModelItem, wxString& prevModelSelectDir,
45 int& prevModelWildcard ) :
47 m_model( aModelItem ), m_cache( aCacheManager ), m_previousDir( prevModelSelectDir ),
48 m_previousFilterIndex( prevModelWildcard )
69 std::list< wxString >::const_iterator sL = fl->begin();
77 while( sL != fl->end() )
79 if( !filter.IsEmpty() )
84 if( !ext_list.IsEmpty() )
85 ext_list.Append(
";" );
87 wxString ext = sL->AfterLast(
'|' );
90 ext_list.Append( ext );
97 if( !ext_list.empty() )
100 full_filter.Printf(
_(
"All supported files (%s)" ), ext_list );
101 full_filter <<
'|' << ext_list <<
'|' << filter;
108 m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
110 if( prevModelWildcard >= 0 && prevModelWildcard < (
int)fl->size() )
111 m_FileTree->SetFilterIndex( prevModelWildcard );
114 prevModelWildcard = 0;
120 m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
121 prevModelWildcard = 0;
128 wxChoice* filterBox =
m_FileTree->GetFilterListCtrl();
187 EmulateButtonClickIfPresent( wxID_OK );
211 std::list< SEARCH_PATH >::const_iterator sL = md->begin();
212 std::set< wxString > cl;
216 if( sL != md->end() )
218 prjDir = sL->m_Pathexp;
222 while( sL != md->end() )
224 if( !sL->m_Pathexp.empty() && sL->m_Pathexp.compare( prjDir ) )
225 cl.insert( sL->m_Pathexp );
232 unsigned int choice = 0;
236 if( !prjDir.empty() )
244 std::set< wxString >::const_iterator sI = cl.begin();
246 while( sI != cl.end() )
wxBoxSizer * m_Sizer3Dviewer
bool TransferDataFromWindow() override
int & m_previousFilterIndex
C3D_MODEL_VIEWER * m_modelViewer
std::list< wxString > const * GetFileFilters() const
Return the list of file filters retrieved from the plugins.
void SetRootDir(wxCommandEvent &event) override
const std::list< SEARCH_PATH > * GetPaths(void)
Return a pointer to the internal path list; the items in:load.
Declaration of the cogl_att_list class.
Cache for storing the 3D shapes.
Implement a canvas based on a wxGLCanvas.
defines the basic data associated with a single 3D model.
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
VECTOR3D m_Offset
3D model offset (mm)
wxString ShortenPath(const wxString &aFullPathName)
Produce a relative path based on the existing search directories or returns the same path if the path...
void Set3DModel(const S3DMODEL &a3DModel)
Set this model to be displayed.
void OnFileActivated(wxCommandEvent &event) override
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
wxGenericDirCtrl * m_FileTree
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)
creates a dialog to select 3D model files
FILENAME_RESOLVER * GetResolver() noexcept
FILENAME_RESOLVER * m_resolver
void Cfg3DPaths(wxCommandEvent &event) override
void updateDirChoiceList(void)
DLG_SELECT_3DMODEL(wxWindow *aParent, S3D_CACHE *aCacheManager, FP_3DMODEL *aModelItem, wxString &prevModelSelectDir, int &prevModelWildcard)
void OnSelectionChanged(wxCommandEvent &event) override
Class DLG_SELECT_3D_MODELE_BASE.