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 *
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 PLUGIN_3D_H
31#define PLUGIN_3D_H
32
33//
34// KICAD_PLUGIN CLASS INTERFACE
35//
36// WARNING: DO NOT EDIT THIS FILE OUTSIDE THE KICAD TREE
37//
38
39// Note: the plugin class name must match the name expected by the loader
40#define KICAD_PLUGIN_CLASS "PLUGIN_3D"
41#define MAJOR 1
42#define MINOR 0
43#define REVISION 0
44#define PATCH 0
45
47
48
50{
51 return KICAD_PLUGIN_CLASS;
52}
53
54
55KICAD_PLUGIN_EXPORT void GetClassVersion( unsigned char* Major,
56 unsigned char* Minor, unsigned char* Patch, unsigned char* Revision )
57{
58 if( Major )
59 *Major = MAJOR;
60
61 if( Minor )
62 *Minor = MINOR;
63
64 if( Patch )
65 *Patch = PATCH;
66
67 if( Revision )
68 *Revision = REVISION;
69
70 return;
71}
72
73KICAD_PLUGIN_EXPORT bool CheckClassVersion( unsigned char Major,
74 unsigned char Minor, unsigned char Patch, unsigned char Revision )
75{
76 if( Major != MAJOR )
77 return false;
78
79 // at the moment there are no incompatibility rules other than the Major Version check
80 return true;
81}
82
83
84class SCENEGRAPH;
85
92
101KICAD_PLUGIN_EXPORT char const* GetModelExtension( int aIndex );
102
108
114KICAD_PLUGIN_EXPORT char const* GetFileFilter( int aIndex );
115
122KICAD_PLUGIN_EXPORT bool CanRender( void );
123
132KICAD_PLUGIN_EXPORT SCENEGRAPH* Load( char const* aFileName );
133
134#endif // PLUGIN_3D_H
KICAD_PLUGIN_EXPORT bool CheckClassVersion(unsigned char Major, unsigned char Minor, unsigned char Patch, unsigned char Revision)
Function CheckClassVersion returns true if the class version reported by the Plugin Loader is compati...
Definition: 3d_plugin.h:73
KICAD_PLUGIN_EXPORT int GetNExtensions(void)
Function GetNExtensions.
#define MINOR
Definition: 3d_plugin.h:42
KICAD_PLUGIN_EXPORT char const * GetModelExtension(int aIndex)
Function GetModelExtension.
KICAD_PLUGIN_EXPORT char const * GetFileFilter(int aIndex)
Function GetFileFilter.
KICAD_PLUGIN_EXPORT SCENEGRAPH * Load(char const *aFileName)
reads a model file and creates a generic display structure
#define MAJOR
Definition: 3d_plugin.h:41
KICAD_PLUGIN_EXPORT char const * GetKicadPluginClass(void)
Function GetKicadPluginClass returns the name of the implemented plugin class; for example 3DPLUGIN.
Definition: 3d_plugin.h:49
KICAD_PLUGIN_EXPORT int GetNFilters(void)
Function GetNFilters.
KICAD_PLUGIN_EXPORT void GetClassVersion(unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
Function GetClassVersion retrieves the version of the Plugin Class.
Definition: 3d_plugin.h:55
KICAD_PLUGIN_EXPORT bool CanRender(void)
Function CanRender.
#define KICAD_PLUGIN_CLASS
Definition: 3d_plugin.h:40
#define REVISION
Definition: 3d_plugin.h:43
#define PATCH
Definition: 3d_plugin.h:44
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