KiCad PCB EDA Suite
|
#include <svg_import_plugin.h>
Public Member Functions | |
SVG_IMPORT_PLUGIN () | |
const wxString | GetName () const override |
Return the plugin name. | |
const std::vector< std::string > | GetFileExtensions () const override |
Return a vector of the file extensions handled by this plugin. | |
const wxString & | GetMessages () const override |
void | ReportMsg (const wxString &aMessage) override |
bool | Import () override |
Actually imports the file. | |
bool | Load (const wxString &aFileName) override |
Load file for import. | |
bool | LoadFromMemory (const wxMemoryBuffer &aMemBuffer) override |
Set memory buffer with content for import. | |
virtual double | GetImageHeight () const override |
Return image height from original imported file. | |
virtual double | GetImageWidth () const override |
Return image width from original imported file. | |
virtual BOX2D | GetImageBBox () const override |
Return image bounding box from original imported file. | |
virtual void | SetImporter (GRAPHICS_IMPORTER *aImporter) |
Set the receiver of the imported shapes. | |
wxString | GetWildcards () const |
Return a list of wildcards that contains the file extensions handled by this plugin, separated with a semi-colon. | |
virtual void | SetLineWidthMM (double aLineWidth) |
Protected Attributes | |
GRAPHICS_IMPORTER * | m_importer |
< Importer used to create objects representing the imported shapes. | |
Private Member Functions | |
void | DrawPath (const float *aPoints, int aNumPoints, bool aClosedPath, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor) |
void | DrawCubicBezierPath (const float *aPoints, int aNumPoints, std::vector< VECTOR2D > &aGeneratedPoints) |
void | DrawCubicBezierCurve (const float *aPoints, std::vector< VECTOR2D > &aGeneratedPoints) |
void | DrawPolygon (const std::vector< VECTOR2D > &aPoints, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor) |
void | DrawLineSegments (const std::vector< VECTOR2D > &aPoints, const IMPORTED_STROKE &aStroke) |
Private Attributes | |
struct NSVGimage * | m_parsedImage |
wxString | m_messages |
GRAPHICS_IMPORTER_BUFFER | m_internalImporter |
Definition at line 37 of file svg_import_plugin.h.
|
inline |
Definition at line 40 of file svg_import_plugin.h.
|
private |
Definition at line 289 of file svg_import_plugin.cpp.
References calculateBezierSegmentationThreshold(), getBezierPoint(), and segmentBezierCurve().
Referenced by DrawCubicBezierPath().
|
private |
Definition at line 271 of file svg_import_plugin.cpp.
References DrawCubicBezierCurve().
Referenced by DrawPath().
|
private |
Definition at line 310 of file svg_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddLine(), and m_internalImporter.
Referenced by DrawPath().
|
private |
Definition at line 255 of file svg_import_plugin.cpp.
References DrawCubicBezierPath(), DrawLineSegments(), and DrawPolygon().
Referenced by Import().
|
private |
Definition at line 302 of file svg_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddPolygon(), and m_internalImporter.
Referenced by DrawPath().
|
inlineoverridevirtual |
Return a vector of the file extensions handled by this plugin.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 51 of file svg_import_plugin.h.
|
overridevirtual |
Return image bounding box from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 230 of file svg_import_plugin.cpp.
References m_parsedImage, BOX2< Vec >::Merge(), BOX2< Vec >::SetEnd(), and BOX2< Vec >::SetOrigin().
|
overridevirtual |
Return image height from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 206 of file svg_import_plugin.cpp.
References m_parsedImage, and SVG_DPI.
Referenced by SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSymbol(), and SCH_EASYEDA_PARSER::ParseSymbolShapes().
|
overridevirtual |
Return image width from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 218 of file svg_import_plugin.cpp.
References m_parsedImage, and SVG_DPI.
Referenced by SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSymbol(), and SCH_EASYEDA_PARSER::ParseSymbolShapes().
|
inlineoverridevirtual |
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 60 of file svg_import_plugin.h.
References m_messages.
|
inlineoverridevirtual |
Return the plugin name.
This string will be used as the description in the file dialog.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 46 of file svg_import_plugin.h.
|
inlineinherited |
Return a list of wildcards that contains the file extensions handled by this plugin, separated with a semi-colon.
Definition at line 65 of file graphics_import_plugin.h.
References formatWildcardExt(), and GRAPHICS_IMPORT_PLUGIN::GetFileExtensions().
|
overridevirtual |
Actually imports the file.
It is necessary to have loaded the file beforehand.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 97 of file svg_import_plugin.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, color, DrawPath(), KIGFX::COLOR4D::g, GRAPHICS_IMPORTER_BUFFER::ImportTo(), GRAPHICS_IMPORT_PLUGIN::m_importer, m_internalImporter, m_parsedImage, GRAPHICS_IMPORTER::NewShape(), path, GRAPHICS_IMPORTER::PF_EVEN_ODD, GRAPHICS_IMPORTER::PF_NONZERO, GRAPHICS_IMPORTER_BUFFER::PostprocessNestedPolygons(), and KIGFX::COLOR4D::r.
Referenced by ConvertSVGToLibShapes(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSymbol(), and SCH_EASYEDA_PARSER::ParseSymbolShapes().
|
overridevirtual |
Load file for import.
It is necessary to have the GRAPHICS_IMPORTER object set before.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 55 of file svg_import_plugin.cpp.
References GRAPHICS_IMPORT_PLUGIN::m_importer, m_parsedImage, and SVG_DPI.
|
overridevirtual |
Set memory buffer with content for import.
It is necessary to have the GRAPHICS_IMPORTER object set before.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 79 of file svg_import_plugin.cpp.
References GRAPHICS_IMPORT_PLUGIN::m_importer, m_parsedImage, and SVG_DPI.
Referenced by ConvertSVGToLibShapes(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSymbol(), and SCH_EASYEDA_PARSER::ParseSymbolShapes().
|
overridevirtual |
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 431 of file svg_import_plugin.cpp.
References m_messages.
|
inlinevirtualinherited |
Set the receiver of the imported shapes.
Reimplemented in DXF_IMPORT_PLUGIN.
Definition at line 47 of file graphics_import_plugin.h.
References GRAPHICS_IMPORT_PLUGIN::m_importer.
Referenced by ConvertSVGToLibShapes(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSymbol(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), and DXF_IMPORT_PLUGIN::SetImporter().
|
inlinevirtualinherited |
Reimplemented in DXF_IMPORT_PLUGIN.
Definition at line 125 of file graphics_import_plugin.h.
|
protectedinherited |
< Importer used to create objects representing the imported shapes.
Definition at line 138 of file graphics_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN::Import(), Import(), Load(), LoadFromMemory(), GRAPHICS_IMPORT_PLUGIN::SetImporter(), and DXF_IMPORT_PLUGIN::SetImporter().
|
private |
Definition at line 94 of file svg_import_plugin.h.
Referenced by DrawLineSegments(), DrawPolygon(), and Import().
|
private |
Definition at line 91 of file svg_import_plugin.h.
Referenced by GetMessages(), and ReportMsg().
|
private |
Definition at line 89 of file svg_import_plugin.h.
Referenced by GetImageBBox(), GetImageHeight(), GetImageWidth(), Import(), Load(), and LoadFromMemory().