further DLIST/Iterators cleanup, some code formatting

This commit is contained in:
Tomasz Włostowski 2017-04-25 11:06:24 +02:00
parent 63f4ab697b
commit 3b16d3cffe
72 changed files with 305 additions and 428 deletions

View File

@ -184,7 +184,7 @@ void CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMod
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
EDGE_MODULE* outline;
for( EDA_ITEM* item = aModule->GraphicalItems();
for( EDA_ITEM* item = aModule->GraphicalItemsList();
item != NULL;
item = item->Next() )
{
@ -607,7 +607,7 @@ void CINFO3D_VISU::AddPadsShapesWithClearanceToContainer( const MODULE* aModule,
int aInflateValue,
bool aSkipNPTHPadsWihNoCopper )
{
const D_PAD* pad = aModule->Pads();
const D_PAD* pad = aModule->PadsList();
wxSize margin;
@ -1518,7 +1518,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( const MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
const D_PAD* pad = module->Pads();
const D_PAD* pad = module->PadsList();
for( ; pad; pad = pad->Next() )
{
@ -1552,7 +1552,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( const MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
const D_PAD* pad = module->Pads();
const D_PAD* pad = module->PadsList();
for( ; pad; pad = pad->Next() )
{
@ -1652,7 +1652,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// Note: NPTH pads are not drawn on copper layers when the pad
// has same shape as its hole
transformPadsShapesWithClearanceToPolygon( module->Pads(),
transformPadsShapesWithClearanceToPolygon( module->PadsList(),
curr_layer_id,
*layerPoly,
0,
@ -2058,7 +2058,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
{
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
{
D_PAD* pad = module->Pads();
D_PAD* pad = module->PadsList();
int linewidth = g_DrawDefaultLineThickness;
for( ; pad; pad = pad->Next() )
@ -2093,7 +2093,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
{
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
{
D_PAD* pad = module->Pads();
D_PAD* pad = module->PadsList();
const int linewidth = g_DrawDefaultLineThickness;
for( ; pad; pad = pad->Next() )
@ -2106,7 +2106,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
}
else
{
transformPadsShapesWithClearanceToPolygon( module->Pads(),
transformPadsShapesWithClearanceToPolygon( module->PadsList(),
curr_layer_id,
*layerPoly,
0,

View File

@ -194,7 +194,7 @@ void CINFO3D_VISU::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModule
PCB_LAYER_ID aLayer,
SHAPE_POLY_SET& aCornerBuffer ) const
{
for( const EDA_ITEM* item = aModule->GraphicalItems();
for( const EDA_ITEM* item = aModule->GraphicalItemsList();
item != NULL;
item = item->Next() )
{

View File

@ -815,7 +815,7 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads()
module;
module = module->Next() )
{
for( const D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( const D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
if( pad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED )
{

View File

@ -1188,7 +1188,7 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container()
module;
module = module->Next() )
{
for( const D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( const D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
if( pad->GetAttribute () != PAD_ATTRIB_HOLE_NOT_PLATED )
{
insert3DPadHole( pad );

View File

@ -1138,7 +1138,6 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) );
// Transfer EDA_DRAW_PANEL settings
GetGalCanvas()->GetViewControls()->EnableCursorWarping( !m_canvas->GetEnableZoomNoCenter() );
GetGalCanvas()->GetViewControls()->EnableMousewheelPan( m_canvas->GetEnableMousewheelPan() );
}
@ -1366,3 +1365,4 @@ void EDA_DRAW_FRAME::GeneralControlKeyMovement( int aHotKey, wxPoint *aPos,
break;
}
}

View File

@ -220,7 +220,7 @@ void ACTION_MANAGER::UpdateHotKeys()
++global_actions_cnt;
}
// assert( global_actions_cnt <= 1 );
assert( global_actions_cnt <= 1 );
}
#endif /* not NDEBUG */
}

View File

@ -27,39 +27,68 @@
#include <dlist.h>
#include <iterator>
template<class T>
class DLIST_ITERATOR: public std::iterator<std::bidirectional_iterator_tag, T>
template <class T>
class DLIST_ITERATOR : public std::iterator<std::bidirectional_iterator_tag, T>
{
private:
T m_obj;
using reference = typename DLIST_ITERATOR<T>::reference ;
using reference = typename DLIST_ITERATOR<T>::reference;
public:
explicit DLIST_ITERATOR<T>( T obj ) : m_obj(obj) {}
explicit DLIST_ITERATOR<T>( T obj ) :
m_obj(obj) {}
DLIST_ITERATOR<T>& operator++() { m_obj = m_obj->Next(); return *this; }
DLIST_ITERATOR<T>& operator--() { m_obj = m_obj->Prev(); return *this; }
DLIST_ITERATOR<T>& operator++()
{
m_obj = m_obj->Next(); return *this;
}
bool operator==(DLIST_ITERATOR<T> other) const {return m_obj == other.m_obj;}
bool operator!=(DLIST_ITERATOR<T> other) const {return !(*this == other);}
DLIST_ITERATOR<T>& operator--()
{
m_obj = m_obj->Prev(); return *this;
}
reference operator*() {return m_obj;}
bool operator==( DLIST_ITERATOR<T> other ) const
{
return m_obj == other.m_obj;
}
bool operator!=( DLIST_ITERATOR<T> other ) const
{
return !(*this == other);
}
reference operator*()
{
return m_obj;
}
};
// helper object, used to convert a DLIST<T> to an iterator
template<class T> class DLIST_ITERATOR_WRAPPER
template <class T>
class DLIST_ITERATOR_WRAPPER
{
public:
explicit DLIST_ITERATOR_WRAPPER<T> ( DLIST<T>& list ) : m_list(list) {};
public:
explicit DLIST_ITERATOR_WRAPPER<T> ( DLIST<T>& list ) :
m_list(list) {}
DLIST_ITERATOR<T*> begin() { return DLIST_ITERATOR<T*> ( m_list.GetFirst()); }
DLIST_ITERATOR<T*> end() { return DLIST_ITERATOR<T*> ( nullptr ); }
DLIST_ITERATOR<T*> begin()
{
return DLIST_ITERATOR<T*> ( m_list.GetFirst() );
}
unsigned int Size() const {
DLIST_ITERATOR<T*> end()
{
return DLIST_ITERATOR<T*> ( nullptr );
}
unsigned int Size() const
{
return m_list.GetCount();
}
private:
private:
DLIST<T>& m_list;
};

View File

@ -601,7 +601,6 @@ public:
}
const VECTOR2I PointAlong( int aPathLength ) const;
const SHAPE_LINE_CHAIN RemoveHoles( ) const;
private:
/// array of vertices

View File

@ -567,7 +567,7 @@ public:
* search connections between tracks and pads and propagate pad net codes to the track
* segments.
*/
void ComputeLegacyConnections ();
void ComputeLegacyConnections();
/* Functions relative to Undo/redo commands:
*/

View File

@ -455,7 +455,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
BOARD* board = GetBoard();
for( MODULE* module = board->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( auto pad : module->Pads() )
view->Update( pad, KIGFX::GEOMETRY );
}
}

View File

@ -602,7 +602,6 @@ void PCB_EDIT_FRAME::Block_Rotate()
{
BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii );
wxASSERT( item );
itemsList->SetPickedItemStatus( UR_CHANGED, ii );
switch( item->Type() )

View File

@ -394,7 +394,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
if( currentModule )
{
wxPoint move_offset = -block->GetMoveVector();
BOARD_ITEM* item = currentModule->GraphicalItems();
BOARD_ITEM* item = currentModule->GraphicalItemsList();
for( ; item != NULL; item = item->Next() )
{
@ -413,7 +413,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
}
}
D_PAD* pad = currentModule->Pads();
D_PAD* pad = currentModule->PadsList();
for( ; pad != NULL; pad = pad->Next() )
{
@ -432,7 +432,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
if( currentModule )
{
BOARD_ITEM* item = currentModule->GraphicalItems();
BOARD_ITEM* item = currentModule->GraphicalItemsList();
wxPoint move_offset = - block->GetMoveVector();
for( ; item != NULL; item = item->Next() )
@ -452,7 +452,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
}
}
D_PAD* pad = currentModule->Pads();
D_PAD* pad = currentModule->PadsList();
for( ; pad != NULL; pad = pad->Next() )
{
@ -477,7 +477,7 @@ void CopyMarkedItems( MODULE* module, wxPoint offset, bool aIncrement )
module->Reference().ClearFlags();
module->Value().ClearFlags();
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
if( !pad->IsSelected() )
continue;
@ -486,7 +486,7 @@ void CopyMarkedItems( MODULE* module, wxPoint offset, bool aIncrement )
D_PAD* NewPad = new D_PAD( *pad );
NewPad->SetParent( module );
NewPad->SetFlags( SELECTED );
module->Pads().PushFront( NewPad );
module->PadsList().PushFront( NewPad );
if( aIncrement )
NewPad->IncrementPadName( true, true );
@ -494,7 +494,7 @@ void CopyMarkedItems( MODULE* module, wxPoint offset, bool aIncrement )
BOARD_ITEM* newItem;
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
{
if( !item->IsSelected() )
continue;
@ -504,7 +504,7 @@ void CopyMarkedItems( MODULE* module, wxPoint offset, bool aIncrement )
newItem = (BOARD_ITEM*)item->Clone();
newItem->SetParent( module );
newItem->SetFlags( SELECTED );
module->GraphicalItems().PushFront( newItem );
module->GraphicalItemsList().PushFront( newItem );
}
MoveMarkedItems( module, offset );
@ -526,7 +526,7 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
if( module->Value().IsSelected() )
module->Value().Move( offset );
D_PAD* pad = module->Pads();
D_PAD* pad = module->PadsList();
for( ; pad != NULL; pad = pad->Next() )
{
@ -537,7 +537,7 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
pad->SetPos0( pad->GetPos0() + offset );
}
item = module->GraphicalItems();
item = module->GraphicalItemsList();
for( ; item != NULL; item = item->Next() )
{
@ -579,7 +579,7 @@ void DeleteMarkedItems( MODULE* module )
D_PAD* next_pad;
BOARD* board = module->GetBoard();
for( D_PAD* pad = module->Pads(); pad; pad = next_pad )
for( D_PAD* pad = module->PadsList(); pad; pad = next_pad )
{
next_pad = pad->Next();
@ -594,7 +594,7 @@ void DeleteMarkedItems( MODULE* module )
BOARD_ITEM* next_item;
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = next_item )
for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = next_item )
{
next_item = item->Next();
@ -628,7 +628,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all )
if( module->Value().IsSelected() || force_all )
module->Value().Mirror( offset, false );
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
// Skip pads not selected, i.e. not inside the block to mirror:
if( !pad->IsSelected() && !force_all )
@ -651,7 +651,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all )
pad->SetOrientation( - pad->GetOrientation() );
}
for( EDA_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
for( EDA_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
{
// Skip items not selected, i.e. not inside the block to mirror:
if( !item->IsSelected() && !force_all )
@ -693,7 +693,7 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
if( module->Value().IsSelected() || force_all )
module->Value().Rotate( offset, 900 );
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
if( !pad->IsSelected() && !force_all )
continue;
@ -706,7 +706,7 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
pad->SetDrawCoord();
}
for( EDA_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
for( EDA_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
{
if( !item->IsSelected() && !force_all )
continue;
@ -738,14 +738,14 @@ void ClearMarkItems( MODULE* module )
module->Reference().ClearFlags();
module->Value().ClearFlags();
EDA_ITEM* item = module->GraphicalItems();
EDA_ITEM* item = module->GraphicalItemsList();
for( ; item != NULL; item = item->Next() )
{
item->ClearFlags();
}
item = module->Pads();
item = module->PadsList();
for( ; item != NULL; item = item->Next() )
{
@ -773,7 +773,7 @@ void MoveMarkedItemsExactly( MODULE* module, const wxPoint& centre,
module->Value().Move( translation );
}
D_PAD* pad = module->Pads();
D_PAD* pad = module->PadsList();
for( ; pad != NULL; pad = pad->Next() )
{
@ -793,7 +793,7 @@ void MoveMarkedItemsExactly( MODULE* module, const wxPoint& centre,
pad->Rotate( newPos, rotation );
}
EDA_ITEM* item = module->GraphicalItems();
EDA_ITEM* item = module->GraphicalItemsList();
for( ; item != NULL; item = item->Next() )
{
@ -857,7 +857,7 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
ItemsCount++;
}
pad = module->Pads();
pad = module->PadsList();
for( ; pad != NULL; pad = pad->Next() )
{
@ -871,7 +871,7 @@ int MarkItemsInBloc( MODULE* module, EDA_RECT& Rect )
}
}
item = module->GraphicalItems();
item = module->GraphicalItemsList();
for( ; item != NULL; item = item->Next() )
{

View File

@ -133,7 +133,7 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( PCB_LAYER_ID aLayer,
double aCorrectionFactor,
bool aSkipNPTHPadsWihNoCopper ) const
{
D_PAD* pad = Pads();
D_PAD* pad = PadsList();
wxSize margin;
for( ; pad != NULL; pad = pad->Next() )
@ -211,7 +211,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet(
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
EDGE_MODULE* outline;
for( EDA_ITEM* item = GraphicalItems(); item != NULL; item = item->Next() )
for( EDA_ITEM* item = GraphicalItemsList(); item != NULL; item = item->Next() )
{
switch( item->Type() )
{
@ -286,7 +286,7 @@ void MODULE::TransformGraphicTextWithClearanceToPolygonSet(
{
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
for( EDA_ITEM* item = GraphicalItems(); item != NULL; item = item->Next() )
for( EDA_ITEM* item = GraphicalItemsList(); item != NULL; item = item->Next() )
{
switch( item->Type() )
{

View File

@ -318,7 +318,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
MODULE* copy = (MODULE*) aPcbComponent->Clone();
// At this point, the component footprint is updated. Now update the nets.
for( D_PAD* pad = aPcbComponent->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aPcbComponent->PadsList(); pad; pad = pad->Next() )
{
COMPONENT_NET net = aNewComponent->GetNet( pad->GetPadName() );

View File

@ -763,7 +763,7 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID LAYER_aPCB, bool isEnabled )
for ( auto track : Tracks() )
track->SetLocalRatsnestVisible( isEnabled );
for( auto mod : Modules() )
for ( auto pad : mod->PadsIter() )
for ( auto pad : mod->Pads() )
pad->SetLocalRatsnestVisible( isEnabled );
for( int i = 0; i<GetAreaCount(); i++ )
{
@ -1617,7 +1617,7 @@ D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, LSET aLayerSet )
{
for( auto mod : Modules() )
{
for ( auto pad : mod->PadsIter() )
for ( auto pad : mod->Pads() )
{
if( pad->GetPosition() != aPosition )
continue;
@ -1743,7 +1743,7 @@ void BOARD::GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNe
{
for ( auto mod : Modules() )
{
for ( auto pad : mod->PadsIter( ) )
for ( auto pad : mod->Pads( ) )
{
if( aNetCode < 0 || pad->GetNetCode() == aNetCode )
{
@ -2617,7 +2617,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
continue;
// At this point, the component footprint is updated. Now update the nets.
for( D_PAD* pad = footprint->Pads(); pad; pad = pad->Next() )
for( auto pad : footprint->Pads() )
{
COMPONENT_NET net = component->GetNet( pad->GetPadName() );
@ -2897,7 +2897,7 @@ const std::vector<D_PAD*> BOARD::GetPads()
std::vector<D_PAD*> rv;
for ( auto mod: Modules() )
{
for ( auto pad: mod->PadsIter() )
for ( auto pad: mod->Pads() )
rv.push_back ( pad );
}
@ -2919,7 +2919,7 @@ D_PAD* BOARD::GetPad( unsigned aIndex ) const
unsigned count = 0;
for ( MODULE *mod = m_Modules; mod ; mod = mod->Next() ) // FIXME: const DLIST_ITERATOR
{
for ( D_PAD *pad = mod->Pads(); pad; pad = pad->Next() )
for ( D_PAD *pad = mod->PadsList(); pad; pad = pad->Next() )
{
if ( count == aIndex )
return pad;

View File

@ -37,7 +37,6 @@
class NETCLASS;
class TRACK;
class D_PAD;
class CN_BOARD_ITEM_DATA;
/**
* Class BOARD_CONNECTED_ITEM

View File

@ -229,7 +229,7 @@ void MODULE::ClearAllNets()
{
// Force the ORPHANED dummy net info for all pads.
// ORPHANED dummy net does not depend on a board
for( D_PAD* pad = Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = PadsList(); pad; pad = pad->Next() )
pad->SetNetCode( NETINFO_LIST::ORPHANED );
}
@ -364,7 +364,7 @@ void MODULE::CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings )
aModule->SetThermalGap( GetThermalGap() );
}
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
{
// Fix me: if aCopyLocalSettings == true, for "multiple" pads
// (set of pads having the same name/number) this is broken
@ -717,7 +717,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
std::set<wxUint32> usedNames;
// Create a set of used pad numbers
for( D_PAD* pad = Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = PadsList(); pad; pad = pad->Next() )
{
// Skip pads not on copper layers (used to build complex
// solder paste shapes for instance)
@ -1065,14 +1065,14 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
m_Value->SetDrawCoord();
// Update the pad local coordinates.
for( D_PAD* pad = Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = PadsList(); pad; pad = pad->Next() )
{
pad->SetPos0( pad->GetPos0() + moveVector );
pad->SetDrawCoord();
}
// Update the draw element coordinates.
for( EDA_ITEM* item = GraphicalItems(); item; item = item->Next() )
for( EDA_ITEM* item = GraphicalItemsList(); item; item = item->Next() )
{
switch( item->Type() )
{
@ -1150,7 +1150,7 @@ BOARD_ITEM* MODULE::Duplicate( const BOARD_ITEM* aItem,
new_pad = new D_PAD( *static_cast<const D_PAD*>( aItem ) );
if( aAddToModule )
Pads().PushBack( new_pad );
PadsList().PushBack( new_pad );
new_item = new_pad;
break;
@ -1167,7 +1167,7 @@ BOARD_ITEM* MODULE::Duplicate( const BOARD_ITEM* aItem,
TEXTE_MODULE* new_text = new TEXTE_MODULE( *old_text );
if( aAddToModule )
GraphicalItems().PushBack( new_text );
GraphicalItemsList().PushBack( new_text );
new_item = new_text;
}
@ -1180,7 +1180,7 @@ BOARD_ITEM* MODULE::Duplicate( const BOARD_ITEM* aItem,
*static_cast<const EDGE_MODULE*>(aItem) );
if( aAddToModule )
GraphicalItems().PushBack( new_edge );
GraphicalItemsList().PushBack( new_edge );
new_item = new_edge;
break;
@ -1211,7 +1211,7 @@ wxString MODULE::GetNextPadName( bool aFillSequenceGaps ) const
std::set<int> usedNumbers;
// Create a set of used pad numbers
for( D_PAD* pad = Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = PadsList(); pad; pad = pad->Next() )
{
int padNumber = getTrailingInt( pad->GetPadName() );
usedNumbers.insert( padNumber );
@ -1276,7 +1276,7 @@ bool MODULE::BuildPolyCourtyard()
std::vector< DRAWSEGMENT* > list_front;
std::vector< DRAWSEGMENT* > list_back;
for( BOARD_ITEM* item = GraphicalItems(); item; item = item->Next() )
for( BOARD_ITEM* item = GraphicalItemsList(); item; item = item->Next() )
{
if( item->GetLayer() == B_CrtYd && item->Type() == PCB_MODULE_EDGE_T )
list_back.push_back( static_cast< DRAWSEGMENT* > ( item ) );

View File

@ -55,9 +55,8 @@ class D_PAD;
class BOARD;
class MSG_PANEL_ITEM;
namespace KIGFX
{
class VIEW;
namespace KIGFX {
class VIEW;
};
enum INCLUDE_NPTH_T
@ -132,26 +131,35 @@ public:
// Virtual function
const EDA_RECT GetBoundingBox() const override;
DLIST<D_PAD>& Pads() { return m_Pads; }
const DLIST<D_PAD>& Pads() const { return m_Pads; }
DLIST<D_PAD>& PadsList() { return m_Pads; }
const DLIST<D_PAD>& PadsList() const { return m_Pads; }
DLIST<BOARD_ITEM>& GraphicalItems() { return m_Drawings; }
const DLIST<BOARD_ITEM>& GraphicalItems() const { return m_Drawings; }
DLIST<BOARD_ITEM>& GraphicalItemsList() { return m_Drawings; }
const DLIST<BOARD_ITEM>& GraphicalItemsList() const { return m_Drawings; }
DLIST_ITERATOR_WRAPPER<D_PAD> PadsIter() { return DLIST_ITERATOR_WRAPPER<D_PAD>(m_Pads); }
DLIST_ITERATOR_WRAPPER<BOARD_ITEM> GraphicalItemsIter() { return DLIST_ITERATOR_WRAPPER<BOARD_ITEM>(m_Drawings); }
DLIST_ITERATOR_WRAPPER<D_PAD> Pads()
{
return DLIST_ITERATOR_WRAPPER<D_PAD>( m_Pads );
}
DLIST_ITERATOR_WRAPPER<BOARD_ITEM> GraphicalItems()
{
return DLIST_ITERATOR_WRAPPER<BOARD_ITEM>( m_Drawings );
}
std::list<S3D_INFO>& Models() { return m_3D_Drawings; }
const std::list<S3D_INFO>& Models() const { return m_3D_Drawings; }
void SetPosition( const wxPoint& aPos ) override;
const wxPoint& GetPosition() const override { return m_Pos; }
void SetOrientation( double newangle );
void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation*10.0 ); }
void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
double GetOrientation() const { return m_Orient; }
double GetOrientationDegrees() const { return m_Orient/10.0; }
double GetOrientationRadians() const { return m_Orient*M_PI/1800; }
double GetOrientationDegrees() const { return m_Orient / 10.0; }
double GetOrientationRadians() const { return m_Orient * M_PI / 1800; }
const LIB_ID& GetFPID() const { return m_fpid; }
void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
@ -216,7 +224,7 @@ public:
* function IsFlipped
* @return true if the module is flipped, i.e. on the back side of the board
*/
bool IsFlipped() const {return GetLayer() == B_Cu; }
bool IsFlipped() const { return GetLayer() == B_Cu; }
// m_ModuleStatus bits:
#define MODULE_is_LOCKED 0x01 ///< module LOCKED: no autoplace allowed
@ -243,7 +251,7 @@ public:
m_ModuleStatus &= ~MODULE_is_LOCKED;
}
bool IsPlaced() const { return (m_ModuleStatus & MODULE_is_PLACED); }
bool IsPlaced() const { return m_ModuleStatus & MODULE_is_PLACED; }
void SetIsPlaced( bool isPlaced )
{
if( isPlaced )
@ -252,7 +260,7 @@ public:
m_ModuleStatus &= ~MODULE_is_PLACED;
}
bool NeedsPlaced() const { return (m_ModuleStatus & MODULE_to_PLACE); }
bool NeedsPlaced() const { return m_ModuleStatus & MODULE_to_PLACE; }
void SetNeedsPlaced( bool needsPlaced )
{
if( needsPlaced )
@ -261,7 +269,7 @@ public:
m_ModuleStatus &= ~MODULE_to_PLACE;
}
bool PadsLocked() const { return ( m_ModuleStatus & MODULE_PADS_LOCKED ); }
bool PadsLocked() const { return m_ModuleStatus & MODULE_PADS_LOCKED; }
void SetPadsLocked( bool aPadsLocked )
{
@ -272,7 +280,7 @@ public:
}
void SetLastEditTime( time_t aTime ) { m_LastEditTime = aTime; }
void SetLastEditTime( ) { m_LastEditTime = time( NULL ); }
void SetLastEditTime() { m_LastEditTime = time( NULL ); }
time_t GetLastEditTime() const { return m_LastEditTime; }
/* drawing functions */
@ -352,8 +360,7 @@ public:
* a circle when building the texts polygonal shapes of the stroke font
* if 0, use the aCircleToSegmentsCount value
*/
void TransformGraphicShapesWithClearanceToPolygonSet(
PCB_LAYER_ID aLayer,
void TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLayer,
SHAPE_POLY_SET& aCornerBuffer,
int aInflateValue,
int aCircleToSegmentsCount,
@ -371,8 +378,7 @@ public:
* @param aCorrectionFactor
* @param aCircleToSegmentsCountForTexts
*/
void TransformGraphicTextWithClearanceToPolygonSet(
PCB_LAYER_ID aLayer,
void TransformGraphicTextWithClearanceToPolygonSet( PCB_LAYER_ID aLayer,
SHAPE_POLY_SET& aCornerBuffer,
int aInflateValue,
int aCircleToSegmentsCount,
@ -400,7 +406,7 @@ public:
const wxPoint& offset, int dim_ancre, GR_DRAWMODE draw_mode );
///> @copydoc EDA_ITEM::GetMsgPanelInfo
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
void GetMsgPanelInfo( std::vector<MSG_PANEL_ITEM>& aList ) override;
bool HitTest( const wxPoint& aPosition ) const override;
@ -490,7 +496,7 @@ public:
* non-plated through holes when false.
* @return the number of pads according to \a aIncludeNPTH.
*/
unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T( INCLUDE_NPTH ) ) const;
unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
/**
* GetUniquePadCount
@ -504,7 +510,7 @@ public:
* non-plated through holes when false.
* @return the number of unique pads according to \a aIncludeNPTH.
*/
unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T( INCLUDE_NPTH ) ) const;
unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
/**
* Function GetNextPadName
@ -597,7 +603,7 @@ public:
* @param aName = the name in library to validate
* @return true if the given name is valid
*/
static bool IsLibNameValid( const wxString & aName );
static bool IsLibNameValid( const wxString& aName );
/**
* static function StringLibNameInvalidChars

View File

@ -94,9 +94,9 @@ void NETINFO_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
return;
int count = 0;
for( MODULE* module = board->m_Modules; module != NULL; module = module->Next() )
for( auto mod : board->Modules() )
{
for( D_PAD* pad = module->Pads(); pad != 0; pad = pad->Next() )
for( auto pad : mod->Pads() )
{
if( pad->GetNetCode() == GetNet() )
{

View File

@ -221,7 +221,7 @@ void NETINFO_MAPPING::Update()
// Modules/pads
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads().GetFirst(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList().GetFirst(); pad; pad = pad->Next() )
{
nets.insert( pad->GetNetCode() );
}

View File

@ -642,7 +642,6 @@ public:
return m_RawPolysList;
}
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override;

View File

@ -35,10 +35,7 @@
#include <view/view.h>
#include <pcbnew.h>
// Helper classes to handle connection points
#include <connect.h>
#include <class_board.h>
/*
* Function SortTracksByNetCode used in RebuildTrackChain()
* to sort track segments by net code.

View File

@ -1,38 +0,0 @@
/**
* @file connect.h
* @brief helper classes to find track to track and track to pad connections.
*/
#ifndef CONNECT_H
#define CONNECT_H
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <class_track.h>
#include <class_board.h>
#endif // ifndef CONNECT_H

View File

@ -189,7 +189,7 @@ void CONNECTIVITY_DATA::BlockRatsnestItems( const std::vector<BOARD_ITEM*>& aIte
{
if( item->Type() == PCB_MODULE_T )
{
for( auto pad : static_cast<MODULE*>(item)->PadsIter() )
for( auto pad : static_cast<MODULE*>(item)->Pads() )
citems.push_back( pad );
}
else

View File

@ -140,7 +140,7 @@ bool CN_CONNECTIVITY_ALGO::Remove( BOARD_ITEM* aItem )
switch( aItem->Type() )
{
case PCB_MODULE_T:
for ( auto pad : static_cast<MODULE *> (aItem ) -> PadsIter() )
for ( auto pad : static_cast<MODULE *> (aItem ) -> Pads() )
{
m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( pad ) ].MarkItemsAsInvalid();
m_itemMap.erase ( static_cast<BOARD_CONNECTED_ITEM*>( pad ) );
@ -195,7 +195,7 @@ void CN_CONNECTIVITY_ALGO::markItemNetAsDirty( const BOARD_ITEM *aItem )
if ( aItem->Type() == PCB_MODULE_T )
{
auto mod = static_cast <const MODULE *> ( aItem );
for( D_PAD* pad = mod->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = mod->PadsList(); pad; pad = pad->Next() )
markNetAsDirty ( pad->GetNetCode() );
}
}
@ -209,7 +209,7 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
switch( aItem->Type() )
{
case PCB_MODULE_T:
for ( auto pad : static_cast<MODULE *> (aItem ) -> PadsIter() )
for ( auto pad : static_cast<MODULE *> (aItem ) -> Pads() )
{
if ( m_itemMap.find ( pad ) != m_itemMap.end() )
return false;
@ -678,7 +678,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard )
Add( tv );
for( auto mod : aBoard->Modules() )
for( auto pad : mod->PadsIter() )
for( auto pad : mod->Pads() )
Add( pad );
/*wxLogTrace( "CN", "zones : %lu, pads : %lu vias : %lu tracks : %lu\n",
@ -701,7 +701,7 @@ void CN_CONNECTIVITY_ALGO::Build( const std::vector<BOARD_ITEM *> &aItems )
case PCB_MODULE_T:
{
for( auto pad : static_cast<MODULE*>(item)->PadsIter() )
for( auto pad : static_cast<MODULE*>(item)->Pads() )
{
Add( pad );
}

View File

@ -177,7 +177,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
for( MODULE* module = m_parent->GetBoard()->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad != NULL; pad = pad->Next() )
{
if( pad->GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )
{

View File

@ -160,7 +160,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete()
masque_layer &= layers_filter;
for( item = pcb->DrawingsList(); item; item = item->Next() )
for( auto item : pcb->Drawings() )
{
KICAD_T type = item->Type();
LAYER_NUM layer = item->GetLayer();

View File

@ -185,7 +185,7 @@ void PCB_BASE_FRAME::ResetModuleTextSizes( const wxString & aFilter, bool aRef,
if( aOthers )
{
// Go through all other module text fields
for( BOARD_ITEM* boardItem = module->GraphicalItems(); boardItem; boardItem = boardItem->Next() )
for( BOARD_ITEM* boardItem = module->GraphicalItemsList(); boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{

View File

@ -331,9 +331,7 @@ void DIALOG_NETLIST::OnCompileRatsnestClick( wxCommandEvent& event )
{
// Rebuild the board connectivity:
auto board = m_parent->GetBoard();
//board->GetConnectivity()->Build( board );
board->GetConnectivity()->PropagateNets();
m_parent->Compile_Ratsnest( m_dc, true );
board->GetConnectivity()->RecalculateRatsnest();
}

View File

@ -60,6 +60,7 @@ DRAG_SEGM_PICKER::DRAG_SEGM_PICKER( TRACK* aTrack )
m_Flipped = false;
}
void DRAG_SEGM_PICKER::SetAuxParameters()
{
MODULE* module = NULL;
@ -155,7 +156,7 @@ void DRAG_LIST::BuildDragListe( MODULE* aModule )
std::vector<D_PAD*> padList;
for ( auto pad : aModule->PadsIter() )
for ( auto pad : aModule->Pads() )
padList.push_back( pad );
sort( padList.begin(), padList.end(), sortPadsByXthenYCoord );
@ -185,8 +186,6 @@ bool sort_tracklist( const DRAG_SEGM_PICKER& ref, const DRAG_SEGM_PICKER& tst )
void DRAG_LIST::fillList( std::vector<D_PAD*>& aList )
{
printf("FillList!\n");
// clear flags and variables of selected tracks
for( auto pad : aList )
{

View File

@ -568,7 +568,7 @@ void DRC::testUnconnected()
DRC_ITEM* uncItem = new DRC_ITEM( DRCE_UNCONNECTED_ITEMS,
t_src,
t_dst,
wxPoint( src.x, src.y ), wxPoint(dst.x, dst.y) );
wxPoint( src.x, src.y ), wxPoint( dst.x, dst.y ) );
m_unconnected.push_back( uncItem );
}
@ -661,6 +661,7 @@ void DRC::testKeepoutAreas()
}
}
void DRC::testTexts()
{
std::vector<wxPoint> textShape; // a buffer to store the text shape (set of segments)
@ -1085,3 +1086,4 @@ bool DRC::doFootprintOverlappingDrc()
return success;
}

View File

@ -655,7 +655,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
// Add a PAD_ATTRIB_HOLE_NOT_PLATED pad to this module.
D_PAD* pad = new D_PAD( module );
module->Pads().PushBack( pad );
module->PadsList().PushBack( pad );
pad->SetShape( PAD_SHAPE_CIRCLE );
pad->SetAttribute( PAD_ATTRIB_HOLE_NOT_PLATED );
@ -851,7 +851,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
m_board->Add( m, ADD_APPEND );
// update the nets within the pads of the clone
for( D_PAD* pad = m->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = m->PadsList(); pad; pad = pad->Next() )
{
string pn_key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) );
@ -1233,7 +1233,7 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, wxXmlNode* aTree ) const
dwg->SetLayer( layer );
dwg->SetWidth( width );
aModule->GraphicalItems().PushBack( dwg );
aModule->GraphicalItemsList().PushBack( dwg );
}
}
@ -1244,7 +1244,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, wxXmlNode* aTree ) const
EPAD e( aTree );
D_PAD* pad = new D_PAD( aModule );
aModule->Pads().PushBack( pad );
aModule->PadsList().PushBack( pad );
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
@ -1346,7 +1346,7 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, wxXmlNode* aTree ) const
{
// FIXME: graphical text items are rotated for some reason.
txt = new TEXTE_MODULE( aModule );
aModule->GraphicalItems().PushBack( txt );
aModule->GraphicalItemsList().PushBack( txt );
}
txt->SetTimeStamp( timeStamp( aTree ) );
@ -1440,7 +1440,7 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, wxXmlNode* aTree ) const
if( IsNonCopperLayer( layer ) ) // skip copper "package.rectangle"s
{
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
aModule->GraphicalItems().PushBack( dwg );
aModule->GraphicalItemsList().PushBack( dwg );
dwg->SetLayer( layer );
dwg->SetWidth( 0 );
@ -1473,7 +1473,7 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const
if( IsNonCopperLayer( layer ) ) // skip copper "package.rectangle"s
{
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
aModule->GraphicalItems().PushBack( dwg );
aModule->GraphicalItemsList().PushBack( dwg );
dwg->SetWidth( 0 ); // it's filled, no need for boundary width
@ -1526,7 +1526,7 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const
PCB_LAYER_ID layer = kicad_layer( e.layer );
EDGE_MODULE* gr = new EDGE_MODULE( aModule, S_CIRCLE );
aModule->GraphicalItems().PushBack( gr );
aModule->GraphicalItemsList().PushBack( gr );
gr->SetWidth( kicad( e.width ) );
@ -1555,7 +1555,7 @@ void EAGLE_PLUGIN::packageHole( MODULE* aModule, wxXmlNode* aTree ) const
// we add a PAD_ATTRIB_HOLE_NOT_PLATED pad to this module.
D_PAD* pad = new D_PAD( aModule );
aModule->Pads().PushBack( pad );
aModule->PadsList().PushBack( pad );
pad->SetShape( PAD_SHAPE_CIRCLE );
pad->SetAttribute( PAD_ATTRIB_HOLE_NOT_PLATED );
@ -1590,7 +1590,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const
}
D_PAD* pad = new D_PAD( aModule );
aModule->Pads().PushBack( pad );
aModule->PadsList().PushBack( pad );
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
pad->SetShape( PAD_SHAPE_RECT );

View File

@ -167,9 +167,9 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge )
if( aEdge == NULL )
{
aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->GraphicalItems();
aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->GraphicalItemsList();
for( BOARD_ITEM *item = module->GraphicalItems(); item; item = item->Next() )
for( BOARD_ITEM *item = module->GraphicalItemsList(); item; item = item->Next() )
{
aEdge = dyn_cast<EDGE_MODULE*>( item );
@ -217,7 +217,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* aEdge )
if( !aEdge )
{
for( BOARD_ITEM *item = module->GraphicalItems() ; item != NULL;
for( BOARD_ITEM *item = module->GraphicalItemsList() ; item != NULL;
item = item->Next() )
{
aEdge = dyn_cast<EDGE_MODULE*>( item );
@ -336,7 +336,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge,
MoveVector.x = MoveVector.y = 0;
// Add the new item to the Drawings list head
module->GraphicalItems().PushFront( aEdge );
module->GraphicalItemsList().PushFront( aEdge );
// Update characteristics of the segment or arc.
aEdge->SetFlags( IS_NEW );
@ -380,7 +380,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge,
EDGE_MODULE* newedge = new EDGE_MODULE( *aEdge );
// insert _after_ aEdge, which is the same as inserting before aEdge->Next()
module->GraphicalItems().Insert( newedge, aEdge->Next() );
module->GraphicalItemsList().Insert( newedge, aEdge->Next() );
aEdge->ClearFlags();
aEdge = newedge; // point now new item

View File

@ -663,6 +663,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
}
SetCurItem( NULL ); // CurItem might be deleted by this command, clear the pointer
// fixme
OnModify();
SetMsgPanel( GetBoard() );
m_canvas->Refresh();

View File

@ -160,7 +160,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
DBG( g_CurrentTrackList.VerifyListIntegrity() );
int net = -1;
if (lockPoint)
if( lockPoint )
net = lockPoint->GetNetCode();
BuildAirWiresTargetsList( lockPoint, wxPoint( 0, 0 ), net );

View File

@ -90,7 +90,7 @@ TEXTE_MODULE* FOOTPRINT_EDIT_FRAME::CreateTextModule( MODULE* aModule, wxDC* aDC
// Add the new text object to the beginning of the footprint draw list.
if( aModule )
aModule->GraphicalItems().PushFront( text );
aModule->GraphicalItemsList().PushFront( text );
text->ClearFlags();

View File

@ -119,7 +119,7 @@ static void build_pad_testpoints( BOARD *aPcb,
for( MODULE *module = aPcb->m_Modules;
module; module = module->Next() )
{
for( D_PAD *pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD *pad = module->PadsList(); pad; pad = pad->Next() )
{
D356_RECORD rk;
rk.access = compute_pad_access_code( aPcb, pad->GetLayerSet() );
@ -394,4 +394,3 @@ void PCB_EDIT_FRAME::GenD356File( wxCommandEvent& aEvent )
fclose( file );
}

View File

@ -642,7 +642,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
{
FootprintWriteShape( aFile, module );
for( pad = module->Pads(); pad; pad = pad->Next() )
for( pad = module->PadsList(); pad; pad = pad->Next() )
{
/* Funny thing: GenCAD requires the pad side even if you use
* padstacks (which are theorically optional but gerbtools
@ -794,7 +794,7 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
for( module = aPcb->m_Modules; module; module = module->Next() )
{
for( pad = module->Pads(); pad; pad = pad->Next() )
for( pad = module->PadsList(); pad; pad = pad->Next() )
{
wxString padname;
@ -1174,7 +1174,7 @@ static void FootprintWriteShape( FILE* aFile, MODULE* module )
// CAM350 read it right but only closed shapes
// ProntoPlace double-flip it (at least the pads are correct)
// GerberTool usually get it right...
for( PtStruct = module->GraphicalItems(); PtStruct; PtStruct = PtStruct->Next() )
for( PtStruct = module->GraphicalItemsList(); PtStruct; PtStruct = PtStruct->Next() )
{
switch( PtStruct->Type() )
{

View File

@ -287,7 +287,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
aIDFBoard.GetUserOffset( dx, dy );
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
{
drill = (double) pad->GetDrillSize().x * scale;
x = pad->GetPosition().x * scale + dx;

View File

@ -1278,7 +1278,7 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb,
export_vrml_text_module( &aModule->Value() );
// Export module edges
for( EDA_ITEM* item = aModule->GraphicalItems(); item; item = item->Next() )
for( EDA_ITEM* item = aModule->GraphicalItemsList(); item; item = item->Next() )
{
switch( item->Type() )
{
@ -1298,7 +1298,7 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb,
}
// Export pads
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
export_vrml_pad( aModel, aPcb, pad );
bool isFlipped = aModule->GetLayer() == B_Cu;

View File

@ -390,7 +390,7 @@ static bool HasNonSMDPins( MODULE* aModule )
{
D_PAD* pad;
for( pad = aModule->Pads(); pad; pad = pad->Next() )
for( pad = aModule->PadsList(); pad; pad = pad->Next() )
{
if( pad->GetAttribute() != PAD_ATTRIB_SMD )
return true;
@ -717,7 +717,7 @@ bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool
else
fputs( "layer other\n", rptfile );
for( D_PAD* pad = Module->Pads(); pad != NULL; pad = pad->Next() )
for( D_PAD* pad = Module->PadsList(); pad != NULL; pad = pad->Next() )
{
fprintf( rptfile, "$PAD \"%s\"\n", TO_UTF8( pad->GetPadName() ) );
int layer = 0;
@ -754,4 +754,3 @@ bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool
return true;
}

View File

@ -584,7 +584,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
{
wxBusyCursor dummy; // Displays an Hourglass while building connectivity
Compile_Ratsnest( NULL, true );
//GetBoard()->GetRatsnest()->ProcessBoard();
GetBoard()->GetConnectivity()->Build( GetBoard() );
}
// Update info shown by the horizontal toolbars

View File

@ -180,7 +180,7 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
bool saveMe = false;
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
// Filters changes prohibited.
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
@ -225,7 +225,7 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
module->ClearFlags( DO_NOT_DRAW );
}
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
// Filters changes prohibited.
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )

View File

@ -581,7 +581,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader )
parseInt( parameters[5], conv_unit ) ) );
drawSeg->SetWidth( parseInt( parameters[6], conv_unit ) );
drawSeg->SetDrawCoord();
module->GraphicalItems().PushBack( drawSeg );
module->GraphicalItemsList().PushBack( drawSeg );
continue;
}
@ -599,7 +599,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader )
EDGE_MODULE* drawSeg = new EDGE_MODULE( module.get() );
drawSeg->SetLayer( F_SilkS );
drawSeg->SetShape( S_ARC );
module->GraphicalItems().PushBack( drawSeg );
module->GraphicalItemsList().PushBack( drawSeg );
// for and arc: ibuf[3] = ibuf[4]. Pcbnew does not know ellipses
int radius = ( parseInt( parameters[4], conv_unit ) +

View File

@ -1099,11 +1099,11 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
Format( (BOARD_ITEM*) &aModule->Value(), aNestLevel+1 );
// Save drawing elements.
for( BOARD_ITEM* gr = aModule->GraphicalItems(); gr; gr = gr->Next() )
for( BOARD_ITEM* gr = aModule->GraphicalItemsList(); gr; gr = gr->Next() )
Format( gr, aNestLevel+1 );
// Save pads.
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
format( pad, aNestLevel+1 );
// Save 3D info.

View File

@ -1198,7 +1198,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule )
// All other fields greater than 1.
default:
textm = new TEXTE_MODULE( aModule );
aModule->GraphicalItems().PushBack( textm );
aModule->GraphicalItemsList().PushBack( textm );
}
loadMODULE_TEXT( textm );
@ -1609,7 +1609,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
pad->SetPosition( padpos + aModule->GetPosition() );
aModule->Pads().PushBack( pad.release() );
aModule->PadsList().PushBack( pad.release() );
return; // preferred exit
}
}
@ -1757,7 +1757,7 @@ void LEGACY_PLUGIN::loadMODULE_EDGE( MODULE* aModule )
EDGE_MODULE* em = dwg.release();
aModule->GraphicalItems().PushBack( em );
aModule->GraphicalItemsList().PushBack( em );
// this had been done at the MODULE level before, presumably because the
// EDGE_MODULE needs to be already added to a module before this function will work.

View File

@ -362,13 +362,13 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern,
PtSegm->SetShape( S_SEGMENT );
PtSegm->SetStart0( PtSegm->GetStart() - module->GetPosition() );
PtSegm->SetEnd0( PtSegm->GetEnd() - module->GetPosition() );
module->GraphicalItems().PushBack( PtSegm );
module->GraphicalItemsList().PushBack( PtSegm );
}
// Place a pad on each end of coil.
pad = new D_PAD( module );
module->Pads().PushFront( pad );
module->PadsList().PushFront( pad );
pad->SetPadName( "1" );
pad->SetPosition( inductorPattern.m_End );
@ -382,7 +382,7 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern,
D_PAD* newpad = new D_PAD( *pad );
module->Pads().Insert( newpad, pad->Next() );
module->PadsList().Insert( newpad, pad->Next() );
pad = newpad;
pad->SetPadName( "2" );

View File

@ -204,7 +204,7 @@ MODULE* PCB_EDIT_FRAME::CreateMuWaveBaseFootprint( const wxString& aValue,
{
D_PAD* pad = new D_PAD( module );
module->Pads().PushFront( pad );
module->PadsList().PushFront( pad );
int tw = GetDesignSettings().GetCurrentTrackWidth();
pad->SetSize( wxSize( tw, tw ) );
@ -312,7 +312,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
}
module = CreateMuWaveBaseFootprint( cmp_name, text_size, pad_count );
pad = module->Pads();
pad = module->PadsList();
switch( shape_type )
{
@ -339,7 +339,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
case 2: // Arc Stub created by a polygonal approach:
{
EDGE_MODULE* edge = new EDGE_MODULE( module );
module->GraphicalItems().PushFront( edge );
module->GraphicalItemsList().PushFront( edge );
edge->SetShape( S_POLYGON );
edge->SetLayer( F_Cu );
@ -623,7 +623,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
wxPoint offset;
offset.x = -ShapeSize.x / 2;
pad1 = module->Pads();
pad1 = module->PadsList();
pad1->SetX0( offset.x );
pad1->SetX( pad1->GetPos0().x );
@ -636,7 +636,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
edge->SetShape( S_POLYGON );
edge->SetLayer( F_Cu );
module->GraphicalItems().PushFront( edge );
module->GraphicalItemsList().PushFront( edge );
// Get the corner buffer of the polygonal edge
std::vector<wxPoint>& polyPoints = edge->GetPolyPoints();
@ -698,7 +698,7 @@ void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* aModule )
if( msg != wxT( "GAP" ) )
return;
pad = aModule->Pads();
pad = aModule->PadsList();
if( pad == NULL )
{

View File

@ -169,8 +169,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
}
// Rebuild the board connectivity:
Compile_Ratsnest( NULL, true );
//board->GetRatsnest()->ProcessBoard();
board->GetConnectivity()->Build( board );
SetMsgPanel( board );
m_canvas->Refresh();

View File

@ -115,7 +115,7 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw )
D_PAD* pad = new D_PAD( aModule );
// Add the new pad to end of the module pad list.
aModule->Pads().PushBack( pad );
aModule->PadsList().PushBack( pad );
// Update the pad properties,
// and keep NETINFO_LIST::ORPHANED as net info

View File

@ -161,7 +161,7 @@ void PCB_ARC::AddToModule( MODULE* aModule )
if( IsNonCopperLayer( m_KiCadLayer ) )
{
EDGE_MODULE* arc = new EDGE_MODULE( aModule, S_ARC );
aModule->GraphicalItems().PushBack( arc );
aModule->GraphicalItemsList().PushBack( arc );
arc->SetAngle( -m_angle );
arc->m_Start0 = wxPoint( m_positionX, m_positionY );

View File

@ -120,7 +120,7 @@ void PCB_LINE::AddToModule( MODULE* aModule )
if( IsNonCopperLayer( m_KiCadLayer ) )
{
EDGE_MODULE* segment = new EDGE_MODULE( aModule, S_SEGMENT );
aModule->GraphicalItems().PushBack( segment );
aModule->GraphicalItemsList().PushBack( segment );
segment->m_Start0 = wxPoint( m_positionX, m_positionY );
segment->m_End0 = wxPoint( m_toX, m_toY );

View File

@ -294,7 +294,7 @@ void PCB_PAD::AddToModule( MODULE* aModule, int aRotation, bool aEncapsulatedPad
pad->SetPosition( padpos + aModule->GetPosition() );
}
aModule->Pads().PushBack( pad );
aModule->PadsList().PushBack( pad );
}

View File

@ -1932,7 +1932,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
break;
default:
module->GraphicalItems().PushBack( text );
module->GraphicalItemsList().PushBack( text );
}
}
break;
@ -1946,7 +1946,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
EDGE_MODULE* em = parseEDGE_MODULE();
em->SetParent( module.get() );
em->SetDrawCoord();
module->GraphicalItems().PushBack( em );
module->GraphicalItemsList().PushBack( em );
}
break;

View File

@ -506,7 +506,7 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
if( IsGalCanvasActive() )
{
aBoard->GetConnectivity()->Build ( aBoard );
aBoard->GetConnectivity()->Build( aBoard );
// reload the worksheet
SetPageSettings( aBoard->GetPageSettings() );

View File

@ -91,7 +91,7 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
{
aPlotter->StartBlock( NULL );
for( D_PAD * pad = Module->Pads(); pad; pad = pad->Next() )
for( D_PAD * pad = Module->PadsList(); pad; pad = pad->Next() )
{
// See if the pad is on this layer
LSET masklayer = pad->GetLayerSet();
@ -314,7 +314,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
{
if( !aLayerMask[ item->GetLayer() ] )
continue;
@ -336,7 +336,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
{
aPlotter->StartBlock( NULL );
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
if( (pad->GetLayerSet() & aLayerMask) == 0 )
continue;
@ -676,7 +676,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter,
{
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
wxSize hole = pad->GetDrillSize();
@ -746,7 +746,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
{
if( layer != item->GetLayer() )
continue;

View File

@ -238,7 +238,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule )
PlotTextModule( &aModule->Value(), GetValueColor() );
}
for( BOARD_ITEM *item = aModule->GraphicalItems().GetFirst(); item; item = item->Next() )
for( BOARD_ITEM *item = aModule->GraphicalItemsList().GetFirst(); item; item = item->Next() )
{
textModule = dyn_cast<TEXTE_MODULE*>( item );
@ -441,7 +441,7 @@ void BRDITEMS_PLOTTER::Plot_Edges_Modules()
{
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
for( BOARD_ITEM* item = module->GraphicalItems().GetFirst(); item; item = item->Next() )
for( BOARD_ITEM* item = module->GraphicalItemsList().GetFirst(); item; item = item->Next() )
{
EDGE_MODULE* edge = dyn_cast<EDGE_MODULE*>( item );
@ -822,7 +822,7 @@ void BRDITEMS_PLOTTER::PlotDrillMarks()
for( MODULE *Module = m_board->m_Modules; Module != NULL; Module = Module->Next() )
{
for( D_PAD *pad = Module->Pads(); pad != NULL; pad = pad->Next() )
for( D_PAD *pad = Module->PadsList(); pad != NULL; pad = pad->Next() )
{
if( pad->GetDrillSize().x == 0 )
continue;

View File

@ -318,7 +318,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt )
{
// Print pads
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
{
if( !( pad->GetLayerSet() & aMask ).any() )
continue;
@ -356,7 +356,7 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
if( aModule->Value().IsVisible() && aMask[aModule->Value().GetLayer()] )
aModule->Value().Draw( aPanel, aDC, aDraw_mode );
for( EDA_ITEM* item = aModule->GraphicalItems(); item; item = item->Next() )
for( EDA_ITEM* item = aModule->GraphicalItemsList(); item; item = item->Next() )
{
switch( item->Type() )
{

View File

@ -225,7 +225,7 @@ void MODULE::DrawOutlinesWhenMoving( EDA_DRAW_PANEL* panel, wxDC* DC,
pad_fill_tmp = displ_opts->m_DisplayPadFill;
displ_opts->m_DisplayPadFill = true;
pt_pad = Pads();
pt_pad = PadsList();
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
pt_pad->Draw( panel, DC, GR_XOR, aMoveVector );
@ -247,7 +247,7 @@ void PCB_EDIT_FRAME::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC )
{
auto mod = static_cast<MODULE*> (item);
for( auto pad : mod->PadsIter() )
for( auto pad : mod->Pads() )
{
pad->SetLocalRatsnestVisible( true );
}

View File

@ -51,116 +51,6 @@ class CN_CONNECTIVITY_ALGO;
struct RN_NODE_OR_FILTER;
struct RN_NODE_AND_FILTER;
#if 0
///> General interface for filtering out nodes in search functions.
struct RN_NODE_FILTER : public std::unary_function<const RN_NODE_PTR&, bool>
{
virtual ~RN_NODE_FILTER() {}
virtual bool operator()( const RN_NODE_PTR& aNode ) const
{
return true; // By default everything passes
}
friend RN_NODE_AND_FILTER operator&&( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
friend RN_NODE_OR_FILTER operator||( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
};
RN_NODE_AND_FILTER operator&&( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
RN_NODE_OR_FILTER operator||( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 );
///> Leaves nodes that can be a ratsnest line target
struct LINE_TARGET : public RN_NODE_FILTER
{
bool operator()( const RN_NODE_PTR& aNode ) const override
{
return true;
}
};
///> Leaves nodes that can be a ratsnest line target and have a specific tag
struct LINE_TARGET_SAME_TAG : public RN_NODE_FILTER
{
LINE_TARGET_SAME_TAG( int aTag ) :
m_tag( aTag )
{}
bool operator()( const RN_NODE_PTR& aNode ) const override
{
return aNode->GetTag() == m_tag;
}
private:
int m_tag;
};
struct LINE_TARGET_DIFF_TAG : public RN_NODE_FILTER
{
LINE_TARGET_DIFF_TAG( int aTag ) :
m_tag( aTag )
{}
bool operator()( const RN_NODE_PTR& aNode ) const override
{
return aNode->GetTag() != m_tag;
}
private:
int m_tag;
};
struct RN_NODE_AND_FILTER : public RN_NODE_FILTER
{
RN_NODE_AND_FILTER( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 ) :
m_filter1( aFilter1 ), m_filter2( aFilter2 )
{}
bool operator()( const RN_NODE_PTR& aNode ) const override
{
return m_filter1( aNode ) && m_filter2( aNode );
}
private:
const RN_NODE_FILTER& m_filter1;
const RN_NODE_FILTER& m_filter2;
};
struct RN_NODE_OR_FILTER : public RN_NODE_FILTER
{
RN_NODE_OR_FILTER( const RN_NODE_FILTER& aFilter1, const RN_NODE_FILTER& aFilter2 ) :
m_filter1( aFilter1 ), m_filter2( aFilter2 )
{}
bool operator()( const RN_NODE_PTR& aNode ) const override
{
return m_filter1( aNode ) || m_filter2( aNode );
}
private:
const RN_NODE_FILTER& m_filter1;
const RN_NODE_FILTER& m_filter2;
};
///> Functor comparing if two nodes are equal by their coordinates. It is required to make set of
///> shared pointers work properly.
struct RN_NODE_COMPARE : std::binary_function<CN_ANCHOR_PTR, CN_ANCHOR_PTR, bool>
{
bool operator()( const CN_ANCHOR_PTR& aNode1, const CN_ANCHOR_PTR& aNode2 ) const
{
if ( aNode1->GetY() < aNode2->GetY() )
return true;
else if ( aNode1->GetY() == aNode2->GetY() )
{
if ( aNode1->GetX() == aNode2->GetX() )
return aNode1->GetCluster() < aNode2->GetCluster();
else
return aNode1->GetX() < aNode2->GetX();
}
return false;
}
};
#endif
/**
* Class RN_NET

View File

@ -133,7 +133,7 @@ PNS_PCBNEW_RULE_RESOLVER::PNS_PCBNEW_RULE_RESOLVER( BOARD* aBoard, PNS::ROUTER*
{
auto moduleClearance = mod->GetLocalClearance();
for( D_PAD* pad = mod->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = mod->PadsList(); pad; pad = pad->Next() )
{
int padClearance = pad->GetLocalClearance();
@ -765,7 +765,7 @@ void PNS_KICAD_IFACE::SyncWorld( PNS::NODE *aWorld )
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
std::unique_ptr< PNS::SOLID > solid = syncPad( pad );

View File

@ -1411,7 +1411,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
return -1;
for ( auto mod : m_board->Modules() )
for ( auto pad : mod->PadsIter() )
for ( auto pad : mod->Pads() )
if( pad->HitTest(pos) && (pad->GetLayerSet() &
lset ).any() )
return -1;

View File

@ -256,7 +256,7 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos )
MODULE* mod = static_cast<MODULE*>( aItem );
addAnchor( mod->GetPosition(), ORIGIN | SNAPPABLE, mod );
for( D_PAD* pad = mod->Pads(); pad; pad = pad->Next() )
for( auto pad : mod->Pads() )
addAnchor( pad->GetPosition(), CORNER | SNAPPABLE, pad );
break;

View File

@ -125,7 +125,7 @@ int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
{
if( !board()->m_Modules || !board()->m_Modules->Pads() )
if( !board()->m_Modules || !board()->m_Modules->PadsList() )
return 0;
Activate();
@ -254,7 +254,7 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
}
}
for( D_PAD* p = board()->m_Modules->Pads(); p; p = p->Next() )
for( auto p : board()->m_Modules->Pads() )
{
p->ClearSelected();
view->Update( p );
@ -411,14 +411,13 @@ int MODULE_EDITOR_TOOLS::PasteItems( const TOOL_EVENT& aEvent )
// MODULE::RunOnChildren is infeasible here: we need to create copies of items, do not
// directly modify them
for( D_PAD* pad = pastedModule->Pads(); pad; pad = pad->Next() )
for( auto pad : pastedModule->Pads() )
{
D_PAD* clone = static_cast<D_PAD*>( pad->Clone() );
commit.Add( clone );
}
for( BOARD_ITEM* drawing = pastedModule->GraphicalItems();
drawing; drawing = drawing->Next() )
for( auto drawing : pastedModule->GraphicalItems() )
{
BOARD_ITEM* clone = static_cast<BOARD_ITEM*>( drawing->Clone() );
@ -469,7 +468,7 @@ int MODULE_EDITOR_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent )
for( auto module : board()->Modules() )
{
for( auto item : module->GraphicalItemsIter() )
for( auto item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_TEXT_T )
view->Update( item, KIGFX::GEOMETRY );
@ -502,7 +501,7 @@ int MODULE_EDITOR_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
for( auto module : board()->Modules() )
{
for( auto item : module->GraphicalItemsIter() )
for( auto item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
view->Update( item, KIGFX::GEOMETRY );

View File

@ -285,7 +285,7 @@ static void globalChangePadSettings( BOARD& board,
if( module->GetFPID() != moduleRef->GetFPID() )
continue;
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
// Filters changes prohibited.
if( aPadShapeFilter && ( pad->GetShape() != aSrcPad.GetShape() ) )

View File

@ -1078,7 +1078,7 @@ static bool showLocalRatsnest( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition
{
if ( item->Type() == PCB_MODULE_T )
{
for ( auto pad : static_cast<MODULE *> (item)->PadsIter() )
for ( auto pad : static_cast<MODULE *> (item)->Pads() )
{
pad->SetLocalRatsnestVisible( true );
}

View File

@ -286,7 +286,7 @@ int PCBNEW_CONTROL::PadDisplayMode( const TOOL_EVENT& aEvent )
for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( auto pad : module->Pads() )
getView()->Update( pad, KIGFX::GEOMETRY );
}

View File

@ -897,7 +897,7 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetpath )
std::list<int> netcodeList;
for( MODULE* mmod : modList )
{
for( D_PAD* pad = mmod->Pads().GetFirst(); pad; pad = pad->Next() )
for( auto pad : mmod->Pads() )
{
if( pad->IsConnected() )
{
@ -918,6 +918,7 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetpath )
for( int netCode : netcodeList )
{
std::list<BOARD_CONNECTED_ITEM*> netPads;
// fixme
// ratsnest->GetNetItems( netCode, netPads, (RN_ITEM_TYPE)( RN_PADS ) );
for( BOARD_CONNECTED_ITEM* mitem : netPads )
{

View File

@ -267,7 +267,7 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* am_canvas, wxDC* DC, int aNetCode )
// Redraw any pads that have aNetCode
for( MODULE* module = m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
{
if( pad->GetNetCode() == aNetCode )
{
@ -302,7 +302,7 @@ static void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* aModule,
displ_opts->m_DisplayPadFill = false;
// Draw pads.
for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
{
if( (pad->GetLayerSet() & aLayerMask) == 0 )
continue;

View File

@ -224,11 +224,11 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
clone->SetParent( GetBoard() );
// Clear current flags (which can be temporary set by a current edit command)
for( EDA_ITEM* loc_item = clone->GraphicalItems(); loc_item;
for( EDA_ITEM* loc_item = clone->GraphicalItemsList(); loc_item;
loc_item = loc_item->Next() )
loc_item->ClearFlags();
for( D_PAD* pad = clone->Pads(); pad; pad = pad->Next() )
for( D_PAD* pad = clone->PadsList(); pad; pad = pad->Next() )
pad->ClearFlags();
clone->Reference().ClearFlags();

View File

@ -154,7 +154,7 @@ void ZONE_CONTAINER::buildFeatureHoleList( BOARD* aPcb, SHAPE_POLY_SET& aFeature
{
D_PAD* nextpad;
for( D_PAD* pad = module->Pads(); pad != NULL; pad = nextpad )
for( D_PAD* pad = module->PadsList(); pad != NULL; pad = nextpad )
{
nextpad = pad->Next(); // pad pointer can be modified by next code, so
// calculate the next pad here
@ -249,7 +249,7 @@ void ZONE_CONTAINER::buildFeatureHoleList( BOARD* aPcb, SHAPE_POLY_SET& aFeature
*/
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
for( BOARD_ITEM* item = module->GraphicalItemsList(); item; item = item->Next() )
{
if( !item->IsOnLayer( GetLayer() ) && !item->IsOnLayer( Edge_Cuts ) )
continue;
@ -342,7 +342,7 @@ void ZONE_CONTAINER::buildFeatureHoleList( BOARD* aPcb, SHAPE_POLY_SET& aFeature
// Remove thermal symbols
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad != NULL; pad = pad->Next() )
{
// Rejects non-standard pads with tht-only thermal reliefs
if( GetPadConnection( pad ) == PAD_ZONE_CONN_THT_THERMAL

View File

@ -108,7 +108,7 @@ void BuildUnconnectedThermalStubsPolygonList( SHAPE_POLY_SET& aCornerBuffer,
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad != NULL; pad = pad->Next() )
for( D_PAD* pad = module->PadsList(); pad != NULL; pad = pad->Next() )
{
// Rejects non-standard pads with tht-only thermal reliefs
if( aZone->GetPadConnection( pad ) == PAD_ZONE_CONN_THT_THERMAL