KiCad PCB EDA Suite
|
#include <svg_import_plugin.h>
Public Member Functions | |
SVG_IMPORT_PLUGIN () | |
const wxString | GetName () const override |
Return the plugin name. More... | |
const std::vector< std::string > | GetFileExtensions () const override |
Return a vector of the file extensions handled by this plugin. More... | |
const wxString & | GetMessages () const override |
bool | Import () override |
Actually imports the file. More... | |
bool | Load (const wxString &aFileName) override |
Load file for import. More... | |
virtual double | GetImageHeight () const override |
Return image height from original imported file. More... | |
virtual double | GetImageWidth () const override |
Return image width from original imported file. More... | |
virtual void | SetImporter (GRAPHICS_IMPORTER *aImporter) |
Set the receiver of the imported shapes. More... | |
wxString | GetWildcards () const |
Return a list of wildcards that contains the file extensions handled by this plugin, separated with a semi-colon. More... | |
virtual void | SetLineWidthMM (double aLineWidth) |
Protected Attributes | |
GRAPHICS_IMPORTER * | m_importer |
< Importer used to create objects representing the imported shapes. More... | |
Private Member Functions | |
void | DrawPath (const float *aPoints, int aNumPoints, bool aClosedPath, bool aFilled, double aLineWidth) |
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, double aWidth) |
void | DrawLineSegments (const std::vector< VECTOR2D > &aPoints, double aWidth) |
Private Attributes | |
struct NSVGimage * | m_parsedImage |
wxString | m_messages |
GRAPHICS_IMPORTER_BUFFER | m_internalImporter |
Definition at line 39 of file svg_import_plugin.h.
|
inline |
Definition at line 42 of file svg_import_plugin.h.
|
private |
Definition at line 171 of file svg_import_plugin.cpp.
References calculateBezierSegmentationThreshold(), getBezierPoint(), and segmentBezierCurve().
Referenced by DrawCubicBezierPath().
|
private |
Definition at line 153 of file svg_import_plugin.cpp.
References DrawCubicBezierCurve().
Referenced by DrawPath().
|
private |
Definition at line 190 of file svg_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddLine(), and m_internalImporter.
Referenced by DrawPath().
|
private |
Definition at line 138 of file svg_import_plugin.cpp.
References DrawCubicBezierPath(), DrawLineSegments(), and DrawPolygon().
Referenced by Import().
|
private |
Definition at line 184 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 53 of file svg_import_plugin.h.
|
overridevirtual |
Return image height from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 114 of file svg_import_plugin.cpp.
References m_parsedImage.
|
overridevirtual |
Return image width from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 126 of file svg_import_plugin.cpp.
References m_parsedImage.
|
inlineoverridevirtual |
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 62 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 48 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 69 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 74 of file svg_import_plugin.cpp.
References color, DrawPath(), 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, and GRAPHICS_IMPORTER_BUFFER::PostprocessNestedPolygons().
|
overridevirtual |
Load file for import.
It is necessary to have the GRAPHICS_IMPORTER object set before.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 53 of file svg_import_plugin.cpp.
References GRAPHICS_IMPORT_PLUGIN::m_importer, and m_parsedImage.
|
inlinevirtualinherited |
Set the receiver of the imported shapes.
Reimplemented in DXF_IMPORT_PLUGIN.
Definition at line 48 of file graphics_import_plugin.h.
References GRAPHICS_IMPORT_PLUGIN::m_importer.
Referenced by DXF_IMPORT_PLUGIN::SetImporter().
|
inlinevirtualinherited |
|
protectedinherited |
< Importer used to create objects representing the imported shapes.
Definition at line 126 of file graphics_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN::Import(), Import(), Load(), GRAPHICS_IMPORT_PLUGIN::SetImporter(), and DXF_IMPORT_PLUGIN::SetImporter().
|
private |
Definition at line 90 of file svg_import_plugin.h.
Referenced by DrawLineSegments(), DrawPolygon(), and Import().
|
private |
Definition at line 87 of file svg_import_plugin.h.
Referenced by GetMessages().
|
private |
Definition at line 85 of file svg_import_plugin.h.
Referenced by GetImageHeight(), GetImageWidth(), Import(), and Load().