KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GRAPHICS_IMPORT_PLUGIN Class Referenceabstract

Interface for vector graphics import plugins. More...

#include <graphics_import_plugin.h>

Inheritance diagram for GRAPHICS_IMPORT_PLUGIN:
DXF_IMPORT_PLUGIN SVG_IMPORT_PLUGIN

Public Member Functions

virtual ~GRAPHICS_IMPORT_PLUGIN ()
 
virtual void SetImporter (GRAPHICS_IMPORTER *aImporter)
 Set the receiver of the imported shapes.
 
virtual const wxString GetName () const =0
 Return the plugin name.
 
virtual const std::vector< std::string > GetFileExtensions () const =0
 Return a vector of the file extensions handled by this plugin.
 
wxString GetWildcards () const
 Return a list of wildcards that contains the file extensions handled by this plugin, separated with a semi-colon.
 
virtual bool Load (const wxString &aFileName)=0
 Load file for import.
 
virtual bool LoadFromMemory (const wxMemoryBuffer &aMemBuffer)=0
 Set memory buffer with content for import.
 
virtual double GetImageHeight () const =0
 Return image height from original imported file.
 
virtual double GetImageWidth () const =0
 Return image width from original imported file.
 
virtual BOX2D GetImageBBox () const =0
 Return image bounding box from original imported file.
 
virtual bool Import ()=0
 Actually imports the file.
 
virtual void SetLineWidthMM (double aLineWidth)
 
virtual const wxString & GetMessages () const =0
 Collect warning and error messages after loading/importing.
 
virtual void ReportMsg (const wxString &aMessage)=0
 

Protected Attributes

GRAPHICS_IMPORTERm_importer
 < Importer used to create objects representing the imported shapes.
 

Detailed Description

Interface for vector graphics import plugins.

Definition at line 39 of file graphics_import_plugin.h.

Constructor & Destructor Documentation

◆ ~GRAPHICS_IMPORT_PLUGIN()

virtual GRAPHICS_IMPORT_PLUGIN::~GRAPHICS_IMPORT_PLUGIN ( )
inlinevirtual

Definition at line 42 of file graphics_import_plugin.h.

Member Function Documentation

◆ GetFileExtensions()

virtual const std::vector< std::string > GRAPHICS_IMPORT_PLUGIN::GetFileExtensions ( ) const
pure virtual

Return a vector of the file extensions handled by this plugin.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

Referenced by GetWildcards().

◆ GetImageBBox()

virtual BOX2D GRAPHICS_IMPORT_PLUGIN::GetImageBBox ( ) const
pure virtual

Return image bounding box from original imported file.

Returns
Image bounding box.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ GetImageHeight()

virtual double GRAPHICS_IMPORT_PLUGIN::GetImageHeight ( ) const
pure virtual

Return image height from original imported file.

Returns
Original Image height in mm.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ GetImageWidth()

virtual double GRAPHICS_IMPORT_PLUGIN::GetImageWidth ( ) const
pure virtual

Return image width from original imported file.

Returns
Original Image width in mm.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ GetMessages()

virtual const wxString & GRAPHICS_IMPORT_PLUGIN::GetMessages ( ) const
pure virtual

Collect warning and error messages after loading/importing.

Returns
the list of messages in one string. Each message ends by '
'

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ GetName()

virtual const wxString GRAPHICS_IMPORT_PLUGIN::GetName ( ) const
pure virtual

Return the plugin name.

This string will be used as the description in the file dialog.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ GetWildcards()

wxString GRAPHICS_IMPORT_PLUGIN::GetWildcards ( ) const
inline

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 GetFileExtensions().

◆ Import()

virtual bool GRAPHICS_IMPORT_PLUGIN::Import ( )
pure virtual

Actually imports the file.

It is necessary to have loaded the file beforehand.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ Load()

virtual bool GRAPHICS_IMPORT_PLUGIN::Load ( const wxString &  aFileName)
pure virtual

Load file for import.

It is necessary to have the GRAPHICS_IMPORTER object set before.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ LoadFromMemory()

virtual bool GRAPHICS_IMPORT_PLUGIN::LoadFromMemory ( const wxMemoryBuffer &  aMemBuffer)
pure virtual

Set memory buffer with content for import.

It is necessary to have the GRAPHICS_IMPORTER object set before.

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ ReportMsg()

virtual void GRAPHICS_IMPORT_PLUGIN::ReportMsg ( const wxString &  aMessage)
pure virtual

Implemented in DXF_IMPORT_PLUGIN, and SVG_IMPORT_PLUGIN.

◆ SetImporter()

virtual void GRAPHICS_IMPORT_PLUGIN::SetImporter ( GRAPHICS_IMPORTER aImporter)
inlinevirtual

◆ SetLineWidthMM()

virtual void GRAPHICS_IMPORT_PLUGIN::SetLineWidthMM ( double  aLineWidth)
inlinevirtual

Reimplemented in DXF_IMPORT_PLUGIN.

Definition at line 125 of file graphics_import_plugin.h.

Member Data Documentation

◆ m_importer

GRAPHICS_IMPORTER* GRAPHICS_IMPORT_PLUGIN::m_importer
protected

< 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(), SVG_IMPORT_PLUGIN::Import(), SVG_IMPORT_PLUGIN::Load(), SVG_IMPORT_PLUGIN::LoadFromMemory(), SetImporter(), and DXF_IMPORT_PLUGIN::SetImporter().


The documentation for this class was generated from the following file: