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 struct S3D_INFO;
40 class SCENEGRAPH;
41 
43 {
44 private:
46  std::list< KICAD_PLUGIN_LDR_3D* > m_Plugins;
47 
49  std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* > m_ExtMap;
50 
52  std::list< wxString > m_FileFilters;
53 
55  void loadPlugins( void );
56 
58  void listPlugins( const wxString& aPath, std::list< wxString >& aPluginList );
59 
61  void checkPluginName( const wxString& aPath, std::list< wxString >& aPluginList );
62 
64  void checkPluginPath( const wxString& aPath, std::list< wxString >& aSearchList );
65 
67  void addFilterString( const wxString& aFilterString );
68 
70  void addExtensionMap( KICAD_PLUGIN_LDR_3D* aPlugin );
71 
72 public:
74  virtual ~S3D_PLUGIN_MANAGER();
75 
84  std::list< wxString > const* GetFileFilters( void ) const;
85 
86  SCENEGRAPH* Load3DModel( const wxString& aFileName, std::string& aPluginInfo );
87 
94  void ClosePlugins( void );
95 
101  bool CheckTag( const char* aTag );
102 };
103 
104 #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...