From 450ad5eab9cce90d9d40253163db40e380c3a9c4 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 23 Jun 2017 14:41:51 +0200 Subject: [PATCH] CONNECTIVITY_DATA::GetNodeCount() implementation --- pcbnew/connectivity.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pcbnew/connectivity.cpp b/pcbnew/connectivity.cpp index a62c06a1ca..c7bd4c1ed7 100644 --- a/pcbnew/connectivity.cpp +++ b/pcbnew/connectivity.cpp @@ -436,8 +436,19 @@ unsigned int CONNECTIVITY_DATA::GetLinksCount() const unsigned int CONNECTIVITY_DATA::GetNodeCount( int aNet ) const { - return 0; - assert( false ); + int sum = 0; + + if( aNet < 0 ) + { + for( const auto& net : m_nets ) + sum += net->GetNodeCount(); + } + else if( aNet < m_nets.size() ) + { + sum = m_nets[aNet]->GetNodeCount(); + } + + return sum; }