Adding SHAPE_ARC direct plotting

This commit is contained in:
Seth Hillbrand 2021-06-03 15:03:00 -07:00
parent 3d4ce0796e
commit cccdaddd50
4 changed files with 20 additions and 0 deletions

View File

@ -816,6 +816,7 @@ void GERBER_PLOTTER::Circle( const wxPoint& aCenter, int aDiameter, FILL_TYPE aF
} }
void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle, void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
int aRadius, FILL_TYPE aFill, int aWidth ) int aRadius, FILL_TYPE aFill, int aWidth )
{ {
@ -825,6 +826,14 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAn
plotArc( aCenter, aStAngle, aEndAngle, aRadius, false ); plotArc( aCenter, aStAngle, aEndAngle, aRadius, false );
} }
void GERBER_PLOTTER::Arc( const SHAPE_ARC& aArc )
{
SetCurrentLineWidth( aArc.GetWidth() );
// aFill is not used here.
plotArc( aArc, false );
}
void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion ) void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
{ {

View File

@ -154,6 +154,13 @@ double PLOTTER::GetDashGapLenIU() const
} }
void PLOTTER::Arc( const SHAPE_ARC& aArc )
{
Arc( wxPoint( aArc.GetCenter() ), aArc.GetStartAngle(), aArc.GetEndAngle(), aArc.GetRadius(),
FILL_TYPE::NO_FILL, aArc.GetWidth() );
}
void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius, void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
FILL_TYPE fill, int width ) FILL_TYPE fill, int width )
{ {

View File

@ -77,6 +77,8 @@ public:
virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle, virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
int aRadius, FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override; int aRadius, FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override;
virtual void Arc( const SHAPE_ARC& aArc ) override;
// These functions plot an item and manage X2 gerber attributes // These functions plot an item and manage X2 gerber attributes
virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
OUTLINE_MODE tracemode, void* aData ) override; OUTLINE_MODE tracemode, void* aData ) override;

View File

@ -42,6 +42,7 @@
#include <render_settings.h> #include <render_settings.h>
class COLOR_SETTINGS; class COLOR_SETTINGS;
class SHAPE_ARC;
class SHAPE_POLY_SET; class SHAPE_POLY_SET;
class SHAPE_LINE_CHAIN; class SHAPE_LINE_CHAIN;
class GBR_NETLIST_METADATA; class GBR_NETLIST_METADATA;
@ -233,6 +234,7 @@ public:
*/ */
virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ); int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH );
virtual void Arc( const SHAPE_ARC& aArc );
/** /**
* Generic fallback: Cubic Bezier curve rendered as a polyline * Generic fallback: Cubic Bezier curve rendered as a polyline