KiCad PCB EDA Suite
Loading...
Searching...
No Matches
vrml.cpp File Reference
#include "plugins/3d/3d_plugin.h"
#include "plugins/3dapi/ifsg_all.h"
#include "richio.h"
#include "vrml1_base.h"
#include "vrml2_base.h"
#include "wrlproc.h"
#include "x3d.h"
#include <clocale>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include <wx/string.h>
#include <wx/wfstream.h>
#include <wx/log.h>
#include <decompress.hpp>

Go to the source code of this file.

Classes

struct  FILE_DATA
 
class  LOCALESWITCH
 

Macros

#define PLUGIN_VRML_MAJOR   1
 
#define PLUGIN_VRML_MINOR   3
 
#define PLUGIN_VRML_PATCH   2
 
#define PLUGIN_VRML_REVNO   2
 

Functions

const char * GetKicadPluginName (void)
 Function GetKicadPluginName returns the name of the plugin instance; for example IDFv3.
 
void GetPluginVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
 Function GetPluginVersion retrieves the version of the instantiated plugin for informational purposes.
 
int GetNExtensions (void)
 Function GetNExtensions.
 
char const * GetModelExtension (int aIndex)
 Function GetModelExtension.
 
int GetNFilters (void)
 Function GetNFilters.
 
char const * GetFileFilter (int aIndex)
 Function GetFileFilter.
 
bool CanRender (void)
 Function CanRender.
 
SCENEGRAPHLoadVRML (const wxString &aFileName, bool useInline)
 
SCENEGRAPHLoadX3D (const wxString &aFileName)
 
SCENEGRAPHLoad (char const *aFileName)
 reads a model file and creates a generic display structure
 

Variables

const wxChar *const traceVrmlPlugin = wxT( "KICAD_VRML_PLUGIN" )
 Flag to enable VRML plugin trace output.
 
static struct FILE_DATA file_data
 

Macro Definition Documentation

◆ PLUGIN_VRML_MAJOR

#define PLUGIN_VRML_MAJOR   1

Definition at line 52 of file vrml.cpp.

◆ PLUGIN_VRML_MINOR

#define PLUGIN_VRML_MINOR   3

Definition at line 53 of file vrml.cpp.

◆ PLUGIN_VRML_PATCH

#define PLUGIN_VRML_PATCH   2

Definition at line 54 of file vrml.cpp.

◆ PLUGIN_VRML_REVNO

#define PLUGIN_VRML_REVNO   2

Definition at line 55 of file vrml.cpp.

Function Documentation

◆ CanRender()

bool CanRender ( void  )

Function CanRender.

Returns
true if the plugin can render a model, that is the Load() function is implemented

Definition at line 143 of file vrml.cpp.

◆ GetFileFilter()

char const * GetFileFilter ( int  aIndex)

Function GetFileFilter.

Returns
the file filter string for the given index

Definition at line 134 of file vrml.cpp.

References file_data, FILE_DATA::filters, and NFILS.

◆ GetKicadPluginName()

const char * GetKicadPluginName ( void  )

Function GetKicadPluginName returns 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.

Returns
is the NULL-terminated UTF-8 string representing the plugin name

Definition at line 66 of file vrml.cpp.

◆ GetModelExtension()

char const * GetModelExtension ( int  aIndex)

Function GetModelExtension.

Parameters
aIndexis the extension to return; valid values are 0 to GetNExtensions() - 1.
Returns
the requested extension or a null string if aIndex was invalid.

Definition at line 119 of file vrml.cpp.

References FILE_DATA::extensions, file_data, and NEXTS.

◆ GetNExtensions()

int GetNExtensions ( void  )

Function GetNExtensions.

Returns
the number of extensions supported by the plugin

Definition at line 113 of file vrml.cpp.

References FILE_DATA::extensions, file_data, and NEXTS.

◆ GetNFilters()

int GetNFilters ( void  )

Function GetNFilters.

Returns
the number of file filters

Definition at line 128 of file vrml.cpp.

References file_data, FILE_DATA::filters, and NFILS.

◆ GetPluginVersion()

void GetPluginVersion ( unsigned char *  Major,
unsigned char *  Minor,
unsigned char *  Patch,
unsigned char *  Revision 
)

Function GetPluginVersion retrieves the version of the instantiated plugin for informational purposes.

Do not confuse this with GetClassVersion which is used to determine API compatibility.

Parameters
Majorwill hold the Plugin Major version
Minorwill hold the Plugin Minor version
Patchwill hold the Plugin Patch level
Revisionwill hold the Plugin Revision

Definition at line 72 of file vrml.cpp.

References PLUGIN_3D_IDF_MAJOR, PLUGIN_3D_IDF_MINOR, PLUGIN_3D_IDF_PATCH, PLUGIN_3D_IDF_REVNO, PLUGIN_VRML_MAJOR, PLUGIN_VRML_MINOR, PLUGIN_VRML_PATCH, and PLUGIN_VRML_REVNO.

◆ Load()

SCENEGRAPH * Load ( char const *  aFileName)

reads a model file and creates a generic display structure

Parameters
aFileNameis the full path of the model file
Returns
a SCENEGRAPH pointer to the display structure if the model was successfully loaded and NULL if there is no rendering support for the model or there were problems reading the model

Definition at line 331 of file vrml.cpp.

References loadIDFBoard(), loadIDFOutline(), LoadVRML(), LoadX3D(), and S3D::WriteVRML().

Referenced by CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PIN::Parse().

◆ LoadVRML()

◆ LoadX3D()

SCENEGRAPH * LoadX3D ( const wxString &  aFileName)

Definition at line 321 of file vrml.cpp.

References X3DPARSER::Load().

Referenced by Load().

Variable Documentation

◆ file_data

struct FILE_DATA file_data
static