27#ifndef GRAPHICS_IMPORTER_BUFFER_H
28#define GRAPHICS_IMPORTER_BUFFER_H
43 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const = 0;
70 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const override
72 return std::make_unique<IMPORTED_LINE>( *
this );
100 bool aFilled,
const COLOR4D& aFillColor ) :
111 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const override
113 return std::make_unique<IMPORTED_CIRCLE>( *
this );
121 newRadius = aTransform * newRadius;
159 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const override
161 return std::make_unique<IMPORTED_ARC>( *
this );
182 start.
x * ang.
Sin() - start.
y * ang.
Cos()};
202 bool aFilled,
const COLOR4D& aFillColor ) :
213 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const override
215 return std::make_unique<IMPORTED_POLYGON>( *
this );
222 vert = aTransform * vert + aTranslation;
271 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const override
273 return std::make_unique<IMPORTED_TEXT>( *
this );
324 virtual std::unique_ptr<IMPORTED_SHAPE>
clone()
const override
326 return std::make_unique<IMPORTED_SPLINE>( *
this );
361 bool aFilled,
const COLOR4D& aFillColor = COLOR4D::UNSPECIFIED )
override;
367 bool aFilled,
const COLOR4D& aFillColor = COLOR4D::UNSPECIFIED )
override;
369 void AddText(
const VECTOR2D& aOrigin,
const wxString& aText,
double aHeight,
double aWidth,
372 const COLOR4D& aColor = COLOR4D::UNSPECIFIED )
override;
379 void AddShape( std::unique_ptr<IMPORTED_SHAPE>& aShape );
389 std::list<std::unique_ptr<IMPORTED_SHAPE>>
m_shapes;
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
std::list< std::unique_ptr< IMPORTED_SHAPE > > & GetShapes()
void AddCircle(const VECTOR2D &aCenter, double aRadius, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor=COLOR4D::UNSPECIFIED) override
Create an object representing a circle.
void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing an arc.
void AddLine(const VECTOR2D &aStart, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing a line segment.
void PostprocessNestedPolygons()
void ImportTo(GRAPHICS_IMPORTER &aImporter)
void AddArc(const VECTOR2D &aCenter, const VECTOR2D &aStart, const EDA_ANGLE &aAngle, const IMPORTED_STROKE &aStroke) 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, const COLOR4D &aColor=COLOR4D::UNSPECIFIED) override
Create an object representing a text.
std::list< std::unique_ptr< IMPORTED_SHAPE > > m_shapes
< List of imported shapes
void AddShape(std::unique_ptr< IMPORTED_SHAPE > &aShape)
void AddPolygon(const std::vector< VECTOR2D > &aVertices, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor=COLOR4D::UNSPECIFIED) override
Create an object representing a polygon.
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.
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 AddLine(const VECTOR2D &aOrigin, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke)=0
Create an object representing a line segment.
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.
virtual void AddCircle(const VECTOR2D &aCenter, double aRadius, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)=0
Create an object representing a circle.
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.
BOX2D GetBoundingBox() const override
IMPORTED_ARC(const VECTOR2D &aCenter, const VECTOR2D &aStart, const EDA_ANGLE &aAngle, const IMPORTED_STROKE &aStroke)
void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation) override
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const override
void ImportTo(GRAPHICS_IMPORTER &aImporter) const override
void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation) override
BOX2D GetBoundingBox() const override
IMPORTED_CIRCLE(const VECTOR2D &aCenter, double aRadius, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)
void ImportTo(GRAPHICS_IMPORTER &aImporter) const override
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const override
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const override
IMPORTED_LINE(const VECTOR2D &aStart, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke)
void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation) override
void ImportTo(GRAPHICS_IMPORTER &aImporter) const override
BOX2D GetBoundingBox() const override
void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation) override
std::vector< VECTOR2D > & Vertices()
const IMPORTED_STROKE & GetStroke() const
IMPORTED_POLYGON(const std::vector< VECTOR2D > &aVertices, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)
void ImportTo(GRAPHICS_IMPORTER &aImporter) const override
BOX2D GetBoundingBox() const override
const COLOR4D & GetFillColor() const
std::vector< VECTOR2D > m_vertices
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const override
int GetParentShapeIndex() const
virtual ~IMPORTED_SHAPE()
virtual void ImportTo(GRAPHICS_IMPORTER &aImporter) const =0
void SetParentShapeIndex(int aIndex)
virtual void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation)=0
virtual BOX2D GetBoundingBox() const =0
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const =0
void ImportTo(GRAPHICS_IMPORTER &aImporter) const override
BOX2D GetBoundingBox() const override
void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation) override
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const override
IMPORTED_SPLINE(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke)
VECTOR2D m_bezierControl2
VECTOR2D m_bezierControl1
A clone of IMPORTED_STROKE, but with floating-point width.
void Transform(const MATRIX3x3D &aTransform, const VECTOR2D &aTranslation) override
GR_TEXT_H_ALIGN_T m_hJustify
IMPORTED_TEXT(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)
GR_TEXT_V_ALIGN_T m_vJustify
BOX2D GetBoundingBox() const override
virtual std::unique_ptr< IMPORTED_SHAPE > clone() const override
void ImportTo(GRAPHICS_IMPORTER &aImporter) const override
A color representation with 4 components: red, green, blue, alpha.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
VECTOR2< double > VECTOR2D