KiCad PCB EDA Suite
Loading...
Searching...
No Matches
3d_plugin.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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
28
29#ifndef PLUGIN_3D_H
30#define PLUGIN_3D_H
31
32// Note: the plugin class name must match the name expected by the loader
33#define KICAD_PLUGIN_CLASS "PLUGIN_3D"
34#define MAJOR 1
35#define MINOR 0
36#define REVISION 0
37#define PATCH 0
38
40
41
43{
44 return KICAD_PLUGIN_CLASS;
45}
46
47
48KICAD_PLUGIN_EXPORT void GetClassVersion( unsigned char* Major, unsigned char* Minor,
49 unsigned char* Patch, unsigned char* Revision )
50{
51 if( Major )
52 *Major = MAJOR;
53
54 if( Minor )
55 *Minor = MINOR;
56
57 if( Patch )
58 *Patch = PATCH;
59
60 if( Revision )
61 *Revision = REVISION;
62
63 return;
64}
65
66KICAD_PLUGIN_EXPORT bool CheckClassVersion( unsigned char Major, unsigned char Minor,
67 unsigned char Patch, unsigned char Revision )
68{
69 if( Major != MAJOR )
70 return false;
71
72 // at the moment there are no incompatibility rules other than the Major Version check
73 return true;
74}
75
76
77class SCENEGRAPH;
78
83
88KICAD_PLUGIN_EXPORT char const* GetModelExtension( int aIndex );
89
94
98KICAD_PLUGIN_EXPORT char const* GetFileFilter( int aIndex );
99
103KICAD_PLUGIN_EXPORT bool CanRender( void );
104
113KICAD_PLUGIN_EXPORT SCENEGRAPH* Load( char const* aFileName );
114
115#endif // PLUGIN_3D_H
KICAD_PLUGIN_EXPORT bool CheckClassVersion(unsigned char Major, unsigned char Minor, unsigned char Patch, unsigned char Revision)
Return true if the class version reported by the Plugin Loader is compatible with the specific implem...
Definition 3d_plugin.h:66
KICAD_PLUGIN_EXPORT int GetNExtensions(void)
#define MINOR
Definition 3d_plugin.h:35
KICAD_PLUGIN_EXPORT char const * GetModelExtension(int aIndex)
KICAD_PLUGIN_EXPORT char const * GetFileFilter(int aIndex)
KICAD_PLUGIN_EXPORT SCENEGRAPH * Load(char const *aFileName)
Read a model file and creates a generic display structure.
#define MAJOR
Definition 3d_plugin.h:34
KICAD_PLUGIN_EXPORT char const * GetKicadPluginClass(void)
Return the name of the implemented plugin class, for example 3DPLUGIN.
Definition 3d_plugin.h:42
KICAD_PLUGIN_EXPORT int GetNFilters(void)
KICAD_PLUGIN_EXPORT void GetClassVersion(unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
Retrieve the version of the Plugin Class.
Definition 3d_plugin.h:48
KICAD_PLUGIN_EXPORT bool CanRender(void)
#define KICAD_PLUGIN_CLASS
Definition 3d_plugin.h:33
#define REVISION
Definition 3d_plugin.h:36
#define PATCH
Definition 3d_plugin.h:37
Define the basic data set required to represent a 3D model.
Definition scenegraph.h:41
defines the most basic functions which all kicad plugins must implement.
#define KICAD_PLUGIN_EXPORT