Fix dxf import making all circles filled
Filled objects in dxf is actually not handled at all, they are implemented as "hatched" objects
This commit is contained in:
parent
1db882ed1b
commit
d59053b775
|
@ -347,7 +347,7 @@ void DXF_IMPORT_PLUGIN::addCircle( const DL_CircleData& aData )
|
|||
|
||||
VECTOR2D center( mapX( aData.cx ), mapY( aData.cy ) );
|
||||
double lineWidth = mapWidth( attributes.getWidth() );
|
||||
m_internalImporter.AddCircle( center, mapDim( aData.radius ), lineWidth );
|
||||
m_internalImporter.AddCircle( center, mapDim( aData.radius ), lineWidth, false );
|
||||
|
||||
VECTOR2D radiusDelta( mapDim( aData.radius ), mapDim( aData.radius ) );
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ public:
|
|||
* @param aRadius is the circle radius expressed in mm.
|
||||
* @param aWidth is the segment thickness in mm. Use -1 for default line thickness
|
||||
*/
|
||||
virtual void AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth ) = 0;
|
||||
virtual void AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth, bool aFilled ) = 0;
|
||||
|
||||
/**
|
||||
* Create an object representing an arc.
|
||||
|
|
|
@ -39,9 +39,9 @@ void GRAPHICS_IMPORTER_BUFFER::AddLine( const VECTOR2D& aStart, const VECTOR2D&
|
|||
}
|
||||
|
||||
|
||||
void GRAPHICS_IMPORTER_BUFFER::AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth )
|
||||
void GRAPHICS_IMPORTER_BUFFER::AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth, bool aFilled )
|
||||
{
|
||||
m_shapes.push_back( make_shape< IMPORTED_CIRCLE >( aCenter, aRadius, aWidth ) );
|
||||
m_shapes.push_back( make_shape<IMPORTED_CIRCLE>( aCenter, aRadius, aWidth, aFilled ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,22 +63,24 @@ private:
|
|||
class IMPORTED_CIRCLE : public IMPORTED_SHAPE
|
||||
{
|
||||
public:
|
||||
IMPORTED_CIRCLE( const VECTOR2D& aCenter, double aRadius, double aWidth ) :
|
||||
IMPORTED_CIRCLE( const VECTOR2D& aCenter, double aRadius, double aWidth, bool aFilled ) :
|
||||
m_center( aCenter ),
|
||||
m_radius( aRadius ),
|
||||
m_width( aWidth )
|
||||
m_width( aWidth ),
|
||||
m_filled( aFilled )
|
||||
{
|
||||
}
|
||||
|
||||
void ImportTo( GRAPHICS_IMPORTER& aImporter ) const override
|
||||
{
|
||||
aImporter.AddCircle( m_center, m_radius, m_width );
|
||||
aImporter.AddCircle( m_center, m_radius, m_width, m_filled );
|
||||
}
|
||||
|
||||
private:
|
||||
const VECTOR2D m_center;
|
||||
double m_radius;
|
||||
double m_width;
|
||||
bool m_filled;
|
||||
};
|
||||
|
||||
|
||||
|
@ -193,7 +195,7 @@ class GRAPHICS_IMPORTER_BUFFER : public GRAPHICS_IMPORTER
|
|||
public:
|
||||
void AddLine( const VECTOR2D& aStart, const VECTOR2D& aEnd, double aWidth ) override;
|
||||
|
||||
void AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth ) override;
|
||||
void AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth, bool aFilled ) override;
|
||||
|
||||
void AddArc( const VECTOR2D& aCenter, const VECTOR2D& aStart, double aAngle, double aWidth ) override;
|
||||
|
||||
|
|
|
@ -75,11 +75,11 @@ void GRAPHICS_IMPORTER_PCBNEW::AddLine( const VECTOR2D& aOrigin, const VECTOR2D&
|
|||
}
|
||||
|
||||
|
||||
void GRAPHICS_IMPORTER_PCBNEW::AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth )
|
||||
void GRAPHICS_IMPORTER_PCBNEW::AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth, bool aFilled )
|
||||
{
|
||||
std::unique_ptr<PCB_SHAPE> circle( createDrawing() );
|
||||
circle->SetShape( S_CIRCLE );
|
||||
circle->SetFilled( GetLayer() != Edge_Cuts );
|
||||
circle->SetFilled( aFilled );
|
||||
circle->SetLayer( GetLayer() );
|
||||
circle->SetWidth( MapLineWidth( aWidth ) );
|
||||
circle->SetCenter( MapCoordinate( aCenter ) );
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
void AddLine( const VECTOR2D& aOrigin, const VECTOR2D& aEnd, double aWidth ) override;
|
||||
|
||||
void AddCircle( const VECTOR2D& aOrigin, double aRadius, double aWidth ) override;
|
||||
void AddCircle( const VECTOR2D& aOrigin, double aRadius, double aWidth, bool aFilled ) override;
|
||||
|
||||
void AddArc( const VECTOR2D& aCenter, const VECTOR2D& aStart, double aAngle,
|
||||
double aWidth ) override;
|
||||
|
|
Loading…
Reference in New Issue