Commit ec17455d authored by jean-pierre charras's avatar jean-pierre charras
Browse files

board_items_to_polygon_shape_transform.cpp: remove full duplicate code between...

board_items_to_polygon_shape_transform.cpp: remove full duplicate code between DRAWSEGMENT and  EDGE_MODULE, and fix incorrect conversion of DRAWSEGMENT polygon type to its polygonal shape.
Gerbview: better info from X2 filefunction attribute displayed in layer manager about copper layers
parent 4274f2d5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ const wxString DrillFileExtension( wxT( "drl" ) );
const wxString SVGFileExtension( wxT( "svg" ) );
const wxString ReportFileExtension( wxT( "rpt" ) );
const wxString FootprintPlaceFileExtension( wxT( "pos" ) );
const wxString KiCadLib3DShapesPathExtension( wxT( "3dshapes" ) );  ///< 3D shapes default libpath

const wxString KiCadFootprintLibPathExtension( wxT( "pretty" ) );   ///< KICAD PLUGIN libpath
const wxString LegacyFootprintLibPathExtension( wxT( "mod" ) );
+15 −3
Original line number Diff line number Diff line
@@ -463,9 +463,21 @@ const wxString GERBER_IMAGE_LIST::GetDisplayName( int aIdx )
    if( gerber && IsUsed(aIdx ) )
    {
        if( gerber->m_FileFunction )
        {
            if( gerber->m_FileFunction->IsCopper() )
            {
                name.Printf( _( "Layer %d (%s, %s, %s)" ), aIdx + 1,
                             GetChars( gerber->m_FileFunction->GetFileType() ),
                             GetChars( gerber->m_FileFunction->GetBrdLayerId() ),
                             GetChars( gerber->m_FileFunction->GetBrdLayerSide() ) );
            }
            else
            {
                name.Printf( _( "Layer %d (%s, %s)" ), aIdx + 1,
                             GetChars( gerber->m_FileFunction->GetFileType() ),
                             GetChars( gerber->m_FileFunction->GetBrdLayerId() ) );
            }
        }
        else
            name.Printf( _( "Layer %d *" ), aIdx + 1 );
    }
+21 −4
Original line number Diff line number Diff line
@@ -189,18 +189,35 @@ const wxString& X2_ATTRIBUTE_FILEFUNCTION::GetFileType()

const wxString& X2_ATTRIBUTE_FILEFUNCTION::GetBrdLayerId()
{
    // the brd layer identifier: Top, Bot, Ln
    // the brd layer identifier: Ln (for Copper type) or Top, Bot
    return m_Prms.Item( 2 );
}

const wxString& X2_ATTRIBUTE_FILEFUNCTION::GetBrdLayerSide()
{
    if( IsCopper() )
        // the brd layer identifier: Top, Bot, Inr
        return m_Prms.Item( 3 );
    else
        // the brd layer identifier: Top, Bot ( same as GetBrdLayerId() )
        return m_Prms.Item( 2 );
}

const wxString& X2_ATTRIBUTE_FILEFUNCTION::GetLabel()
{
    // the filefunction label, if any
    if( IsCopper() )
       return m_Prms.Item( 4 );
    else
        return m_Prms.Item( 3 );
}


bool X2_ATTRIBUTE_FILEFUNCTION::IsCopper()
{
    // the filefunction label, if any
    return GetFileType().IsSameAs( wxT( "Copper" ), false );
}

// Initialize the z order priority of the current file, from its attributes
// this priority is the order of layers from top to bottom to draw/display gerber images
// Stack up is(  from external copper layer to external)
@@ -211,7 +228,7 @@ void X2_ATTRIBUTE_FILEFUNCTION::set_Z_Order()
    m_z_order = -100;     // low level
    m_z_sub_order = 0;

    if( GetFileType().IsSameAs( wxT( "Copper" ), false ) )
    if( IsCopper() )
    {
        // Copper layer: the priority is the layer Id
        m_z_order = 0;
+13 −6
Original line number Diff line number Diff line
@@ -153,12 +153,19 @@ class X2_ATTRIBUTE_FILEFUNCTION : public X2_ATTRIBUTE
public:
    X2_ATTRIBUTE_FILEFUNCTION( X2_ATTRIBUTE& aAttributeBase );

    bool IsCopper();                    ///< return true if the filefunction type is "Copper"

    const wxString& GetFileType();      ///< the type of layer (Copper, Soldermask ... )
    const wxString& GetBrdLayerId();  ///< the brd layer identifier: Top, Bot, Ln
    const wxString& GetBrdLayerId();    ///< the brd layer identifier: Ln, only for Copper type
                                        ///< or Top, Bot for other types
    const wxString& GetBrdLayerSide();  ///< the brd layer Pos: Top, Bot, Inr
                                        ///< same as GetBrdLayerId() for non copper type
    const wxString& GetLabel();         ///< the filefunction label, if any

    int GetZOrder() { return m_z_order; }   ///< the Order of the bdr layer, from front (Top side) to back side
    int GetZSubOrder() { return m_z_sub_order; }   ///< the Order of the bdr copper layer, from front (Top side) to back side
    int GetZOrder() { return m_z_order; }           ///< the Order of the board layer,
                                                    ///< from front (Top) side to back (Bot) side
    int GetZSubOrder() { return m_z_sub_order; }    ///< the Order of the bdr copper layer,
                                                    ///< from front (Top) side to back (Bot) side

private:

+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ extern const wxString GedaPcbFootprintLibFileExtension;
extern const wxString EagleFootprintLibPathExtension;
extern const wxString ComponentFileExtensionWildcard;
extern const wxString PageLayoutDescrFileWildcard;
extern const wxString KiCadLib3DShapesPathExtension;

/// Proper wxFileDialog wild card definitions.
extern const wxString SchematicSymbolFileWildcard;
Loading