27#ifndef GRAPHICS_IMPORTER_H
28#define GRAPHICS_IMPORTER_H
93 void SetPlugin( std::unique_ptr<GRAPHICS_IMPORT_PLUGIN> aPlugin )
105 bool Load(
const wxString& aFileName );
258 bool aFilled,
const COLOR4D& aFillColor ) = 0;
281 bool aFilled,
const COLOR4D& aFillColor ) = 0;
297 double aWidth,
double aThickness,
double aOrientation,
316 void addItem( std::unique_ptr<EDA_ITEM> aItem )
318 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.
virtual void AddArc(const VECTOR2D &aCenter, const VECTOR2D &aStart, const EDA_ANGLE &aAngle, const IMPORTED_STROKE &aStroke)=0
Create an object representing an arc.
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 AddPolygon(const std::vector< VECTOR2D > &aVertices, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)=0
Create an object representing a polygon.
virtual void NewShape(POLY_FILL_RULE aFillRule=PF_NONZERO)
virtual ~GRAPHICS_IMPORTER()
VECTOR2D m_scale
Scale factor applied to the imported graphics.
std::vector< POLY_FILL_RULE > m_shapeFillRules
const wxString & GetMessages() const
Collect warning and error messages after loading/importing.
virtual void AddLine(const VECTOR2D &aOrigin, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke)=0
Create an object representing a line segment.
std::unique_ptr< GRAPHICS_IMPORT_PLUGIN > m_plugin
Total image width.
void ReportMsg(const wxString &aMessage)
VECTOR2D GetScale() const
double GetMillimeterToIuFactor()
void SetImportOffsetMM(const VECTOR2D &aOffset)
Set the offset in millimeters to add to coordinates when importing graphic items.
void SetScale(const VECTOR2D &aScale)
Set the scale factor affecting the imported shapes.
bool Import(const VECTOR2D &aScale=VECTOR2D(1.0, 1.0))
Import shapes from loaded file.
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, const COLOR4D &aColor)=0
Create an object representing a text.
double GetLineWidthMM() const
Return the line width used for importing the outlines (in mm).
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).
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.
double m_millimeterToIu
Offset (in mm) for imported coordinates.
const VECTOR2D & GetImportOffsetMM() const
double m_originalWidth
Total image Height;.
virtual void AddCircle(const VECTOR2D &aCenter, double aRadius, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)=0
Create an object representing a circle.
double GetImageHeightMM() const
Get original image Height.
std::list< std::unique_ptr< EDA_ITEM > > m_items
< List of imported items
VECTOR2D ImportScalingFactor() const
virtual void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke)=0
Create an object representing an arc.
A clone of IMPORTED_STROKE, but with floating-point width.
void SetWidth(double aWidth)
LINE_STYLE GetPlotStyle() const
void SetColor(const KIGFX::COLOR4D &aColor)
void SetPlotStyle(LINE_STYLE aPlotStyle)
KIGFX::COLOR4D GetColor() const
IMPORTED_STROKE(double aWidth=0, LINE_STYLE aPlotStyle=LINE_STYLE::DEFAULT, const KIGFX::COLOR4D &aColor=KIGFX::COLOR4D::UNSPECIFIED)
A color representation with 4 components: red, green, blue, alpha.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
LINE_STYLE
Dashed line types.
VECTOR2< double > VECTOR2D