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, 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
33#ifndef PLUGIN_3D_H
34#define PLUGIN_3D_H
35
36// Note: the plugin class name must match the name expected by the loader
37#define KICAD_PLUGIN_CLASS "PLUGIN_3D"
38#define MAJOR 1
39#define MINOR 0
40#define REVISION 0
41#define PATCH 0
42
44
45
47{
48 return KICAD_PLUGIN_CLASS;
49}
50
51
52KICAD_PLUGIN_EXPORT void GetClassVersion( unsigned char* Major, unsigned char* Minor,
53 unsigned char* Patch, unsigned char* Revision )
54{
55 if( Major )
56 *Major = MAJOR;
57
58 if( Minor )
59 *Minor = MINOR;
60
61 if( Patch )
62 *Patch = PATCH;
63
64 if( Revision )
65 *Revision = REVISION;
66
67 return;
68}
69
70KICAD_PLUGIN_EXPORT bool CheckClassVersion( unsigned char Major, unsigned char Minor,
71 unsigned char Patch, unsigned char Revision )
72{
73 if( Major != MAJOR )
74 return false;
75
76 // at the moment there are no incompatibility rules other than the Major Version check
77 return true;
78}
79
80
81class SCENEGRAPH;
82
87
92KICAD_PLUGIN_EXPORT char const* GetModelExtension( int aIndex );
93
98
102KICAD_PLUGIN_EXPORT char const* GetFileFilter( int aIndex );
103
107KICAD_PLUGIN_EXPORT bool CanRender( void );
108
117KICAD_PLUGIN_EXPORT SCENEGRAPH* Load( char const* aFileName );
118
119#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:70
KICAD_PLUGIN_EXPORT int GetNExtensions(void)
#define MINOR
Definition: 3d_plugin.h:39
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:38
KICAD_PLUGIN_EXPORT char const * GetKicadPluginClass(void)
Return the name of the implemented plugin class, for example 3DPLUGIN.
Definition: 3d_plugin.h:46
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:52
KICAD_PLUGIN_EXPORT bool CanRender(void)
#define KICAD_PLUGIN_CLASS
Definition: 3d_plugin.h:37
#define REVISION
Definition: 3d_plugin.h:40
#define PATCH
Definition: 3d_plugin.h:41
Define the basic data set required to represent a 3D model.
Definition: scenegraph.h:45
defines the most basic functions which all kicad plugins must implement.
#define KICAD_PLUGIN_EXPORT
Definition: kicad_plugin.h:37