KiCad PCB EDA Suite
3d_plugin_manager.h
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) 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 
29 #ifndef PLUGIN_MANAGER_3D_H
30 #define PLUGIN_MANAGER_3D_H
31 
32 #include <map>
33 #include <list>
34 #include <string>
35 #include <wx/string.h>
36 
37 class wxWindow;
38 class KICAD_PLUGIN_LDR_3D;
39 class SCENEGRAPH;
40 
42 {
43 private:
45  std::list< KICAD_PLUGIN_LDR_3D* > m_Plugins;
46 
48  std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* > m_ExtMap;
49 
51  std::list< wxString > m_FileFilters;
52 
54  void loadPlugins( void );
55 
57  void listPlugins( const wxString& aPath, std::list< wxString >& aPluginList );
58 
60  void checkPluginName( const wxString& aPath, std::list< wxString >& aPluginList );
61 
63  void checkPluginPath( const wxString& aPath, std::list< wxString >& aSearchList );
64 
66  void addFilterString( const wxString& aFilterString );
67 
69  void addExtensionMap( KICAD_PLUGIN_LDR_3D* aPlugin );
70 
71 public:
73  virtual ~S3D_PLUGIN_MANAGER();
74 
83  std::list< wxString > const* GetFileFilters( void ) const;
84 
85  SCENEGRAPH* Load3DModel( const wxString& aFileName, std::string& aPluginInfo );
86 
93  void ClosePlugins( void );
94 
100  bool CheckTag( const char* aTag );
101 };
102 
103 #endif // PLUGIN_MANAGER_3D_H
std::list< wxString > m_FileFilters
list of file filters
std::multimap< const wxString, KICAD_PLUGIN_LDR_3D * > m_ExtMap
mapping of extensions to available plugins
void addFilterString(const wxString &aFilterString)
add an entry to the file filter list
SCENEGRAPH * Load3DModel(const wxString &aFileName, std::string &aPluginInfo)
void listPlugins(const wxString &aPath, std::list< wxString > &aPluginList)
list potential plugins
std::list< KICAD_PLUGIN_LDR_3D * > m_Plugins
list of discovered plugins
void checkPluginPath(const wxString &aPath, std::list< wxString > &aSearchList)
check the existence of a path and add it to the path search list
bool CheckTag(const char *aTag)
Function CheckTag checks the given tag and returns true if the plugin named in the tag is not loaded ...
void addExtensionMap(KICAD_PLUGIN_LDR_3D *aPlugin)
add entries to the extension map
void loadPlugins(void)
load plugins
void ClosePlugins(void)
Function ClosePlugins iterates through all discovered plugins and closes them to reclaim memory...
void checkPluginName(const wxString &aPath, std::list< wxString > &aPluginList)
check the existence of a plugin name and add it to the list
std::list< wxString > const * GetFileFilters(void) const
Function GetFileFilters returns the list of file filters; this will contain at least the default "All...