MODULE -> FOOTPRINT.
This commit is contained in:
parent
3451ac3088
commit
bdbb68f813
|
@ -41,7 +41,7 @@
|
|||
#include <widgets/infobar.h>
|
||||
|
||||
|
||||
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint,
|
||||
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
|
||||
std::vector<FP_3DMODEL>* aParentModelList ) :
|
||||
PANEL_PREV_3D_BASE( aParent, wxID_ANY ),
|
||||
m_previewPane( nullptr ),
|
||||
|
@ -86,7 +86,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE*
|
|||
|
||||
m_parentModelList = aParentModelList;
|
||||
|
||||
m_dummyFootprint = new MODULE( *aFootprint );
|
||||
m_dummyFootprint = new FOOTPRINT( *aFootprint );
|
||||
m_dummyBoard->Add( m_dummyFootprint );
|
||||
|
||||
// Create the infobar
|
||||
|
|
|
@ -69,12 +69,12 @@ class S3D_CACHE;
|
|||
class FILENAME_RESOLVER;
|
||||
class BOARD;
|
||||
class BOARD_ADAPTER;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
|
||||
class PANEL_PREV_3D: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREV_3D_BASE
|
||||
{
|
||||
public:
|
||||
PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint,
|
||||
PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
|
||||
std::vector<FP_3DMODEL>* aParentModelList );
|
||||
|
||||
~PANEL_PREV_3D();
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
CTRACK_BALL m_trackBallCamera;
|
||||
|
||||
BOARD* m_dummyBoard;
|
||||
MODULE* m_dummyFootprint;
|
||||
FOOTPRINT* m_dummyFootprint;
|
||||
|
||||
std::vector<FP_3DMODEL>* m_parentModelList;
|
||||
int m_selected; /// Index into m_parentInfoList
|
||||
|
|
|
@ -543,13 +543,13 @@ class BOARD_ADAPTER
|
|||
|
||||
COBJECT2D *createNewPadDrill( const PAD* aPad, int aInflateValue );
|
||||
|
||||
void AddPadsWithClearanceToContainer( const MODULE *aFootprint,
|
||||
void AddPadsWithClearanceToContainer( const FOOTPRINT *aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId, int aInflateValue,
|
||||
bool aSkipNPTHPadsWihNoCopper, bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads );
|
||||
|
||||
void AddFPShapesWithClearanceToContainer( const MODULE *aFootprint,
|
||||
void AddFPShapesWithClearanceToContainer( const FOOTPRINT *aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId, int aInflateValue );
|
||||
|
||||
|
@ -580,7 +580,7 @@ class BOARD_ADAPTER
|
|||
void buildPadShapeThickOutlineAsPolygon( const PAD *aPad, SHAPE_POLY_SET &aCornerBuffer,
|
||||
int aWidth) const;
|
||||
|
||||
void transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer,
|
||||
void transformFPShapesToPolygon( const FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer,
|
||||
SHAPE_POLY_SET& aCornerBuffer ) const;
|
||||
|
||||
public:
|
||||
|
|
|
@ -185,7 +185,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DIMENSION_BASE* aDim
|
|||
// Based on
|
||||
// void FOOTPRINT::TransformFPShapesWithClearanceToPolygonSet
|
||||
// board_items_to_polygon_shape_transform.cpp#L204
|
||||
void BOARD_ADAPTER::AddFPShapesWithClearanceToContainer( const MODULE* aFootprint,
|
||||
void BOARD_ADAPTER::AddFPShapesWithClearanceToContainer( const FOOTPRINT* aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue )
|
||||
|
@ -473,7 +473,7 @@ COBJECT2D *BOARD_ADAPTER::createNewPadDrill( const PAD* aPad, int aInflateValue
|
|||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const MODULE* aFootprint,
|
||||
void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const FOOTPRINT* aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue,
|
||||
|
|
|
@ -463,7 +463,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
|
||||
// Add holes of footprints
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -497,7 +497,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
|
||||
// Add contours of the pad holes (pads can be Circle or Segment holes)
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -549,7 +549,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id];
|
||||
|
||||
// ADD PADS
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad
|
||||
// has same shape as its hole
|
||||
|
@ -564,7 +564,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
if( renderPlatedPadsAsPlated )
|
||||
{
|
||||
// ADD PLATED PADS
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
AddPadsWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu,
|
||||
0, true, false, true );
|
||||
|
@ -588,7 +588,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id];
|
||||
|
||||
// Add pads to polygon list
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad
|
||||
// has same shape as its hole
|
||||
|
@ -604,7 +604,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
if( renderPlatedPadsAsPlated )
|
||||
{
|
||||
// ADD PLATED PADS contourns
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
footprint->TransformPadsWithClearanceToPolygon( *m_F_Cu_PlatedPads_poly, F_Cu,
|
||||
0, ARC_HIGH_DEF, ERROR_INSIDE,
|
||||
|
@ -977,7 +977,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
|
||||
// Add footprints tech layers - objects
|
||||
// /////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
|
||||
{
|
||||
|
@ -1002,7 +1002,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
|
||||
|
||||
// Add footprints tech layers - contours
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
|
||||
{
|
||||
|
|
|
@ -60,7 +60,7 @@ void BOARD_ADAPTER::buildPadShapeThickOutlineAsPolygon( const PAD* aPad,
|
|||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer,
|
||||
void BOARD_ADAPTER::transformFPShapesToPolygon( const FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer,
|
||||
SHAPE_POLY_SET& aCornerBuffer ) const
|
||||
{
|
||||
for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
|
||||
|
|
|
@ -763,7 +763,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event )
|
|||
|
||||
case PCB_FOOTPRINT_T:
|
||||
{
|
||||
MODULE* footprint = dynamic_cast<MODULE *>( intersectedBoardItem );
|
||||
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT *>( intersectedBoardItem );
|
||||
|
||||
if( footprint )
|
||||
activityReporter.Report( footprint->GetReference() );
|
||||
|
|
|
@ -862,7 +862,7 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads()
|
|||
tht_inner_holes_poly.RemoveAllContours();
|
||||
|
||||
// Insert pads holes (vertical cylinders)
|
||||
for( const MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( const FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -965,7 +965,7 @@ void C3D_RENDER_OGL_LEGACY::load_3D_models( REPORTER* aStatusReporter )
|
|||
}
|
||||
|
||||
// Go for all footprints
|
||||
for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
for( const FP_3DMODEL& model : footprint->Models() )
|
||||
{
|
||||
|
|
|
@ -1265,7 +1265,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot,
|
|||
C_OGL_3DMODEL::BeginDrawMulti( !aRenderSelectedOnly );
|
||||
|
||||
// Go for all footprints
|
||||
for( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
const bool isIntersected = ( fp == m_currentIntersectedBoardItem );
|
||||
|
||||
|
@ -1319,7 +1319,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models( bool aRenderTopOrBot,
|
|||
}
|
||||
|
||||
|
||||
void C3D_RENDER_OGL_LEGACY::render_3D_footprint( const MODULE* aFootprint,
|
||||
void C3D_RENDER_OGL_LEGACY::render_3D_footprint( const FOOTPRINT* aFootprint,
|
||||
bool aRenderTransparentOnly,
|
||||
bool aIsSelected )
|
||||
{
|
||||
|
|
|
@ -201,9 +201,11 @@ private:
|
|||
*/
|
||||
void render_3D_models( bool aRenderTopOrBot, bool aRenderTransparentOnly );
|
||||
|
||||
void render_3D_models_selected( bool aRenderTopOrBot, bool aRenderTransparentOnly, bool aRenderSelectedOnly );
|
||||
void render_3D_models_selected( bool aRenderTopOrBot, bool aRenderTransparentOnly,
|
||||
bool aRenderSelectedOnly );
|
||||
|
||||
void render_3D_footprint( const MODULE* aFootprint, bool aRenderTransparentOnly, bool aIsSelected );
|
||||
void render_3D_footprint( const FOOTPRINT* aFootprint, bool aRenderTransparentOnly,
|
||||
bool aIsSelected );
|
||||
|
||||
void setLight_Front( bool enabled );
|
||||
void setLight_Top( bool enabled );
|
||||
|
|
|
@ -1386,7 +1386,7 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container()
|
|||
}
|
||||
|
||||
// Insert pads holes (vertical cylinders)
|
||||
for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
if( pad->GetAttribute () != PAD_ATTRIB_NPTH )
|
||||
|
@ -1400,7 +1400,7 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container()
|
|||
void C3D_RENDER_RAYTRACING::load_3D_models( CCONTAINER &aDstContainer, bool aSkipMaterialInformation )
|
||||
{
|
||||
// Go for all footprints
|
||||
for( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
if( !fp->Models().empty()
|
||||
&& m_boardAdapter.ShouldFPBeDisplayed((FOOTPRINT_ATTR_T) fp->GetAttributes()) )
|
||||
|
|
|
@ -307,8 +307,8 @@ const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname )
|
|||
}
|
||||
|
||||
|
||||
static void setLibNickname( MODULE* aModule,
|
||||
const wxString& aNickname, const wxString& aFootprintName )
|
||||
static void setLibNickname( FOOTPRINT* aModule, const wxString& aNickname,
|
||||
const wxString& aFootprintName )
|
||||
{
|
||||
// The library cannot know its own name, because it might have been renamed or moved.
|
||||
// Therefore footprints cannot know their own library nickname when residing in
|
||||
|
@ -331,8 +331,8 @@ static void setLibNickname( MODULE* aModule,
|
|||
}
|
||||
|
||||
|
||||
const MODULE* FP_LIB_TABLE::GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName )
|
||||
const FOOTPRINT* FP_LIB_TABLE::GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
|
@ -359,13 +359,13 @@ bool FP_LIB_TABLE::FootprintExists( const wxString& aNickname, const wxString& a
|
|||
}
|
||||
|
||||
|
||||
MODULE* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString& aFootprintName )
|
||||
FOOTPRINT* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString& aFootprintName )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
|
||||
MODULE* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
|
||||
row->GetProperties() );
|
||||
FOOTPRINT* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
|
||||
row->GetProperties() );
|
||||
|
||||
setLibNickname( ret, row->GetNickName(), aFootprintName );
|
||||
|
||||
|
@ -374,7 +374,7 @@ MODULE* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString&
|
|||
|
||||
|
||||
FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname,
|
||||
const MODULE* aFootprint, bool aOverwrite )
|
||||
const FOOTPRINT* aFootprint, bool aOverwrite )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
|
@ -386,8 +386,9 @@ FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname,
|
|||
|
||||
wxString fpname = aFootprint->GetFPID().GetLibItemName();
|
||||
|
||||
std::unique_ptr<MODULE> footprint( row->plugin->FootprintLoad( row->GetFullURI( true ),
|
||||
fpname, row->GetProperties() ) );
|
||||
std::unique_ptr<FOOTPRINT> footprint( row->plugin->FootprintLoad( row->GetFullURI( true ),
|
||||
fpname,
|
||||
row->GetProperties() ) );
|
||||
|
||||
if( footprint.get() )
|
||||
return SAVE_SKIPPED;
|
||||
|
@ -432,7 +433,7 @@ void FP_LIB_TABLE::FootprintLibCreate( const wxString& aNickname )
|
|||
}
|
||||
|
||||
|
||||
MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId )
|
||||
FOOTPRINT* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId )
|
||||
{
|
||||
wxString nickname = aFootprintId.GetLibNickname();
|
||||
wxString fpname = aFootprintId.GetLibItemName();
|
||||
|
@ -452,7 +453,7 @@ MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootprin
|
|||
{
|
||||
// FootprintLoad() returns NULL on not found, does not throw exception
|
||||
// unless there's an IO_ERROR.
|
||||
MODULE* ret = FootprintLoad( nicks[i], fpname );
|
||||
FOOTPRINT* ret = FootprintLoad( nicks[i], fpname );
|
||||
|
||||
if( ret )
|
||||
return ret;
|
||||
|
|
|
@ -54,7 +54,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
|
|||
{
|
||||
case PCB_FOOTPRINT_T:
|
||||
{
|
||||
const MODULE* footprint = static_cast<const MODULE*>( aItem );
|
||||
const FOOTPRINT* footprint = static_cast<const FOOTPRINT*>( aItem );
|
||||
|
||||
ret = hash_board_item( footprint, aFlags );
|
||||
|
||||
|
|
|
@ -42,13 +42,13 @@
|
|||
#include <kicad_string.h>
|
||||
#include <common.h> // needed for wxString hash template
|
||||
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
struct EINSTANCE;
|
||||
struct EPART;
|
||||
struct ETEXT;
|
||||
|
||||
typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
|
||||
typedef std::map<wxString, MODULE*> MODULE_MAP;
|
||||
typedef std::map<wxString, FOOTPRINT*> FOOTPRINT_MAP;
|
||||
typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
|
||||
typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME()
|
|||
if( m_toolManager )
|
||||
m_toolManager->ShutdownAllTools();
|
||||
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
GetCanvas()->StopDrawing();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
// Be sure any event cannot be fired after frame deletion:
|
||||
|
@ -371,11 +371,11 @@ COLOR4D DISPLAY_FOOTPRINTS_FRAME::GetGridColor()
|
|||
}
|
||||
|
||||
|
||||
MODULE* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintName,
|
||||
REPORTER& aReporter )
|
||||
FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintName,
|
||||
REPORTER& aReporter )
|
||||
{
|
||||
MODULE* footprint = NULL;
|
||||
LIB_ID fpid;
|
||||
FOOTPRINT* footprint = NULL;
|
||||
LIB_ID fpid;
|
||||
|
||||
if( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) >= 0 )
|
||||
{
|
||||
|
@ -434,10 +434,10 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintName,
|
|||
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
{
|
||||
CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
|
||||
MODULE* footprint = nullptr;
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
const FOOTPRINT_INFO* fpInfo = nullptr;
|
||||
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
wxString footprintName = parentframe->GetSelectedFootprint();
|
||||
|
@ -500,7 +500,7 @@ void DISPLAY_FOOTPRINTS_FRAME::updateView()
|
|||
|
||||
void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel()
|
||||
{
|
||||
MODULE* footprint = GetBoard()->GetFirstFootprint();
|
||||
FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
|
||||
MSG_PANEL_ITEMS items;
|
||||
|
||||
if( footprint )
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
*/
|
||||
COLOR4D GetGridColor() override;
|
||||
|
||||
MODULE* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
|
||||
FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
|
||||
|
||||
/* SaveCopyInUndoList() virtual
|
||||
* currently: do nothing in CvPcb.
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
};
|
||||
|
||||
///> Map to hold NETLIST footprints data
|
||||
using PCB_MODULES_MAP = std::map<wxString, std::shared_ptr<PCB_FP_DATA>>;
|
||||
using PCB_FOOTPRINTS_MAP = std::map<wxString, std::shared_ptr<PCB_FP_DATA>>;
|
||||
|
||||
using CHANGELIST_ITEM = std::pair<SCH_REFERENCE, std::shared_ptr<PCB_FP_DATA>>;
|
||||
|
||||
|
@ -111,7 +111,7 @@ private:
|
|||
bool m_processNetNames;
|
||||
bool m_dryRun;
|
||||
|
||||
PCB_MODULES_MAP m_pcbFootprints;
|
||||
PCB_FOOTPRINTS_MAP m_pcbFootprints;
|
||||
SCH_REFERENCE_LIST m_refs;
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP m_multiUnitsRefs;
|
||||
std::deque<CHANGELIST_ITEM> m_changelist;
|
||||
|
|
|
@ -86,7 +86,7 @@ enum KICAD_T
|
|||
SCREEN_T, ///< not really an item, used to identify a screen
|
||||
|
||||
// Items in pcb
|
||||
PCB_FOOTPRINT_T, ///< class MODULE, a footprint
|
||||
PCB_FOOTPRINT_T, ///< class FOOTPRINT, a footprint
|
||||
PCB_PAD_T, ///< class PAD, a pad in a footprint
|
||||
PCB_SHAPE_T, ///< class PCB_SHAPE, a segment not on copper layers
|
||||
PCB_TEXT_T, ///< class PCB_TEXT, text on a layer
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <lib_table_base.h>
|
||||
#include <io_mgr.h>
|
||||
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class FP_LIB_TABLE_GRID;
|
||||
|
||||
|
||||
|
@ -182,12 +182,12 @@ public:
|
|||
*
|
||||
* @param aFootprintName is the name of the footprint to load.
|
||||
*
|
||||
* @return MODULE* - if found caller owns it, else NULL if not found.
|
||||
* @return FOOTPRINT* - if found caller owns it, else NULL if not found.
|
||||
*
|
||||
* @throw IO_ERROR if the library cannot be found or read. No exception
|
||||
* is thrown in the case where aFootprintName cannot be found.
|
||||
*/
|
||||
MODULE* FootprintLoad( const wxString& aNickname, const wxString& aFootprintName );
|
||||
FOOTPRINT* FootprintLoad( const wxString& aNickname, const wxString& aFootprintName );
|
||||
|
||||
/**
|
||||
* Function FootprintExists
|
||||
|
@ -203,8 +203,8 @@ public:
|
|||
* cache management. Return value is const to allow it to return a reference to a cached
|
||||
* item.
|
||||
*/
|
||||
const MODULE* GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName );
|
||||
const FOOTPRINT* GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName );
|
||||
/**
|
||||
* Enum SAVE_T
|
||||
* is the set of return values from FootprintSave() below.
|
||||
|
@ -233,7 +233,7 @@ public:
|
|||
*
|
||||
* @throw IO_ERROR if there is a problem saving.
|
||||
*/
|
||||
SAVE_T FootprintSave( const wxString& aNickname, const MODULE* aFootprint,
|
||||
SAVE_T FootprintSave( const wxString& aNickname, const FOOTPRINT* aFootprint,
|
||||
bool aOverwrite = true );
|
||||
|
||||
/**
|
||||
|
@ -271,13 +271,13 @@ public:
|
|||
*
|
||||
* @param aFootprintId the [nickname] & footprint name of the footprint to load.
|
||||
*
|
||||
* @return MODULE* - if found caller owns it, else NULL if not found.
|
||||
* @return FOOTPRINT* - if found caller owns it, else NULL if not found.
|
||||
*
|
||||
* @throw IO_ERROR if the library cannot be found or read. No exception
|
||||
* is thrown in the case where aFootprintName cannot be found.
|
||||
* @throw PARSE_ERROR if @a aFootprintId is not parsed OK.
|
||||
*/
|
||||
MODULE* FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId );
|
||||
FOOTPRINT* FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId );
|
||||
|
||||
/**
|
||||
* Function LoadGlobalTable
|
||||
|
|
|
@ -50,7 +50,7 @@ class APP_SETTINGS_BASE;
|
|||
class BOARD;
|
||||
class BOARD_CONNECTED_ITEM;
|
||||
class COLOR_SETTINGS;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class TRACK;
|
||||
class PAD;
|
||||
class EDA_3D_VIEWER;
|
||||
|
@ -86,12 +86,12 @@ protected:
|
|||
* attempts to load \a aFootprintId from the footprint library table.
|
||||
*
|
||||
* @param aFootprintId is the #LIB_ID of component footprint to load.
|
||||
* @return the #MODULE if found or NULL if \a aFootprintId not found in any of the
|
||||
* @return the #FOOTPRINT if found or NULL if \a aFootprintId not found in any of the
|
||||
* libraries in the table returned from #Prj().PcbFootprintLibs().
|
||||
* @throw IO_ERROR if an I/O error occurs or a #PARSE_ERROR if a file parsing error
|
||||
* occurs while reading footprint library files.
|
||||
*/
|
||||
MODULE* loadFootprint( const LIB_ID& aFootprintId );
|
||||
FOOTPRINT* loadFootprint( const LIB_ID& aFootprintId );
|
||||
|
||||
public:
|
||||
PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||
|
@ -124,10 +124,10 @@ public:
|
|||
* attempts to load \a aFootprintId from the footprint library table.
|
||||
*
|
||||
* @param aFootprintId is the #LIB_ID of component footprint to load.
|
||||
* @return the #MODULE if found or NULL if \a aFootprintId not found in any of the
|
||||
* @return the #FOOTPRINT if found or NULL if \a aFootprintId not found in any of the
|
||||
* libraries in table returned from #Prj().PcbFootprintLibs().
|
||||
*/
|
||||
MODULE* LoadFootprint( const LIB_ID& aFootprintId );
|
||||
FOOTPRINT* LoadFootprint( const LIB_ID& aFootprintId );
|
||||
|
||||
/**
|
||||
* Function GetBoardBoundingBox
|
||||
|
@ -275,7 +275,7 @@ public:
|
|||
* reference is entered by the user from a dialog (by awxTextCtlr, or a list of
|
||||
* available references)
|
||||
*/
|
||||
MODULE* GetFootprintFromBoardByReference();
|
||||
FOOTPRINT* GetFootprintFromBoardByReference();
|
||||
|
||||
/**
|
||||
* Function OnModify
|
||||
|
@ -298,7 +298,7 @@ public:
|
|||
* when the fooprint is placed on a board and a netlist is read
|
||||
* @param aFootprintName = name of the new footprint in library
|
||||
*/
|
||||
MODULE* CreateNewFootprint( const wxString& aFootprintName );
|
||||
FOOTPRINT* CreateNewFootprint( const wxString& aFootprintName );
|
||||
|
||||
/**
|
||||
* Function PlaceFootprint
|
||||
|
@ -307,7 +307,7 @@ public:
|
|||
*
|
||||
* @param aRecreateRatsnest A bool true redraws the footprint ratsnest.
|
||||
*/
|
||||
void PlaceFootprint( MODULE* aFootprint, bool aRecreateRatsnest = true );
|
||||
void PlaceFootprint( FOOTPRINT* aFootprint, bool aRecreateRatsnest = true );
|
||||
|
||||
void ShowPadPropertiesDialog( PAD* aPad );
|
||||
|
||||
|
@ -317,14 +317,14 @@ public:
|
|||
*
|
||||
* @param aPreslect = if valid, the LIB_ID to select (otherwise the global history is used)
|
||||
*/
|
||||
MODULE* SelectFootprintFromLibTree( LIB_ID aPreselect = LIB_ID() );
|
||||
FOOTPRINT* SelectFootprintFromLibTree( LIB_ID aPreselect = LIB_ID() );
|
||||
|
||||
/**
|
||||
* Adds the given footprint to the board.
|
||||
* @param aFootprint
|
||||
* @param aDC (can be NULL ) = the current Device Context, to draw the new footprint
|
||||
*/
|
||||
virtual void AddFootprintToBoard( MODULE* aFootprint );
|
||||
virtual void AddFootprintToBoard( FOOTPRINT* aFootprint );
|
||||
|
||||
/**
|
||||
* Function SelectFootprintFromLibBrowser
|
||||
|
|
|
@ -52,7 +52,7 @@ void ARRAY_CREATOR::Invoke()
|
|||
if( m_selection.Size() == 0 )
|
||||
return;
|
||||
|
||||
MODULE* const fp = m_isFootprintEditor ? m_parent.GetBoard()->GetFirstFootprint() : nullptr;
|
||||
FOOTPRINT* const fp = m_isFootprintEditor ? m_parent.GetBoard()->GetFirstFootprint() : nullptr;
|
||||
|
||||
const bool enableArrayNumbering = m_isFootprintEditor;
|
||||
const wxPoint rotPoint = (wxPoint) m_selection.GetCenter();
|
||||
|
@ -77,7 +77,7 @@ void ARRAY_CREATOR::Invoke()
|
|||
if( item->Type() == PCB_PAD_T && !m_isFootprintEditor )
|
||||
{
|
||||
// If it is not the footprint editor, then duplicate the parent footprint instead
|
||||
item = static_cast<MODULE*>( item )->GetParent();
|
||||
item = static_cast<FOOTPRINT*>( item )->GetParent();
|
||||
}
|
||||
|
||||
// The first item in list is the original item. We do not modify it
|
||||
|
@ -130,8 +130,8 @@ void ARRAY_CREATOR::Invoke()
|
|||
// @TODO: renumber footprints if asked. This needs UI to enable.
|
||||
// something like this, but needs a "block offset" to prevent
|
||||
// multiple selections overlapping.
|
||||
// if( new_item->Type() == PCB_MODULE_T )
|
||||
// static_cast<MODULE&>( *new_item ).IncrementReference( ptN );
|
||||
// if( new_item->Type() == PCB_FOOTPRINT_T )
|
||||
// static_cast<FOOTPRINT&>( *new_item ).IncrementReference( ptN );
|
||||
|
||||
// @TODO: we should merge zones. This is a bit tricky, because
|
||||
// the undo command needs saving old area, if it is merged.
|
||||
|
@ -147,7 +147,7 @@ void ARRAY_CREATOR::Invoke()
|
|||
|
||||
if( this_item->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
static_cast<MODULE*>( this_item )->RunOnChildren(
|
||||
static_cast<FOOTPRINT*>( this_item )->RunOnChildren(
|
||||
[&]( BOARD_ITEM* aItem )
|
||||
{
|
||||
aItem->ClearSelected();
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <pad.h>
|
||||
|
||||
|
||||
ARRAY_PAD_NAME_PROVIDER::ARRAY_PAD_NAME_PROVIDER( const MODULE* aFootprint,
|
||||
ARRAY_PAD_NAME_PROVIDER::ARRAY_PAD_NAME_PROVIDER( const FOOTPRINT* aFootprint,
|
||||
const ARRAY_OPTIONS& aArrayOpts )
|
||||
: m_arrayOpts( aArrayOpts )
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
* @param aFootprint the footprint to gather existing names from (nullptr for no footprint)
|
||||
* @oaram aArrayOpts the array options that provide the candidate names
|
||||
*/
|
||||
ARRAY_PAD_NAME_PROVIDER( const MODULE* aFootprint, const ARRAY_OPTIONS& aArrayOpts );
|
||||
ARRAY_PAD_NAME_PROVIDER( const FOOTPRINT* aFootprint, const ARRAY_OPTIONS& aArrayOpts );
|
||||
|
||||
/**
|
||||
* Get the next available pad name.
|
||||
|
|
|
@ -82,7 +82,7 @@ AR_AUTOPLACER::AR_AUTOPLACER( BOARD* aBoard )
|
|||
m_board = aBoard;
|
||||
m_connectivity = std::make_unique<CONNECTIVITY_DATA>( );
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
m_connectivity->Add( footprint );
|
||||
|
||||
m_gridSize = Millimeter2iu( STEP_AR_MM );
|
||||
|
@ -92,7 +92,7 @@ AR_AUTOPLACER::AR_AUTOPLACER( BOARD* aBoard )
|
|||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::placeFootprint( MODULE* aFootprint, bool aDoNotRecreateRatsnest,
|
||||
void AR_AUTOPLACER::placeFootprint( FOOTPRINT* aFootprint, bool aDoNotRecreateRatsnest,
|
||||
const wxPoint& aPos )
|
||||
{
|
||||
if( !aFootprint )
|
||||
|
@ -271,7 +271,7 @@ bool AR_AUTOPLACER::fillMatrix()
|
|||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::rotateFootprint( MODULE* aFootprint, double angle, bool incremental )
|
||||
void AR_AUTOPLACER::rotateFootprint( FOOTPRINT* aFootprint, double angle, bool incremental )
|
||||
{
|
||||
if( aFootprint == NULL )
|
||||
return;
|
||||
|
@ -332,7 +332,7 @@ void AR_AUTOPLACER::addPad( PAD* aPad, int aClearance )
|
|||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::buildFpAreas( MODULE* aFootprint, int aFpClearance )
|
||||
void AR_AUTOPLACER::buildFpAreas( FOOTPRINT* aFootprint, int aFpClearance )
|
||||
{
|
||||
m_fpAreaTop.RemoveAllContours();
|
||||
m_fpAreaBottom.RemoveAllContours();
|
||||
|
@ -365,7 +365,7 @@ void AR_AUTOPLACER::buildFpAreas( MODULE* aFootprint, int aFpClearance )
|
|||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::genModuleOnRoutingMatrix( MODULE* Module )
|
||||
void AR_AUTOPLACER::genModuleOnRoutingMatrix( FOOTPRINT* Module )
|
||||
{
|
||||
int ox, oy, fx, fy;
|
||||
LSET layerMask;
|
||||
|
@ -546,7 +546,7 @@ unsigned int AR_AUTOPLACER::calculateKeepOutArea( const EDA_RECT& aRect, int sid
|
|||
* Returns the value TstRectangle().
|
||||
* Module is known by its bounding box
|
||||
*/
|
||||
int AR_AUTOPLACER::testFootprintOnBoard( MODULE* aFootprint, bool TstOtherSide,
|
||||
int AR_AUTOPLACER::testFootprintOnBoard( FOOTPRINT* aFootprint, bool TstOtherSide,
|
||||
const wxPoint& aOffset )
|
||||
{
|
||||
int side = AR_SIDE_TOP;
|
||||
|
@ -584,7 +584,7 @@ int AR_AUTOPLACER::testFootprintOnBoard( MODULE* aFootprint, bool TstOtherSide,
|
|||
}
|
||||
|
||||
|
||||
int AR_AUTOPLACER::getOptimalFPPlacement( MODULE* aFootprint )
|
||||
int AR_AUTOPLACER::getOptimalFPPlacement( FOOTPRINT* aFootprint )
|
||||
{
|
||||
int error = 1;
|
||||
wxPoint lastPosOK;
|
||||
|
@ -678,12 +678,12 @@ int AR_AUTOPLACER::getOptimalFPPlacement( MODULE* aFootprint )
|
|||
}
|
||||
|
||||
|
||||
const PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefFP, PAD* aRefPad, const wxPoint& aOffset)
|
||||
const PAD* AR_AUTOPLACER::nearestPad( FOOTPRINT *aRefFP, PAD* aRefPad, const wxPoint& aOffset)
|
||||
{
|
||||
const PAD* nearest = nullptr;
|
||||
int64_t nearestDist = INT64_MAX;
|
||||
|
||||
for ( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if ( footprint == aRefFP )
|
||||
continue;
|
||||
|
@ -710,7 +710,7 @@ const PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefFP, PAD* aRefPad, const wxPoin
|
|||
}
|
||||
|
||||
|
||||
double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aFootprint, const wxPoint& aOffset )
|
||||
double AR_AUTOPLACER::computePlacementRatsnestCost( FOOTPRINT *aFootprint, const wxPoint& aOffset )
|
||||
{
|
||||
double curr_cost;
|
||||
VECTOR2I start; // start point of a ratsnest
|
||||
|
@ -719,7 +719,7 @@ double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aFootprint, const wx
|
|||
|
||||
curr_cost = 0;
|
||||
|
||||
for ( PAD* pad : aFootprint->Pads() )
|
||||
for( PAD* pad : aFootprint->Pads() )
|
||||
{
|
||||
const PAD* nearest = nearestPad( aFootprint, pad, aOffset );
|
||||
|
||||
|
@ -758,7 +758,7 @@ double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aFootprint, const wx
|
|||
|
||||
|
||||
// Sort routines
|
||||
static bool sortFootprintsByComplexity( MODULE* ref, MODULE* compare )
|
||||
static bool sortFootprintsByComplexity( FOOTPRINT* ref, FOOTPRINT* compare )
|
||||
{
|
||||
double ff1, ff2;
|
||||
|
||||
|
@ -769,7 +769,7 @@ static bool sortFootprintsByComplexity( MODULE* ref, MODULE* compare )
|
|||
}
|
||||
|
||||
|
||||
static bool sortFootprintsByRatsnestSize( MODULE* ref, MODULE* compare )
|
||||
static bool sortFootprintsByRatsnestSize( FOOTPRINT* ref, FOOTPRINT* compare )
|
||||
{
|
||||
double ff1, ff2;
|
||||
|
||||
|
@ -779,12 +779,12 @@ static bool sortFootprintsByRatsnestSize( MODULE* ref, MODULE* compare )
|
|||
}
|
||||
|
||||
|
||||
MODULE* AR_AUTOPLACER::pickFootprint( )
|
||||
FOOTPRINT* AR_AUTOPLACER::pickFootprint( )
|
||||
{
|
||||
std::vector<MODULE*> fpList;
|
||||
std::vector<FOOTPRINT*> fpList;
|
||||
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
footprint->CalculateBoundingBox();
|
||||
fpList.push_back( footprint );
|
||||
|
@ -794,7 +794,7 @@ MODULE* AR_AUTOPLACER::pickFootprint( )
|
|||
|
||||
for( unsigned kk = 0; kk < fpList.size(); kk++ )
|
||||
{
|
||||
MODULE* footprint = fpList[kk];
|
||||
FOOTPRINT* footprint = fpList[kk];
|
||||
footprint->SetFlag( 0 );
|
||||
|
||||
if( !footprint->NeedsPlaced() )
|
||||
|
@ -807,7 +807,7 @@ MODULE* AR_AUTOPLACER::pickFootprint( )
|
|||
|
||||
for( unsigned kk = 0; kk < fpList.size(); kk++ )
|
||||
{
|
||||
MODULE* footprint = fpList[kk];
|
||||
FOOTPRINT* footprint = fpList[kk];
|
||||
|
||||
auto edges = m_connectivity->GetRatsnestForComponent( footprint, true );
|
||||
|
||||
|
@ -817,12 +817,12 @@ MODULE* AR_AUTOPLACER::pickFootprint( )
|
|||
sort( fpList.begin(), fpList.end(), sortFootprintsByRatsnestSize );
|
||||
|
||||
// Search for "best" footprint.
|
||||
MODULE* bestFootprint = nullptr;
|
||||
MODULE* altFootprint = nullptr;
|
||||
FOOTPRINT* bestFootprint = nullptr;
|
||||
FOOTPRINT* altFootprint = nullptr;
|
||||
|
||||
for( unsigned ii = 0; ii < fpList.size(); ii++ )
|
||||
{
|
||||
MODULE* footprint = fpList[ii];
|
||||
FOOTPRINT* footprint = fpList[ii];
|
||||
|
||||
if( !footprint->NeedsPlaced() )
|
||||
continue;
|
||||
|
@ -874,7 +874,7 @@ void AR_AUTOPLACER::drawPlacementRoutingMatrix( )
|
|||
}
|
||||
|
||||
|
||||
AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<MODULE*>& aFootprints,
|
||||
AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<FOOTPRINT*>& aFootprints,
|
||||
BOARD_COMMIT* aCommit,
|
||||
bool aPlaceOffboardModules )
|
||||
{
|
||||
|
@ -896,33 +896,33 @@ AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<MODULE*>& aFootprints,
|
|||
|
||||
int placedCount = 0;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
footprint->SetNeedsPlaced( false );
|
||||
|
||||
std::vector<MODULE*> offboardMods;
|
||||
std::vector<FOOTPRINT*> offboardMods;
|
||||
|
||||
if( aPlaceOffboardModules )
|
||||
{
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( !m_matrix.m_BrdBox.Contains( footprint->GetPosition() ) )
|
||||
offboardMods.push_back( footprint );
|
||||
}
|
||||
}
|
||||
|
||||
for( MODULE* footprint : aFootprints )
|
||||
for( FOOTPRINT* footprint : aFootprints )
|
||||
{
|
||||
footprint->SetNeedsPlaced( true );
|
||||
aCommit->Modify( footprint );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : offboardMods )
|
||||
for( FOOTPRINT* footprint : offboardMods )
|
||||
{
|
||||
footprint->SetNeedsPlaced( true );
|
||||
aCommit->Modify( footprint );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( footprint->NeedsPlaced() ) // Erase from screen
|
||||
placedCount++;
|
||||
|
@ -945,7 +945,7 @@ AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<MODULE*>& aFootprints,
|
|||
if( m_refreshCallback )
|
||||
m_refreshCallback( nullptr );
|
||||
|
||||
MODULE* footprint;
|
||||
FOOTPRINT* footprint;
|
||||
|
||||
while( ( footprint = pickFootprint() ) != nullptr )
|
||||
{
|
||||
|
@ -1075,7 +1075,7 @@ end_of_tst:
|
|||
|
||||
m_matrix.UnInitRoutingMatrix();
|
||||
|
||||
for( MODULE* fp : m_board->Footprints() )
|
||||
for( FOOTPRINT* fp : m_board->Footprints() )
|
||||
fp->CalculateBoundingBox();
|
||||
|
||||
return cancelled ? AR_CANCELLED : AR_COMPLETED;
|
||||
|
|
|
@ -59,7 +59,7 @@ class AR_AUTOPLACER
|
|||
public:
|
||||
AR_AUTOPLACER( BOARD* aBoard );
|
||||
|
||||
AR_RESULT AutoplaceFootprints( std::vector<MODULE*>& aFootprints, BOARD_COMMIT* aCommit,
|
||||
AR_RESULT AutoplaceFootprints( std::vector<FOOTPRINT*>& aFootprints, BOARD_COMMIT* aCommit,
|
||||
bool aPlaceOffboardModules = false );
|
||||
|
||||
/**
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
* a callback function to redraw on screen the view after changes,
|
||||
* for instance after moving a footprint
|
||||
*/
|
||||
void SetRefreshCallback( std::function<int( MODULE* aModule )> aCallback )
|
||||
void SetRefreshCallback( std::function<int( FOOTPRINT* aFootprint )> aCallback )
|
||||
{
|
||||
m_refreshCallback = aCallback;
|
||||
}
|
||||
|
@ -85,33 +85,32 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void drawPlacementRoutingMatrix(); // draw the working area (shows free and occupied areas)
|
||||
void rotateFootprint( MODULE* aFootprint, double angle, bool incremental );
|
||||
int genPlacementRoutingMatrix();
|
||||
void drawPlacementRoutingMatrix(); // draw the working area (shows free and occupied areas)
|
||||
void rotateFootprint( FOOTPRINT* aFootprint, double angle, bool incremental );
|
||||
int genPlacementRoutingMatrix();
|
||||
|
||||
/** fills m_matrix cells from m_boardShape.
|
||||
* cells inside m_boardShape are set to CELL_IS_ZONE
|
||||
*/
|
||||
bool fillMatrix();
|
||||
void genModuleOnRoutingMatrix( MODULE* Module );
|
||||
bool fillMatrix();
|
||||
void genModuleOnRoutingMatrix( FOOTPRINT* aFootprint );
|
||||
|
||||
int testRectangle( const EDA_RECT& aRect, int side );
|
||||
int testRectangle( const EDA_RECT& aRect, int side );
|
||||
unsigned int calculateKeepOutArea( const EDA_RECT& aRect, int side );
|
||||
int testFootprintOnBoard( MODULE* aFootprint, bool TstOtherSide, const wxPoint& aOffset );
|
||||
int getOptimalFPPlacement( MODULE* aFootprint );
|
||||
double computePlacementRatsnestCost( MODULE* aFootprint, const wxPoint& aOffset );
|
||||
int testFootprintOnBoard( FOOTPRINT* aFootprint, bool TstOtherSide, const wxPoint& aOffset );
|
||||
int getOptimalFPPlacement( FOOTPRINT* aFootprint );
|
||||
double computePlacementRatsnestCost( FOOTPRINT* aFootprint, const wxPoint& aOffset );
|
||||
|
||||
/**
|
||||
* Find the "best" footprint place. The criteria are:
|
||||
* - Maximum ratsnest with footprints already placed
|
||||
* - Max size, and number of pads max
|
||||
*/
|
||||
MODULE* pickFootprint();
|
||||
FOOTPRINT* pickFootprint();
|
||||
|
||||
void placeFootprint( MODULE* aFootprint, bool aDoNotRecreateRatsnest,
|
||||
const wxPoint& aPos );
|
||||
void placeFootprint( FOOTPRINT* aFootprint, bool aDoNotRecreateRatsnest, const wxPoint& aPos );
|
||||
|
||||
const PAD* nearestPad( MODULE* aRefFP, PAD* aRefPad, const wxPoint& aOffset );
|
||||
const PAD* nearestPad( FOOTPRINT* aRefFP, PAD* aRefPad, const wxPoint& aOffset );
|
||||
|
||||
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
|
||||
void addFpBody( wxPoint aStart, wxPoint aEnd, LSET aLayerMask );
|
||||
|
@ -121,7 +120,7 @@ private:
|
|||
|
||||
// Build m_fpAreaTop and m_fpAreaBottom polygonal shapes for aFootprint.
|
||||
// aFpClearance is a mechanical clearance.
|
||||
void buildFpAreas( MODULE* aFootprint, int aFpClearance );
|
||||
void buildFpAreas( FOOTPRINT* aFootprint, int aFpClearance );
|
||||
|
||||
AR_MATRIX m_matrix;
|
||||
SHAPE_POLY_SET m_topFreeArea; // The polygonal description of the top side free areas;
|
||||
|
@ -136,10 +135,10 @@ private:
|
|||
double m_minCost;
|
||||
int m_gridSize;
|
||||
|
||||
std::shared_ptr<KIGFX::VIEW_OVERLAY> m_overlay;
|
||||
std::unique_ptr<CONNECTIVITY_DATA> m_connectivity;
|
||||
std::function<int( MODULE* aModule )> m_refreshCallback;
|
||||
PROGRESS_REPORTER* m_progressReporter;
|
||||
std::shared_ptr<KIGFX::VIEW_OVERLAY> m_overlay;
|
||||
std::unique_ptr<CONNECTIVITY_DATA> m_connectivity;
|
||||
std::function<int( FOOTPRINT* aFootprint )> m_refreshCallback;
|
||||
PROGRESS_REPORTER* m_progressReporter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
class PCB_SHAPE;
|
||||
class TRACK;
|
||||
class PAD;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
|
||||
#define AR_MAX_ROUTING_LAYERS_COUNT 2
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ AUTOPLACE_TOOL::~AUTOPLACE_TOOL()
|
|||
// especially each time a footprint is autoplaced,
|
||||
static PCB_BASE_EDIT_FRAME* fparent;
|
||||
|
||||
static int refreshCallback( MODULE* aFootprint )
|
||||
static int refreshCallback( FOOTPRINT* aFootprint )
|
||||
{
|
||||
if( aFootprint )
|
||||
fparent->GetCanvas()->GetView()->Update( aFootprint );
|
||||
|
@ -59,7 +59,7 @@ static int refreshCallback( MODULE* aFootprint )
|
|||
}
|
||||
|
||||
|
||||
int AUTOPLACE_TOOL::autoplace( std::vector<MODULE*>& aFootprints, bool aPlaceOffboard )
|
||||
int AUTOPLACE_TOOL::autoplace( std::vector<FOOTPRINT*>& aFootprints, bool aPlaceOffboard )
|
||||
{
|
||||
EDA_RECT bbox = board()->GetBoardEdgesBoundingBox();
|
||||
|
||||
|
@ -82,7 +82,7 @@ int AUTOPLACE_TOOL::autoplace( std::vector<MODULE*>& aFootprints, bool aPlaceOff
|
|||
autoplacer.SetOverlay( overlay );
|
||||
|
||||
fparent = frame();
|
||||
std::function<int( MODULE* aFootprint )> callback = refreshCallback;
|
||||
std::function<int( FOOTPRINT* aFootprint )> callback = refreshCallback;
|
||||
autoplacer.SetRefreshCallback( callback );
|
||||
|
||||
std::unique_ptr<WX_PROGRESS_REPORTER> progressReporter(
|
||||
|
@ -102,12 +102,12 @@ int AUTOPLACE_TOOL::autoplace( std::vector<MODULE*>& aFootprints, bool aPlaceOff
|
|||
|
||||
int AUTOPLACE_TOOL::autoplaceSelected( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
std::vector<MODULE*> footprints;
|
||||
std::vector<FOOTPRINT*> footprints;
|
||||
|
||||
for( EDA_ITEM* item : selection() )
|
||||
{
|
||||
if( item->Type() == PCB_FOOTPRINT_T )
|
||||
footprints.push_back( static_cast<MODULE*>( item ) );
|
||||
footprints.push_back( static_cast<FOOTPRINT*>( item ) );
|
||||
}
|
||||
|
||||
return autoplace( footprints, false );
|
||||
|
@ -116,7 +116,7 @@ int AUTOPLACE_TOOL::autoplaceSelected( const TOOL_EVENT& aEvent )
|
|||
|
||||
int AUTOPLACE_TOOL::autoplaceOffboard( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
std::vector<MODULE*> footprints;
|
||||
std::vector<FOOTPRINT*> footprints;
|
||||
|
||||
return autoplace( footprints, true );
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
void setTransitions() override;
|
||||
|
||||
private:
|
||||
int autoplace( std::vector<MODULE*>& aFootprints, bool aPlaceOffboard );
|
||||
int autoplace( std::vector<FOOTPRINT*>& aFootprints, bool aPlaceOffboard );
|
||||
|
||||
int autoplaceSelected( const TOOL_EVENT& aEvent );
|
||||
int autoplaceOffboard( const TOOL_EVENT& aEvent );
|
||||
|
|
|
@ -63,7 +63,7 @@ const int scale = (int)(0.01 * IU_PER_MM);
|
|||
const int PADDING = (int)(1 * IU_PER_MM);
|
||||
|
||||
// Populates a list of rectangles, from a list of footprints
|
||||
void fillRectList( CSubRectArray& vecSubRects, std::vector <MODULE*>& aFootprintList )
|
||||
void fillRectList( CSubRectArray& vecSubRects, std::vector <FOOTPRINT*>& aFootprintList )
|
||||
{
|
||||
vecSubRects.clear();
|
||||
|
||||
|
@ -148,7 +148,7 @@ void spreadRectangles( CRectPlacement& aPlacementArea,
|
|||
}
|
||||
|
||||
|
||||
void moveFootprintsInArea( CRectPlacement& aPlacementArea, std::vector <MODULE*>& aFootprintList,
|
||||
void moveFootprintsInArea( CRectPlacement& aPlacementArea, std::vector <FOOTPRINT*>& aFootprintList,
|
||||
EDA_RECT& aFreeArea, bool aFindAreaOnly )
|
||||
{
|
||||
CSubRectArray vecSubRects;
|
||||
|
@ -165,7 +165,7 @@ void moveFootprintsInArea( CRectPlacement& aPlacementArea, std::vector <MODULE*>
|
|||
pos.x *= scale;
|
||||
pos.y *= scale;
|
||||
|
||||
MODULE* footprint = aFootprintList[vecSubRects[it].n];
|
||||
FOOTPRINT* footprint = aFootprintList[vecSubRects[it].n];
|
||||
|
||||
EDA_RECT fpBBox = footprint->GetFootprintRect();
|
||||
wxPoint mod_pos = pos + ( footprint->GetPosition() - fpBBox.GetOrigin() )
|
||||
|
@ -175,7 +175,7 @@ void moveFootprintsInArea( CRectPlacement& aPlacementArea, std::vector <MODULE*>
|
|||
}
|
||||
}
|
||||
|
||||
static bool sortFootprintsbySheetPath( MODULE* ref, MODULE* compare );
|
||||
static bool sortFootprintsbySheetPath( FOOTPRINT* ref, FOOTPRINT* compare );
|
||||
|
||||
|
||||
/**
|
||||
|
@ -186,13 +186,13 @@ static bool sortFootprintsbySheetPath( MODULE* ref, MODULE* compare );
|
|||
* @param aSpreadAreaPosition the position of the upper left corner of the
|
||||
* area allowed to spread footprints
|
||||
*/
|
||||
void SpreadFootprints( std::vector<MODULE*>* aFootprints, wxPoint aSpreadAreaPosition )
|
||||
void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, wxPoint aSpreadAreaPosition )
|
||||
{
|
||||
// Build candidate list
|
||||
// calculate also the area needed by these footprints
|
||||
std::vector <MODULE*> footprintList;
|
||||
std::vector <FOOTPRINT*> footprintList;
|
||||
|
||||
for( MODULE* footprint : *aFootprints )
|
||||
for( FOOTPRINT* footprint : *aFootprints )
|
||||
{
|
||||
if( footprint->IsLocked() )
|
||||
continue;
|
||||
|
@ -208,10 +208,10 @@ void SpreadFootprints( std::vector<MODULE*>* aFootprints, wxPoint aSpreadAreaPo
|
|||
sort( footprintList.begin(), footprintList.end(), sortFootprintsbySheetPath );
|
||||
|
||||
// Extract and place footprints by sheet
|
||||
std::vector <MODULE*> footprintListBySheet;
|
||||
std::vector <EDA_RECT> placementSheetAreas;
|
||||
double subsurface;
|
||||
double placementsurface = 0.0;
|
||||
std::vector <FOOTPRINT*> footprintListBySheet;
|
||||
std::vector <EDA_RECT> placementSheetAreas;
|
||||
double subsurface;
|
||||
double placementsurface = 0.0;
|
||||
|
||||
// The placement uses 2 passes:
|
||||
// the first pass creates the rectangular areas to place footprints
|
||||
|
@ -228,8 +228,8 @@ void SpreadFootprints( std::vector<MODULE*>* aFootprints, wxPoint aSpreadAreaPo
|
|||
|
||||
for( unsigned ii = 0; ii < footprintList.size(); ii++ )
|
||||
{
|
||||
MODULE* footprint = footprintList[ii];
|
||||
bool islastItem = false;
|
||||
FOOTPRINT* footprint = footprintList[ii];
|
||||
bool islastItem = false;
|
||||
|
||||
if( ii == footprintList.size() - 1 ||
|
||||
( footprintList[ii]->GetPath().AsString().BeforeLast( '/' ) !=
|
||||
|
@ -337,7 +337,7 @@ void SpreadFootprints( std::vector<MODULE*>* aFootprints, wxPoint aSpreadAreaPo
|
|||
// Footprints are sorted by their sheet path.
|
||||
// (the full sheet path restricted to the time stamp of the sheet itself,
|
||||
// without the time stamp of the footprint ).
|
||||
static bool sortFootprintsbySheetPath( MODULE* ref, MODULE* compare )
|
||||
static bool sortFootprintsbySheetPath( FOOTPRINT* ref, FOOTPRINT* compare )
|
||||
{
|
||||
return ref->GetPath() < compare->GetPath();
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ BOARD::~BOARD()
|
|||
|
||||
m_zones.clear();
|
||||
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
delete footprint;
|
||||
|
||||
m_footprints.clear();
|
||||
|
@ -514,7 +514,7 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID aLayer, bool isEnabled )
|
|||
for( TRACK* track : Tracks() )
|
||||
track->SetLocalRatsnestVisible( isEnabled );
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
pad->SetLocalRatsnestVisible( isEnabled );
|
||||
|
@ -598,9 +598,9 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
|||
|
||||
case PCB_FOOTPRINT_T:
|
||||
if( aMode == ADD_MODE::APPEND )
|
||||
m_footprints.push_back((MODULE*) aBoardItem );
|
||||
m_footprints.push_back( static_cast<FOOTPRINT*>( aBoardItem ) );
|
||||
else
|
||||
m_footprints.push_front((MODULE*) aBoardItem );
|
||||
m_footprints.push_front( static_cast<FOOTPRINT*>( aBoardItem ) );
|
||||
|
||||
break;
|
||||
|
||||
|
@ -768,7 +768,7 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID ) const
|
|||
return track;
|
||||
}
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
if( footprint->m_Uuid == aID )
|
||||
return footprint;
|
||||
|
@ -844,7 +844,7 @@ void BOARD::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
|
|||
for( TRACK* track : Tracks() )
|
||||
aMap[ track->m_Uuid ] = track;
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
aMap[ footprint->m_Uuid ] = footprint;
|
||||
|
||||
|
@ -900,7 +900,7 @@ wxString BOARD::ConvertCrossReferencesToKIIDs( const wxString& aSource )
|
|||
wxString remainder;
|
||||
wxString ref = token.BeforeFirst( ':', &remainder );
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
if( footprint->GetReference().CmpNoCase( ref ) == 0 )
|
||||
{
|
||||
|
@ -956,7 +956,7 @@ wxString BOARD::ConvertKIIDsToCrossReferences( const wxString& aSource )
|
|||
BOARD_ITEM* refItem = GetItem( KIID( ref ) );
|
||||
|
||||
if( refItem && refItem->Type() == PCB_FOOTPRINT_T )
|
||||
token = static_cast<MODULE*>( refItem )->GetReference() + ":" + remainder;
|
||||
token = static_cast<FOOTPRINT*>( refItem )->GetReference() + ":" + remainder;
|
||||
}
|
||||
|
||||
newbuf.append( "${" + token + "}" );
|
||||
|
@ -975,7 +975,7 @@ unsigned BOARD::GetNodesCount( int aNet ) const
|
|||
{
|
||||
unsigned retval = 0;
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -1012,7 +1012,7 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
|
|||
}
|
||||
|
||||
// Check footprints
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
if( !( footprint->GetLayerSet() & visible ).any() )
|
||||
continue;
|
||||
|
@ -1122,7 +1122,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
|
|||
case PCB_FP_ZONE_T:
|
||||
|
||||
// this calls FOOTPRINT::Visit() on each footprint.
|
||||
result = IterateForward<MODULE*>( m_footprints, inspector, testData, p );
|
||||
result = IterateForward<FOOTPRINT*>( m_footprints, inspector, testData, p );
|
||||
|
||||
// skip over any types handled in the above call.
|
||||
for( ; ; )
|
||||
|
@ -1251,9 +1251,9 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const
|
|||
}
|
||||
|
||||
|
||||
MODULE* BOARD::FindModuleByReference( const wxString& aReference ) const
|
||||
FOOTPRINT* BOARD::FindFootprintByReference( const wxString& aReference ) const
|
||||
{
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
if( aReference == footprint->GetReference() )
|
||||
return footprint;
|
||||
|
@ -1263,9 +1263,9 @@ MODULE* BOARD::FindModuleByReference( const wxString& aReference ) const
|
|||
}
|
||||
|
||||
|
||||
MODULE* BOARD::FindModuleByPath( const KIID_PATH& aPath ) const
|
||||
FOOTPRINT* BOARD::FindFootprintByPath( const KIID_PATH& aPath ) const
|
||||
{
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
if( footprint->GetPath() == aPath )
|
||||
return footprint;
|
||||
|
@ -1447,7 +1447,7 @@ PAD* BOARD::GetPad( const wxPoint& aPosition, LSET aLayerSet )
|
|||
if( !aLayerSet.any() )
|
||||
aLayerSet = LSET::AllCuMask();
|
||||
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
PAD* pad = NULL;
|
||||
|
||||
|
@ -1474,7 +1474,7 @@ PAD* BOARD::GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint )
|
|||
|
||||
PAD* BOARD::GetPadFast( const wxPoint& aPosition, LSET aLayerSet )
|
||||
{
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -1600,7 +1600,7 @@ bool sortPadsByXthenYCoord( PAD* const & ref, PAD* const & comp )
|
|||
|
||||
void BOARD::GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode )
|
||||
{
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads( ) )
|
||||
{
|
||||
|
@ -1666,16 +1666,16 @@ std::tuple<int, double, double> BOARD::GetTrackLength( const TRACK& aTrack ) con
|
|||
}
|
||||
|
||||
|
||||
MODULE* BOARD::GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
|
||||
bool aVisibleOnly, bool aIgnoreLocked )
|
||||
FOOTPRINT* BOARD::GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
|
||||
bool aVisibleOnly, bool aIgnoreLocked )
|
||||
{
|
||||
MODULE* footprint = NULL;
|
||||
MODULE* alt_footprint = NULL;
|
||||
int min_dim = 0x7FFFFFFF;
|
||||
int alt_min_dim = 0x7FFFFFFF;
|
||||
bool current_layer_back = IsBackLayer( aActiveLayer );
|
||||
FOOTPRINT* footprint = NULL;
|
||||
FOOTPRINT* alt_footprint = NULL;
|
||||
int min_dim = 0x7FFFFFFF;
|
||||
int alt_min_dim = 0x7FFFFFFF;
|
||||
bool current_layer_back = IsBackLayer( aActiveLayer );
|
||||
|
||||
for( MODULE* candidate : m_footprints )
|
||||
for( FOOTPRINT* candidate : m_footprints )
|
||||
{
|
||||
// is the ref point within the footprint's bounds?
|
||||
if( !candidate->HitTest( aPosition ) )
|
||||
|
@ -1739,7 +1739,7 @@ std::list<ZONE*> BOARD::GetZoneList( bool aIncludeZonesInFootprints )
|
|||
|
||||
if( aIncludeZonesInFootprints )
|
||||
{
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
for( FP_ZONE* zone : footprint->Zones() )
|
||||
zones.push_back( zone );
|
||||
|
@ -1859,7 +1859,7 @@ const std::vector<PAD*> BOARD::GetPads() const
|
|||
{
|
||||
std::vector<PAD*> allPads;
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
allPads.push_back( pad );
|
||||
|
@ -1873,7 +1873,7 @@ unsigned BOARD::GetPadCount() const
|
|||
{
|
||||
unsigned retval = 0;
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
retval += footprint->Pads().size();
|
||||
|
||||
return retval;
|
||||
|
@ -1887,7 +1887,7 @@ const std::vector<BOARD_CONNECTED_ITEM*> BOARD::AllConnectedItems()
|
|||
for( TRACK* track : Tracks() )
|
||||
items.push_back( track );
|
||||
|
||||
for( MODULE* footprint : Footprints() )
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
items.push_back( pad );
|
||||
|
|
|
@ -194,7 +194,7 @@ private:
|
|||
wxString m_fileName;
|
||||
MARKERS m_markers;
|
||||
DRAWINGS m_drawings;
|
||||
MODULES m_footprints;
|
||||
FOOTPRINTS m_footprints;
|
||||
TRACKS m_tracks;
|
||||
GROUPS m_groups;
|
||||
ZONES m_zones;
|
||||
|
@ -281,8 +281,8 @@ public:
|
|||
TRACKS& Tracks() { return m_tracks; }
|
||||
const TRACKS& Tracks() const { return m_tracks; }
|
||||
|
||||
MODULES& Footprints() { return m_footprints; }
|
||||
const MODULES& Footprints() const { return m_footprints; }
|
||||
FOOTPRINTS& Footprints() { return m_footprints; }
|
||||
const FOOTPRINTS& Footprints() const { return m_footprints; }
|
||||
|
||||
DRAWINGS& Drawings() { return m_drawings; }
|
||||
const DRAWINGS& Drawings() const { return m_drawings; }
|
||||
|
@ -345,7 +345,7 @@ public:
|
|||
* This is used primarily by the footprint editor which knows there is only one.
|
||||
* @return first footprint or null pointer
|
||||
*/
|
||||
MODULE* GetFirstFootprint() const
|
||||
FOOTPRINT* GetFirstFootprint() const
|
||||
{
|
||||
return m_footprints.empty() ? nullptr : m_footprints.front();
|
||||
}
|
||||
|
@ -353,9 +353,9 @@ public:
|
|||
/**
|
||||
* Removes all footprints from the deque and frees the memory associated with them
|
||||
*/
|
||||
void DeleteAllModules()
|
||||
void DeleteAllFootprints()
|
||||
{
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
delete footprint;
|
||||
|
||||
m_footprints.clear();
|
||||
|
@ -802,22 +802,23 @@ public:
|
|||
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
|
||||
|
||||
/**
|
||||
* Search for a MODULE within this board with the given reference designator.
|
||||
* Search for a FOOTPRINT within this board with the given reference designator.
|
||||
*
|
||||
* Finds only the first one, if there is more than one such MODULE.
|
||||
* Finds only the first one, if there is more than one such FOOTPRINT.
|
||||
*
|
||||
* @param aReference The reference designator of the MODULE to find.
|
||||
* @return MODULE* - If found, the MODULE having the given reference designator, else NULL.
|
||||
* @param aReference The reference designator of the FOOTPRINT to find.
|
||||
* @return FOOTPRINT* - If found, the FOOTPRINT having the given reference designator, else
|
||||
* nullptr.
|
||||
*/
|
||||
MODULE* FindModuleByReference( const wxString& aReference ) const;
|
||||
FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
|
||||
|
||||
/**
|
||||
* Search for a MODULE within this board with the given path.
|
||||
* Search for a FOOTPRINT within this board with the given path.
|
||||
*
|
||||
* @param aPath The path ([sheetUUID, .., symbolUUID]) to search for.
|
||||
* @return MODULE* - If found, the MODULE having the given uuid, else NULL.
|
||||
* @return FOOTPRINT* - If found, the FOOTPRINT having the given uuid, else NULL.
|
||||
*/
|
||||
MODULE* FindModuleByPath( const KIID_PATH& aPath ) const;
|
||||
FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
|
||||
|
||||
/**
|
||||
* @param aNames An array string to fill with net names.
|
||||
|
@ -1082,8 +1083,8 @@ public:
|
|||
* @param aVisibleOnly Search only the visible layers if true.
|
||||
* @param aIgnoreLocked Ignore locked footprints when true.
|
||||
*/
|
||||
MODULE* GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
|
||||
bool aVisibleOnly, bool aIgnoreLocked = false );
|
||||
FOOTPRINT* GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
|
||||
bool aVisibleOnly, bool aIgnoreLocked = false );
|
||||
|
||||
/**
|
||||
* Reset all items' netcodes to 0 (no net).
|
||||
|
|
|
@ -130,7 +130,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
}
|
||||
|
||||
savedModules.insert( ent.m_item );
|
||||
static_cast<MODULE*>( ent.m_item )->SetLastEditTime();
|
||||
static_cast<FOOTPRINT*>( ent.m_item )->SetLastEditTime();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
|
||||
if( !( changeFlags & CHT_DONE ) )
|
||||
{
|
||||
MODULE* footprint = static_cast<MODULE*>( boardItem->GetParent() );
|
||||
FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem->GetParent() );
|
||||
wxASSERT( footprint && footprint->Type() == PCB_FOOTPRINT_T );
|
||||
footprint->Delete( boardItem );
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
// No support for nested footprints (yet)
|
||||
wxASSERT( !m_isFootprintEditor );
|
||||
|
||||
MODULE* footprint = static_cast<MODULE*>( boardItem );
|
||||
FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem );
|
||||
view->Remove( footprint );
|
||||
footprint->ClearFlags();
|
||||
|
||||
|
@ -286,10 +286,11 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
|
||||
if( m_isFootprintEditor )
|
||||
{
|
||||
static_cast<MODULE*>( boardItem )->RunOnChildren( [&]( BOARD_ITEM* aChild )
|
||||
{
|
||||
view->Update( aChild );
|
||||
});
|
||||
static_cast<FOOTPRINT*>( boardItem )->RunOnChildren(
|
||||
[&]( BOARD_ITEM* aChild )
|
||||
{
|
||||
view->Update( aChild );
|
||||
});
|
||||
}
|
||||
|
||||
board->OnItemChanged( boardItem );
|
||||
|
@ -373,7 +374,7 @@ EDA_ITEM* BOARD_COMMIT::parentObject( EDA_ITEM* aItem ) const
|
|||
return aItem->GetParent();
|
||||
|
||||
case PCB_ZONE_T:
|
||||
wxASSERT( !dynamic_cast<MODULE*>( aItem->GetParent() ) );
|
||||
wxASSERT( !dynamic_cast<FOOTPRINT*>( aItem->GetParent() ) );
|
||||
return aItem;
|
||||
|
||||
default:
|
||||
|
|
|
@ -77,7 +77,7 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
|
|||
}
|
||||
|
||||
// convert pads
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
footprint->TransformPadsWithClearanceToPolygon( aOutlines, aLayer, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
|
@ -125,12 +125,12 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
|
|||
}
|
||||
|
||||
|
||||
void MODULE::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aMaxError, ERROR_LOC aErrorLoc,
|
||||
bool aSkipNPTHPadsWihNoCopper,
|
||||
bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads ) const
|
||||
void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aMaxError, ERROR_LOC aErrorLoc,
|
||||
bool aSkipNPTHPadsWihNoCopper,
|
||||
bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads ) const
|
||||
{
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
|
@ -223,11 +223,11 @@ void MODULE::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
* @aIncludeText = indicates footprint text items (reference, value, etc.) should be included
|
||||
* in the outline
|
||||
*/
|
||||
void MODULE::TransformFPShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aError, ERROR_LOC aErrorLoc,
|
||||
bool aIncludeText,
|
||||
bool aIncludeShapes ) const
|
||||
void FOOTPRINT::TransformFPShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aError, ERROR_LOC aErrorLoc,
|
||||
bool aIncludeText,
|
||||
bool aIncludeShapes ) const
|
||||
{
|
||||
std::vector<FP_TEXT*> texts; // List of FP_TEXT to convert
|
||||
|
||||
|
@ -455,9 +455,9 @@ void PCB_SHAPE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuf
|
|||
{
|
||||
// The polygon is expected to be a simple polygon
|
||||
// not self intersecting, no hole.
|
||||
MODULE* footprint = GetParentFootprint(); // NULL for items not in footprints
|
||||
double orientation = footprint ? footprint->GetOrientation() : 0.0;
|
||||
wxPoint offset;
|
||||
FOOTPRINT* footprint = GetParentFootprint(); // NULL for items not in footprints
|
||||
double orientation = footprint ? footprint->GetOrientation() : 0.0;
|
||||
wxPoint offset;
|
||||
|
||||
if( footprint )
|
||||
offset = footprint->GetPosition();
|
||||
|
|
|
@ -119,7 +119,7 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
|
|||
CmpList::iterator iter;
|
||||
int i = 1;
|
||||
|
||||
for( MODULE* fp : GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : GetBoard()->Footprints() )
|
||||
{
|
||||
bool valExist = false;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ const KICAD_T GENERAL_COLLECTOR::Dimensions[] = {
|
|||
SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
||||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
|
||||
MODULE* footprint = nullptr;
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
PCB_GROUP* group = nullptr;
|
||||
PAD* pad = nullptr;
|
||||
bool pad_through = false;
|
||||
|
@ -206,7 +206,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
{
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
MODULE* footprint = (MODULE*) item->GetParent();
|
||||
FOOTPRINT* footprint = (FOOTPRINT*) item->GetParent();
|
||||
|
||||
if( footprint->GetReference() == wxT( "Y2" ) )
|
||||
breakhere++;
|
||||
|
@ -245,7 +245,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
|
||||
case PCB_FOOTPRINT_T:
|
||||
{
|
||||
MODULE* footprint = (MODULE*) item;
|
||||
FOOTPRINT* footprint = (FOOTPRINT*) item;
|
||||
|
||||
if( footprint->GetReference() == wxT( "C98" ) )
|
||||
breakhere++;
|
||||
|
@ -284,7 +284,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
}
|
||||
else // smd, so use pads test after footprint test
|
||||
{
|
||||
footprint = static_cast<MODULE*>( item->GetParent() );
|
||||
footprint = static_cast<FOOTPRINT*>( item->GetParent() );
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -300,7 +300,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
break;
|
||||
|
||||
case PCB_FP_ZONE_T:
|
||||
footprint = static_cast<MODULE*>( item->GetParent() );
|
||||
footprint = static_cast<FOOTPRINT*>( item->GetParent() );
|
||||
|
||||
// Fallthrough to get the zone as well
|
||||
KI_FALLTHROUGH;
|
||||
|
@ -364,7 +364,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
}
|
||||
|
||||
// Extract the footprint since it could be hidden
|
||||
footprint = static_cast<MODULE*>( item->GetParent() );
|
||||
footprint = static_cast<FOOTPRINT*>( item->GetParent() );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -373,7 +373,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
break;
|
||||
|
||||
case PCB_FOOTPRINT_T:
|
||||
footprint = static_cast<MODULE*>( item );
|
||||
footprint = static_cast<FOOTPRINT*>( item );
|
||||
break;
|
||||
|
||||
case PCB_GROUP_T:
|
||||
|
@ -390,7 +390,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
|
||||
// common tests:
|
||||
|
||||
if( footprint ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_MODULE_T
|
||||
if( footprint ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_FOOTPRINT_T
|
||||
{
|
||||
if( m_Guide->IgnoreFootprintsOnBack() && ( footprint->GetLayer() == B_Cu) )
|
||||
goto exit;
|
||||
|
|
|
@ -309,12 +309,12 @@ public:
|
|||
static const KICAD_T ModuleItems[];
|
||||
|
||||
/**
|
||||
* A scan list for only TRACKS
|
||||
* A scan list for only TRACKs
|
||||
*/
|
||||
static const KICAD_T Tracks[];
|
||||
|
||||
/**
|
||||
* A scan list for TRACKS, VIAS, MODULES
|
||||
* A scan list for TRACKs, VIAs, FOOTPRINTs
|
||||
*/
|
||||
static const KICAD_T LockableItems[];
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ bool CN_CONNECTIVITY_ALGO::Remove( BOARD_ITEM* aItem )
|
|||
switch( aItem->Type() )
|
||||
{
|
||||
case PCB_FOOTPRINT_T:
|
||||
for( PAD* pad : static_cast<MODULE*>( aItem )->Pads() )
|
||||
for( PAD* pad : static_cast<FOOTPRINT*>( aItem )->Pads() )
|
||||
{
|
||||
m_itemMap[pad].MarkItemsAsInvalid();
|
||||
m_itemMap.erase( pad );
|
||||
|
@ -102,9 +102,9 @@ void CN_CONNECTIVITY_ALGO::markItemNetAsDirty( const BOARD_ITEM* aItem )
|
|||
{
|
||||
if( aItem->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
auto mod = static_cast <const MODULE*>( aItem );
|
||||
const FOOTPRINT* footprint = static_cast<const FOOTPRINT*>( aItem );
|
||||
|
||||
for( auto pad : mod->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
MarkNetAsDirty( pad->GetNetCode() );
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case PCB_FOOTPRINT_T:
|
||||
for( PAD* pad : static_cast<MODULE*>( aItem )->Pads() )
|
||||
for( PAD* pad : static_cast<FOOTPRINT*>( aItem )->Pads() )
|
||||
{
|
||||
if( m_itemMap.find( pad ) != m_itemMap.end() )
|
||||
return false;
|
||||
|
@ -423,7 +423,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
|||
size += aBoard->Zones().size();
|
||||
size += aBoard->Tracks().size();
|
||||
|
||||
for( MODULE* footprint : aBoard->Footprints() )
|
||||
for( FOOTPRINT* footprint : aBoard->Footprints() )
|
||||
size += footprint->Pads().size();
|
||||
|
||||
size *= 2; // Our caller us gets the other half of the progress bar
|
||||
|
@ -440,7 +440,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
|||
reportProgress( aReporter, ii++, size, delta );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : aBoard->Footprints() )
|
||||
for( FOOTPRINT* footprint : aBoard->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -465,7 +465,7 @@ void CN_CONNECTIVITY_ALGO::Build( const std::vector<BOARD_ITEM*>& aItems )
|
|||
break;
|
||||
|
||||
case PCB_FOOTPRINT_T:
|
||||
for( PAD* pad : static_cast<MODULE*>( item )->Pads() )
|
||||
for( PAD* pad : static_cast<FOOTPRINT*>( item )->Pads() )
|
||||
Add( pad );
|
||||
|
||||
break;
|
||||
|
|
|
@ -225,7 +225,7 @@ void CONNECTIVITY_DATA::BlockRatsnestItems( const std::vector<BOARD_ITEM*>& aIte
|
|||
{
|
||||
if( item->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
for( auto pad : static_cast<MODULE*>(item)->Pads() )
|
||||
for( PAD* pad : static_cast<FOOTPRINT*>(item)->Pads() )
|
||||
citems.push_back( pad );
|
||||
}
|
||||
else
|
||||
|
@ -656,10 +656,8 @@ void CONNECTIVITY_DATA::MarkItemNetAsDirty( BOARD_ITEM *aItem )
|
|||
{
|
||||
if ( aItem->Type() == PCB_FOOTPRINT_T)
|
||||
{
|
||||
for ( auto pad : static_cast<MODULE*>( aItem )->Pads() )
|
||||
{
|
||||
for( PAD* pad : static_cast<FOOTPRINT*>( aItem )->Pads() )
|
||||
m_connAlgo->MarkNetAsDirty( pad->GetNetCode() );
|
||||
}
|
||||
}
|
||||
if (aItem->IsConnected() )
|
||||
{
|
||||
|
@ -685,9 +683,9 @@ const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForItems( std::vector<B
|
|||
{
|
||||
if( item->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
auto component = static_cast<MODULE*>( item );
|
||||
FOOTPRINT* footprint = static_cast<FOOTPRINT*>( item );
|
||||
|
||||
for( auto pad : component->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
nets.insert( pad->GetNetCode() );
|
||||
item_set.insert( pad );
|
||||
|
@ -724,7 +722,7 @@ const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForItems( std::vector<B
|
|||
}
|
||||
|
||||
|
||||
const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForComponent( MODULE* aComponent, bool aSkipInternalConnections )
|
||||
const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForComponent( FOOTPRINT* aComponent, bool aSkipInternalConnections )
|
||||
{
|
||||
std::set<int> nets;
|
||||
std::set<const PAD*> pads;
|
||||
|
|
|
@ -51,7 +51,7 @@ class RN_DATA;
|
|||
class RN_NET;
|
||||
class TRACK;
|
||||
class PAD;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class PROGRESS_REPORTER;
|
||||
|
||||
struct CN_DISJOINT_NET_ENTRY
|
||||
|
@ -267,7 +267,8 @@ public:
|
|||
#ifndef SWIG
|
||||
const std::vector<CN_EDGE> GetRatsnestForItems( const std::vector<BOARD_ITEM*> aItems );
|
||||
|
||||
const std::vector<CN_EDGE> GetRatsnestForComponent( MODULE* aComponent, bool aSkipInternalConnections = false );
|
||||
const std::vector<CN_EDGE> GetRatsnestForComponent( FOOTPRINT* aComponent,
|
||||
bool aSkipInternalConnections = false );
|
||||
#endif
|
||||
|
||||
std::shared_ptr<FROM_TO_CACHE> GetFromToCache()
|
||||
|
|
|
@ -35,7 +35,7 @@ void FROM_TO_CACHE::buildEndpointList( )
|
|||
{
|
||||
m_ftEndpoints.clear();
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -901,7 +901,7 @@ void buildBoardBoundingBoxPoly( const BOARD* aBoard, SHAPE_POLY_SET& aOutline )
|
|||
}
|
||||
|
||||
|
||||
bool isCopperOutside( const MODULE* aMod, SHAPE_POLY_SET& aShape )
|
||||
bool isCopperOutside( const FOOTPRINT* aMod, SHAPE_POLY_SET& aShape )
|
||||
{
|
||||
bool padOutside = false;
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines,
|
|||
bool success = ConvertOutlineToPolygon( segList, outlines, aTolerance, aErrorText,
|
||||
aDiscontinuities, aIntersections );
|
||||
|
||||
MODULE* footprint = aBoard->GetFirstFootprint();
|
||||
FOOTPRINT* footprint = aBoard->GetFirstFootprint();
|
||||
|
||||
// No footprint loaded
|
||||
if( !footprint )
|
||||
|
|
|
@ -68,7 +68,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
char* text;
|
||||
int netcode = -1;
|
||||
bool multiHighlight = false;
|
||||
MODULE* footprint = nullptr;
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
PAD* pad = nullptr;
|
||||
BOARD* pcb = GetBoard();
|
||||
|
||||
|
@ -151,7 +151,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
|
||||
modName = FROM_UTF8( text );
|
||||
|
||||
footprint = pcb->FindModuleByReference( modName );
|
||||
footprint = pcb->FindFootprintByReference( modName );
|
||||
|
||||
if( footprint )
|
||||
pad = footprint->FindPadByName( pinName );
|
||||
|
@ -174,7 +174,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
|
||||
modName = FROM_UTF8( text );
|
||||
|
||||
footprint = pcb->FindModuleByReference( modName );
|
||||
footprint = pcb->FindFootprintByReference( modName );
|
||||
|
||||
if( footprint )
|
||||
msg.Printf( _( "%s found" ), modName );
|
||||
|
@ -256,7 +256,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
for( TRACK* track : pcb->Tracks() )
|
||||
merge_area( track );
|
||||
|
||||
for( MODULE* fp : pcb->Footprints() )
|
||||
for( FOOTPRINT* fp : pcb->Footprints() )
|
||||
{
|
||||
for( PAD* p : fp->Pads() )
|
||||
merge_area( p );
|
||||
|
@ -402,7 +402,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
|
||||
std::string FormatProbeItem( BOARD_ITEM* aItem )
|
||||
{
|
||||
MODULE* footprint;
|
||||
FOOTPRINT* footprint;
|
||||
|
||||
if( !aItem )
|
||||
return "$CLEAR: \"HIGHLIGHTED\""; // message to clear highlight state
|
||||
|
@ -410,12 +410,12 @@ std::string FormatProbeItem( BOARD_ITEM* aItem )
|
|||
switch( aItem->Type() )
|
||||
{
|
||||
case PCB_FOOTPRINT_T:
|
||||
footprint = (MODULE*) aItem;
|
||||
footprint = (FOOTPRINT*) aItem;
|
||||
return StrPrintf( "$PART: \"%s\"", TO_UTF8( footprint->GetReference() ) );
|
||||
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
footprint = (MODULE*) aItem->GetParent();
|
||||
footprint = static_cast<FOOTPRINT*>( aItem->GetParent() );
|
||||
wxString pad = static_cast<PAD*>( aItem )->GetName();
|
||||
|
||||
return StrPrintf( "$PART: \"%s\" $PAD: \"%s\"",
|
||||
|
@ -425,7 +425,7 @@ std::string FormatProbeItem( BOARD_ITEM* aItem )
|
|||
|
||||
case PCB_FP_TEXT_T:
|
||||
{
|
||||
footprint = static_cast<MODULE*>( aItem->GetParent() );
|
||||
footprint = static_cast<FOOTPRINT*>( aItem->GetParent() );
|
||||
|
||||
FP_TEXT* text = static_cast<FP_TEXT*>( aItem );
|
||||
const char* text_key;
|
||||
|
@ -510,7 +510,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
NETLIST netlist;
|
||||
STRING_FORMATTER sf;
|
||||
|
||||
for( MODULE* footprint : this->GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : this->GetBoard()->Footprints() )
|
||||
{
|
||||
COMPONENT* component = new COMPONENT( footprint->GetFPID(), footprint->GetReference(),
|
||||
footprint->GetValue(), footprint->GetPath() );
|
||||
|
|
|
@ -636,7 +636,7 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard()
|
|||
if( m_UpdateSchematic->GetValue() )
|
||||
{ //If updating schematic send a netlist
|
||||
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{ // Create a netlist
|
||||
newref = GetNewRefDes( footprint );
|
||||
|
||||
|
@ -672,7 +672,7 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard()
|
|||
if( reannotateOk )//Only update if no errors
|
||||
{
|
||||
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
newref = GetNewRefDes( footprint );
|
||||
|
||||
|
@ -743,7 +743,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector<RefDesInfo>& aBadR
|
|||
RefDesInfo fpData;
|
||||
bool useModuleLocation = m_locationChoice->GetSelection() == 0;
|
||||
|
||||
for( MODULE* footprint : m_footprints )
|
||||
for( FOOTPRINT* footprint : m_footprints )
|
||||
{
|
||||
fpData.Uuid = footprint->m_Uuid;
|
||||
fpData.RefDesString = footprint->GetReference();
|
||||
|
@ -948,7 +948,7 @@ void DIALOG_BOARD_REANNOTATE::BuildChangeArray( std::vector<RefDesInfo>& aFootpr
|
|||
|
||||
//
|
||||
/// @returns the new refdes for this footprint
|
||||
RefDesChange* DIALOG_BOARD_REANNOTATE::GetNewRefDes( MODULE* aFootprint )
|
||||
RefDesChange* DIALOG_BOARD_REANNOTATE::GetNewRefDes( FOOTPRINT* aFootprint )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
|
||||
private:
|
||||
PCB_EDIT_FRAME* m_frame;
|
||||
MODULES m_footprints;
|
||||
FOOTPRINTS m_footprints;
|
||||
PCB_SCREEN* m_screen;
|
||||
PCBNEW_SELECTION m_selection;
|
||||
|
||||
|
@ -181,7 +181,7 @@ private:
|
|||
wxString aPrefix, bool aRemovePrefix,
|
||||
std::vector<RefDesInfo>& aBadRefDes );
|
||||
|
||||
RefDesChange* GetNewRefDes( MODULE* aFootprint );
|
||||
RefDesChange* GetNewRefDes( FOOTPRINT* aFootprint );
|
||||
|
||||
int RoundToGrid( int aCoord, int aGrid );
|
||||
wxString CoordTowxString( int aX, int aY );
|
||||
|
|
|
@ -181,7 +181,7 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB()
|
|||
BOARD* board = m_parentFrame->GetBoard();
|
||||
|
||||
// Get footprints and pads count
|
||||
for( MODULE* footprint : board->Footprints() )
|
||||
for( FOOTPRINT* footprint : board->Footprints() )
|
||||
{
|
||||
// Do not proceed footprints with no pads if checkbox checked
|
||||
if( m_checkBoxExcludeComponentsNoPins->GetValue() && ! footprint->Pads().size() )
|
||||
|
|
|
@ -42,7 +42,7 @@ class wxTimer;
|
|||
|
||||
class PCB_BASE_FRAME;
|
||||
class LIB_TREE;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -84,7 +84,7 @@ void DIALOG_CLEANUP_GRAPHICS::doCleanup( bool aDryRun )
|
|||
|
||||
BOARD_COMMIT commit( m_parentFrame );
|
||||
BOARD* board = m_parentFrame->GetBoard();
|
||||
MODULE* fp = m_isFootprintEditor ? board->GetFirstFootprint() : nullptr;
|
||||
FOOTPRINT* fp = m_isFootprintEditor ? board->GetFirstFootprint() : nullptr;
|
||||
GRAPHICS_CLEANER cleaner( fp ? fp->GraphicalItems() : board->Drawings(), fp, commit );
|
||||
|
||||
if( !aDryRun )
|
||||
|
|
|
@ -52,7 +52,7 @@ int DIALOG_FOOTPRINT_FP_EDITOR::m_page = 0; // remember the last open page d
|
|||
|
||||
|
||||
DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent,
|
||||
MODULE* aFootprint ) :
|
||||
FOOTPRINT* aFootprint ) :
|
||||
DIALOG_FOOTPRINT_FP_EDITOR_BASE( aParent ),
|
||||
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits, true ),
|
||||
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
|
||||
|
@ -526,10 +526,10 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::checkFootprintName( const wxString& aFootprintN
|
|||
m_delayedErrorMessage = _( "Footprint must have a name." );
|
||||
return false;
|
||||
}
|
||||
else if( !MODULE::IsLibNameValid( aFootprintName ) )
|
||||
else if( !FOOTPRINT::IsLibNameValid( aFootprintName ) )
|
||||
{
|
||||
m_delayedErrorMessage.Printf( _( "Footprint name may not contain \"%s\"." ),
|
||||
MODULE::StringLibNameInvalidChars( true ) );
|
||||
FOOTPRINT::StringLibNameInvalidChars( true ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -709,7 +709,7 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow()
|
|||
}
|
||||
|
||||
|
||||
static bool footprintIsFromBoard( MODULE* aFootprint )
|
||||
static bool footprintIsFromBoard( FOOTPRINT* aFootprint )
|
||||
{
|
||||
return aFootprint->GetLink() != niluuid;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class DIALOG_FOOTPRINT_FP_EDITOR : public DIALOG_FOOTPRINT_FP_EDITOR_BASE
|
|||
{
|
||||
private:
|
||||
FOOTPRINT_EDIT_FRAME* m_frame;
|
||||
MODULE* m_footprint;
|
||||
FOOTPRINT* m_footprint;
|
||||
|
||||
static int m_page; // remember the last open page during session
|
||||
|
||||
|
@ -65,7 +65,7 @@ private:
|
|||
|
||||
public:
|
||||
// Constructor and destructor
|
||||
DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, MODULE* aFootprint );
|
||||
DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, FOOTPRINT* aFootprint );
|
||||
~DIALOG_FOOTPRINT_FP_EDITOR() override;
|
||||
|
||||
bool Validate() override;
|
||||
|
|
|
@ -57,7 +57,7 @@ bool g_reset3DModels[2] = { false, true };
|
|||
|
||||
|
||||
DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
|
||||
MODULE* aFootprint,
|
||||
FOOTPRINT* aFootprint,
|
||||
bool updateMode, bool selectedMode ) :
|
||||
DIALOG_EXCHANGE_FOOTPRINTS_BASE( aParent ),
|
||||
m_commit( aParent ),
|
||||
|
@ -169,7 +169,7 @@ DIALOG_EXCHANGE_FOOTPRINTS::~DIALOG_EXCHANGE_FOOTPRINTS()
|
|||
}
|
||||
|
||||
|
||||
bool DIALOG_EXCHANGE_FOOTPRINTS::isMatch( MODULE* aFootprint )
|
||||
bool DIALOG_EXCHANGE_FOOTPRINTS::isMatch( FOOTPRINT* aFootprint )
|
||||
{
|
||||
LIB_ID specifiedID;
|
||||
|
||||
|
@ -351,7 +351,7 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints()
|
|||
}
|
||||
|
||||
|
||||
bool DIALOG_EXCHANGE_FOOTPRINTS::processFootprint( MODULE* aFootprint, const LIB_ID& aNewFPID )
|
||||
bool DIALOG_EXCHANGE_FOOTPRINTS::processFootprint( FOOTPRINT* aFootprint, const LIB_ID& aNewFPID )
|
||||
{
|
||||
LIB_ID oldFPID = aFootprint->GetFPID();
|
||||
wxString msg;
|
||||
|
@ -363,7 +363,7 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::processFootprint( MODULE* aFootprint, const LIB
|
|||
oldFPID.Format().c_str(),
|
||||
aNewFPID.Format().c_str() );
|
||||
|
||||
MODULE* newFootprint = m_parent->LoadFootprint( aNewFPID );
|
||||
FOOTPRINT* newFootprint = m_parent->LoadFootprint( aNewFPID );
|
||||
|
||||
if( !newFootprint )
|
||||
{
|
||||
|
@ -411,7 +411,7 @@ void processTextItem( const FP_TEXT& aSrc, FP_TEXT& aDest,
|
|||
}
|
||||
|
||||
|
||||
FP_TEXT* getMatchingTextItem( FP_TEXT* aRefItem, MODULE* aFootprint )
|
||||
FP_TEXT* getMatchingTextItem( FP_TEXT* aRefItem, FOOTPRINT* aFootprint )
|
||||
{
|
||||
std::vector<FP_TEXT*> candidates;
|
||||
|
||||
|
@ -459,10 +459,10 @@ FP_TEXT* getMatchingTextItem( FP_TEXT* aRefItem, MODULE* aFootprint )
|
|||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::ExchangeFootprint( MODULE* aExisting, MODULE* aNew, BOARD_COMMIT& aCommit,
|
||||
bool deleteExtraTexts, bool resetTextLayers,
|
||||
bool resetTextEffects, bool resetFabricationAttrs,
|
||||
bool reset3DModels )
|
||||
void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew,
|
||||
BOARD_COMMIT& aCommit, bool deleteExtraTexts,
|
||||
bool resetTextLayers, bool resetTextEffects,
|
||||
bool resetFabricationAttrs, bool reset3DModels )
|
||||
{
|
||||
PCB_GROUP* parentGroup = aExisting->GetParentGroup();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <board_commit.h>
|
||||
|
||||
class PCB_EDIT_FRAME;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class LIB_ID;
|
||||
|
||||
class DIALOG_EXCHANGE_FOOTPRINTS : public DIALOG_EXCHANGE_FOOTPRINTS_BASE
|
||||
|
@ -38,12 +38,12 @@ class DIALOG_EXCHANGE_FOOTPRINTS : public DIALOG_EXCHANGE_FOOTPRINTS_BASE
|
|||
private:
|
||||
BOARD_COMMIT m_commit;
|
||||
PCB_EDIT_FRAME* m_parent;
|
||||
MODULE* m_currentFootprint;
|
||||
FOOTPRINT* m_currentFootprint;
|
||||
bool m_updateMode;
|
||||
int* m_matchMode;
|
||||
|
||||
public:
|
||||
DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent, MODULE* aFootprint, bool updateMode,
|
||||
DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent, FOOTPRINT* aFootprint, bool updateMode,
|
||||
bool selectedMode );
|
||||
~DIALOG_EXCHANGE_FOOTPRINTS() override;
|
||||
|
||||
|
@ -59,9 +59,9 @@ private:
|
|||
|
||||
wxRadioButton* getRadioButtonForMode();
|
||||
|
||||
bool isMatch( MODULE* );
|
||||
bool isMatch( FOOTPRINT* );
|
||||
bool processMatchingFootprints();
|
||||
bool processFootprint( MODULE* aFootprint, const LIB_ID& aNewFPID );
|
||||
bool processFootprint( FOOTPRINT* aFootprint, const LIB_ID& aNewFPID );
|
||||
};
|
||||
|
||||
#endif // DIALOG_EXCHANGE_FOOTPRINTS_H_
|
||||
|
|
|
@ -220,7 +220,7 @@ void DIALOG_FIND::search( bool aDirection )
|
|||
|
||||
if( FindIncludeTexts || FindIncludeValues || FindIncludeReferences )
|
||||
{
|
||||
for( MODULE* fp : m_frame->GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : m_frame->GetBoard()->Footprints() )
|
||||
{
|
||||
if( ( fp->Reference().Matches( m_frame->GetFindReplaceData(), nullptr )
|
||||
&& FindIncludeReferences )
|
||||
|
|
|
@ -51,7 +51,7 @@ int DIALOG_FOOTPRINT_PROPERTIES::m_page = 0; // remember the last open page
|
|||
|
||||
|
||||
DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent,
|
||||
MODULE* aFootprint ) :
|
||||
FOOTPRINT* aFootprint ) :
|
||||
DIALOG_FOOTPRINT_PROPERTIES_BASE( aParent ),
|
||||
m_posX( aParent, m_XPosLabel, m_ModPositionX, m_XPosUnit ),
|
||||
m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
|
||||
|
|
|
@ -42,7 +42,7 @@ class DIALOG_FOOTPRINT_PROPERTIES: public DIALOG_FOOTPRINT_PROPERTIES_BASE
|
|||
{
|
||||
private:
|
||||
PCB_EDIT_FRAME* m_frame;
|
||||
MODULE* m_footprint;
|
||||
FOOTPRINT* m_footprint;
|
||||
|
||||
static int m_page; // remember the last open page during session
|
||||
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
public:
|
||||
// Constructor and destructor
|
||||
DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent, MODULE* aFootprint );
|
||||
DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent, FOOTPRINT* aFootprint );
|
||||
~DIALOG_FOOTPRINT_PROPERTIES() override;
|
||||
|
||||
bool Validate() override;
|
||||
|
|
|
@ -139,7 +139,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
|
|||
m_microViasCount = 0;
|
||||
m_blindOrBuriedViasCount = 0;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -170,7 +170,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete()
|
|||
|
||||
if( delAll || m_DelModules->GetValue() )
|
||||
{
|
||||
for( MODULE* item : pcb->Footprints() )
|
||||
for( FOOTPRINT* item : pcb->Footprints() )
|
||||
{
|
||||
bool del_fp = delAll;
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( BOARD_COMMIT& aCommit, BOA
|
|||
|
||||
if( m_referenceFilterOpt->GetValue() && !m_referenceFilter->GetValue().IsEmpty() )
|
||||
{
|
||||
MODULE* fp = dynamic_cast<MODULE*>( aItem->GetParent() );
|
||||
FOOTPRINT* fp = dynamic_cast<FOOTPRINT*>( aItem->GetParent() );
|
||||
|
||||
if( fp )
|
||||
{
|
||||
|
@ -354,7 +354,7 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( BOARD_COMMIT& aCommit, BOA
|
|||
|
||||
if( m_footprintFilterOpt->GetValue() && !m_footprintFilter->GetValue().IsEmpty() )
|
||||
{
|
||||
MODULE* fp = dynamic_cast<MODULE*>( aItem->GetParent() );
|
||||
FOOTPRINT* fp = dynamic_cast<FOOTPRINT*>( aItem->GetParent() );
|
||||
|
||||
if( fp )
|
||||
{
|
||||
|
@ -378,7 +378,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
|
|||
BOARD_COMMIT commit( m_parent );
|
||||
|
||||
// Go through the footprints
|
||||
for( MODULE* fp : m_parent->GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : m_parent->GetBoard()->Footprints() )
|
||||
{
|
||||
if( m_references->GetValue() )
|
||||
visitItem( commit, &fp->Reference() );
|
||||
|
|
|
@ -1154,7 +1154,7 @@ void DIALOG_NET_INSPECTOR::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardIt
|
|||
// resort to generic slower net update otherwise.
|
||||
updateNet( i->GetNet() );
|
||||
}
|
||||
else if( MODULE* footprint = dynamic_cast<MODULE*>( aBoardItem ) )
|
||||
else if( FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( aBoardItem ) )
|
||||
{
|
||||
for( const PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -1193,7 +1193,7 @@ void DIALOG_NET_INSPECTOR::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoard
|
|||
{
|
||||
m_data_model->deleteItem( m_data_model->findItem( net ) );
|
||||
}
|
||||
else if( MODULE* footprint = dynamic_cast<MODULE*>( aBoardItem ) )
|
||||
else if( FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( aBoardItem ) )
|
||||
{
|
||||
for( const PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -1244,7 +1244,7 @@ void DIALOG_NET_INSPECTOR::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoard
|
|||
void DIALOG_NET_INSPECTOR::OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem )
|
||||
{
|
||||
if( dynamic_cast<BOARD_CONNECTED_ITEM*>( aBoardItem ) != nullptr
|
||||
|| dynamic_cast<MODULE*>( aBoardItem ) != nullptr )
|
||||
|| dynamic_cast<FOOTPRINT*>( aBoardItem ) != nullptr )
|
||||
{
|
||||
buildNetsList();
|
||||
m_netsList->Refresh();
|
||||
|
@ -1471,7 +1471,7 @@ void DIALOG_NET_INSPECTOR::buildNetsList()
|
|||
// count the pads for each net. since the nets are sorted by netcode
|
||||
// iterating over the footprints' pads is faster.
|
||||
|
||||
for( MODULE* footprint : m_brd->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_brd->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <dialog_netlist_base.h>
|
||||
|
||||
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class NETLIST;
|
||||
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad
|
|||
m_nonCopperWarningIcon->SetBitmap( KiBitmap( dialog_warning_xpm ) );
|
||||
|
||||
m_padMaster = &m_parent->GetDesignSettings().m_Pad_Master;
|
||||
m_dummyPad = new PAD((MODULE*) NULL );
|
||||
m_dummyPad = new PAD( (FOOTPRINT*) NULL );
|
||||
|
||||
if( aPad )
|
||||
{
|
||||
|
@ -462,7 +462,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
|
|||
m_isFlipped = m_currentPad->IsFlipped();
|
||||
|
||||
// Diplay parent footprint info
|
||||
MODULE* footprint = m_currentPad->GetParent();
|
||||
FOOTPRINT* footprint = m_currentPad->GetParent();
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
|
@ -479,7 +479,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
|
|||
|
||||
if( m_currentPad )
|
||||
{
|
||||
MODULE* footprint = m_currentPad->GetParent();
|
||||
FOOTPRINT* footprint = m_currentPad->GetParent();
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
|
@ -1522,8 +1522,8 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
|
|||
m_currentPad->SetPosition( m_padMaster->GetPosition() );
|
||||
m_currentPad->SetOrientation( m_padMaster->GetOrientation() );
|
||||
|
||||
wxSize size;
|
||||
MODULE* footprint = m_currentPad->GetParent();
|
||||
wxSize size;
|
||||
FOOTPRINT* footprint = m_currentPad->GetParent();
|
||||
|
||||
m_currentPad->SetSize( m_padMaster->GetSize() );
|
||||
|
||||
|
|
|
@ -249,8 +249,8 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
|
|||
|
||||
if( m_item->Type() == PCB_FP_TEXT_T && m_fpText )
|
||||
{
|
||||
MODULE* footprint = dynamic_cast<MODULE*>( m_fpText->GetParent() );
|
||||
wxString msg;
|
||||
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( m_fpText->GetParent() );
|
||||
wxString msg;
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
|
|
|
@ -103,7 +103,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow()
|
|||
|
||||
if( item->Type() == PCB_FOOTPRINT_T && m_rbScope->GetSelection() == SCOPE_PADS )
|
||||
{
|
||||
MODULE* footprint = static_cast<MODULE*>( item );
|
||||
FOOTPRINT* footprint = static_cast<FOOTPRINT*>( item );
|
||||
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow()
|
|||
{
|
||||
if( m_rbScope->GetSelection() == SCOPE_PADS )
|
||||
{
|
||||
for( MODULE* footprint : m_frame->GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_frame->GetBoard()->Footprints() )
|
||||
{
|
||||
m_commit.Modify( footprint );
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ void DRC_ENGINE::loadImplicitRules()
|
|||
keepoutZones.push_back( zone );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( ZONE* zone : footprint->Zones() )
|
||||
{
|
||||
|
@ -659,7 +659,7 @@ void DRC_ENGINE::RunTests( EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aT
|
|||
for( ZONE* zone : m_board->Zones() )
|
||||
zone->CacheBoundingBox();
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( ZONE* zone : footprint->Zones() )
|
||||
zone->CacheBoundingBox();
|
||||
|
|
|
@ -228,7 +228,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
|
|||
}
|
||||
}
|
||||
|
||||
for( MODULE* footprint : brd->Footprints() )
|
||||
for( FOOTPRINT* footprint : brd->Footprints() )
|
||||
{
|
||||
if( typeMask[ PCB_FP_TEXT_T ] )
|
||||
{
|
||||
|
|
|
@ -127,7 +127,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
|
|||
m_zones.push_back( zone );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( ZONE* zone : footprint->Zones() )
|
||||
{
|
||||
|
@ -513,14 +513,14 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( )
|
|||
|
||||
size_t count = 0;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
count += footprint->Pads().size();
|
||||
|
||||
reportAux( "Testing %d pads...", count );
|
||||
|
||||
int ii = 0;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -82,7 +82,7 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions()
|
|||
|
||||
int ii = 0;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( !reportProgress( ii++, m_board->Footprints().size(), delta ) )
|
||||
return;
|
||||
|
@ -136,7 +136,7 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testOverlappingComponentCourtyards()
|
|||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_OVERLAPPING_FOOTPRINTS) )
|
||||
break;
|
||||
|
||||
MODULE* footprint = *it1;
|
||||
FOOTPRINT* footprint = *it1;
|
||||
SHAPE_POLY_SET& footprintFront = footprint->GetPolyCourtyardFront();
|
||||
SHAPE_POLY_SET& footprintBack = footprint->GetPolyCourtyardBack();
|
||||
|
||||
|
@ -145,7 +145,7 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testOverlappingComponentCourtyards()
|
|||
|
||||
for( auto it2 = it1 + 1; it2 != m_board->Footprints().end(); it2++ )
|
||||
{
|
||||
MODULE* test = *it2;
|
||||
FOOTPRINT* test = *it2;
|
||||
SHAPE_POLY_SET& testFront = test->GetPolyCourtyardFront();
|
||||
SHAPE_POLY_SET& testBack = test->GetPolyCourtyardBack();
|
||||
SHAPE_POLY_SET intersection;
|
||||
|
|
|
@ -196,7 +196,7 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run()
|
|||
via->SetFlags( SKIP_STRUCT );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -81,7 +81,7 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run()
|
|||
|
||||
m_board = m_drcEngine->GetBoard();
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_TOO_SMALL_DRILL ) )
|
||||
break;
|
||||
|
|
|
@ -80,15 +80,15 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist )
|
|||
{
|
||||
BOARD* board = m_drcEngine->GetBoard();
|
||||
|
||||
auto compare = []( const MODULE* x, const MODULE* y )
|
||||
auto compare = []( const FOOTPRINT* x, const FOOTPRINT* y )
|
||||
{
|
||||
return x->GetReference().CmpNoCase( y->GetReference() ) < 0;
|
||||
};
|
||||
|
||||
auto footprints = std::set<MODULE*, decltype( compare )>( compare );
|
||||
auto footprints = std::set<FOOTPRINT*, decltype( compare )>( compare );
|
||||
|
||||
// Search for duplicate footprints on the board
|
||||
for( MODULE* footprint : board->Footprints() )
|
||||
for( FOOTPRINT* footprint : board->Footprints() )
|
||||
{
|
||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_DUPLICATE_FOOTPRINT ) )
|
||||
break;
|
||||
|
@ -108,7 +108,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist )
|
|||
for( unsigned ii = 0; ii < aNetlist.GetCount(); ii++ )
|
||||
{
|
||||
COMPONENT* component = aNetlist.GetComponent( ii );
|
||||
MODULE* footprint = board->FindModuleByReference( component->GetReference() );
|
||||
FOOTPRINT* footprint = board->FindFootprintByReference( component->GetReference());
|
||||
|
||||
if( footprint == nullptr )
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist )
|
|||
}
|
||||
|
||||
// Search for component footprints found on board but not in netlist.
|
||||
for( MODULE* footprint : board->Footprints() )
|
||||
for( FOOTPRINT* footprint : board->Footprints() )
|
||||
{
|
||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_EXTRA_FOOTPRINT ) )
|
||||
break;
|
||||
|
|
|
@ -167,8 +167,8 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run()
|
|||
|
||||
if( refGraphic && testGraphic )
|
||||
{
|
||||
MODULE *refParentFP = dynamic_cast<MODULE*>( refGraphic->GetParent() );
|
||||
MODULE *testParentFP = dynamic_cast<MODULE*>( testGraphic->GetParent() );
|
||||
FOOTPRINT *refParentFP = dynamic_cast<FOOTPRINT*>( refGraphic->GetParent() );
|
||||
FOOTPRINT *testParentFP = dynamic_cast<FOOTPRINT*>( testGraphic->GetParent() );
|
||||
|
||||
if( refParentFP == testParentFP ) // also true when both are nullptr
|
||||
return true;
|
||||
|
|
|
@ -131,7 +131,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case PCB_FOOTPRINT_T:
|
||||
ShowFootprintPropertiesDialog( static_cast<MODULE*>( aItem ) );
|
||||
ShowFootprintPropertiesDialog( static_cast<FOOTPRINT*>( aItem ) );
|
||||
break;
|
||||
|
||||
case PCB_TARGET_T:
|
||||
|
|
|
@ -94,7 +94,7 @@ static void build_pad_testpoints( BOARD *aPcb, std::vector <D356_RECORD>& aRecor
|
|||
{
|
||||
wxPoint origin = aPcb->GetDesignSettings().m_AuxOrigin;
|
||||
|
||||
for( MODULE* footprint : aPcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : aPcb->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ bool RecreateCmpFile( BOARD * aBrd, const wxString& aFullCmpFileName )
|
|||
|
||||
fprintf( cmpFile, "Cmp-Mod V01 Created by PcbNew date = %s\n", TO_UTF8( DateAndTime() ) );
|
||||
|
||||
for( MODULE* fp : aBrd->Footprints() )
|
||||
for( FOOTPRINT* fp : aBrd->Footprints() )
|
||||
{
|
||||
fprintf( cmpFile, "\nBeginCmp\n" );
|
||||
fprintf( cmpFile, "TimeStamp = %s\n", TO_UTF8( fp->m_Uuid.AsString() ) );
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
class LIST_MOD // An helper class used to build a list of useful footprints.
|
||||
{
|
||||
public:
|
||||
MODULE* m_Footprint; // Link to the actual footprint
|
||||
FOOTPRINT* m_Footprint; // Link to the actual footprint
|
||||
wxString m_Reference; // Its schematic reference
|
||||
wxString m_Value; // Its schematic value
|
||||
LAYER_NUM m_Layer; // its side (B_Cu, or F_Cu)
|
||||
|
@ -113,7 +113,7 @@ std::string PLACE_FILE_EXPORTER::GenPositionData()
|
|||
// Build and sort the list of footprints alphabetically
|
||||
std::vector<LIST_MOD> list;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( m_side != PCB_BOTH_SIDES )
|
||||
{
|
||||
|
@ -303,18 +303,18 @@ std::string PLACE_FILE_EXPORTER::GenReportData()
|
|||
|
||||
buffer += "$EndBOARD\n\n";
|
||||
|
||||
std::vector<MODULE*> sortedFootprints;
|
||||
std::vector<FOOTPRINT*> sortedFootprints;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
sortedFootprints.push_back( footprint );
|
||||
|
||||
std::sort( sortedFootprints.begin(), sortedFootprints.end(),
|
||||
[]( MODULE* a, MODULE* b ) -> bool
|
||||
[]( FOOTPRINT* a, FOOTPRINT* b ) -> bool
|
||||
{
|
||||
return StrNumCmp( a->GetReference(), b->GetReference(), true ) < 0;
|
||||
});
|
||||
|
||||
for( MODULE* footprint : sortedFootprints )
|
||||
for( FOOTPRINT* footprint : sortedFootprints )
|
||||
{
|
||||
wxString ref = footprint->Reference().GetShownText();
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static void CreateRoutesSection( FILE* aFile, BOARD* aPcb );
|
|||
static void CreateSignalsSection( FILE* aFile, BOARD* aPcb );
|
||||
static void CreateShapesSection( FILE* aFile, BOARD* aPcb );
|
||||
static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb );
|
||||
static void FootprintWriteShape( FILE* File, MODULE* aFootprint, const wxString& aShapeName );
|
||||
static void FootprintWriteShape( FILE* File, FOOTPRINT* aFootprint, const wxString& aShapeName );
|
||||
|
||||
// layer names for Gencad export
|
||||
|
||||
|
@ -181,10 +181,10 @@ static bool storeOriginCoords;
|
|||
static int GencadOffsetX, GencadOffsetY;
|
||||
|
||||
// Association between shape names (using shapeName index) and components
|
||||
static std::map<MODULE*, int> componentShapes;
|
||||
static std::map<FOOTPRINT*, int> componentShapes;
|
||||
static std::map<int, wxString> shapeNames;
|
||||
|
||||
static const wxString getShapeName( MODULE* aFootprint )
|
||||
static const wxString getShapeName( FOOTPRINT* aFootprint )
|
||||
{
|
||||
static const wxString invalid( "invalid" );
|
||||
|
||||
|
@ -275,7 +275,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
|
|||
*/
|
||||
BOARD* pcb = GetBoard();
|
||||
|
||||
for( MODULE* footprint : pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : pcb->Footprints() )
|
||||
{
|
||||
footprint->SetFlag( 0 );
|
||||
|
||||
|
@ -311,7 +311,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
|
|||
fclose( file );
|
||||
|
||||
// Undo the footprints modifications (flipped footprints)
|
||||
for( MODULE* footprint : pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : pcb->Footprints() )
|
||||
{
|
||||
if( footprint->GetFlag() )
|
||||
{
|
||||
|
@ -664,17 +664,16 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
|
||||
|
||||
/// Compute hashes for footprints without taking into account their position, rotation or layer
|
||||
static size_t hashModule( const MODULE* aFootprint )
|
||||
static size_t hashFootprint( const FOOTPRINT* aFootprint )
|
||||
{
|
||||
size_t ret = 0x11223344;
|
||||
size_t ret = 0x11223344;
|
||||
constexpr int flags = HASH_FLAGS::HASH_POS | HASH_FLAGS::REL_COORD
|
||||
| HASH_FLAGS::HASH_ROT | HASH_FLAGS::HASH_LAYER;
|
||||
| HASH_FLAGS::HASH_ROT | HASH_FLAGS::HASH_LAYER;
|
||||
|
||||
|
||||
for( auto i : aFootprint->GraphicalItems() )
|
||||
for( BOARD_ITEM* i : aFootprint->GraphicalItems() )
|
||||
ret += hash_eda( i, flags );
|
||||
|
||||
for( auto i : aFootprint->Pads() )
|
||||
for( PAD* i : aFootprint->Pads() )
|
||||
ret += hash_eda( i, flags );
|
||||
|
||||
return ret;
|
||||
|
@ -694,7 +693,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
|
||||
fputs( "$SHAPES\n", aFile );
|
||||
|
||||
for( MODULE* footprint : aPcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : aPcb->Footprints() )
|
||||
{
|
||||
if( !individualShapes )
|
||||
{
|
||||
|
@ -705,7 +704,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
wxString shapeName = footprint->GetFPID().Format();
|
||||
|
||||
auto shapeIt = shapes.find( shapeName );
|
||||
size_t modHash = hashModule( footprint );
|
||||
size_t modHash = hashFootprint( footprint );
|
||||
|
||||
if( shapeIt != shapes.end() )
|
||||
{
|
||||
|
@ -807,7 +806,7 @@ static void CreateComponentsSection( FILE* aFile, BOARD* aPcb )
|
|||
|
||||
int cu_count = aPcb->GetCopperLayerCount();
|
||||
|
||||
for( MODULE* footprint : aPcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : aPcb->Footprints() )
|
||||
{
|
||||
const char* mirror;
|
||||
const char* flip;
|
||||
|
@ -898,7 +897,7 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
|
|||
fputs( TO_UTF8( msg ), aFile );
|
||||
fputs( "\n", aFile );
|
||||
|
||||
for( MODULE* footprint : aPcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : aPcb->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -1065,7 +1064,7 @@ static void CreateDevicesSection( FILE* aFile, BOARD* aPcb )
|
|||
if( !newDevice ) // do not repeat device definitions
|
||||
continue;
|
||||
|
||||
const MODULE* footprint = componentShape.first;
|
||||
const FOOTPRINT* footprint = componentShape.first;
|
||||
|
||||
fprintf( aFile, "\nDEVICE \"DEV_%s\"\n", TO_UTF8( escapeString( shapeName ) ) );
|
||||
|
||||
|
@ -1142,7 +1141,7 @@ static void CreateTracksInfoData( FILE* aFile, BOARD* aPcb )
|
|||
* It's almost guaranteed that the silk layer will be imported wrong but
|
||||
* the shape also contains the pads!
|
||||
*/
|
||||
static void FootprintWriteShape( FILE* aFile, MODULE* aFootprint, const wxString& aShapeName )
|
||||
static void FootprintWriteShape( FILE* aFile, FOOTPRINT* aFootprint, const wxString& aShapeName )
|
||||
{
|
||||
FP_SHAPE* shape;
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ bool HYPERLYNX_EXPORTER::writeDevices()
|
|||
{
|
||||
m_out->Print( 0, "{DEVICES\n" );
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
wxString ref = footprint->GetReference();
|
||||
wxString layerName = m_board->GetLayerName( footprint->GetLayer() );
|
||||
|
@ -402,7 +402,7 @@ bool HYPERLYNX_EXPORTER::writeDevices()
|
|||
|
||||
bool HYPERLYNX_EXPORTER::writePadStacks()
|
||||
{
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
@ -546,9 +546,9 @@ const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcod
|
|||
return false;
|
||||
};
|
||||
|
||||
for( MODULE* mod : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : mod->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
if( check( pad ) )
|
||||
rv.push_back( pad );
|
||||
|
|
|
@ -273,7 +273,7 @@ UseBoundingBox:
|
|||
* compiles data for the PLACEMENT section and compiles data for
|
||||
* the library ELECTRICAL section.
|
||||
*/
|
||||
static void idf_export_footprint( BOARD* aPcb, MODULE* aFootprint, IDF3_BOARD& aIDFBoard )
|
||||
static void idf_export_footprint( BOARD* aPcb, FOOTPRINT* aFootprint, IDF3_BOARD& aIDFBoard )
|
||||
{
|
||||
// Reference Designator
|
||||
std::string crefdes = TO_UTF8( aFootprint->Reference().GetShownText() );
|
||||
|
@ -616,7 +616,7 @@ bool PCB_EDIT_FRAME::Export_IDF3( BOARD* aPcb, const wxString& aFullFileName,
|
|||
idf_export_outline( aPcb, idfBoard );
|
||||
|
||||
// Output the drill holes and footprint (library) data.
|
||||
for( MODULE* footprint : aPcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : aPcb->Footprints() )
|
||||
idf_export_footprint( aPcb, footprint, idfBoard );
|
||||
|
||||
if( !idfBoard.WriteFile( aFullFileName, idfUnit, false ) )
|
||||
|
|
|
@ -1069,7 +1069,7 @@ static void export_vrml_fp_text( FP_TEXT* item )
|
|||
}
|
||||
|
||||
|
||||
static void export_vrml_fp_shape( MODEL_VRML& aModel, FP_SHAPE* aOutline, MODULE* aFootprint )
|
||||
static void export_vrml_fp_shape( MODEL_VRML& aModel, FP_SHAPE* aOutline, FOOTPRINT* aFootprint )
|
||||
{
|
||||
LAYER_NUM layer = aOutline->GetLayer();
|
||||
double x = aOutline->GetStart().x * BOARD_SCALE;
|
||||
|
@ -1361,7 +1361,7 @@ static void compose_quat( double q1[4], double q2[4], double qr[4] )
|
|||
}
|
||||
|
||||
|
||||
static void export_vrml_footprint( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aFootprint,
|
||||
static void export_vrml_footprint( MODEL_VRML& aModel, BOARD* aPcb, FOOTPRINT* aFootprint,
|
||||
std::ostream* aOutputFile )
|
||||
{
|
||||
if( !aModel.m_plainPCB )
|
||||
|
@ -1655,7 +1655,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
|
|||
output_file << " children [\n";
|
||||
|
||||
// Export footprints
|
||||
for( MODULE* footprint : pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : pcb->Footprints() )
|
||||
export_vrml_footprint( model3d, pcb, footprint, &output_file );
|
||||
|
||||
// write out the board and all layers
|
||||
|
@ -1669,7 +1669,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
|
|||
else
|
||||
{
|
||||
// Export footprints
|
||||
for( MODULE* footprint : pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : pcb->Footprints() )
|
||||
export_vrml_footprint( model3d, pcb, footprint, NULL );
|
||||
|
||||
// write out the board and all layers
|
||||
|
|
|
@ -119,7 +119,7 @@ void GENDRILL_WRITER_BASE::buildHolesList( DRILL_LAYER_PAIR aLayerPair,
|
|||
if( aLayerPair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
|
||||
{
|
||||
// add holes for thru hole pads
|
||||
for( MODULE* footprint : m_pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_pcb->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -464,7 +464,7 @@ void GERBER_JOBFILE_WRITER::addJSONDesignRules()
|
|||
int minPadClearanceOuter = defaultNC.GetClearance();
|
||||
int minPadClearanceInner = defaultNC.GetClearance();
|
||||
|
||||
for( MODULE* footprint : m_pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_pcb->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
|
|
|
@ -65,9 +65,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
m_offset = m_pcb->GetDesignSettings().m_AuxOrigin;
|
||||
|
||||
// Collect footprints on the right layer
|
||||
std::vector<MODULE*> fp_list;
|
||||
std::vector<FOOTPRINT*> fp_list;
|
||||
|
||||
for( MODULE* footprint : m_pcb->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_pcb->Footprints() )
|
||||
{
|
||||
if( footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES )
|
||||
continue;
|
||||
|
@ -124,7 +124,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
bool allowUtf8 = true;
|
||||
|
||||
// Plot components data: position, outlines, pad1 and other pads.
|
||||
for( MODULE* footprint : fp_list )
|
||||
for( FOOTPRINT* footprint : fp_list )
|
||||
{
|
||||
// Manage the aperture attribute component position:
|
||||
GBR_METADATA gbr_metadata;
|
||||
|
@ -299,7 +299,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
brd_plotter.PlotBoardGraphicItems();
|
||||
|
||||
// Draw footprint other graphic items:
|
||||
for( MODULE* footprint : fp_list )
|
||||
for( FOOTPRINT* footprint : fp_list )
|
||||
{
|
||||
for( BOARD_ITEM* item : footprint->GraphicalItems() )
|
||||
{
|
||||
|
@ -324,7 +324,7 @@ double PLACEFILE_GERBER_WRITER::mapRotationAngle( double aAngle )
|
|||
}
|
||||
|
||||
|
||||
void PLACEFILE_GERBER_WRITER::findPads1( std::vector<PAD*>& aPadList, MODULE* aFootprint ) const
|
||||
void PLACEFILE_GERBER_WRITER::findPads1( std::vector<PAD*>& aPadList, FOOTPRINT* aFootprint ) const
|
||||
{
|
||||
// Fint the pad "1" or pad "A1"
|
||||
// this is possible only if only one pad is found
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <wx/gdicmn.h>
|
||||
|
||||
class BOARD;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class PAD;
|
||||
|
||||
/**
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
* @param aPadList is the list to fill
|
||||
* @param aFootprint is the footprint to test
|
||||
*/
|
||||
void findPads1( std::vector<PAD*>& aPadList, MODULE* aFootprint ) const;
|
||||
void findPads1( std::vector<PAD*>& aPadList, FOOTPRINT* aFootprint ) const;
|
||||
};
|
||||
|
||||
#endif // #ifndef PLACEFILE_GERBER_WRITER_H
|
||||
|
|
|
@ -1104,7 +1104,7 @@ bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
|
|||
|
||||
|
||||
// Update footprint LIB_IDs to point to the just imported Eagle library
|
||||
for( MODULE* footprint : GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
|
||||
{
|
||||
LIB_ID libId = footprint->GetFPID();
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <convert_drawsegment_list_to_polygon.h>
|
||||
|
||||
|
||||
MODULE::MODULE( BOARD* parent ) :
|
||||
FOOTPRINT::FOOTPRINT( BOARD* parent ) :
|
||||
BOARD_ITEM_CONTAINER((BOARD_ITEM*) parent, PCB_FOOTPRINT_T ),
|
||||
m_initial_comments( 0 )
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ MODULE::MODULE( BOARD* parent ) :
|
|||
}
|
||||
|
||||
|
||||
MODULE::MODULE( const MODULE& aFootprint ) :
|
||||
FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) :
|
||||
BOARD_ITEM_CONTAINER( aFootprint )
|
||||
{
|
||||
m_pos = aFootprint.m_pos;
|
||||
|
@ -164,14 +164,14 @@ MODULE::MODULE( const MODULE& aFootprint ) :
|
|||
}
|
||||
|
||||
|
||||
MODULE::MODULE( MODULE&& aFootprint ) :
|
||||
FOOTPRINT::FOOTPRINT( FOOTPRINT&& aFootprint ) :
|
||||
BOARD_ITEM_CONTAINER( aFootprint )
|
||||
{
|
||||
*this = std::move( aFootprint );
|
||||
}
|
||||
|
||||
|
||||
MODULE::~MODULE()
|
||||
FOOTPRINT::~FOOTPRINT()
|
||||
{
|
||||
// Clean up the owned elements
|
||||
delete m_reference;
|
||||
|
@ -200,7 +200,7 @@ MODULE::~MODULE()
|
|||
}
|
||||
|
||||
|
||||
MODULE& MODULE::operator=( MODULE&& aOther )
|
||||
FOOTPRINT& FOOTPRINT::operator=( FOOTPRINT&& aOther )
|
||||
{
|
||||
BOARD_ITEM::operator=( aOther );
|
||||
|
||||
|
@ -295,7 +295,7 @@ MODULE& MODULE::operator=( MODULE&& aOther )
|
|||
}
|
||||
|
||||
|
||||
MODULE& MODULE::operator=( const MODULE& aOther )
|
||||
FOOTPRINT& FOOTPRINT::operator=( const FOOTPRINT& aOther )
|
||||
{
|
||||
BOARD_ITEM::operator=( aOther );
|
||||
|
||||
|
@ -394,7 +394,7 @@ MODULE& MODULE::operator=( const MODULE& aOther )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::GetContextualTextVars( wxArrayString* aVars ) const
|
||||
void FOOTPRINT::GetContextualTextVars( wxArrayString* aVars ) const
|
||||
{
|
||||
aVars->push_back( wxT( "REFERENCE" ) );
|
||||
aVars->push_back( wxT( "VALUE" ) );
|
||||
|
@ -402,7 +402,7 @@ void MODULE::GetContextualTextVars( wxArrayString* aVars ) const
|
|||
}
|
||||
|
||||
|
||||
bool MODULE::ResolveTextVar( wxString* token, int aDepth ) const
|
||||
bool FOOTPRINT::ResolveTextVar( wxString* token, int aDepth ) const
|
||||
{
|
||||
if( token->IsSameAs( wxT( "REFERENCE" ) ) )
|
||||
{
|
||||
|
@ -429,7 +429,7 @@ bool MODULE::ResolveTextVar( wxString* token, int aDepth ) const
|
|||
}
|
||||
|
||||
|
||||
void MODULE::ClearAllNets()
|
||||
void FOOTPRINT::ClearAllNets()
|
||||
{
|
||||
// Force the ORPHANED dummy net info for all pads.
|
||||
// ORPHANED dummy net does not depend on a board
|
||||
|
@ -438,7 +438,7 @@ void MODULE::ClearAllNets()
|
|||
}
|
||||
|
||||
|
||||
void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
||||
void FOOTPRINT::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
||||
{
|
||||
switch( aBoardItem->Type() )
|
||||
{
|
||||
|
@ -491,7 +491,7 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::Remove( BOARD_ITEM* aBoardItem )
|
||||
void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem )
|
||||
{
|
||||
switch( aBoardItem->Type() )
|
||||
{
|
||||
|
@ -561,13 +561,13 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::CalculateBoundingBox()
|
||||
void FOOTPRINT::CalculateBoundingBox()
|
||||
{
|
||||
m_boundingBox = GetFootprintRect();
|
||||
}
|
||||
|
||||
|
||||
double MODULE::GetArea( int aPadding ) const
|
||||
double FOOTPRINT::GetArea( int aPadding ) const
|
||||
{
|
||||
double w = std::abs( static_cast<double>( m_boundingBox.GetWidth() ) ) + aPadding;
|
||||
double h = std::abs( static_cast<double>( m_boundingBox.GetHeight() ) ) + aPadding;
|
||||
|
@ -575,7 +575,7 @@ double MODULE::GetArea( int aPadding ) const
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT MODULE::GetFootprintRect() const
|
||||
EDA_RECT FOOTPRINT::GetFootprintRect() const
|
||||
{
|
||||
EDA_RECT area;
|
||||
|
||||
|
@ -601,13 +601,13 @@ EDA_RECT MODULE::GetFootprintRect() const
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT MODULE::GetFpPadsLocalBbox() const
|
||||
EDA_RECT FOOTPRINT::GetFpPadsLocalBbox() const
|
||||
{
|
||||
EDA_RECT area;
|
||||
|
||||
// We want the bounding box of the footprint pads at rot 0, not flipped
|
||||
// Create such a image:
|
||||
MODULE dummy( *this );
|
||||
FOOTPRINT dummy( *this );
|
||||
|
||||
dummy.SetPosition( wxPoint( 0, 0 ) );
|
||||
|
||||
|
@ -624,13 +624,13 @@ EDA_RECT MODULE::GetFpPadsLocalBbox() const
|
|||
}
|
||||
|
||||
|
||||
const EDA_RECT MODULE::GetBoundingBox() const
|
||||
const EDA_RECT FOOTPRINT::GetBoundingBox() const
|
||||
{
|
||||
return GetBoundingBox( true );
|
||||
}
|
||||
|
||||
|
||||
const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const
|
||||
const EDA_RECT FOOTPRINT::GetBoundingBox( bool aIncludeInvisibleText ) const
|
||||
{
|
||||
EDA_RECT area = GetFootprintRect();
|
||||
|
||||
|
@ -687,13 +687,12 @@ const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const
|
|||
* We should consider doing that instead at some point in the future if we can
|
||||
* use a performant algorithm and cache the result to avoid extra computing.
|
||||
*/
|
||||
SHAPE_POLY_SET MODULE::GetBoundingPoly() const
|
||||
SHAPE_POLY_SET FOOTPRINT::GetBoundingPoly() const
|
||||
{
|
||||
SHAPE_POLY_SET poly;
|
||||
double orientation = GetOrientationRadians();
|
||||
FOOTPRINT temp = *this;
|
||||
|
||||
double orientation = GetOrientationRadians();
|
||||
|
||||
MODULE temp = *this;
|
||||
temp.SetOrientation( 0.0 );
|
||||
BOX2I area = temp.GetFootprintRect();
|
||||
|
||||
|
@ -722,7 +721,7 @@ SHAPE_POLY_SET MODULE::GetBoundingPoly() const
|
|||
}
|
||||
|
||||
|
||||
void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void FOOTPRINT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg, msg2;
|
||||
|
||||
|
@ -790,20 +789,20 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM
|
|||
}
|
||||
|
||||
|
||||
bool MODULE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||
bool FOOTPRINT::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||
{
|
||||
EDA_RECT rect = m_boundingBox;//.GetBoundingBoxRotated( GetPosition(), m_Orient );
|
||||
return rect.Inflate( aAccuracy ).Contains( aPosition );
|
||||
}
|
||||
|
||||
|
||||
bool MODULE::HitTestAccurate( const wxPoint& aPosition, int aAccuracy ) const
|
||||
bool FOOTPRINT::HitTestAccurate( const wxPoint& aPosition, int aAccuracy ) const
|
||||
{
|
||||
return GetBoundingPoly().Collide( aPosition, aAccuracy );
|
||||
}
|
||||
|
||||
|
||||
bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
|
||||
bool FOOTPRINT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
|
||||
{
|
||||
EDA_RECT arect = aRect;
|
||||
arect.Inflate( aAccuracy );
|
||||
|
@ -816,7 +815,7 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
|
|||
if( !aRect.Intersects( GetBoundingBox() ) )
|
||||
return false;
|
||||
|
||||
// Determine if any elements in the MODULE intersect the rect
|
||||
// Determine if any elements in the FOOTPRINT intersect the rect
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->HitTest( arect, false, 0 ) )
|
||||
|
@ -843,7 +842,7 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
|
|||
}
|
||||
|
||||
|
||||
PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
||||
PAD* FOOTPRINT::FindPadByName( const wxString& aPadName ) const
|
||||
{
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
|
@ -855,7 +854,7 @@ PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
|||
}
|
||||
|
||||
|
||||
PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
||||
PAD* FOOTPRINT::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
||||
{
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
|
@ -871,7 +870,7 @@ PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
|||
}
|
||||
|
||||
|
||||
PAD* MODULE::GetTopLeftPad()
|
||||
PAD* FOOTPRINT::GetTopLeftPad()
|
||||
{
|
||||
PAD* topLeftPad = GetFirstPad();
|
||||
|
||||
|
@ -890,7 +889,7 @@ PAD* MODULE::GetTopLeftPad()
|
|||
}
|
||||
|
||||
|
||||
unsigned MODULE::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
||||
unsigned FOOTPRINT::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
||||
{
|
||||
if( aIncludeNPTH )
|
||||
return m_pads.size();
|
||||
|
@ -909,7 +908,7 @@ unsigned MODULE::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
}
|
||||
|
||||
|
||||
unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
||||
unsigned FOOTPRINT::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
||||
{
|
||||
std::set<wxString> usedNames;
|
||||
|
||||
|
@ -942,7 +941,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
}
|
||||
|
||||
|
||||
void MODULE::Add3DModel( FP_3DMODEL* a3DModel )
|
||||
void FOOTPRINT::Add3DModel( FP_3DMODEL* a3DModel )
|
||||
{
|
||||
if( NULL == a3DModel )
|
||||
return;
|
||||
|
@ -955,7 +954,7 @@ void MODULE::Add3DModel( FP_3DMODEL* a3DModel )
|
|||
|
||||
|
||||
// see footprint.h
|
||||
SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
|
||||
SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
|
||||
{
|
||||
KICAD_T stype;
|
||||
SEARCH_RESULT result = SEARCH_RESULT::CONTINUE;
|
||||
|
@ -998,7 +997,7 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
|
|||
if( result == SEARCH_RESULT::QUIT )
|
||||
break;
|
||||
|
||||
// Intentionally fall through since m_Drawings can hold TYPETEXTMODULE also
|
||||
// Intentionally fall through since m_Drawings can hold PCB_FP_SHAPE_T also
|
||||
KI_FALLTHROUGH;
|
||||
|
||||
case PCB_FP_SHAPE_T:
|
||||
|
@ -1040,7 +1039,7 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
|
|||
}
|
||||
|
||||
|
||||
wxString MODULE::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
wxString FOOTPRINT::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
{
|
||||
wxString reference = GetReference();
|
||||
|
||||
|
@ -1051,19 +1050,19 @@ wxString MODULE::GetSelectMenuText( EDA_UNITS aUnits ) const
|
|||
}
|
||||
|
||||
|
||||
BITMAP_DEF MODULE::GetMenuImage() const
|
||||
BITMAP_DEF FOOTPRINT::GetMenuImage() const
|
||||
{
|
||||
return module_xpm;
|
||||
}
|
||||
|
||||
|
||||
EDA_ITEM* MODULE::Clone() const
|
||||
EDA_ITEM* FOOTPRINT::Clone() const
|
||||
{
|
||||
return new MODULE( *this );
|
||||
return new FOOTPRINT( *this );
|
||||
}
|
||||
|
||||
|
||||
void MODULE::RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const
|
||||
void FOOTPRINT::RunOnChildren( const std::function<void ( BOARD_ITEM*)>& aFunction ) const
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1084,12 +1083,12 @@ void MODULE::RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction )
|
|||
}
|
||||
catch( std::bad_function_call& )
|
||||
{
|
||||
wxFAIL_MSG( "Error running MODULE::RunOnChildren" );
|
||||
wxFAIL_MSG( "Error running FOOTPRINT::RunOnChildren" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads ) const
|
||||
void FOOTPRINT::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads ) const
|
||||
{
|
||||
std::unordered_set<int> layers;
|
||||
|
||||
|
@ -1116,7 +1115,7 @@ void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads
|
|||
}
|
||||
|
||||
|
||||
void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
void FOOTPRINT::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 2;
|
||||
aLayers[0] = LAYER_ANCHOR;
|
||||
|
@ -1162,7 +1161,7 @@ void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
}
|
||||
|
||||
|
||||
double MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||
double FOOTPRINT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||
{
|
||||
int layer = ( m_Layer == F_Cu ) ? LAYER_MOD_FR :
|
||||
( m_Layer == B_Cu ) ? LAYER_MOD_BK : LAYER_ANCHOR;
|
||||
|
@ -1179,7 +1178,7 @@ double MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
}
|
||||
|
||||
|
||||
const BOX2I MODULE::ViewBBox() const
|
||||
const BOX2I FOOTPRINT::ViewBBox() const
|
||||
{
|
||||
EDA_RECT area = GetFootprintRect();
|
||||
|
||||
|
@ -1200,7 +1199,7 @@ const BOX2I MODULE::ViewBBox() const
|
|||
}
|
||||
|
||||
|
||||
bool MODULE::IsLibNameValid( const wxString & aName )
|
||||
bool FOOTPRINT::IsLibNameValid( const wxString & aName )
|
||||
{
|
||||
const wxChar * invalids = StringLibNameInvalidChars( false );
|
||||
|
||||
|
@ -1211,7 +1210,7 @@ bool MODULE::IsLibNameValid( const wxString & aName )
|
|||
}
|
||||
|
||||
|
||||
const wxChar* MODULE::StringLibNameInvalidChars( bool aUserReadable )
|
||||
const wxChar* FOOTPRINT::StringLibNameInvalidChars( bool aUserReadable )
|
||||
{
|
||||
// This list of characters is also duplicated in validators.cpp and
|
||||
// lib_id.cpp
|
||||
|
@ -1226,14 +1225,14 @@ const wxChar* MODULE::StringLibNameInvalidChars( bool aUserReadable )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::Move( const wxPoint& aMoveVector )
|
||||
void FOOTPRINT::Move( const wxPoint& aMoveVector )
|
||||
{
|
||||
wxPoint newpos = m_pos + aMoveVector;
|
||||
SetPosition( newpos );
|
||||
}
|
||||
|
||||
|
||||
void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||
void FOOTPRINT::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||
{
|
||||
double orientation = GetOrientation();
|
||||
double newOrientation = orientation + aAngle;
|
||||
|
@ -1255,7 +1254,7 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
||||
void FOOTPRINT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
||||
{
|
||||
// Move footprint to its final position:
|
||||
wxPoint finalPos = m_pos;
|
||||
|
@ -1320,7 +1319,7 @@ void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::SetPosition( const wxPoint& aPos )
|
||||
void FOOTPRINT::SetPosition( const wxPoint& aPos )
|
||||
{
|
||||
wxPoint delta = aPos - m_pos;
|
||||
|
||||
|
@ -1363,7 +1362,7 @@ void MODULE::SetPosition( const wxPoint& aPos )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
|
||||
void FOOTPRINT::MoveAnchorPosition( const wxPoint& aMoveVector )
|
||||
{
|
||||
/* Move the reference point of the footprint
|
||||
* the footprints elements (pads, outlines, edges .. ) are moved
|
||||
|
@ -1420,7 +1419,7 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
|
|||
}
|
||||
|
||||
|
||||
void MODULE::SetOrientation( double aNewAngle )
|
||||
void FOOTPRINT::SetOrientation( double aNewAngle )
|
||||
{
|
||||
double angleChange = aNewAngle - m_orient; // change in rotation
|
||||
|
||||
|
@ -1458,9 +1457,9 @@ void MODULE::SetOrientation( double aNewAngle )
|
|||
}
|
||||
|
||||
|
||||
BOARD_ITEM* MODULE::Duplicate() const
|
||||
BOARD_ITEM* FOOTPRINT::Duplicate() const
|
||||
{
|
||||
MODULE* dupe = (MODULE*) Clone();
|
||||
FOOTPRINT* dupe = (FOOTPRINT*) Clone();
|
||||
const_cast<KIID&>( dupe->m_Uuid ) = KIID();
|
||||
|
||||
dupe->RunOnChildren( [&]( BOARD_ITEM* child )
|
||||
|
@ -1472,7 +1471,7 @@ BOARD_ITEM* MODULE::Duplicate() const
|
|||
}
|
||||
|
||||
|
||||
BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint )
|
||||
BOARD_ITEM* FOOTPRINT::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint )
|
||||
{
|
||||
BOARD_ITEM* new_item = NULL;
|
||||
FP_ZONE* new_zone = NULL;
|
||||
|
@ -1557,7 +1556,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint
|
|||
}
|
||||
|
||||
|
||||
wxString MODULE::GetNextPadName( const wxString& aLastPadName ) const
|
||||
wxString FOOTPRINT::GetNextPadName( const wxString& aLastPadName ) const
|
||||
{
|
||||
std::set<wxString> usedNames;
|
||||
|
||||
|
@ -1575,7 +1574,7 @@ wxString MODULE::GetNextPadName( const wxString& aLastPadName ) const
|
|||
}
|
||||
|
||||
|
||||
void MODULE::IncrementReference( int aDelta )
|
||||
void FOOTPRINT::IncrementReference( int aDelta )
|
||||
{
|
||||
const wxString& refdes = GetReference();
|
||||
|
||||
|
@ -1614,7 +1613,7 @@ static void addRect( SHAPE_POLY_SET& aPolySet, wxRect aRect )
|
|||
aPolySet.Append( aRect.GetX(), aRect.GetY()+aRect.height );
|
||||
}
|
||||
|
||||
double MODULE::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
|
||||
double FOOTPRINT::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
|
||||
{
|
||||
double fpArea = GetFootprintRect().GetArea();
|
||||
SHAPE_POLY_SET coveredRegion;
|
||||
|
@ -1669,7 +1668,7 @@ double MODULE::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
|
|||
}
|
||||
|
||||
|
||||
std::shared_ptr<SHAPE> MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
||||
std::shared_ptr<SHAPE> FOOTPRINT::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
|
||||
|
||||
|
@ -1693,7 +1692,7 @@ std::shared_ptr<SHAPE> MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
|||
}
|
||||
|
||||
|
||||
void MODULE::BuildPolyCourtyards()
|
||||
void FOOTPRINT::BuildPolyCourtyards()
|
||||
{
|
||||
m_poly_courtyard_front.RemoveAllContours();
|
||||
m_poly_courtyard_back.RemoveAllContours();
|
||||
|
@ -1741,15 +1740,15 @@ void MODULE::BuildPolyCourtyards()
|
|||
}
|
||||
|
||||
|
||||
void MODULE::SwapData( BOARD_ITEM* aImage )
|
||||
void FOOTPRINT::SwapData( BOARD_ITEM* aImage )
|
||||
{
|
||||
assert( aImage->Type() == PCB_FOOTPRINT_T );
|
||||
|
||||
std::swap( *((MODULE*) this), *((MODULE*) aImage) );
|
||||
std::swap( *((FOOTPRINT*) this), *((FOOTPRINT*) aImage) );
|
||||
}
|
||||
|
||||
|
||||
bool MODULE::HasThroughHolePads() const
|
||||
bool FOOTPRINT::HasThroughHolePads() const
|
||||
{
|
||||
for( PAD* pad : Pads() )
|
||||
{
|
||||
|
@ -1761,7 +1760,8 @@ bool MODULE::HasThroughHolePads() const
|
|||
}
|
||||
|
||||
|
||||
bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const
|
||||
bool FOOTPRINT::cmp_drawings::operator()( const BOARD_ITEM* aFirst,
|
||||
const BOARD_ITEM* aSecond ) const
|
||||
{
|
||||
if( aFirst->Type() != aSecond->Type() )
|
||||
return aFirst->Type() < aSecond->Type();
|
||||
|
@ -1785,7 +1785,7 @@ bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITE
|
|||
}
|
||||
|
||||
|
||||
bool MODULE::cmp_pads::operator()( const PAD* aFirst, const PAD* aSecond ) const
|
||||
bool FOOTPRINT::cmp_pads::operator()( const PAD* aFirst, const PAD* aSecond ) const
|
||||
{
|
||||
if( aFirst->GetName() != aSecond->GetName() )
|
||||
return StrNumCmp( aFirst->GetName(), aSecond->GetName() ) < 0;
|
||||
|
@ -1816,37 +1816,37 @@ static struct MODULE_DESC
|
|||
fpLayers.Add( LSET::Name( B_Cu ), B_Cu );
|
||||
|
||||
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
|
||||
REGISTER_TYPE( MODULE );
|
||||
propMgr.AddTypeCast( new TYPE_CAST<MODULE, BOARD_ITEM> );
|
||||
propMgr.AddTypeCast( new TYPE_CAST<MODULE, BOARD_ITEM_CONTAINER> );
|
||||
propMgr.InheritsAfter( TYPE_HASH( MODULE ), TYPE_HASH( BOARD_ITEM ) );
|
||||
propMgr.InheritsAfter( TYPE_HASH( MODULE ), TYPE_HASH( BOARD_ITEM_CONTAINER ) );
|
||||
REGISTER_TYPE( FOOTPRINT );
|
||||
propMgr.AddTypeCast( new TYPE_CAST<FOOTPRINT, BOARD_ITEM> );
|
||||
propMgr.AddTypeCast( new TYPE_CAST<FOOTPRINT, BOARD_ITEM_CONTAINER> );
|
||||
propMgr.InheritsAfter( TYPE_HASH( FOOTPRINT ), TYPE_HASH( BOARD_ITEM ) );
|
||||
propMgr.InheritsAfter( TYPE_HASH( FOOTPRINT ), TYPE_HASH( BOARD_ITEM_CONTAINER ) );
|
||||
|
||||
auto layer = new PROPERTY_ENUM<MODULE, PCB_LAYER_ID, BOARD_ITEM>( _HKI( "Layer" ),
|
||||
&MODULE::SetLayer, &MODULE::GetLayer );
|
||||
auto layer = new PROPERTY_ENUM<FOOTPRINT, PCB_LAYER_ID, BOARD_ITEM>( _HKI( "Layer" ),
|
||||
&FOOTPRINT::SetLayer, &FOOTPRINT::GetLayer );
|
||||
layer->SetChoices( fpLayers );
|
||||
propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ), layer );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, wxString>( _HKI( "Reference" ),
|
||||
&MODULE::SetReference, &MODULE::GetReference ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, wxString>( _HKI( "Value" ),
|
||||
&MODULE::SetValue, &MODULE::GetValue ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, double>( _HKI( "Orientation" ),
|
||||
&MODULE::SetOrientationDegrees, &MODULE::GetOrientationDegrees,
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Reference" ),
|
||||
&FOOTPRINT::SetReference, &FOOTPRINT::GetReference ) );
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Value" ),
|
||||
&FOOTPRINT::SetValue, &FOOTPRINT::GetValue ) );
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, double>( _HKI( "Orientation" ),
|
||||
&FOOTPRINT::SetOrientationDegrees, &FOOTPRINT::GetOrientationDegrees,
|
||||
PROPERTY_DISPLAY::DEGREE ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, int>( _HKI( "Local Clearance" ),
|
||||
&MODULE::SetLocalClearance, &MODULE::GetLocalClearance,
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Local Clearance" ),
|
||||
&FOOTPRINT::SetLocalClearance, &FOOTPRINT::GetLocalClearance,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, int>( _HKI( "Local Solderpaste Margin" ),
|
||||
&MODULE::SetLocalSolderPasteMargin, &MODULE::GetLocalSolderPasteMargin,
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Local Solderpaste Margin" ),
|
||||
&FOOTPRINT::SetLocalSolderPasteMargin, &FOOTPRINT::GetLocalSolderPasteMargin,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, double>( _HKI( "Local Solderpaste Margin Ratio" ),
|
||||
&MODULE::SetLocalSolderPasteMarginRatio, &MODULE::GetLocalSolderPasteMarginRatio ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, int>( _HKI( "Thermal Width" ),
|
||||
&MODULE::SetThermalWidth, &MODULE::GetThermalWidth,
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, double>( _HKI( "Local Solderpaste Margin Ratio" ),
|
||||
&FOOTPRINT::SetLocalSolderPasteMarginRatio, &FOOTPRINT::GetLocalSolderPasteMarginRatio ) );
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Thermal Width" ),
|
||||
&FOOTPRINT::SetThermalWidth, &FOOTPRINT::GetThermalWidth,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<MODULE, int>( _HKI( "Thermal Gap" ),
|
||||
&MODULE::SetThermalGap, &MODULE::GetThermalGap,
|
||||
propMgr.AddProperty( new PROPERTY<FOOTPRINT, int>( _HKI( "Thermal Gap" ),
|
||||
&FOOTPRINT::SetThermalGap, &FOOTPRINT::GetThermalGap,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
// TODO zone connection, FPID?
|
||||
}
|
||||
|
|
|
@ -101,23 +101,23 @@ public:
|
|||
DECL_DEQ_FOR_SWIG( PADS, PAD* )
|
||||
DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
|
||||
DECL_VEC_FOR_SWIG( FP_ZONES, FP_ZONE* )
|
||||
DECL_VEC_FOR_SWIG( MODULE_GROUPS, PCB_GROUP* )
|
||||
DECL_DEQ_FOR_SWIG( MODULES, MODULE* )
|
||||
DECL_VEC_FOR_SWIG( FP_GROUPS, PCB_GROUP* )
|
||||
DECL_DEQ_FOR_SWIG( FOOTPRINTS, FOOTPRINT* )
|
||||
|
||||
class MODULE : public BOARD_ITEM_CONTAINER
|
||||
class FOOTPRINT : public BOARD_ITEM_CONTAINER
|
||||
{
|
||||
public:
|
||||
MODULE( BOARD* parent );
|
||||
FOOTPRINT( BOARD* parent );
|
||||
|
||||
MODULE( const MODULE& aFootprint );
|
||||
FOOTPRINT( const FOOTPRINT& aFootprint );
|
||||
|
||||
// Move constructor and operator needed due to std containers inside the footprint
|
||||
MODULE( MODULE&& aFootprint );
|
||||
FOOTPRINT( FOOTPRINT&& aFootprint );
|
||||
|
||||
~MODULE();
|
||||
~FOOTPRINT();
|
||||
|
||||
MODULE& operator=( const MODULE& aOther );
|
||||
MODULE& operator=( MODULE&& aOther );
|
||||
FOOTPRINT& operator=( const FOOTPRINT& aOther );
|
||||
FOOTPRINT& operator=( FOOTPRINT&& aOther );
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
|
@ -187,8 +187,8 @@ public:
|
|||
FP_ZONES& Zones() { return m_fp_zones; }
|
||||
const FP_ZONES& Zones() const { return m_fp_zones; }
|
||||
|
||||
MODULE_GROUPS& Groups() { return m_fp_groups; }
|
||||
const MODULE_GROUPS& Groups() const { return m_fp_groups; }
|
||||
FP_GROUPS& Groups() { return m_fp_groups; }
|
||||
const FP_GROUPS& Groups() const { return m_fp_groups; }
|
||||
|
||||
bool HasThroughHolePads() const;
|
||||
|
||||
|
@ -694,7 +694,7 @@ private:
|
|||
DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
|
||||
PADS m_pads; // PAD items, owned by pointer
|
||||
FP_ZONES m_fp_zones; // FP_ZONE items, owned by pointer
|
||||
MODULE_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
|
||||
FP_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
|
||||
|
||||
double m_orient; // Orientation in tenths of a degree, 900=90.0 degrees.
|
||||
wxPoint m_pos; // Position of footprint on the board in internal units.
|
||||
|
|
|
@ -374,7 +374,7 @@ LIB_ID FOOTPRINT_EDIT_FRAME::GetTargetFPID() const
|
|||
|
||||
LIB_ID FOOTPRINT_EDIT_FRAME::GetLoadedFPID() const
|
||||
{
|
||||
MODULE* footprint = GetBoard()->GetFirstFootprint();
|
||||
FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
|
||||
|
||||
if( footprint )
|
||||
return LIB_ID( footprint->GetFPID().GetLibNickname(), m_footprintNameWhenLoaded );
|
||||
|
@ -394,7 +394,7 @@ void FOOTPRINT_EDIT_FRAME::ClearModify()
|
|||
|
||||
bool FOOTPRINT_EDIT_FRAME::IsCurrentFPFromBoard() const
|
||||
{
|
||||
MODULE* footprint = GetBoard()->GetFirstFootprint();
|
||||
FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
|
||||
|
||||
return ( footprint && footprint->GetLink() != niluuid );
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
|
|||
id.SetLibNickname( libNickname );
|
||||
id.SetLibItemName( footprintName );
|
||||
|
||||
MODULE* footprint = loadFootprint( id );
|
||||
FOOTPRINT* footprint = loadFootprint( id );
|
||||
|
||||
if( footprint )
|
||||
AddFootprintToBoard( footprint );
|
||||
|
@ -431,9 +431,9 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
|
|||
}
|
||||
|
||||
|
||||
void FOOTPRINT_EDIT_FRAME::AddFootprintToBoard( MODULE* aFootprint )
|
||||
void FOOTPRINT_EDIT_FRAME::AddFootprintToBoard( FOOTPRINT* aFootprint )
|
||||
{
|
||||
m_revertModule.reset( (MODULE*) aFootprint->Clone() );
|
||||
m_revertModule.reset( (FOOTPRINT*) aFootprint->Clone() );
|
||||
|
||||
m_footprintNameWhenLoaded = aFootprint->GetFPID().GetLibItemName();
|
||||
|
||||
|
@ -542,7 +542,7 @@ MAGNETIC_SETTINGS* FOOTPRINT_EDIT_FRAME::GetMagneticItemsSettings()
|
|||
|
||||
const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
|
||||
{
|
||||
MODULE* footprint = GetBoard()->GetFirstFootprint();
|
||||
FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
|
@ -653,8 +653,8 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard( wxUpdateUIEvent& aEvent
|
|||
{
|
||||
PCB_EDIT_FRAME* frame = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
|
||||
|
||||
MODULE* editorFootprint = GetBoard()->GetFirstFootprint();
|
||||
bool canInsert = frame && editorFootprint && editorFootprint->GetLink() == niluuid;
|
||||
FOOTPRINT* editorFootprint = GetBoard()->GetFirstFootprint();
|
||||
bool canInsert = frame && editorFootprint && editorFootprint->GetLink() == niluuid;
|
||||
|
||||
// If the source was deleted, the footprint can inserted but not updated in the board.
|
||||
if( frame && editorFootprint && editorFootprint->GetLink() != niluuid )
|
||||
|
@ -663,7 +663,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard( wxUpdateUIEvent& aEvent
|
|||
canInsert = true;
|
||||
|
||||
// search if the source footprint was not deleted:
|
||||
for( MODULE* candidate : mainpcb->Footprints() )
|
||||
for( FOOTPRINT* candidate : mainpcb->Footprints() )
|
||||
{
|
||||
if( editorFootprint->GetLink() == candidate->m_Uuid )
|
||||
{
|
||||
|
@ -714,10 +714,10 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::updateTitle()
|
||||
{
|
||||
wxString title;
|
||||
LIB_ID fpid = GetLoadedFPID();
|
||||
MODULE* footprint = GetBoard()->GetFirstFootprint();
|
||||
bool writable = true;
|
||||
wxString title;
|
||||
LIB_ID fpid = GetLoadedFPID();
|
||||
FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
|
||||
bool writable = true;
|
||||
|
||||
if( IsCurrentFPFromBoard() )
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ class FOOTPRINT_EDIT_FRAME : public PCB_BASE_EDIT_FRAME
|
|||
|
||||
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> m_adapter;
|
||||
|
||||
std::unique_ptr<MODULE> m_revertModule;
|
||||
std::unique_ptr<FOOTPRINT> m_revertModule;
|
||||
wxString m_footprintNameWhenLoaded;
|
||||
|
||||
int m_defaultLibWidth;
|
||||
|
@ -180,10 +180,10 @@ public:
|
|||
* @param aFootprint = the given footprint
|
||||
* @return : true if OK, false if abort
|
||||
*/
|
||||
bool SaveFootprint( MODULE* aFootprint );
|
||||
bool SaveFootprintAs( MODULE* aFootprint );
|
||||
bool SaveFootprint( FOOTPRINT* aFootprint );
|
||||
bool SaveFootprintAs( FOOTPRINT* aFootprint );
|
||||
bool SaveFootprintToBoard( bool aAddNew );
|
||||
bool SaveFootprintInLibrary( MODULE* aFootprint, const wxString& aLibraryName );
|
||||
bool SaveFootprintInLibrary( FOOTPRINT* aFootprint, const wxString& aLibraryName );
|
||||
bool RevertFootprint();
|
||||
|
||||
/**
|
||||
|
@ -221,7 +221,7 @@ public:
|
|||
/**
|
||||
* Create a file containing only one footprint.
|
||||
*/
|
||||
void ExportFootprint( MODULE* aFootprint );
|
||||
void ExportFootprint( FOOTPRINT* aFootprint );
|
||||
|
||||
/**
|
||||
* Read a file containing only one footprint.
|
||||
|
@ -229,7 +229,7 @@ public:
|
|||
* The import function can also read gpcb footprint file, in Newlib format.
|
||||
* (One footprint per file, Newlib files have no special ext.)
|
||||
*/
|
||||
MODULE* ImportFootprint( const wxString& aName = wxT( "") );
|
||||
FOOTPRINT* ImportFootprint( const wxString& aName = wxT( "") );
|
||||
|
||||
/**
|
||||
* Load a footprint from the main board into the Footprint Editor.
|
||||
|
@ -238,14 +238,14 @@ public:
|
|||
* footprint reference.
|
||||
* @return true if a footprint is loaded.
|
||||
*/
|
||||
bool LoadFootprintFromBoard( MODULE* aFootprint );
|
||||
bool LoadFootprintFromBoard( FOOTPRINT* aFootprint );
|
||||
|
||||
/**
|
||||
* Display the list of footprints currently existing on the BOARD.
|
||||
*
|
||||
* @return the selected footprint or nullptr
|
||||
*/
|
||||
MODULE* SelectFootprintFromBoard( BOARD* aPcb );
|
||||
FOOTPRINT* SelectFootprintFromBoard( BOARD* aPcb );
|
||||
|
||||
/**
|
||||
* Delete the given footprint from its library.
|
||||
|
@ -281,7 +281,7 @@ public:
|
|||
* Override from PCB_BASE_EDIT_FRAME which adds a footprint to the editor's dummy board,
|
||||
* NOT to the user's PCB.
|
||||
*/
|
||||
void AddFootprintToBoard( MODULE* aFootprint ) override;
|
||||
void AddFootprintToBoard( FOOTPRINT* aFootprint ) override;
|
||||
|
||||
/**
|
||||
* Allows Modedit to install its preferences panel into the preferences dialog.
|
||||
|
@ -347,7 +347,7 @@ protected:
|
|||
/**
|
||||
* Run the Footprint Properties dialog and handle changes made in it.
|
||||
*/
|
||||
void editFootprintProperties( MODULE* aFootprint );
|
||||
void editFootprintProperties( FOOTPRINT* aFootprint );
|
||||
|
||||
void setupUIConditions() override;
|
||||
};
|
||||
|
|
|
@ -50,7 +50,7 @@ void FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary( LIB_ID aFPID)
|
|||
{
|
||||
bool is_last_fp_from_brd = IsCurrentFPFromBoard();
|
||||
|
||||
MODULE* footprint = LoadFootprint( aFPID );
|
||||
FOOTPRINT* footprint = LoadFootprint( aFPID );
|
||||
|
||||
if( !footprint )
|
||||
return;
|
||||
|
@ -122,7 +122,7 @@ void FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( wxCommandEvent& event )
|
|||
class BASIC_FOOTPRINT_INFO : public FOOTPRINT_INFO
|
||||
{
|
||||
public:
|
||||
BASIC_FOOTPRINT_INFO( MODULE* aFootprint )
|
||||
BASIC_FOOTPRINT_INFO( FOOTPRINT* aFootprint )
|
||||
{
|
||||
m_nickname = aFootprint->GetFPID().GetLibNickname().wx_str();
|
||||
m_fpname = aFootprint->GetFPID().GetLibItemName().wx_str();
|
||||
|
@ -135,7 +135,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aFootprint )
|
||||
void FOOTPRINT_EDIT_FRAME::editFootprintProperties( FOOTPRINT* aFootprint )
|
||||
{
|
||||
LIB_ID oldFPID = aFootprint->GetFPID();
|
||||
|
||||
|
@ -164,11 +164,11 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
switch( aItem->Type() )
|
||||
{
|
||||
case PCB_PAD_T:
|
||||
ShowPadPropertiesDialog( static_cast<PAD*>( aItem ));
|
||||
ShowPadPropertiesDialog( static_cast<PAD*>( aItem ) );
|
||||
break;
|
||||
|
||||
case PCB_FOOTPRINT_T:
|
||||
editFootprintProperties( (MODULE*) aItem );
|
||||
editFootprintProperties( static_cast<FOOTPRINT*>( aItem ) );
|
||||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ void FOOTPRINT_INFO_IMPL::load()
|
|||
|
||||
wxASSERT( fptable );
|
||||
|
||||
const MODULE* footprint = fptable->GetEnumeratedFootprint( m_nickname, m_fpname );
|
||||
const FOOTPRINT* footprint = fptable->GetEnumeratedFootprint( m_nickname, m_fpname );
|
||||
|
||||
if( footprint == NULL ) // Should happen only with malformed/broken libraries
|
||||
{
|
||||
|
|
|
@ -148,9 +148,9 @@ static IO_MGR::PCB_FILE_T detect_file_type( FILE* aFile, const wxFileName& aFile
|
|||
* @param aFileType - type of the file
|
||||
* @param aName - name of the footprint
|
||||
*/
|
||||
static MODULE* parse_module_with_plugin( const wxFileName& aFileName,
|
||||
IO_MGR::PCB_FILE_T aFileType,
|
||||
const wxString& aName )
|
||||
static FOOTPRINT* parse_module_with_plugin( const wxFileName& aFileName,
|
||||
IO_MGR::PCB_FILE_T aFileType,
|
||||
const wxString& aName )
|
||||
{
|
||||
wxString path;
|
||||
|
||||
|
@ -176,7 +176,7 @@ static MODULE* parse_module_with_plugin( const wxFileName& aFileName,
|
|||
* Parse a KICAD footprint.
|
||||
* @param aFileName - file name to parse
|
||||
*/
|
||||
static MODULE* parse_module_kicad( const wxFileName& aFileName )
|
||||
static FOOTPRINT* parse_module_kicad( const wxFileName& aFileName )
|
||||
{
|
||||
wxString fcontents;
|
||||
PCB_IO pcb_io;
|
||||
|
@ -187,7 +187,7 @@ static MODULE* parse_module_kicad( const wxFileName& aFileName )
|
|||
|
||||
f.ReadAll( &fcontents );
|
||||
|
||||
return dynamic_cast<MODULE*>( pcb_io.Parse( fcontents ) );
|
||||
return dynamic_cast<FOOTPRINT*>( pcb_io.Parse( fcontents ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -197,10 +197,10 @@ static MODULE* parse_module_kicad( const wxFileName& aFileName )
|
|||
* @param aFileType - type of the file to load
|
||||
* @param aName - footprint name
|
||||
*/
|
||||
MODULE* try_load_footprint( const wxFileName& aFileName, IO_MGR::PCB_FILE_T aFileType,
|
||||
const wxString& aName )
|
||||
FOOTPRINT* try_load_footprint( const wxFileName& aFileName, IO_MGR::PCB_FILE_T aFileType,
|
||||
const wxString& aName )
|
||||
{
|
||||
MODULE* footprint;
|
||||
FOOTPRINT* footprint;
|
||||
|
||||
switch( aFileType )
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ MODULE* try_load_footprint( const wxFileName& aFileName, IO_MGR::PCB_FILE_T aFil
|
|||
}
|
||||
|
||||
|
||||
MODULE* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
|
||||
FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
|
||||
{
|
||||
wxString lastOpenedPathForLoading = m_mruPath;
|
||||
FOOTPRINT_EDITOR_SETTINGS* cfg = GetSettings();
|
||||
|
@ -260,7 +260,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
MODULE* footprint = NULL;
|
||||
FOOTPRINT* footprint = NULL;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -306,7 +306,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName )
|
|||
}
|
||||
|
||||
|
||||
void FOOTPRINT_EDIT_FRAME::ExportFootprint( MODULE* aFootprint )
|
||||
void FOOTPRINT_EDIT_FRAME::ExportFootprint( FOOTPRINT* aFootprint )
|
||||
{
|
||||
wxFileName fn;
|
||||
FOOTPRINT_EDITOR_SETTINGS* cfg = GetSettings();
|
||||
|
@ -621,7 +621,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
|
|||
wxString footprintName;
|
||||
|
||||
auto resetReference =
|
||||
[]( MODULE* aFootprint )
|
||||
[]( FOOTPRINT* aFootprint )
|
||||
{
|
||||
aFootprint->SetReference( "REF**" );
|
||||
};
|
||||
|
@ -638,7 +638,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
|
|||
|
||||
prj.SetRString( PROJECT::PCB_LIB_NICKNAME, nickname );
|
||||
|
||||
for( MODULE* footprint : GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -646,7 +646,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
|
|||
|
||||
if( !footprint->GetFPID().GetLibItemName().empty() ) // Handle old boards.
|
||||
{
|
||||
MODULE* fpCopy = static_cast<MODULE*>( footprint->Duplicate() );
|
||||
FOOTPRINT* fpCopy = static_cast<FOOTPRINT*>( footprint->Duplicate() );
|
||||
|
||||
resetReference( fpCopy );
|
||||
tbl->FootprintSave( nickname, fpCopy, true );
|
||||
|
@ -675,13 +675,13 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
|
|||
IO_MGR::PCB_FILE_T piType = IO_MGR::KICAD_SEXP;
|
||||
PLUGIN::RELEASER pi( IO_MGR::PluginFind( piType ) );
|
||||
|
||||
for( MODULE* footprint : GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
|
||||
{
|
||||
try
|
||||
{
|
||||
if( !footprint->GetFPID().GetLibItemName().empty() ) // Handle old boards.
|
||||
{
|
||||
MODULE* fpCopy = static_cast<MODULE*>( footprint->Duplicate() );
|
||||
FOOTPRINT* fpCopy = static_cast<FOOTPRINT*>( footprint->Duplicate() );
|
||||
|
||||
resetReference( fpCopy );
|
||||
pi->FootprintSave( libPath, fpCopy );
|
||||
|
@ -698,7 +698,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
|
|||
}
|
||||
|
||||
|
||||
bool FOOTPRINT_EDIT_FRAME::SaveFootprint( MODULE* aFootprint )
|
||||
bool FOOTPRINT_EDIT_FRAME::SaveFootprint( FOOTPRINT* aFootprint )
|
||||
{
|
||||
if( !aFootprint ) // Happen if no footprint loaded
|
||||
return false;
|
||||
|
@ -760,7 +760,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprint( MODULE* aFootprint )
|
|||
}
|
||||
|
||||
|
||||
bool FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary( MODULE* aFootprint,
|
||||
bool FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary( FOOTPRINT* aFootprint,
|
||||
const wxString& aLibraryName )
|
||||
{
|
||||
try
|
||||
|
@ -794,9 +794,9 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
|
|||
return false;
|
||||
}
|
||||
|
||||
BOARD* mainpcb = pcbframe->GetBoard();
|
||||
MODULE* sourceFootprint = NULL;
|
||||
MODULE* editorFootprint = GetBoard()->GetFirstFootprint();
|
||||
BOARD* mainpcb = pcbframe->GetBoard();
|
||||
FOOTPRINT* sourceFootprint = NULL;
|
||||
FOOTPRINT* editorFootprint = GetBoard()->GetFirstFootprint();
|
||||
|
||||
// Search the old footprint (source) if exists
|
||||
// Because this source could be deleted when editing the main board...
|
||||
|
@ -804,7 +804,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
|
|||
{
|
||||
sourceFootprint = nullptr;
|
||||
|
||||
for( MODULE* candidate : mainpcb->Footprints() )
|
||||
for( FOOTPRINT* candidate : mainpcb->Footprints() )
|
||||
{
|
||||
if( editorFootprint->GetLink() == candidate->m_Uuid )
|
||||
{
|
||||
|
@ -825,7 +825,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
|
|||
BOARD_COMMIT commit( pcbframe );
|
||||
|
||||
// Create the "new" footprint
|
||||
MODULE* newFootprint = new MODULE( *editorFootprint );
|
||||
FOOTPRINT* newFootprint = new FOOTPRINT( *editorFootprint );
|
||||
const_cast<KIID&>( newFootprint->m_Uuid ) = KIID();
|
||||
|
||||
newFootprint->SetParent( mainpcb );
|
||||
|
@ -863,7 +863,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
|
|||
}
|
||||
|
||||
|
||||
bool FOOTPRINT_EDIT_FRAME::SaveFootprintAs( MODULE* aFootprint )
|
||||
bool FOOTPRINT_EDIT_FRAME::SaveFootprintAs( FOOTPRINT* aFootprint )
|
||||
{
|
||||
if( aFootprint == NULL )
|
||||
return false;
|
||||
|
@ -906,7 +906,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintAs( MODULE* aFootprint )
|
|||
bNameSizer->Add( nameTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST );
|
||||
nameValidator.SetCharExcludes( MODULE::StringLibNameInvalidChars( false ) );
|
||||
nameValidator.SetCharExcludes( FOOTPRINT::StringLibNameInvalidChars( false ) );
|
||||
nameTextCtrl->SetValidator( nameValidator );
|
||||
|
||||
wxSizer* mainSizer = dlg.GetSizer();
|
||||
|
@ -1000,7 +1000,7 @@ bool FOOTPRINT_EDIT_FRAME::RevertFootprint()
|
|||
if( ConfirmRevertDialog( this, msg ) )
|
||||
{
|
||||
Clear_Pcb( false );
|
||||
AddFootprintToBoard( (MODULE*) m_revertModule->Clone());
|
||||
AddFootprintToBoard( (FOOTPRINT*) m_revertModule->Clone());
|
||||
|
||||
Zoom_Automatique( false );
|
||||
|
||||
|
@ -1020,7 +1020,7 @@ bool FOOTPRINT_EDIT_FRAME::RevertFootprint()
|
|||
}
|
||||
|
||||
|
||||
MODULE* PCB_BASE_FRAME::CreateNewFootprint( const wxString& aFootprintName )
|
||||
FOOTPRINT* PCB_BASE_FRAME::CreateNewFootprint( const wxString& aFootprintName )
|
||||
{
|
||||
wxString footprintName = aFootprintName;
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ MODULE* PCB_BASE_FRAME::CreateNewFootprint( const wxString& aFootprintName )
|
|||
}
|
||||
|
||||
// Creates the new footprint and add it to the head of the linked list of footprints
|
||||
MODULE* footprint = new MODULE( GetBoard() );
|
||||
FOOTPRINT* footprint = new FOOTPRINT( GetBoard() );
|
||||
|
||||
// Update parameters: timestamp ...
|
||||
footprint->SetLastEditTime();
|
||||
|
|
|
@ -327,7 +327,7 @@ void FOOTPRINT_PREVIEW_PANEL::CacheFootprint( const LIB_ID& aFPID )
|
|||
}
|
||||
|
||||
|
||||
void FOOTPRINT_PREVIEW_PANEL::renderFootprint( std::shared_ptr<MODULE> aFootprint )
|
||||
void FOOTPRINT_PREVIEW_PANEL::renderFootprint( std::shared_ptr<FOOTPRINT> aFootprint )
|
||||
{
|
||||
if( m_currentFootprint )
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <widgets/footprint_preview_widget.h>
|
||||
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class KIWAY;
|
||||
class IO_MGR;
|
||||
class BOARD;
|
||||
|
@ -76,9 +76,9 @@ public:
|
|||
private:
|
||||
struct CACHE_ENTRY
|
||||
{
|
||||
LIB_ID fpid;
|
||||
std::shared_ptr<MODULE> footprint;
|
||||
FOOTPRINT_STATUS status;
|
||||
LIB_ID fpid;
|
||||
std::shared_ptr<FOOTPRINT> footprint;
|
||||
FOOTPRINT_STATUS status;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -98,7 +98,7 @@ private:
|
|||
|
||||
void OnLoaderThreadUpdate( wxCommandEvent& aEvent );
|
||||
|
||||
void renderFootprint( std::shared_ptr<MODULE> aFootprint );
|
||||
void renderFootprint( std::shared_ptr<FOOTPRINT> aFootprint );
|
||||
|
||||
private:
|
||||
FP_LOADER_THREAD* m_loader;
|
||||
|
@ -108,9 +108,9 @@ private:
|
|||
std::unique_ptr<BOARD> m_dummyBoard;
|
||||
std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> m_displayOptions;
|
||||
|
||||
std::shared_ptr<MODULE> m_currentFootprint;
|
||||
LIB_ID m_currentFPID;
|
||||
bool m_footprintDisplayed;
|
||||
std::shared_ptr<FOOTPRINT> m_currentFootprint;
|
||||
LIB_ID m_currentFPID;
|
||||
bool m_footprintDisplayed;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -663,7 +663,7 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& aEvent )
|
|||
// Delete the current footprint (MUST reset tools first)
|
||||
GetToolManager()->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
|
||||
LIB_ID id;
|
||||
id.SetLibNickname( getCurNickname() );
|
||||
|
@ -733,7 +733,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent )
|
|||
BOARD_COMMIT commit( pcbframe );
|
||||
|
||||
// Create the "new" footprint
|
||||
MODULE* newFootprint = (MODULE*) GetBoard()->GetFirstFootprint()->Duplicate();
|
||||
FOOTPRINT* newFootprint = (FOOTPRINT*) GetBoard()->GetFirstFootprint()->Duplicate();
|
||||
newFootprint->SetParent( pcbframe->GetBoard() );
|
||||
newFootprint->SetLink( 0 );
|
||||
|
||||
|
@ -1027,10 +1027,10 @@ void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode )
|
|||
setCurFootprintName( m_fpList->GetString((unsigned) selection ) );
|
||||
|
||||
// Delete the current footprint
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
|
||||
MODULE* footprint = Prj().PcbFootprintLibs()->FootprintLoad( getCurNickname(),
|
||||
getCurFootprintName() );
|
||||
FOOTPRINT* footprint = Prj().PcbFootprintLibs()->FootprintLoad( getCurNickname(),
|
||||
getCurFootprintName() );
|
||||
|
||||
if( footprint )
|
||||
GetBoard()->Add( footprint, ADD_MODE::APPEND );
|
||||
|
|
|
@ -151,7 +151,7 @@ public:
|
|||
* @param aMessage a wxString to store messages (if any) generated by the
|
||||
* footprint generator
|
||||
*/
|
||||
virtual MODULE* GetFootprint( wxString* aMessage ) = 0;
|
||||
virtual FOOTPRINT* GetFootprint( wxString* aMessage ) = 0;
|
||||
|
||||
/**
|
||||
* Function GetObject
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
///> @copydoc PCB_BASE_FRAME::GetModel()
|
||||
BOARD_ITEM_CONTAINER* GetModel() const override;
|
||||
|
||||
MODULE* GetBuiltFootprint();
|
||||
FOOTPRINT* GetBuiltFootprint();
|
||||
|
||||
/**
|
||||
* Reload the Python plugins if they are newer than
|
||||
|
|
|
@ -99,11 +99,11 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
|
|||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
||||
// Delete the current footprint
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
|
||||
// Creates the footprint
|
||||
wxString msg;
|
||||
MODULE* footprint = footprintWizard->GetFootprint( &msg );
|
||||
wxString msg;
|
||||
FOOTPRINT* footprint = footprintWizard->GetFootprint( &msg );
|
||||
DisplayBuildMessage( msg );
|
||||
|
||||
if( footprint )
|
||||
|
@ -141,14 +141,14 @@ FOOTPRINT_WIZARD* FOOTPRINT_WIZARD_FRAME::GetMyWizard()
|
|||
}
|
||||
|
||||
|
||||
MODULE* FOOTPRINT_WIZARD_FRAME::GetBuiltFootprint()
|
||||
FOOTPRINT* FOOTPRINT_WIZARD_FRAME::GetBuiltFootprint()
|
||||
{
|
||||
FOOTPRINT_WIZARD* footprintWizard = FOOTPRINT_WIZARD_LIST::GetWizard( m_wizardName );
|
||||
|
||||
if( footprintWizard && m_modal_ret_val )
|
||||
{
|
||||
wxString msg;
|
||||
MODULE * footprint = footprintWizard->GetFootprint( &msg );
|
||||
wxString msg;
|
||||
FOOTPRINT* footprint = footprintWizard->GetFootprint( &msg );
|
||||
DisplayBuildMessage( msg );
|
||||
|
||||
return footprint;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <view/view.h>
|
||||
|
||||
|
||||
FP_SHAPE::FP_SHAPE( MODULE* parent, PCB_SHAPE_TYPE_T aShape ) :
|
||||
FP_SHAPE::FP_SHAPE( FOOTPRINT* parent, PCB_SHAPE_TYPE_T aShape ) :
|
||||
PCB_SHAPE( parent, PCB_FP_SHAPE_T )
|
||||
{
|
||||
m_Shape = aShape;
|
||||
|
@ -51,7 +51,7 @@ FP_SHAPE::~FP_SHAPE()
|
|||
|
||||
void FP_SHAPE::SetLocalCoord()
|
||||
{
|
||||
MODULE* fp = (MODULE*) m_Parent;
|
||||
FOOTPRINT* fp = (FOOTPRINT*) m_Parent;
|
||||
|
||||
if( fp == NULL )
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ void FP_SHAPE::SetLocalCoord()
|
|||
|
||||
void FP_SHAPE::SetDrawCoord()
|
||||
{
|
||||
MODULE* fp = (MODULE*) m_Parent;
|
||||
FOOTPRINT* fp = (FOOTPRINT*) m_Parent;
|
||||
|
||||
m_Start = m_Start0;
|
||||
m_End = m_End0;
|
||||
|
@ -109,9 +109,8 @@ void FP_SHAPE::SetDrawCoord()
|
|||
// see class_edge_mod.h
|
||||
void FP_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
MODULE* fp = (MODULE*) m_Parent;
|
||||
wxString msg;
|
||||
FOOTPRINT* fp = (FOOTPRINT*) m_Parent;
|
||||
|
||||
if( !fp )
|
||||
return;
|
||||
|
|
|
@ -39,7 +39,7 @@ class MSG_PANEL_ITEM;
|
|||
class FP_SHAPE : public PCB_SHAPE
|
||||
{
|
||||
public:
|
||||
FP_SHAPE( MODULE* parent, PCB_SHAPE_TYPE_T aShape = S_SEGMENT );
|
||||
FP_SHAPE( FOOTPRINT* parent, PCB_SHAPE_TYPE_T aShape = S_SEGMENT );
|
||||
|
||||
// Do not create a copy constructor & operator=.
|
||||
// The ones generated by the compiler are adequate.
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
#include <settings/settings_manager.h>
|
||||
#include <trigo.h>
|
||||
|
||||
FP_TEXT::FP_TEXT( MODULE* aParentFootprint, TEXT_TYPE text_type ) :
|
||||
FP_TEXT::FP_TEXT( FOOTPRINT* aParentFootprint, TEXT_TYPE text_type ) :
|
||||
BOARD_ITEM( aParentFootprint, PCB_FP_TEXT_T ),
|
||||
EDA_TEXT()
|
||||
{
|
||||
MODULE* parentFootprint = static_cast<MODULE*>( m_Parent );
|
||||
FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_Parent );
|
||||
|
||||
m_Type = text_type;
|
||||
m_keepUpright = true;
|
||||
|
@ -197,7 +197,7 @@ int FP_TEXT::GetLength() const
|
|||
|
||||
void FP_TEXT::SetDrawCoord()
|
||||
{
|
||||
const MODULE* parentFootprint = static_cast<const MODULE*>( m_Parent );
|
||||
const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_Parent );
|
||||
|
||||
SetTextPos( m_Pos0 );
|
||||
|
||||
|
@ -216,7 +216,7 @@ void FP_TEXT::SetDrawCoord()
|
|||
|
||||
void FP_TEXT::SetLocalCoord()
|
||||
{
|
||||
const MODULE* parentFootprint = static_cast<const MODULE*>( m_Parent );
|
||||
const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_Parent );
|
||||
|
||||
if( parentFootprint )
|
||||
{
|
||||
|
@ -246,8 +246,8 @@ const EDA_RECT FP_TEXT::GetBoundingBox() const
|
|||
|
||||
double FP_TEXT::GetDrawRotation() const
|
||||
{
|
||||
MODULE* parentFootprint = (MODULE*) m_Parent;
|
||||
double rotation = GetTextAngle();
|
||||
FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_Parent );
|
||||
double rotation = GetTextAngle();
|
||||
|
||||
if( parentFootprint )
|
||||
rotation += parentFootprint->GetOrientation();
|
||||
|
@ -273,7 +273,7 @@ double FP_TEXT::GetDrawRotation() const
|
|||
// see class_text_mod.h
|
||||
void FP_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
MODULE* parentFootprint = (MODULE*) m_Parent;
|
||||
FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_Parent );
|
||||
|
||||
if( parentFootprint == NULL ) // Happens in modedit, and for new texts
|
||||
return;
|
||||
|
@ -331,17 +331,17 @@ wxString FP_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const
|
|||
{
|
||||
case TEXT_is_REFERENCE:
|
||||
return wxString::Format( _( "Reference '%s'" ),
|
||||
static_cast<MODULE*>( GetParent() )->GetReference() );
|
||||
static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
|
||||
|
||||
case TEXT_is_VALUE:
|
||||
return wxString::Format( _( "Value '%s' of %s" ),
|
||||
GetShownText(),
|
||||
static_cast<MODULE*>( GetParent() )->GetReference() );
|
||||
static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
|
||||
|
||||
default:
|
||||
return wxString::Format( _( "Footprint Text '%s' of %s" ),
|
||||
ShortenedShownText(),
|
||||
static_cast<MODULE*>( GetParent() )->GetReference() );
|
||||
static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
|
||||
wxString FP_TEXT::GetShownText( int aDepth ) const
|
||||
{
|
||||
const MODULE* parentFootprint = static_cast<MODULE*>( GetParent() );
|
||||
const FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( GetParent() );
|
||||
wxASSERT( parentFootprint );
|
||||
const BOARD* board = parentFootprint->GetBoard();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
class LINE_READER;
|
||||
class EDA_RECT;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class MSG_PANEL_ITEM;
|
||||
class PCB_BASE_FRAME;
|
||||
class SHAPE;
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
TEXT_is_DIVERS = 2
|
||||
};
|
||||
|
||||
FP_TEXT( MODULE* aParentFootprint, TEXT_TYPE text_type = TEXT_is_DIVERS );
|
||||
FP_TEXT( FOOTPRINT* aParentFootprint, TEXT_TYPE text_type = TEXT_is_DIVERS );
|
||||
|
||||
// Do not create a copy constructor & operator=.
|
||||
// The ones generated by the compiler are adequate.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue