KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
5 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
31#ifndef PLUGINLDR3D_H
32#define PLUGINLDR3D_H
33
34#include "../pluginldr.h"
35
36class SCENEGRAPH;
37
38// typedefs of the functions exported by the 3D Plugin Class
39typedef int (*PLUGIN_3D_GET_N_EXTENSIONS) ( void );
40
41typedef char const* (*PLUGIN_3D_GET_MODEL_EXTENSION) ( int aIndex );
42
43typedef int (*PLUGIN_3D_GET_N_FILTERS) ( void );
44
45typedef char const* (*PLUGIN_3D_GET_FILE_FILTER) ( int aIndex );
46
47typedef bool (*PLUGIN_3D_CAN_RENDER) ( void );
48
49typedef SCENEGRAPH* (*PLUGIN_3D_LOAD) ( char const* aFileName );
50
51
53{
54public:
56 virtual ~KICAD_PLUGIN_LDR_3D();
57
58 bool Open( const wxString& aFullFileName ) override;
59
60 void Close( void ) override;
61
62 void GetLoaderVersion( unsigned char* Major, unsigned char* Minor,
63 unsigned char* Revision, unsigned char* Patch ) const override;
64
65 int GetNExtensions( void );
66
67 char const* GetModelExtension( int aIndex );
68
69 int GetNFilters( void );
70
71 char const* GetFileFilter( int aIndex );
72
73 bool CanRender( void );
74
75 SCENEGRAPH* Load( char const* aFileName );
76
77private:
78 bool ok; // set TRUE if all functions are linked
85};
86
87#endif // PLUGINMGR3D_H
bool Open(const wxString &aFullFileName) override
Open a plugin of the given class, performs version compatibility checks, and links all required funct...
Definition: pluginldr3D.cpp:61
PLUGIN_3D_GET_FILE_FILTER m_getFileFilter
Definition: pluginldr3D.h:82
SCENEGRAPH * Load(char const *aFileName)
char const * GetFileFilter(int aIndex)
PLUGIN_3D_GET_N_FILTERS m_getNFilters
Definition: pluginldr3D.h:81
int GetNExtensions(void)
virtual ~KICAD_PLUGIN_LDR_3D()
Definition: pluginldr3D.cpp:53
void GetLoaderVersion(unsigned char *Major, unsigned char *Minor, unsigned char *Revision, unsigned char *Patch) const override
Return the version information of the Plugin Loader for plugin compatibility checking.
PLUGIN_3D_LOAD m_load
Definition: pluginldr3D.h:84
PLUGIN_3D_CAN_RENDER m_canRender
Definition: pluginldr3D.h:83
PLUGIN_3D_GET_MODEL_EXTENSION m_getModelExtension
Definition: pluginldr3D.h:80
PLUGIN_3D_GET_N_EXTENSIONS m_getNExtensions
Definition: pluginldr3D.h:79
char const * GetModelExtension(int aIndex)
void Close(void) override
Clean up and closes/unloads the plugin.
Define the basic data set required to represent a 3D model.
Definition: scenegraph.h:45
int(* PLUGIN_3D_GET_N_EXTENSIONS)(void)
Definition: pluginldr3D.h:39
char const *(* PLUGIN_3D_GET_MODEL_EXTENSION)(int aIndex)
Definition: pluginldr3D.h:41
char const *(* PLUGIN_3D_GET_FILE_FILTER)(int aIndex)
Definition: pluginldr3D.h:45
SCENEGRAPH *(* PLUGIN_3D_LOAD)(char const *aFileName)
Definition: pluginldr3D.h:49
bool(* PLUGIN_3D_CAN_RENDER)(void)
Definition: pluginldr3D.h:47
int(* PLUGIN_3D_GET_N_FILTERS)(void)
Definition: pluginldr3D.h:43