KiCad PCB EDA Suite
pluginldr3D.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) 2015 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 
30 #ifndef PLUGINLDR3D_H
31 #define PLUGINLDR3D_H
32 
33 #include "../pluginldr.h"
34 
35 class SCENEGRAPH;
36 
37 // typedefs of the functions exported by the 3D Plugin Class
38 typedef int (*PLUGIN_3D_GET_N_EXTENSIONS) ( void );
39 
40 typedef char const* (*PLUGIN_3D_GET_MODEL_EXTENSION) ( int aIndex );
41 
42 typedef int (*PLUGIN_3D_GET_N_FILTERS) ( void );
43 
44 typedef char const* (*PLUGIN_3D_GET_FILE_FILTER) ( int aIndex );
45 
46 typedef bool (*PLUGIN_3D_CAN_RENDER) ( void );
47 
48 typedef SCENEGRAPH* (*PLUGIN_3D_LOAD) ( char const* aFileName );
49 
50 
52 {
53 private:
54  bool ok; // set TRUE if all functions are linked
61 
62 public:
64  virtual ~KICAD_PLUGIN_LDR_3D();
65 
66 
67  // virtuals inherited from KICAD_PLUGIN_LDR
68  bool Open( const wxString& aFullFileName ) override;
69 
70  void Close( void ) override;
71 
72  void GetLoaderVersion( unsigned char* Major, unsigned char* Minor,
73  unsigned char* Revision, unsigned char* Patch ) const override;
74 
75 
76  // these functions are shadows of the 3D Plugin functions from 3d_plugin.h
77  int GetNExtensions( void );
78 
79  char const* GetModelExtension( int aIndex );
80 
81  int GetNFilters( void );
82 
83  char const* GetFileFilter( int aIndex );
84 
85  bool CanRender( void );
86 
87  SCENEGRAPH* Load( char const* aFileName );
88 };
89 
90 #endif // PLUGINMGR3D_H
PLUGIN_3D_CAN_RENDER m_canRender
Definition: pluginldr3D.h:59
bool(* PLUGIN_3D_CAN_RENDER)(void)
Definition: pluginldr3D.h:46
void Close(void) override
Function Close cleans up and closes/unloads the plugin.
PLUGIN_3D_GET_MODEL_EXTENSION m_getModelExtension
Definition: pluginldr3D.h:56
bool Open(const wxString &aFullFileName) override
Function Open opens a plugin of the given class, performs version compatibility checks,...
Definition: pluginldr3D.cpp:60
SCENEGRAPH * Load(char const *aFileName)
int GetNExtensions(void)
PLUGIN_3D_GET_N_EXTENSIONS m_getNExtensions
Definition: pluginldr3D.h:55
char const *(* PLUGIN_3D_GET_MODEL_EXTENSION)(int aIndex)
Definition: pluginldr3D.h:40
char const * GetFileFilter(int aIndex)
PLUGIN_3D_GET_N_FILTERS m_getNFilters
Definition: pluginldr3D.h:57
PLUGIN_3D_GET_FILE_FILTER m_getFileFilter
Definition: pluginldr3D.h:58
char const * GetModelExtension(int aIndex)
SCENEGRAPH *(* PLUGIN_3D_LOAD)(char const *aFileName)
Definition: pluginldr3D.h:48
int(* PLUGIN_3D_GET_N_EXTENSIONS)(void)
Definition: pluginldr3D.h:38
void GetLoaderVersion(unsigned char *Major, unsigned char *Minor, unsigned char *Revision, unsigned char *Patch) const override
Function GetLoaderVersion returns the version information of the Plugin Loader for plugin compatibili...
virtual ~KICAD_PLUGIN_LDR_3D()
Definition: pluginldr3D.cpp:52
char const *(* PLUGIN_3D_GET_FILE_FILTER)(int aIndex)
Definition: pluginldr3D.h:44
int(* PLUGIN_3D_GET_N_FILTERS)(void)
Definition: pluginldr3D.h:42
PLUGIN_3D_LOAD m_load
Definition: pluginldr3D.h:60