KiCad PCB EDA Suite
|
#include <cmath>
#include <string>
#include <map>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/string.h>
#include "plugins/3d/3d_plugin.h"
#include "plugins/3dapi/ifsg_all.h"
#include "idf_parser.h"
#include "vrml_layer.h"
Go to the source code of this file.
Classes | |
class | LOCALESWITCH |
struct | FILE_DATA |
Macros | |
#define | PLUGIN_3D_IDF_MAJOR 1 |
#define | PLUGIN_3D_IDF_MINOR 0 |
#define | PLUGIN_3D_IDF_PATCH 0 |
#define | PLUGIN_3D_IDF_REVNO 0 |
#define | NCOLORS 6 |
#define | NEXTS 4 |
#define | NFILS 2 |
Functions | |
static SCENEGRAPH * | loadIDFOutline (const wxString &aFileName) |
static SCENEGRAPH * | loadIDFBoard (const wxString &aFileName) |
static SCENEGRAPH * | addOutline (IDF3_COMP_OUTLINE *outline, int idxColor, SGNODE *aParent) |
static SCENEGRAPH * | makeBoard (IDF3_BOARD &brd, SGNODE *aParent) |
static bool | makeComponents (IDF3_BOARD &brd, SGNODE *aParent) |
static bool | makeOtherOutlines (IDF3_BOARD &brd, SGNODE *aParent) |
static bool | getOutlineModel (VRML_LAYER &model, const std::list< IDF_OUTLINE * > *items) |
static bool | addSegment (VRML_LAYER &model, IDF_SEGMENT *seg, int icont, int iseg) |
static SCENEGRAPH * | vrmlToSG (VRML_LAYER &vpcb, int idxColor, SGNODE *aParent, double top, double bottom) |
static SGNODE * | getColor (IFSG_SHAPE &shape, int colorIdx) |
const char * | GetKicadPluginName (void) |
Return the name of the plugin instance, for example IDFv3. | |
void | GetPluginVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision) |
Retrieve the version of the instantiated plugin for informational purposes. | |
int | GetNExtensions (void) |
char const * | GetModelExtension (int aIndex) |
int | GetNFilters (void) |
char const * | GetFileFilter (int aIndex) |
bool | CanRender (void) |
SCENEGRAPH * | Load (char const *aFileName) |
Read a model file and creates a generic display structure. | |
Variables | |
const wxChar *const | traceIdfPlugin = wxT( "KICAD_IDF_PLUGIN" ) |
Flag to enable IDF plugin trace output. | |
static char | ext0 [] = "idf" |
static char | ext1 [] = "emn" |
static char | ext2 [] = "IDF" |
static char | ext3 [] = "EMN" |
static char | fil0 [] = "IDF (*.idf;*.IDF)|*.idf;*.IDF" |
static char | fil1 [] = "IDF BRD (*.emn;*.EMN)|*.emn;*.EMN" |
static struct FILE_DATA | file_data |
#define NCOLORS 6 |
Definition at line 46 of file s3d_plugin_idf.cpp.
#define NEXTS 4 |
Definition at line 222 of file s3d_plugin_idf.cpp.
#define NFILS 2 |
Definition at line 227 of file s3d_plugin_idf.cpp.
#define PLUGIN_3D_IDF_MAJOR 1 |
Definition at line 39 of file s3d_plugin_idf.cpp.
#define PLUGIN_3D_IDF_MINOR 0 |
Definition at line 40 of file s3d_plugin_idf.cpp.
#define PLUGIN_3D_IDF_PATCH 0 |
Definition at line 41 of file s3d_plugin_idf.cpp.
#define PLUGIN_3D_IDF_REVNO 0 |
Definition at line 42 of file s3d_plugin_idf.cpp.
|
static |
Definition at line 574 of file s3d_plugin_idf.cpp.
References getOutlineModel(), traceIdfPlugin, and vrmlToSG().
Referenced by loadIDFOutline(), and makeComponents().
|
static |
Definition at line 407 of file s3d_plugin_idf.cpp.
References traceIdfPlugin.
Referenced by ConnectBoardShapes(), getOutlineModel(), makeWireFromChain(), PCB_IO_EASYEDAPRO_PARSER::ParsePoly(), and DOGBONE_CORNER_ROUTINE::ProcessLinePair().
bool CanRender | ( | void | ) |
Definition at line 295 of file s3d_plugin_idf.cpp.
|
static |
Definition at line 110 of file s3d_plugin_idf.cpp.
References IFSG_NODE::GetRawPtr(), NCOLORS, IFSG_APPEARANCE::SetDiffuse(), IFSG_APPEARANCE::SetShininess(), and IFSG_APPEARANCE::SetSpecular().
Referenced by vrmlToSG().
char const * GetFileFilter | ( | int | aIndex | ) |
Definition at line 286 of file s3d_plugin_idf.cpp.
const char * GetKicadPluginName | ( | void | ) |
Return the name of the plugin instance, for example IDFv3.
This string may be used to check for name conflicts or to display informational messages about loaded plugins. This method must be implemented in specific instantiations of a plugin class.
Definition at line 195 of file s3d_plugin_idf.cpp.
char const * GetModelExtension | ( | int | aIndex | ) |
aIndex | is the extension to return; valid values are 0 to GetNExtensions() - 1. |
Definition at line 271 of file s3d_plugin_idf.cpp.
int GetNExtensions | ( | void | ) |
Definition at line 265 of file s3d_plugin_idf.cpp.
int GetNFilters | ( | void | ) |
Definition at line 280 of file s3d_plugin_idf.cpp.
|
static |
Definition at line 340 of file s3d_plugin_idf.cpp.
References addSegment(), and traceIdfPlugin.
Referenced by addOutline(), makeBoard(), and makeOtherOutlines().
void GetPluginVersion | ( | unsigned char * | Major, |
unsigned char * | Minor, | ||
unsigned char * | Patch, | ||
unsigned char * | Revision | ||
) |
Retrieve the version of the instantiated plugin for informational purposes.
Do not confuse this with GetClassVersion which is used to determine API compatibility.
Major | will hold the Plugin Major version. |
Minor | will hold the Plugin Minor version. |
Patch | will hold the Plugin Patch level. |
Revision | will hold the Plugin Revision. |
Definition at line 201 of file s3d_plugin_idf.cpp.
SCENEGRAPH * Load | ( | char const * | aFileName | ) |
Read a model file and creates a generic display structure.
aFileName | is the full path of the model file. |
Definition at line 302 of file s3d_plugin_idf.cpp.
|
static |
Definition at line 632 of file s3d_plugin_idf.cpp.
References IFSG_NODE::Destroy(), IFSG_NODE::GetRawPtr(), makeBoard(), makeComponents(), makeOtherOutlines(), and traceIdfPlugin.
Referenced by Load().
|
static |
Definition at line 605 of file s3d_plugin_idf.cpp.
References addOutline(), and traceIdfPlugin.
Referenced by Load().
|
static |
Definition at line 675 of file s3d_plugin_idf.cpp.
References getOutlineModel(), and vrmlToSG().
Referenced by loadIDFBoard().
|
static |
Definition at line 738 of file s3d_plugin_idf.cpp.
References std::abs(), IFSG_NODE::AddChildNode(), addOutline(), IFSG_NODE::AddRefNode(), IFSG_TRANSFORM::Attach(), IFSG_NODE::GetParent(), IFSG_TRANSFORM::SetRotation(), and IFSG_TRANSFORM::SetTranslation().
Referenced by loadIDFBoard().
|
static |
Definition at line 859 of file s3d_plugin_idf.cpp.
References std::abs(), getOutlineModel(), and vrmlToSG().
Referenced by loadIDFBoard().
|
static |
Definition at line 442 of file s3d_plugin_idf.cpp.
References IFSG_COORDS::AddCoord(), IFSG_INDEX::AddIndex(), IFSG_NORMALS::AddNormal(), IFSG_NODE::AddRefNode(), S3D::CalcTriNorm(), getColor(), IFSG_NODE::GetRawPtr(), IFSG_COORDINDEX::NewNode(), IFSG_COORDS::NewNode(), IFSG_FACESET::NewNode(), IFSG_NORMALS::NewNode(), IFSG_SHAPE::NewNode(), IFSG_COORDS::SetCoordsList(), IFSG_INDEX::SetIndices(), SGVECTOR::SetVector(), and traceIdfPlugin.
Referenced by addOutline(), makeBoard(), and makeOtherOutlines().
|
static |
Definition at line 230 of file s3d_plugin_idf.cpp.
Referenced by FILE_DATA::FILE_DATA().
|
static |
Definition at line 231 of file s3d_plugin_idf.cpp.
Referenced by FILE_DATA::FILE_DATA().
|
static |
Definition at line 238 of file s3d_plugin_idf.cpp.
Referenced by FILE_DATA::FILE_DATA().
|
static |
Definition at line 239 of file s3d_plugin_idf.cpp.
Referenced by FILE_DATA::FILE_DATA().
|
static |
Definition at line 240 of file s3d_plugin_idf.cpp.
Referenced by FILE_DATA::FILE_DATA().
|
static |
Definition at line 241 of file s3d_plugin_idf.cpp.
Referenced by FILE_DATA::FILE_DATA().
|
static |
Referenced by GetFileFilter(), and GetModelExtension().