Code formatting and clean-up

This commit is contained in:
Maciej Suminski 2017-06-30 13:40:20 +02:00
parent 20b4226a25
commit adf4f83cb0
4 changed files with 16 additions and 19 deletions

View File

@ -2889,6 +2889,7 @@ extern bool BuildBoardPolygonOutlines( BOARD* aBoard,
SHAPE_POLY_SET& aOutlines,
wxString* aErrorText );
bool BOARD::GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
wxString* aErrorText )
{
@ -2901,10 +2902,6 @@ bool BOARD::GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
}
/*RN_DATA* BOARD::GetRatsnest() const
{
return m_connectivity->GetRatsnest();
}*/
const std::vector<D_PAD*> BOARD::GetPads()
{
@ -2919,11 +2916,13 @@ const std::vector<D_PAD*> BOARD::GetPads()
return rv;
}
unsigned BOARD::GetPadCount() const
{
return m_connectivity->GetPadCount();
}
/**
* Function GetPad
* @return D_PAD* - at the \a aIndex
@ -2931,11 +2930,12 @@ unsigned BOARD::GetPadCount() const
D_PAD* BOARD::GetPad( unsigned aIndex ) const
{
unsigned count = 0;
for ( MODULE *mod = m_Modules; mod ; mod = mod->Next() ) // FIXME: const DLIST_ITERATOR
for( MODULE* mod = m_Modules; mod ; mod = mod->Next() ) // FIXME: const DLIST_ITERATOR
{
for ( D_PAD *pad = mod->PadsList(); pad; pad = pad->Next() )
for( D_PAD* pad = mod->PadsList(); pad; pad = pad->Next() )
{
if ( count == aIndex )
if( count == aIndex )
return pad;
count++;

View File

@ -150,14 +150,13 @@ void CONNECTIVITY_DATA::RecalculateRatsnest()
int dirtyNets = 0;
for( int net = 0; net < lastNet; net++ )
{
if( m_connAlgo->IsNetDirty( net ) )
{
m_nets[net]->Clear();
dirtyNets++;
}
}
for( auto c : clusters )
{
@ -431,7 +430,7 @@ unsigned int CONNECTIVITY_DATA::GetNodeCount( int aNet ) const
{
int sum = 0;
if( aNet < 0 )
if( aNet < 0 ) // Node count for all nets
{
for( const auto& net : m_nets )
sum += net->GetNodeCount();

View File

@ -35,7 +35,6 @@
#include <math/vector2d.h>
class CN_ITEM;
class CN_CLUSTER;
class CN_CONNECTIVITY_ALGO;
class CN_EDGE;
@ -51,7 +50,7 @@ class D_PAD;
struct CN_DISJOINT_NET_ENTRY
{
int net;
BOARD_CONNECTED_ITEM* a, * b;
BOARD_CONNECTED_ITEM *a, *b;
VECTOR2I anchorA, anchorB;
};
@ -109,7 +108,6 @@ public:
* Function Clear()
* Erases the connectivity database.
*/
void Clear();
/**
@ -156,9 +154,9 @@ public:
unsigned int GetPadCount( int aNet = -1 ) const;
const std::vector<TRACK*> GetConnectedTracks( const BOARD_CONNECTED_ITEM* aItem ) const;
const std::vector<TRACK*> GetConnectedTracks( const BOARD_CONNECTED_ITEM* aItem ) const;
const std::vector<D_PAD*> GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem ) const;
const std::vector<D_PAD*> GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem ) const;
const std::vector<BOARD_CONNECTED_ITEM*> GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem, const VECTOR2I& aAnchor, KICAD_T aTypes[] );

View File

@ -883,8 +883,8 @@ public:
CN_PAD_LIST& PadList() { return m_padList; }
void ForEachAnchor( std::function<void(CN_ANCHOR_PTR)> aFunc );
void ForEachItem( std::function<void(CN_ITEM*)> aFunc );
void ForEachAnchor( std::function<void(CN_ANCHOR_PTR)> aFunc );
void ForEachItem( std::function<void(CN_ITEM*)> aFunc );
};
bool operator<( const CN_ANCHOR_PTR a, const CN_ANCHOR_PTR b );