Replace individual LIB_* shapes with LIB_SHAPE (based on EDA_SHAPE).
Also moves to more capable FILL_T model that can be shared.
This commit is contained in:
@@ -190,7 +190,7 @@ void PDF_PLOTTER::SetDash( PLOT_DASH_TYPE dashed )
|
||||
}
|
||||
|
||||
|
||||
void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width )
|
||||
void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width )
|
||||
{
|
||||
wxASSERT( workFile );
|
||||
DPOINT p1_dev = userToDeviceCoordinates( p1 );
|
||||
@@ -198,11 +198,11 @@ void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, in
|
||||
|
||||
SetCurrentLineWidth( width );
|
||||
fprintf( workFile, "%g %g %g %g re %c\n", p1_dev.x, p1_dev.y,
|
||||
p2_dev.x - p1_dev.x, p2_dev.y - p1_dev.y, fill == FILL_TYPE::NO_FILL ? 'S' : 'B' );
|
||||
p2_dev.x - p1_dev.x, p2_dev.y - p1_dev.y, fill == FILL_T::NO_FILL ? 'S' : 'B' );
|
||||
}
|
||||
|
||||
|
||||
void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_TYPE aFill, int width )
|
||||
void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int width )
|
||||
{
|
||||
wxASSERT( workFile );
|
||||
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||
@@ -217,9 +217,9 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_TYPE aFill, int
|
||||
SetCurrentLineWidth( width );
|
||||
|
||||
// If diameter is less than width, switch to filled mode
|
||||
if( aFill == FILL_TYPE::NO_FILL && diametre < width )
|
||||
if( aFill == FILL_T::NO_FILL && diametre < width )
|
||||
{
|
||||
aFill = FILL_TYPE::FILLED_SHAPE;
|
||||
aFill = FILL_T::FILLED_SHAPE;
|
||||
SetCurrentLineWidth( 0 );
|
||||
|
||||
radius = userToDeviceSize( ( diametre / 2.0 ) + ( width / 2.0 ) );
|
||||
@@ -251,18 +251,18 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_TYPE aFill, int
|
||||
pos_dev.x - radius, pos_dev.y - magic,
|
||||
pos_dev.x - radius, pos_dev.y,
|
||||
|
||||
aFill == FILL_TYPE::NO_FILL ? 's' : 'b' );
|
||||
aFill == FILL_T::NO_FILL ? 's' : 'b' );
|
||||
}
|
||||
|
||||
|
||||
void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
|
||||
FILL_TYPE fill, int width )
|
||||
FILL_T fill, int width )
|
||||
{
|
||||
wxASSERT( workFile );
|
||||
|
||||
if( radius <= 0 )
|
||||
{
|
||||
Circle( centre, width, FILL_TYPE::FILLED_SHAPE, 0 );
|
||||
Circle( centre, width, FILL_T::FILLED_SHAPE, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
|
||||
|
||||
// The arc is drawn... if not filled we stroke it, otherwise we finish
|
||||
// closing the pie at the center
|
||||
if( fill == FILL_TYPE::NO_FILL )
|
||||
if( fill == FILL_T::NO_FILL )
|
||||
{
|
||||
fputs( "S\n", workFile );
|
||||
}
|
||||
@@ -309,8 +309,8 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
|
||||
}
|
||||
|
||||
|
||||
void PDF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||
FILL_TYPE aFill, int aWidth, void* aData )
|
||||
void PDF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth,
|
||||
void* aData )
|
||||
{
|
||||
wxASSERT( workFile );
|
||||
|
||||
@@ -329,7 +329,7 @@ void PDF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||
}
|
||||
|
||||
// Close path and stroke(/fill)
|
||||
fprintf( workFile, "%c\n", aFill == FILL_TYPE::NO_FILL ? 'S' : 'b' );
|
||||
fprintf( workFile, "%c\n", aFill == FILL_T::NO_FILL ? 'S' : 'b' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user