52 if( aLineWidth <= 0.0 )
71 if( line->GetStart() == line->GetEnd() )
76 static_cast<FP_SHAPE*
>( line.get() )->SetLocalCoord();
87 circle->SetFilled( aFilled );
94 static_cast<FP_SHAPE*
>( circle.get() )->SetLocalCoord();
122 static_cast<FP_SHAPE*
>( arc.get() )->SetLocalCoord();
130 std::vector<VECTOR2I> convertedPoints;
131 convertedPoints.reserve( aVertices.size() );
133 for(
const VECTOR2D& precisePoint : aVertices )
134 convertedPoints.emplace_back(
MapCoordinate( precisePoint ) );
140 polygon->SetPolyPoints( convertedPoints );
143 static_cast<FP_SHAPE*
>( polygon.get() )->SetLocalCoord();
146 addItem( std::move( polygon ) );
151 double aHeight,
double aWidth,
double aThickness,
155 std::unique_ptr<BOARD_ITEM> boardItem;
169 static_cast<FP_TEXT*
>( boardItem.get() )->SetLocalCoord();
171 addItem( std::move( boardItem ) );
187 spline->RebuildBezierToSegmentsPointsList( aWidth );
191 if( spline->GetBezierPoints().size() <= 2 )
197 #define MIN_SEG_LEN_ACCEPTABLE_NM 20
204 static_cast<FP_SHAPE*
>( spline.get() )->SetLocalCoord();
206 addItem( std::move( spline ) );
212 return std::make_unique<PCB_SHAPE>(
m_board );
219 return make_pair( std::unique_ptr<BOARD_ITEM>(
text ),
static_cast<EDA_TEXT*
>(
text ) );
232 return make_pair( std::unique_ptr<BOARD_ITEM>(
text ),
static_cast<EDA_TEXT*
>(
text ) );
constexpr EDA_IU_SCALE pcbIUScale
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void SetTextPos(const VECTOR2I &aPoint)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
void SetTextWidth(int aWidth)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetTextHeight(int aHeight)
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
std::pair< std::unique_ptr< BOARD_ITEM >, EDA_TEXT * > createText() override
Target layer for the imported shapes.
std::unique_ptr< PCB_SHAPE > createDrawing() override
< Create an object representing a graphical shape.
void AddArc(const VECTOR2D &aCenter, const VECTOR2D &aStart, const EDA_ANGLE &aAngle, double aWidth) override
Create an object representing an arc.
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) override
Create an object representing a text.
void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, double aWidth) override
Create an object representing an arc.
void AddLine(const VECTOR2D &aOrigin, const VECTOR2D &aEnd, double aWidth) override
Create an object representing a line segment.
void AddPolygon(const std::vector< VECTOR2D > &aVertices, double aWidth) override
void AddCircle(const VECTOR2D &aOrigin, double aRadius, double aWidth, bool aFilled) override
Create an object representing a circle.
virtual std::unique_ptr< PCB_SHAPE > createDrawing()=0
< Create an object representing a graphical shape.
virtual std::pair< std::unique_ptr< BOARD_ITEM >, EDA_TEXT * > createText()=0
Target layer for the imported shapes.
int MapLineWidth(double aLineWidth)
If aLineWidth < 0, the default line thickness value is returned.
PCB_LAYER_ID GetLayer() const
Return the target layer for the imported shapes.
GRAPHICS_IMPORTER_PCBNEW()
VECTOR2I MapCoordinate(const VECTOR2D &aCoordinate)
Convert an imported coordinate to a board coordinate, according to the internal units,...
double ImportScalingFactor() const
double GetLineWidthMM() const
Return the line width used for importing the outlines (in mm).
void addItem(std::unique_ptr< EDA_ITEM > aItem)
< Add an item to the imported shapes list.
double m_millimeterToIu
Offset (in mm) for imported coordinates.
const VECTOR2D & GetImportOffsetMM() const
void SetStroke(const STROKE_PARAMS &aStroke) override
Simple container to manage line stroke parameters.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
#define MIN_SEG_LEN_ACCEPTABLE_NM
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< double > VECTOR2D