27#ifndef GRAPHICS_IMPORTER_H
28#define GRAPHICS_IMPORTER_H
63 void SetPlugin( std::unique_ptr<GRAPHICS_IMPORT_PLUGIN> aPlugin )
75 bool Load(
const wxString& aFileName );
86 bool Import(
double aScale = 1.0 );
236 virtual void AddPolygon(
const std::vector< VECTOR2D >& aVertices,
double aWidth ) = 0;
251 double aWidth,
double aThickness,
double aOrientation,
269 void addItem( std::unique_ptr<EDA_ITEM> aItem )
271 m_items.emplace_back( std::move( aItem ) );
A base class for most all the KiCad significant classes used in schematics and boards.
Interface that creates objects representing shapes for a given data model.
void SetPlugin(std::unique_ptr< GRAPHICS_IMPORT_PLUGIN > aPlugin)
Set the import plugin used to obtain shapes from a file.
void ClearItems()
Empties out the imported shapes list.
double GetImageWidthMM() const
Get original image Width.
static constexpr unsigned int DEFAULT_LINE_WIDTH_DFX
virtual void NewShape(POLY_FILL_RULE aFillRule=PF_NONZERO)
virtual ~GRAPHICS_IMPORTER()
virtual void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, double aWidth)=0
Create an object representing an arc.
std::vector< POLY_FILL_RULE > m_shapeFillRules
double m_scale
Scale factor applied to the imported graphics.
virtual void AddLine(const VECTOR2D &aOrigin, const VECTOR2D &aEnd, double aWidth)=0
Create an object representing a line segment.
const wxString & GetMessages() const
Collect warning and error messages after loading/importing.
std::unique_ptr< GRAPHICS_IMPORT_PLUGIN > m_plugin
Total image width.
double GetMillimeterToIuFactor()
void SetImportOffsetMM(const VECTOR2D &aOffset)
Set the offset in millimeters to add to coordinates when importing graphic items.
double ImportScalingFactor() const
double GetLineWidthMM() const
Return the line width used for importing the outlines (in mm).
bool Import(double aScale=1.0)
Import shapes from loaded file.
std::list< std::unique_ptr< EDA_ITEM > > & GetItems()
Return the list of objects representing the imported shapes.
void SetLineWidthMM(double aWidth)
Set the line width for the imported outlines (in mm).
virtual void AddArc(const VECTOR2D &aCenter, const VECTOR2D &aStart, const EDA_ANGLE &aAngle, double aWidth)=0
Create an object representing an arc.
void addItem(std::unique_ptr< EDA_ITEM > aItem)
< Add an item to the imported shapes list.
bool Load(const wxString &aFileName)
Load file and get its basic data.
void SetScale(double aScale)
Set the scale factor affecting the imported shapes.
double m_millimeterToIu
Offset (in mm) for imported coordinates.
virtual void AddText(const VECTOR2D &aOrigin, const wxString &aText, double aHeight, double aWidth, double aThickness, double aOrientation, GR_TEXT_H_ALIGN_T aHJustify, GR_TEXT_V_ALIGN_T aVJustify)=0
Create an object representing a text.
const VECTOR2D & GetImportOffsetMM() const
double m_originalWidth
Total image Height;.
virtual void AddPolygon(const std::vector< VECTOR2D > &aVertices, double aWidth)=0
double GetImageHeightMM() const
Get original image Height.
std::list< std::unique_ptr< EDA_ITEM > > m_items
< List of imported items
virtual void AddCircle(const VECTOR2D &aCenter, double aRadius, double aWidth, bool aFilled)=0
Create an object representing a circle.