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, SHAPE_POLY_SET& aOutlines,
wxString* aErrorText ); wxString* aErrorText );
bool BOARD::GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines, bool BOARD::GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
wxString* aErrorText ) 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() const std::vector<D_PAD*> BOARD::GetPads()
{ {
@ -2919,11 +2916,13 @@ const std::vector<D_PAD*> BOARD::GetPads()
return rv; return rv;
} }
unsigned BOARD::GetPadCount() const unsigned BOARD::GetPadCount() const
{ {
return m_connectivity->GetPadCount(); return m_connectivity->GetPadCount();
} }
/** /**
* Function GetPad * Function GetPad
* @return D_PAD* - at the \a aIndex * @return D_PAD* - at the \a aIndex
@ -2931,11 +2930,12 @@ unsigned BOARD::GetPadCount() const
D_PAD* BOARD::GetPad( unsigned aIndex ) const D_PAD* BOARD::GetPad( unsigned aIndex ) const
{ {
unsigned count = 0; 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; return pad;
count++; count++;

View File

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

View File

@ -35,7 +35,6 @@
#include <math/vector2d.h> #include <math/vector2d.h>
class CN_ITEM;
class CN_CLUSTER; class CN_CLUSTER;
class CN_CONNECTIVITY_ALGO; class CN_CONNECTIVITY_ALGO;
class CN_EDGE; class CN_EDGE;
@ -51,7 +50,7 @@ class D_PAD;
struct CN_DISJOINT_NET_ENTRY struct CN_DISJOINT_NET_ENTRY
{ {
int net; int net;
BOARD_CONNECTED_ITEM* a, * b; BOARD_CONNECTED_ITEM *a, *b;
VECTOR2I anchorA, anchorB; VECTOR2I anchorA, anchorB;
}; };
@ -109,7 +108,6 @@ public:
* Function Clear() * Function Clear()
* Erases the connectivity database. * Erases the connectivity database.
*/ */
void Clear(); void Clear();
/** /**
@ -123,7 +121,7 @@ public:
* Returns the ratsnest, expressed as a set of graph edges for a given net. * Returns the ratsnest, expressed as a set of graph edges for a given net.
*/ */
RN_NET* GetRatsnestForNet( int aNet ); RN_NET* GetRatsnestForNet( int aNet );
/** /**
* Function PropagateNets() * Function PropagateNets()
* Propagates the net codes from the source pads to the tracks/vias. * Propagates the net codes from the source pads to the tracks/vias.
@ -156,9 +154,9 @@ public:
unsigned int GetPadCount( int aNet = -1 ) const; 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[] ); 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; } CN_PAD_LIST& PadList() { return m_padList; }
void ForEachAnchor( std::function<void(CN_ANCHOR_PTR)> aFunc ); void ForEachAnchor( std::function<void(CN_ANCHOR_PTR)> aFunc );
void ForEachItem( std::function<void(CN_ITEM*)> aFunc ); void ForEachItem( std::function<void(CN_ITEM*)> aFunc );
}; };
bool operator<( const CN_ANCHOR_PTR a, const CN_ANCHOR_PTR b ); bool operator<( const CN_ANCHOR_PTR a, const CN_ANCHOR_PTR b );