40 using namespace KIGFX;
50 VECTOR2D point = aPoint + m_transform.m_moveOffset - m_transform.m_rotCenter;
51 point = point.
Rotate( m_transform.m_rotAngle ) + m_transform.m_rotCenter;
62 GRPoly( m_isClipped ? &m_clipBox :
nullptr, m_DC, aLocalPointList.size(),
63 &aLocalPointList[0], 0, GetLineWidth(), m_Color, m_Color );
67 for(
unsigned ii = 1; ii < aLocalPointList.size(); ++ii )
69 GRCSegm( m_isClipped ? &m_clipBox :
nullptr, m_DC, aLocalPointList[ ii - 1],
70 aLocalPointList[ii], GetLineWidth(), m_Color );
76 m_plotter->MoveTo( aLocalPointList[0] );
78 for(
unsigned ii = 1; ii < aLocalPointList.size(); ii++ )
80 m_plotter->LineTo( aLocalPointList[ii] );
83 m_plotter->PenFinish();
87 for(
unsigned ii = 1; ii < aLocalPointList.size(); ii++ )
89 m_callback( aLocalPointList[ ii - 1].x, aLocalPointList[ ii - 1].y,
90 aLocalPointList[ii].x, aLocalPointList[ii].y, m_callbackData );
98 if( aPointList.size() < 2 )
101 std::vector<wxPoint> polyline_corners;
103 for(
const VECTOR2D& pt : aPointList )
104 polyline_corners.emplace_back( (wxPoint) transform( pt ) );
106 doDrawPolyline( polyline_corners );
115 std::vector<wxPoint> polyline_corners;
117 for(
int ii = 0; ii < aListSize; ++ii )
118 polyline_corners.emplace_back( (wxPoint) transform( aPointList[ ii ] ) );
120 doDrawPolyline( polyline_corners );
126 VECTOR2D startVector = transform( aStartPoint );
127 VECTOR2D endVector = transform( aEndPoint );
131 if( m_isFillEnabled )
133 GRLine( m_isClipped ? &m_clipBox :
nullptr, m_DC, startVector.
x, startVector.
y,
134 endVector.
x, endVector.
y, GetLineWidth(), m_Color );
138 GRCSegm( m_isClipped ? &m_clipBox :
nullptr, m_DC, startVector.
x, startVector.
y,
139 endVector.
x, endVector.
y, GetLineWidth(), 0, m_Color );
144 m_plotter->MoveTo( wxPoint( startVector.
x, startVector.
y ) );
145 m_plotter->LineTo( wxPoint( endVector.
x, endVector.
y ) );
146 m_plotter->PenFinish();
148 else if( m_callback )
150 m_callback( startVector.
x, startVector.
y, endVector.
x, endVector.
y, m_callbackData );
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
The Cairo implementation of the graphics abstraction layer.
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Start and end points are defined as 2D-Vectors.
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
void doDrawPolyline(const std::vector< wxPoint > &aLocalPointList)
KIGFX::GAL_DISPLAY_OPTIONS basic_displayOptions
VECTOR2< T > Rotate(double aAngle) const
Rotate the vector by a given angle.
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
BASIC_GAL basic_gal(basic_displayOptions)
const VECTOR2D transform(const VECTOR2D &aPoint) const
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList) override
Draw a polyline.
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, const COLOR4D &Color)