You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
This directory will contain headers for the various types ofKiCad dynamic plugins and associated APIs.
In a typical implementation a dynamic plugin will provide a simple interface toprovide KiCad with a list of functions which can be invoked to provide thedesired feature. For example the 3D plugins provide a function to list thefile types supported by the plugin, the associated filters required for browsingfiles, and a Load() function to process a 3D file and return a data structurewhich KiCad can use in the 3D rendering process. The set of functions providedby a plugin shall be referred to here as the Plugin Interface. Every pluginmust be a derived class of at least one type of plugin declared in the headerfiles in this directory. All implementations of a plugin interface constitutean actual plugin; the various KiCad tools such as pcbnew and eeschema containno actual implementation of the plugin interface.
Plugins also need to interact with KiCad and its internal data while knowingessentially nothing of the complex structures within KiCad. To make this possibleeach type of dynamic plugin must interact with at least one type of API whichprovides functions to create, inspect, and manipulate the complex data structureswithin KiCad. These APIs shall be declared in the api subdirectory and must beimplemented within each KiCad tool which services the related plugin type. Forexample the 3D plugins must produce the intermediate scene graph data for useby the 3D renderer; to accomplish this an API is required to provide each 3Dplugin with a method for creating the data structures required by pcbnew andcvpcb. In the implementation detail the API may be implemented once in the commonstatic library of pcbnew or it can be implemented as a runtime shared librarywhich can then be linked to by pcbnew. cvpcb, or even eeschema.
Plugin specialization: To keep APIs and plugin interfaces as simple as possibleit is necessary for plugins to be specialized (have different types). While itis possible to define only one plugin interface and one API for any and allplugins to use, this would result in a very large API which is difficult tomaintain. Having specialized plugins and APIs ensures better maintainabilityof the code; a specific plugin may implement multiple plugin interfaces orinteract with multiple APIs if it makes sense to do so. At least two plugininterfaces have been identified for implementation at this point: the 3DPlugin Interface and the PCBExport interface. The 3D Plugin Interface shallprovide a method for processing supported 3D model types and returning anintermediate scene graph representation which a renderer can use to create avisual representation of the model. The PCBExport interface shall provide ameans of exporting PCB data to a variety of formats such as Specctra DSN forthe consumption of autorouters, GenCAD, VRML for visualization of the boardusing external tools, and IDF and IGES for interacting with mechanical designersand MCAD software. Other exporters such as netlist exporters or even BoMexporters should be possible. A PCBImport Interface is also a possibility butis currently a low priority item since there are currently only two importfunctions implemented (Specctra result import and DXF import) and a significantamount of work is required to implement the PCBImport API.
Plugin management: Since plugins are specialized, each type should also beloaded and managed by a specialized plugin manager which has responsibilitiesfor ensuring integration of the plugin with KiCad. For example the3d_plugin_manager searches a list of paths to identify and load plugins whichimplement the 3D Plugin Interface. The 3D manager extracts information fromeach 3D plugin such as the types of 3D formats supported and the associatedfile extensions; the manager also responds to a Load() request by activatingthe appropriate 3D plugin and executing that plugin's Load() function. In thecase of the Export Plugin Interface, a specific exporter would enumerate theplugins, add a menu item to the File->Export list, load and invoke a plugin'sExport() function at the user's request, and unload the plugin when theExport() function completes.
|