From 0c879eead308ba90aa1c9d14d235da65442bb841 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Fri, 4 Jun 2021 01:28:40 +0100 Subject: [PATCH] Cleanup headers in pcbnew pcad importer --- pcbnew/plugins/pcad/CMakeLists.txt | 7 ++-- pcbnew/plugins/pcad/pcad2kicad_common.cpp | 7 ++-- pcbnew/plugins/pcad/pcad2kicad_common.h | 7 ++-- pcbnew/plugins/pcad/pcad_item_types.h | 49 +++++++++++++++++++++++ pcbnew/plugins/pcad/pcad_plugin.cpp | 13 +++--- pcbnew/plugins/pcad/pcad_plugin.h | 7 ++-- pcbnew/plugins/pcad/pcb.cpp | 23 ++++++----- pcbnew/plugins/pcad/pcb.h | 40 +++++++++--------- pcbnew/plugins/pcad/pcb_arc.cpp | 16 ++++---- pcbnew/plugins/pcad/pcb_arc.h | 21 +++++----- pcbnew/plugins/pcad/pcb_callbacks.h | 3 +- pcbnew/plugins/pcad/pcb_component.cpp | 11 +++-- pcbnew/plugins/pcad/pcb_component.h | 47 ++++++++++------------ pcbnew/plugins/pcad/pcb_copper_pour.cpp | 10 ++--- pcbnew/plugins/pcad/pcb_copper_pour.h | 11 ++--- pcbnew/plugins/pcad/pcb_cutout.cpp | 7 +++- pcbnew/plugins/pcad/pcb_cutout.h | 17 ++++---- pcbnew/plugins/pcad/pcb_footprint.cpp | 28 +++++++------ pcbnew/plugins/pcad/pcb_footprint.h | 25 +++++++----- pcbnew/plugins/pcad/pcb_keepout.cpp | 10 ++--- pcbnew/plugins/pcad/pcb_keepout.h | 11 ++--- pcbnew/plugins/pcad/pcb_line.cpp | 13 +++--- pcbnew/plugins/pcad/pcb_line.h | 19 +++++---- pcbnew/plugins/pcad/pcb_net.cpp | 8 ++-- pcbnew/plugins/pcad/pcb_net.h | 29 ++++++-------- pcbnew/plugins/pcad/pcb_pad.cpp | 14 ++++--- pcbnew/plugins/pcad/pcb_pad.h | 18 +++++---- pcbnew/plugins/pcad/pcb_pad_shape.cpp | 9 ++--- pcbnew/plugins/pcad/pcb_pad_shape.h | 21 ++++------ pcbnew/plugins/pcad/pcb_plane.cpp | 10 ++--- pcbnew/plugins/pcad/pcb_plane.h | 11 ++--- pcbnew/plugins/pcad/pcb_polygon.cpp | 15 +++---- pcbnew/plugins/pcad/pcb_polygon.h | 28 ++++++------- pcbnew/plugins/pcad/pcb_text.cpp | 7 +++- pcbnew/plugins/pcad/pcb_text.h | 12 +++--- pcbnew/plugins/pcad/pcb_via.cpp | 10 ++--- pcbnew/plugins/pcad/pcb_via.h | 10 ++--- pcbnew/plugins/pcad/pcb_via_shape.cpp | 8 ++-- pcbnew/plugins/pcad/pcb_via_shape.h | 10 ++--- pcbnew/plugins/pcad/s_expr_loader.cpp | 9 ++--- pcbnew/plugins/pcad/s_expr_loader.h | 4 +- 41 files changed, 331 insertions(+), 304 deletions(-) create mode 100644 pcbnew/plugins/pcad/pcad_item_types.h diff --git a/pcbnew/plugins/pcad/CMakeLists.txt b/pcbnew/plugins/pcad/CMakeLists.txt index eb3412dc77..ef6398617c 100644 --- a/pcbnew/plugins/pcad/CMakeLists.txt +++ b/pcbnew/plugins/pcad/CMakeLists.txt @@ -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}/../" ) diff --git a/pcbnew/plugins/pcad/pcad2kicad_common.cpp b/pcbnew/plugins/pcad/pcad2kicad_common.cpp index 10f21448c1..bc9fe9c23c 100644 --- a/pcbnew/plugins/pcad/pcad2kicad_common.cpp +++ b/pcbnew/plugins/pcad/pcad2kicad_common.cpp @@ -27,15 +27,16 @@ * @file pcad2kicad_common.cpp */ -#include -#include +#include #include #include #include // for KiROUND #include +#include -#include +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcad2kicad_common.h b/pcbnew/plugins/pcad/pcad2kicad_common.h index 1dbfb6ecbf..7c982ab8b7 100644 --- a/pcbnew/plugins/pcad/pcad2kicad_common.h +++ b/pcbnew/plugins/pcad/pcad2kicad_common.h @@ -30,12 +30,11 @@ #ifndef PCAD2KICAD_COMMON_H_ #define PCAD2KICAD_COMMON_H_ -#include -#include -#include - #include +class wxString; +class XNODE; + namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcad_item_types.h b/pcbnew/plugins/pcad/pcad_item_types.h new file mode 100644 index 0000000000..78d06edaae --- /dev/null +++ b/pcbnew/plugins/pcad/pcad_item_types.h @@ -0,0 +1,49 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007, 2008 Lubo Racko + * Copyright (C) 2007, 2008, 2012 Alexander Lunev + * 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 + +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 diff --git a/pcbnew/plugins/pcad/pcad_plugin.cpp b/pcbnew/plugins/pcad/pcad_plugin.cpp index 5b042455f4..9356d00a43 100644 --- a/pcbnew/plugins/pcad/pcad_plugin.cpp +++ b/pcbnew/plugins/pcad/pcad_plugin.cpp @@ -27,17 +27,18 @@ * @brief Pcbnew PLUGIN for P-Cad 200x ASCII *.pcb format. */ -#include +#include +#include +#include +#include +#include + +#include #include #include #include -#include -#include -#include -#include - using namespace PCAD2KICAD; PCAD_PLUGIN::PCAD_PLUGIN() diff --git a/pcbnew/plugins/pcad/pcad_plugin.h b/pcbnew/plugins/pcad/pcad_plugin.h index 935bc02705..8bd1a614d6 100644 --- a/pcbnew/plugins/pcad/pcad_plugin.h +++ b/pcbnew/plugins/pcad/pcad_plugin.h @@ -30,12 +30,14 @@ #ifndef PCAD_PLUGIN_H_ #define PCAD_PLUGIN_H_ - #include 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; diff --git a/pcbnew/plugins/pcad/pcb.cpp b/pcbnew/plugins/pcad/pcb.cpp index 5ab1bef949..7f6b1b8059 100644 --- a/pcbnew/plugins/pcad/pcb.cpp +++ b/pcbnew/plugins/pcad/pcb.cpp @@ -23,21 +23,22 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb.cpp - */ +#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb.h b/pcbnew/plugins/pcad/pcb.h index 761ab26834..8599f5fda0 100644 --- a/pcbnew/plugins/pcad/pcb.h +++ b/pcbnew/plugins/pcad/pcb.h @@ -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 +#include +#include +#include #include -#include -#include +#include -#include -#include +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 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 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 diff --git a/pcbnew/plugins/pcad/pcb_arc.cpp b/pcbnew/plugins/pcad/pcb_arc.cpp index c321abb0c5..03413a91b9 100644 --- a/pcbnew/plugins/pcad/pcb_arc.cpp +++ b/pcbnew/plugins/pcad/pcb_arc.cpp @@ -23,17 +23,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_arc.cpp - */ +#include -#include - -#include // for KiROUND -#include +#include +#include #include -#include +#include // for KiROUND #include +#include +#include + +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_arc.h b/pcbnew/plugins/pcad/pcb_arc.h index ccf9cfa65c..299e49603f 100644 --- a/pcbnew/plugins/pcad/pcb_arc.h +++ b/pcbnew/plugins/pcad/pcb_arc.h @@ -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 +#include -#include +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(); }; diff --git a/pcbnew/plugins/pcad/pcb_callbacks.h b/pcbnew/plugins/pcad/pcb_callbacks.h index f5ddb9bed9..9532eb7d9b 100644 --- a/pcbnew/plugins/pcad/pcb_callbacks.h +++ b/pcbnew/plugins/pcad/pcb_callbacks.h @@ -30,9 +30,10 @@ #ifndef PCB_CALLBACKS_H_ #define PCB_CALLBACKS_H_ -#include #include +class wxString; + enum LAYER_TYPE_T { LAYER_TYPE_SIGNAL, diff --git a/pcbnew/plugins/pcad/pcb_component.cpp b/pcbnew/plugins/pcad/pcb_component.cpp index 456003f2c1..2e021b793f 100644 --- a/pcbnew/plugins/pcad/pcb_component.cpp +++ b/pcbnew/plugins/pcad/pcb_component.cpp @@ -23,15 +23,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_component.cpp - */ - -#include +#include +#include #include +#include + +#include -#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_component.h b/pcbnew/plugins/pcad/pcb_component.h index fa509b0fae..2f2637535f 100644 --- a/pcbnew/plugins/pcad/pcb_component.h +++ b/pcbnew/plugins/pcad/pcb_component.h @@ -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 -#include +#include +#include +#include -#include -#include -#include -#include -#include +#include +#include +#include + +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_ diff --git a/pcbnew/plugins/pcad/pcb_copper_pour.cpp b/pcbnew/plugins/pcad/pcb_copper_pour.cpp index 1ea1e16ae1..3447346023 100644 --- a/pcbnew/plugins/pcad/pcb_copper_pour.cpp +++ b/pcbnew/plugins/pcad/pcb_copper_pour.cpp @@ -23,15 +23,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_copper_pour.cpp - */ - -#include +#include #include +#include -#include +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_copper_pour.h b/pcbnew/plugins/pcad/pcb_copper_pour.h index feb5e99ee9..d632905602 100644 --- a/pcbnew/plugins/pcad/pcb_copper_pour.h +++ b/pcbnew/plugins/pcad/pcb_copper_pour.h @@ -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 +#include -#include +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(); diff --git a/pcbnew/plugins/pcad/pcb_cutout.cpp b/pcbnew/plugins/pcad/pcb_cutout.cpp index 4b407182a7..af39597d76 100644 --- a/pcbnew/plugins/pcad/pcb_cutout.cpp +++ b/pcbnew/plugins/pcad/pcb_cutout.cpp @@ -27,9 +27,12 @@ * @file pcb_cutout.cpp */ -#include +#include -#include +#include + +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_cutout.h b/pcbnew/plugins/pcad/pcb_cutout.h index 86f7b9ce83..6b899cf64e 100644 --- a/pcbnew/plugins/pcad/pcb_cutout.h +++ b/pcbnew/plugins/pcad/pcb_cutout.h @@ -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 +#include -#include +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 diff --git a/pcbnew/plugins/pcad/pcb_footprint.cpp b/pcbnew/plugins/pcad/pcb_footprint.cpp index 0d95659e81..04f894f42f 100644 --- a/pcbnew/plugins/pcad/pcb_footprint.cpp +++ b/pcbnew/plugins/pcad/pcb_footprint.cpp @@ -23,20 +23,24 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_footprint.h b/pcbnew/plugins/pcad/pcb_footprint.h index bf4d3230b7..6b91e1bd48 100644 --- a/pcbnew/plugins/pcad/pcb_footprint.h +++ b/pcbnew/plugins/pcad/pcb_footprint.h @@ -26,21 +26,21 @@ #ifndef PCB_FOOTPRINT_H #define PCB_FOOTPRINT_H -#include +#include +#include +#include -#include -#include +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 diff --git a/pcbnew/plugins/pcad/pcb_keepout.cpp b/pcbnew/plugins/pcad/pcb_keepout.cpp index 5c808db9cc..0f659e1d3c 100644 --- a/pcbnew/plugins/pcad/pcb_keepout.cpp +++ b/pcbnew/plugins/pcad/pcb_keepout.cpp @@ -22,15 +22,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_keepout.cpp - */ - -#include +#include #include +#include -#include +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_keepout.h b/pcbnew/plugins/pcad/pcb_keepout.h index dde8904353..04247880c9 100644 --- a/pcbnew/plugins/pcad/pcb_keepout.h +++ b/pcbnew/plugins/pcad/pcb_keepout.h @@ -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 +#include -#include +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(); diff --git a/pcbnew/plugins/pcad/pcb_line.cpp b/pcbnew/plugins/pcad/pcb_line.cpp index bd00c65c28..05edd4f441 100644 --- a/pcbnew/plugins/pcad/pcb_line.cpp +++ b/pcbnew/plugins/pcad/pcb_line.cpp @@ -23,16 +23,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_line.cpp - */ - -#include +#include +#include #include +#include #include #include -#include +#include +#include + +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_line.h b/pcbnew/plugins/pcad/pcb_line.h index a2e31a1a7b..7895be8b4f 100644 --- a/pcbnew/plugins/pcad/pcb_line.h +++ b/pcbnew/plugins/pcad/pcb_line.h @@ -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 +#include -#include +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 diff --git a/pcbnew/plugins/pcad/pcb_net.cpp b/pcbnew/plugins/pcad/pcb_net.cpp index ea5c90f30b..e331b266ee 100644 --- a/pcbnew/plugins/pcad/pcb_net.cpp +++ b/pcbnew/plugins/pcad/pcb_net.cpp @@ -23,13 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_net.cpp - */ +#include -#include +#include -#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_net.h b/pcbnew/plugins/pcad/pcb_net.h index fa268c625e..52bc485d08 100644 --- a/pcbnew/plugins/pcad/pcb_net.h +++ b/pcbnew/plugins/pcad/pcb_net.h @@ -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 -#include +#include +#include + +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 diff --git a/pcbnew/plugins/pcad/pcb_pad.cpp b/pcbnew/plugins/pcad/pcb_pad.cpp index bfa147fbd8..22d37b54e5 100644 --- a/pcbnew/plugins/pcad/pcb_pad.cpp +++ b/pcbnew/plugins/pcad/pcb_pad.cpp @@ -23,14 +23,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_pad.cpp - */ +#include +#include -#include +#include +#include +#include +#include #include +#include -#include +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_pad.h b/pcbnew/plugins/pcad/pcb_pad.h index 38044cb436..1e9b2a0c0c 100644 --- a/pcbnew/plugins/pcad/pcb_pad.h +++ b/pcbnew/plugins/pcad/pcb_pad.h @@ -26,21 +26,18 @@ #ifndef PCB_PAD_H_ #define PCB_PAD_H_ -#include +#include -#include -#include +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; }; diff --git a/pcbnew/plugins/pcad/pcb_pad_shape.cpp b/pcbnew/plugins/pcad/pcb_pad_shape.cpp index a29145819b..636849ea8c 100644 --- a/pcbnew/plugins/pcad/pcb_pad_shape.cpp +++ b/pcbnew/plugins/pcad/pcb_pad_shape.cpp @@ -23,15 +23,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_pad_shape.cpp - */ - -#include +#include #include +#include -#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_pad_shape.h b/pcbnew/plugins/pcad/pcb_pad_shape.h index ea30c01159..8963641026 100644 --- a/pcbnew/plugins/pcad/pcb_pad_shape.h +++ b/pcbnew/plugins/pcad/pcb_pad_shape.h @@ -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 -#include +#include -#include +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 diff --git a/pcbnew/plugins/pcad/pcb_plane.cpp b/pcbnew/plugins/pcad/pcb_plane.cpp index da1c04aa60..cce622cfc2 100644 --- a/pcbnew/plugins/pcad/pcb_plane.cpp +++ b/pcbnew/plugins/pcad/pcb_plane.cpp @@ -22,15 +22,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_plane.cpp - */ - -#include +#include #include +#include -#include +#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_plane.h b/pcbnew/plugins/pcad/pcb_plane.h index b721378810..2d6a53d0eb 100644 --- a/pcbnew/plugins/pcad/pcb_plane.h +++ b/pcbnew/plugins/pcad/pcb_plane.h @@ -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 +#include -#include +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(); diff --git a/pcbnew/plugins/pcad/pcb_polygon.cpp b/pcbnew/plugins/pcad/pcb_polygon.cpp index 057b18c9e1..84ea417538 100644 --- a/pcbnew/plugins/pcad/pcb_polygon.cpp +++ b/pcbnew/plugins/pcad/pcb_polygon.cpp @@ -23,18 +23,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_polygon.cpp - */ - -#include +#include +#include #include -#include // for KiROUND +#include #include -#include +#include // for KiROUND +#include #include +#include +#include + namespace PCAD2KICAD { PCB_POLYGON::PCB_POLYGON( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer ) : diff --git a/pcbnew/plugins/pcad/pcb_polygon.h b/pcbnew/plugins/pcad/pcb_polygon.h index 817b09f3b7..b2938fa146 100644 --- a/pcbnew/plugins/pcad/pcb_polygon.h +++ b/pcbnew/plugins/pcad/pcb_polygon.h @@ -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 +#include +#include -#include +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; }; diff --git a/pcbnew/plugins/pcad/pcb_text.cpp b/pcbnew/plugins/pcad/pcb_text.cpp index bef9451511..c478b1e09f 100644 --- a/pcbnew/plugins/pcad/pcb_text.cpp +++ b/pcbnew/plugins/pcad/pcb_text.cpp @@ -23,11 +23,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include #include +#include #include -#include +#include + +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_text.h b/pcbnew/plugins/pcad/pcb_text.h index 41d000d120..73da8719ff 100644 --- a/pcbnew/plugins/pcad/pcb_text.h +++ b/pcbnew/plugins/pcad/pcb_text.h @@ -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 +#include -#include +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(); diff --git a/pcbnew/plugins/pcad/pcb_via.cpp b/pcbnew/plugins/pcad/pcb_via.cpp index 366616180e..da95efe585 100644 --- a/pcbnew/plugins/pcad/pcb_via.cpp +++ b/pcbnew/plugins/pcad/pcb_via.cpp @@ -23,14 +23,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_via.cpp - */ +#include +#include -#include +#include -#include -#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_via.h b/pcbnew/plugins/pcad/pcb_via.h index 83139b0c8a..d2e6776897 100644 --- a/pcbnew/plugins/pcad/pcb_via.h +++ b/pcbnew/plugins/pcad/pcb_via.h @@ -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 +#include -#include +class BOARD; +class wxString; +class XNODE; namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_via_shape.cpp b/pcbnew/plugins/pcad/pcb_via_shape.cpp index 9dee4b8dd7..fd89ac108a 100644 --- a/pcbnew/plugins/pcad/pcb_via_shape.cpp +++ b/pcbnew/plugins/pcad/pcb_via_shape.cpp @@ -23,14 +23,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file pcb_via_shape.cpp - */ +#include -#include #include +#include -#include +#include namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/pcb_via_shape.h b/pcbnew/plugins/pcad/pcb_via_shape.h index 373150a2e3..0cfa7eb24c 100644 --- a/pcbnew/plugins/pcad/pcb_via_shape.h +++ b/pcbnew/plugins/pcad/pcb_via_shape.h @@ -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 +#include -#include +class BOARD; +class wxString; +class XNODE; namespace PCAD2KICAD { diff --git a/pcbnew/plugins/pcad/s_expr_loader.cpp b/pcbnew/plugins/pcad/s_expr_loader.cpp index 74625ba338..c6ca560f33 100644 --- a/pcbnew/plugins/pcad/s_expr_loader.cpp +++ b/pcbnew/plugins/pcad/s_expr_loader.cpp @@ -22,16 +22,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file s_expr_loader.cpp - */ - -#include +#include #include #include #include +#include +#include + namespace PCAD2KICAD { static KEYWORD empty_keywords[1] = {}; diff --git a/pcbnew/plugins/pcad/s_expr_loader.h b/pcbnew/plugins/pcad/s_expr_loader.h index 6076802f05..04348ab1ab 100644 --- a/pcbnew/plugins/pcad/s_expr_loader.h +++ b/pcbnew/plugins/pcad/s_expr_loader.h @@ -29,8 +29,8 @@ #ifndef S_EXPR_LOADER_H_ #define S_EXPR_LOADER_H_ -#include -#include +class wxString; +class wxXmlDocument; namespace PCAD2KICAD {