Cleanup headers in pcbnew pcad importer

This commit is contained in:
Ian McInerney 2021-06-04 01:28:40 +01:00
parent f94816fbd4
commit 0c879eead3
41 changed files with 331 additions and 304 deletions

View File

@ -2,9 +2,6 @@
# Sources for the pcbnew PLUGIN called PCAD_PLUGIN
# This CMakeLists.txt is included from pcbnew, so we are inheriting its include_directories(),
# simply add the current source dir to inherited include_directories() for sources in here only.
include_directories( . )
set( PCAD2PCBNEW_SRCS
pcad2kicad_common.cpp
@ -31,3 +28,7 @@ set( PCAD2PCBNEW_SRCS
add_library( pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS} )
target_link_libraries( pcad2kicadpcb pcbcommon )
# Make all headers be prefixed by pcad/ to differentiate them
target_include_directories( pcad2kicadpcb PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../" )

View File

@ -27,15 +27,16 @@
* @file pcad2kicad_common.cpp
*/
#include <wx/wx.h>
#include <wx/regex.h>
#include <pcad/pcad2kicad_common.h>
#include <common.h>
#include <convert_to_biu.h>
#include <math/util.h> // for KiROUND
#include <trigo.h>
#include <xnode.h>
#include <pcad2kicad_common.h>
#include <wx/wx.h>
#include <wx/regex.h>
namespace PCAD2KICAD {

View File

@ -30,12 +30,11 @@
#ifndef PCAD2KICAD_COMMON_H_
#define PCAD2KICAD_COMMON_H_
#include <wx/wx.h>
#include <wx/xml/xml.h>
#include <xnode.h>
#include <eda_text.h>
class wxString;
class XNODE;
namespace PCAD2KICAD
{

View File

@ -0,0 +1,49 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007, 2008 Lubo Racko <developer@lura.sk>
* Copyright (C) 2007, 2008, 2012 Alexander Lunev <al.lunev@yahoo.com>
* Copyright (C) 2012-2020 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef PCAD_ITEM_TYPES_H_
#define PCAD_ITEM_TYPES_H_
#include <wx/dynarray.h>
class wxRealPoint;
WX_DEFINE_ARRAY( wxRealPoint*, VERTICES_ARRAY );
WX_DEFINE_ARRAY( VERTICES_ARRAY*, ISLANDS_ARRAY );
namespace PCAD2KICAD {
class PCB_COMPONENT;
class PCB_NET;
class PCB_NET_NODE;
class PCB_PAD_SHAPE;
WX_DEFINE_ARRAY( PCB_COMPONENT*, PCB_COMPONENTS_ARRAY );
WX_DEFINE_ARRAY( PCB_NET*, PCB_NETS_ARRAY );
WX_DEFINE_ARRAY( PCB_NET_NODE*, PCB_NET_NODES_ARRAY );
WX_DEFINE_ARRAY( PCB_PAD_SHAPE*, PCB_PAD_SHAPES_ARRAY );
}
#endif

View File

@ -27,17 +27,18 @@
* @brief Pcbnew PLUGIN for P-Cad 200x ASCII *.pcb format.
*/
#include <cerrno>
#include <pcad/pcad_plugin.h>
#include <pcad/pcb.h>
#include <pcad/s_expr_loader.h>
#include <board.h>
#include <locale_io.h>
#include <cerrno>
#include <wx/string.h>
#include <wx/filename.h>
#include <wx/xml/xml.h>
#include <locale_io.h>
#include <pcad_plugin.h>
#include <s_expr_loader.h>
#include <pcb.h>
using namespace PCAD2KICAD;
PCAD_PLUGIN::PCAD_PLUGIN()

View File

@ -30,12 +30,14 @@
#ifndef PCAD_PLUGIN_H_
#define PCAD_PLUGIN_H_
#include <io_mgr.h>
class PCAD_PLUGIN : public PLUGIN
{
public:
PCAD_PLUGIN();
~PCAD_PLUGIN();
const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName,
@ -51,9 +53,6 @@ public:
return 0;
}
PCAD_PLUGIN();
~PCAD_PLUGIN();
private:
const PROPERTIES* m_props;
BOARD* m_board;

View File

@ -23,21 +23,22 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb.cpp
*/
#include <pcad/pcb.h>
#include <wx/wx.h>
#include <pcad/pcb_keepout.h>
#include <pcad/pcb_footprint.h>
#include <pcad/pcb_net.h>
#include <pcad/pcb_pad.h>
#include <pcad/pcb_text.h>
#include <pcad/pcb_via.h>
#include <pcad/s_expr_loader.h>
#include <board.h>
#include <common.h>
#include <xnode.h>
#include <pcb.h>
#include <pcb_keepout.h>
#include <pcb_footprint.h>
#include <pcb_pad.h>
#include <pcb_text.h>
#include <pcb_via.h>
#include <s_expr_loader.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,32 +23,29 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb.h
*/
#ifndef PCB_H_
#define PCB_H_
#ifndef pcb_H_
#define pcb_H_
#include <pcad/pcad2kicad_common.h>
#include <pcad/pcad_item_types.h>
#include <pcad/pcb_callbacks.h>
#include <pcad/pcb_footprint.h>
#include <map>
#include <wx/wx.h>
#include <xnode.h>
#include <wx/arrstr.h>
#include <pcb_footprint.h>
#include <pcb_net.h>
class BOARD;
class XNODE;
class wxStatusBar;
class wxString;
class wxRealPoint;
class wxXmlDocument;
namespace PCAD2KICAD {
class PCB : public PCB_FOOTPRINT, public PCB_CALLBACKS
{
public:
PCB_COMPONENTS_ARRAY m_PcbComponents; // PCB footprints,Lines,Routes,Texts, .... and so on
PCB_NETS_ARRAY m_PcbNetlist; // net objects collection
wxString m_DefaultMeasurementUnit;
std::map<int, TLAYER> m_LayersMap; // flexible layers mapping
int m_SizeX;
int m_SizeY;
PCB( BOARD* aBoard );
~PCB();
@ -62,9 +59,14 @@ public:
void AddToBoard() override;
private:
wxArrayString m_layersStackup;
PCB_COMPONENTS_ARRAY m_PcbComponents; // PCB footprints,Lines,Routes,Texts, .... and so on
PCB_NETS_ARRAY m_PcbNetlist; // net objects collection
wxString m_DefaultMeasurementUnit;
std::map<int, TLAYER> m_LayersMap; // flexible layers mapping
int m_SizeX;
int m_SizeY;
private:
XNODE* FindCompDefName( XNODE* aNode, const wxString& aName ) const;
void SetTextProperty( XNODE* aNode, TTEXTVALUE* aTextValue, const wxString& aPatGraphRefName,
@ -80,6 +82,8 @@ private:
int FindOutlinePoint( const VERTICES_ARRAY* aOutline, wxRealPoint aPoint ) const;
double GetDistance( const wxRealPoint* aPoint1, const wxRealPoint* aPoint2 ) const;
void GetBoardOutline( wxXmlDocument* aXmlDoc, const wxString& aActualConversion );
wxArrayString m_layersStackup;
};
} // namespace PCAD2KICAD

View File

@ -23,17 +23,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_arc.cpp
*/
#include <pcad/pcb_arc.h>
#include <wx/wx.h>
#include <math/util.h> // for KiROUND
#include <trigo.h>
#include <board.h>
#include <footprint.h>
#include <fp_shape.h>
#include <pcb_arc.h>
#include <math/util.h> // for KiROUND
#include <pcb_shape.h>
#include <trigo.h>
#include <xnode.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,27 +23,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_arc.h
*/
#ifndef PCB_ARC_H_
#define PCB_ARC_H_
#include <wx/wx.h>
#include <pcad/pcb_component.h>
#include <pcb_component.h>
class BOARD;
class FOOTPRINT;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_ARC : public PCB_COMPONENT
{
public:
int m_StartX;
int m_StartY;
double m_Angle;
int m_Width;
PCB_ARC( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_ARC();
@ -57,6 +51,11 @@ public:
void AddToFootprint( FOOTPRINT* aFootprint ) override;
void AddToBoard() override;
int m_StartX;
int m_StartY;
double m_Angle;
int m_Width;
private:
bool IsCircle();
};

View File

@ -30,9 +30,10 @@
#ifndef PCB_CALLBACKS_H_
#define PCB_CALLBACKS_H_
#include <wx/wx.h>
#include <layers_id_colors_and_visibility.h>
class wxString;
enum LAYER_TYPE_T
{
LAYER_TYPE_SIGNAL,

View File

@ -23,15 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_component.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_component.h>
#include <board.h>
#include <common.h>
#include <footprint.h>
#include <wx/string.h>
#include <pcb_component.h>
namespace PCAD2KICAD {

View File

@ -23,21 +23,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_component.h
*/
#ifndef PCB_COMPONENT_H_
#define PCB_COMPONENT_H_
#include <wx/wx.h>
#include <wx/file.h>
#include <pcad/pcad2kicad_common.h>
#include <pcad/pcad_item_types.h>
#include <pcad/pcb_callbacks.h>
#include <pcad2kicad_common.h>
#include <pcb_callbacks.h>
#include <board.h>
#include <footprint.h>
#include <track.h>
#include <kiid.h>
#include <layers_id_colors_and_visibility.h>
#include <wx/object.h>
class BOARD;
class FOOTPRINT;
class wxString;
class wxRealPoint;
namespace PCAD2KICAD {
@ -45,6 +45,17 @@ namespace PCAD2KICAD {
class PCB_COMPONENT : public wxObject
{
public:
PCB_COMPONENT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_COMPONENT();
virtual void SetPosOffset( int aX_offs, int aY_offs );
virtual void Flip();
virtual void AddToFootprint( FOOTPRINT* aFootprint );
virtual void AddToBoard() = 0;
PCB_LAYER_ID GetKiCadLayer() const { return m_callbacks->GetKiCadLayer( m_PCadLayer ); }
int GetNetCode( wxString aNetName ) const { return m_callbacks->GetNetCode( aNetName ); }
int m_tag;
char m_objType;
int m_PCadLayer;
@ -59,25 +70,11 @@ public:
wxString m_compRef; // internal usage for XL parsing
wxString m_patGraphRefName; // internal usage for XL parsing
PCB_COMPONENT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_COMPONENT();
virtual void SetPosOffset( int aX_offs, int aY_offs );
virtual void Flip();
virtual void AddToFootprint( FOOTPRINT* aFootprint );
virtual void AddToBoard() = 0;
PCB_LAYER_ID GetKiCadLayer() const { return m_callbacks->GetKiCadLayer( m_PCadLayer ); }
int GetNetCode( wxString aNetName ) const { return m_callbacks->GetNetCode( aNetName ); }
protected:
PCB_CALLBACKS* m_callbacks;
BOARD* m_board;
};
WX_DEFINE_ARRAY( PCB_COMPONENT*, PCB_COMPONENTS_ARRAY );
WX_DEFINE_ARRAY( wxRealPoint*, VERTICES_ARRAY );
} // namespace PCAD2KICAD
#endif // PCB_COMPONENT_H_

View File

@ -23,15 +23,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_copper_pour.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_copper_pour.h>
#include <common.h>
#include <xnode.h>
#include <pcb_copper_pour.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,23 +23,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_copper_pour.h
*/
#ifndef PCB_COPPER_POUR_H_
#define PCB_COPPER_POUR_H_
#include <wx/wx.h>
#include <pcad/pcb_polygon.h>
#include <pcb_polygon.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_COPPER_POUR : public PCB_POLYGON
{
public:
PCB_COPPER_POUR( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer );
~PCB_COPPER_POUR();

View File

@ -27,9 +27,12 @@
* @file pcb_cutout.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_cutout.h>
#include <pcb_cutout.h>
#include <xnode.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,29 +23,26 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_cutout.h
*/
#ifndef PCB_CUTOUT_H_
#define PCB_CUTOUT_H_
#include <wx/wx.h>
#include <pcad/pcb_polygon.h>
#include <pcb_polygon.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_CUTOUT : public PCB_POLYGON
{
public:
PCB_CUTOUT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer );
~PCB_CUTOUT();
virtual bool Parse( XNODE* aNode,
const wxString& aDefaultMeasurementUnit,
const wxString& actualConversion ) override;
virtual bool Parse( XNODE* aNode,
const wxString& aDefaultMeasurementUnit,
const wxString& actualConversion ) override;
};
} // namespace PCAD2KICAD

View File

@ -23,20 +23,24 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/wx.h>
#include <pcb_arc.h>
#include <pcb_copper_pour.h>
#include <pcb_cutout.h>
#include <pcb_plane.h>
#include <pcb_line.h>
#include <pcb_footprint.h>
#include <pcb_pad.h>
#include <pcb_polygon.h>
#include <plugins/pcad/pcb_text.h>
#include <pcb_via.h>
#include <pcad/pcb_arc.h>
#include <pcad/pcb_copper_pour.h>
#include <pcad/pcb_cutout.h>
#include <pcad/pcb_plane.h>
#include <pcad/pcb_line.h>
#include <pcad/pcb_footprint.h>
#include <pcad/pcb_pad.h>
#include <pcad/pcb_polygon.h>
#include <pcad/pcb_text.h>
#include <pcad/pcb_via.h>
#include <board.h>
#include <footprint.h>
#include <trigo.h>
#include <xnode.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -26,21 +26,21 @@
#ifndef PCB_FOOTPRINT_H
#define PCB_FOOTPRINT_H
#include <wx/wx.h>
#include <pcad/pcad2kicad_common.h>
#include <pcad/pcad_item_types.h>
#include <pcad/pcb_component.h>
#include <pcad2kicad_common.h>
#include <pcb_component.h>
class BOARD;
class FOOTPRINT;
class wxStatusBar;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_FOOTPRINT : public PCB_COMPONENT
{
public:
TTEXTVALUE m_Value; // has reference (Name from parent) and value
PCB_COMPONENTS_ARRAY m_FootprintItems; // set of objects like PCB_LINE, PCB_PAD, PCB_VIA....
int m_Mirror;
VERTICES_ARRAY m_BoardOutline;
PCB_FOOTPRINT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_FOOTPRINT();
@ -60,9 +60,14 @@ public:
virtual void Flip() override;
void AddToBoard() override;
TTEXTVALUE m_Value; // has reference (Name from parent) and value
PCB_COMPONENTS_ARRAY m_FootprintItems; // set of objects like PCB_LINE, PCB_PAD, PCB_VIA....
int m_Mirror;
VERTICES_ARRAY m_BoardOutline;
private:
XNODE* FindPatternMultilayerSection( XNODE* aNode, wxString* aPatGraphRefName );
wxString ModuleLayer( int aMirror );
XNODE* FindPatternMultilayerSection( XNODE* aNode, wxString* aPatGraphRefName );
wxString ModuleLayer( int aMirror );
};
} // namespace PCAD2KICAD

View File

@ -22,15 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_keepout.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_keepout.h>
#include <common.h>
#include <xnode.h>
#include <pcb_keepout.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -22,23 +22,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_keepout.h
*/
#ifndef PCB_KEEPOUT_H_
#define PCB_KEEPOUT_H_
#include <wx/wx.h>
#include <pcad/pcb_polygon.h>
#include <pcb_polygon.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_KEEPOUT : public PCB_POLYGON
{
public:
PCB_KEEPOUT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer );
~PCB_KEEPOUT();

View File

@ -23,16 +23,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_line.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_line.h>
#include <board.h>
#include <common.h>
#include <footprint.h>
#include <fp_shape.h>
#include <pcb_shape.h>
#include <pcb_line.h>
#include <track.h>
#include <xnode.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,16 +23,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_line.h
*/
#ifndef PCB_LINE_H_
#define PCB_LINE_H_
#include <wx/wx.h>
#include <pcad/pcb_component.h>
#include <pcb_component.h>
class BOARD;
class FOOTPRINT;
class wxString;
class XNODE;
namespace PCAD2KICAD {
@ -40,10 +39,6 @@ namespace PCAD2KICAD {
class PCB_LINE : public PCB_COMPONENT
{
public:
int m_Width;
int m_ToX;
int m_ToY;
PCB_LINE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_LINE();
@ -56,6 +51,10 @@ public:
void AddToFootprint( FOOTPRINT* aFootprint ) override;
void AddToBoard() override;
int m_Width;
int m_ToX;
int m_ToY;
};
} // namespace PCAD2KICAD

View File

@ -23,13 +23,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_net.cpp
*/
#include <pcad/pcb_net.h>
#include <wx/wx.h>
#include <xnode.h>
#include <pcb_net.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,45 +23,40 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_net.h
*/
#ifndef PCB_NET_H_
#define PCB_NET_H_
#include <wx/wx.h>
#include <pcad2kicad_common.h>
#include <pcad/pcad2kicad_common.h>
#include <pcad/pcad_item_types.h>
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_NET_NODE : public wxObject
{
public:
wxString m_CompRef;
wxString m_PinRef;
PCB_NET_NODE();
~PCB_NET_NODE();
};
WX_DEFINE_ARRAY( PCB_NET_NODE*, PCB_NET_NODES_ARRAY );
wxString m_CompRef;
wxString m_PinRef;
};
class PCB_NET : public wxObject
{
public:
wxString m_Name;
int m_NetCode;
PCB_NET_NODES_ARRAY m_NetNodes;
PCB_NET( int aNetCode );
~PCB_NET();
void Parse( XNODE* aNode );
};
WX_DEFINE_ARRAY( PCB_NET*, PCB_NETS_ARRAY );
wxString m_Name;
int m_NetCode;
PCB_NET_NODES_ARRAY m_NetNodes;
};
} // namespace PCAD2KICAD

View File

@ -23,14 +23,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_pad.cpp
*/
#include <pcad/pcb_pad.h>
#include <pcad/pcb_pad_shape.h>
#include <wx/wx.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <track.h>
#include <trigo.h>
#include <xnode.h>
#include <pcb_pad.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -26,21 +26,18 @@
#ifndef PCB_PAD_H_
#define PCB_PAD_H_
#include <wx/wx.h>
#include <pcad/pcb_component.h>
#include <pcb_component.h>
#include <pcb_pad_shape.h>
class BOARD;
class FOOTPRINT;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_PAD : public PCB_COMPONENT
{
public:
int m_Number;
int m_Hole;
bool m_IsHolePlated;
PCB_PAD_SHAPES_ARRAY m_Shapes;
PCB_PAD( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_PAD();
@ -58,6 +55,11 @@ public:
void AddToBoard() override;
int m_Number;
int m_Hole;
bool m_IsHolePlated;
PCB_PAD_SHAPES_ARRAY m_Shapes;
private:
wxString m_defaultPinDes;
};

View File

@ -23,15 +23,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_pad_shape.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_pad_shape.h>
#include <common.h>
#include <xnode.h>
#include <pcb_pad_shape.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,27 +23,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_pad_shape.h
*/
#ifndef PCB_PAD_SHAPE_H_
#define PCB_PAD_SHAPE_H_
#include <wx/wx.h>
#include <wx/dynarray.h>
#include <pcad/pcb_component.h>
#include <pcb_component.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_PAD_SHAPE : public PCB_COMPONENT
{
public:
wxString m_Shape;
int m_Width;
int m_Height;
PCB_PAD_SHAPE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_PAD_SHAPE();
@ -51,9 +44,11 @@ public:
const wxString& aActualConversion );
void AddToBoard() override;
};
WX_DEFINE_ARRAY( PCB_PAD_SHAPE*, PCB_PAD_SHAPES_ARRAY );
wxString m_Shape;
int m_Width;
int m_Height;
};
} // namespace PCAD2KICAD

View File

@ -22,15 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_plane.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_plane.h>
#include <common.h>
#include <xnode.h>
#include <pcb_plane.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -22,23 +22,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_plane.h
*/
#ifndef PCB_PLANE_H_
#define PCB_PLANE_H_
#include <wx/wx.h>
#include <pcad/pcb_polygon.h>
#include <pcb_polygon.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {
class PCB_PLANE : public PCB_POLYGON
{
public:
PCB_PLANE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer );
~PCB_PLANE();

View File

@ -23,18 +23,19 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_polygon.cpp
*/
#include <wx/wx.h>
#include <pcad/pcb_polygon.h>
#include <board.h>
#include <common.h>
#include <math/util.h> // for KiROUND
#include <footprint.h>
#include <fp_shape.h>
#include <pcb_polygon.h>
#include <math/util.h> // for KiROUND
#include <xnode.h>
#include <zone.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
namespace PCAD2KICAD {
PCB_POLYGON::PCB_POLYGON( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer ) :

View File

@ -23,31 +23,22 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_polygon.h
*/
#ifndef PCB_POLYGON_H_
#define PCB_POLYGON_H_
#include <wx/wx.h>
#include <pcad/pcad_item_types.h>
#include <pcad/pcb_component.h>
#include <pcb_component.h>
class BOARD;
class FOOTPRINT;
class wxString;
class XNODE;
namespace PCAD2KICAD {
//WX_DEFINE_ARRAY( wxRealPoint*, VERTICES_ARRAY );
WX_DEFINE_ARRAY( VERTICES_ARRAY*, ISLANDS_ARRAY );
class PCB_POLYGON : public PCB_COMPONENT
{
public:
int m_width;
int m_priority;
VERTICES_ARRAY m_outline; // collection of boundary/outline lines - objects
ISLANDS_ARRAY m_islands;
ISLANDS_ARRAY m_cutouts;
PCB_POLYGON( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer );
~PCB_POLYGON();
@ -69,6 +60,13 @@ public:
void FormPolygon( XNODE* aNode, VERTICES_ARRAY* aPolygon,
const wxString& aDefaultMeasurementUnit, const wxString& actualConversion );
int m_width;
int m_priority;
VERTICES_ARRAY m_outline; // collection of boundary/outline lines - objects
ISLANDS_ARRAY m_islands;
ISLANDS_ARRAY m_cutouts;
protected:
bool m_filled;
};

View File

@ -23,11 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/wx.h>
#include <pcad/pcb_text.h>
#include <common.h>
#include <board.h>
#include <pcb_text.h>
#include <plugins/pcad/pcb_text.h>
#include <xnode.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,16 +23,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_text.h
*/
#ifndef PCB_TEXT_H_
#define PCB_TEXT_H_
#include <wx/wx.h>
#include <pcad/pcb_component.h>
#include <pcb_component.h>
class BOARD;
class FOOTPRINT;
class wxString;
class XNODE;
namespace PCAD2KICAD {
@ -40,7 +39,6 @@ namespace PCAD2KICAD {
class PCB_TEXT : public PCB_COMPONENT
{
public:
PCB_TEXT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard );
~PCB_TEXT();

View File

@ -23,14 +23,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_via.cpp
*/
#include <pcad/pcb_via.h>
#include <pcad/pcb_via_shape.h>
#include <wx/wx.h>
#include <xnode.h>
#include <pcb_via.h>
#include <pcb_via_shape.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,16 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_via.h
*/
#ifndef PCB_VIA_H_
#define PCB_VIA_H_
#include <wx/wx.h>
#include <pcad/pcb_pad.h>
#include <pcb_pad.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {

View File

@ -23,14 +23,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_via_shape.cpp
*/
#include <pcad/pcb_via_shape.h>
#include <wx/wx.h>
#include <common.h>
#include <xnode.h>
#include <pcb_via_shape.h>
#include <wx/string.h>
namespace PCAD2KICAD {

View File

@ -23,16 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pcb_via_shape.h
*/
#ifndef PCB_VIA_SHAPE_H_
#define PCB_VIA_SHAPE_H_
#include <wx/wx.h>
#include <pcad/pcb_pad_shape.h>
#include <pcb_pad_shape.h>
class BOARD;
class wxString;
class XNODE;
namespace PCAD2KICAD {

View File

@ -22,16 +22,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file s_expr_loader.cpp
*/
#include <s_expr_loader.h>
#include <pcad/s_expr_loader.h>
#include <dsnlexer.h>
#include <macros.h>
#include <xnode.h>
#include <wx/string.h>
#include <wx/xml/xml.h>
namespace PCAD2KICAD {
static KEYWORD empty_keywords[1] = {};

View File

@ -29,8 +29,8 @@
#ifndef S_EXPR_LOADER_H_
#define S_EXPR_LOADER_H_
#include <wx/wx.h>
#include <wx/xml/xml.h>
class wxString;
class wxXmlDocument;
namespace PCAD2KICAD
{