27#ifndef GRAPHICS_IMPORTER_H 
   28#define GRAPHICS_IMPORTER_H 
   94    void SetPlugin( std::unique_ptr<GRAPHICS_IMPORT_PLUGIN> aPlugin )
 
 
  106    bool Load( 
const wxString& aFileName );
 
  259                            bool aFilled, 
const COLOR4D& aFillColor ) = 0;
 
  282                             bool aFilled, 
const COLOR4D& aFillColor ) = 0;
 
  298                          double aWidth, 
double aThickness, 
double aOrientation,
 
  317    void addItem( std::unique_ptr<EDA_ITEM> aItem );
 
 
A base class for most all the KiCad significant classes used in schematics and boards.
 
double m_originalHeight
Total image Height.
 
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
Default line thickness (in mm).
 
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
Plugin used to load a file.
 
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.
 
VECTOR2D m_offsetCoordmm
Offset (in mm) for imported coordinates.
 
double m_millimeterToIu
Factor to convert millimeters to Internal Units.
 
bool setupSplineOrLine(EDA_SHAPE &aShape, int aAccuracy)
Configure a shape as a spline or a line segment if it's degenerate.
 
const VECTOR2D & GetImportOffsetMM() const
 
double m_originalWidth
Total image width.
 
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.
 
double m_lineWidth
Default line thickness for the imported graphics.
 
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.
 
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
 
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
 
VECTOR2< double > VECTOR2D