KiCad PCB EDA Suite
3d_cache_dialogs.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) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <wx/filename.h>
25 
26 #include "3d_info.h"
27 #include "3d_cache.h"
28 #include "plugins/3dapi/ifsg_api.h"
29 #include "3d_cache_dialogs.h"
30 #include "dlg_3d_pathconfig.h"
31 #include "dlg_select_3dmodel.h"
32 
33 
34 bool S3D::Select3DModel( wxWindow* aParent, S3D_CACHE* aCache,
35  wxString& prevModelSelectDir, int& prevModelWildcard, S3D_INFO* aModel )
36 {
37  if( NULL == aModel )
38  return false;
39 
40  DLG_SELECT_3DMODEL* dm = new DLG_SELECT_3DMODEL( aParent, aCache, aModel,
41  prevModelSelectDir, prevModelWildcard );
42 
43  if( wxID_OK == dm->ShowModal() )
44  {
45  delete dm;
46  return true;
47  }
48 
49  delete dm;
50  return false;
51 }
52 
53 
54 bool S3D::Configure3DPaths( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver )
55 {
56  DLG_3D_PATH_CONFIG* dp = new DLG_3D_PATH_CONFIG( aParent, aResolver );
57 
58  if( wxID_OK == dp->ShowModal() )
59  {
60  delete dp;
61  return true;
62  }
63 
64  delete dp;
65  return false;
66 }
defines the basic data associated with a single 3D model.
bool Configure3DPaths(wxWindow *aParent, S3D_FILENAME_RESOLVER *aResolver)
bool Select3DModel(wxWindow *aParent, S3D_CACHE *aCache, wxString &prevModelSelectDir, int &prevModelWildcard, S3D_INFO *aModel)
defines the API calls for the manipulation of SG* classes
creates a dialog to select 3D model files
defines the display data cache manager for 3D models