KiCad PCB EDA Suite
connectivity_algo.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KICAD, a free EDA CAD application.
3  *
4  * Copyright (C) 2016-2018 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
28 #include <board_commit.h>
29 
30 #include <thread>
31 #include <mutex>
32 #include <algorithm>
33 #include <future>
34 
35 #ifdef PROFILE
36 #include <profile.h>
37 #endif
38 
39 
41 {
42  markItemNetAsDirty( aItem );
43 
44  switch( aItem->Type() )
45  {
46  case PCB_MODULE_T:
47  for( auto pad : static_cast<MODULE*>( aItem ) -> Pads() )
48  {
49  m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( pad ) ].MarkItemsAsInvalid();
50  m_itemMap.erase( static_cast<BOARD_CONNECTED_ITEM*>( pad ) );
51  }
52 
53  m_itemList.SetDirty( true );
54  break;
55 
56  case PCB_PAD_T:
57  m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( aItem ) ].MarkItemsAsInvalid();
58  m_itemMap.erase( static_cast<BOARD_CONNECTED_ITEM*>( aItem ) );
59  m_itemList.SetDirty( true );
60  break;
61 
62  case PCB_TRACE_T:
63  case PCB_ARC_T:
64  m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( aItem ) ].MarkItemsAsInvalid();
65  m_itemMap.erase( static_cast<BOARD_CONNECTED_ITEM*>( aItem ) );
66  m_itemList.SetDirty( true );
67  break;
68 
69  case PCB_VIA_T:
70  m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( aItem ) ].MarkItemsAsInvalid();
71  m_itemMap.erase( static_cast<BOARD_CONNECTED_ITEM*>( aItem ) );
72  m_itemList.SetDirty( true );
73  break;
74 
75  case PCB_ZONE_AREA_T:
76  {
77  m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( aItem ) ].MarkItemsAsInvalid();
78  m_itemMap.erase ( static_cast<BOARD_CONNECTED_ITEM*>( aItem ) );
79  m_itemList.SetDirty( true );
80  break;
81  }
82 
83  default:
84  return false;
85  }
86 
87  // Once we delete an item, it may connect between lists, so mark both as potentially invalid
88  m_itemList.SetHasInvalid( true );
89 
90  return true;
91 }
92 
93 
95 {
96  if( aItem->IsConnected() )
97  {
98  auto citem = static_cast<const BOARD_CONNECTED_ITEM*>( aItem );
99  MarkNetAsDirty( citem->GetNetCode() );
100  }
101  else
102  {
103  if( aItem->Type() == PCB_MODULE_T )
104  {
105  auto mod = static_cast <const MODULE*>( aItem );
106 
107  for( auto pad : mod->Pads() )
108  MarkNetAsDirty( pad->GetNetCode() );
109  }
110  }
111 }
112 
113 
115 {
116  if( !aItem->IsOnCopperLayer() )
117  return false;
118 
119  markItemNetAsDirty ( aItem );
120 
121  switch( aItem->Type() )
122  {
123  case PCB_NETINFO_T:
124  {
125  MarkNetAsDirty( static_cast<NETINFO_ITEM*>( aItem )->GetNet() );
126  break;
127  }
128  case PCB_MODULE_T:
129  for( auto pad : static_cast<MODULE*>( aItem ) -> Pads() )
130  {
131  if( m_itemMap.find( pad ) != m_itemMap.end() )
132  return false;
133 
134  add( m_itemList, pad );
135  }
136 
137  break;
138 
139  case PCB_PAD_T:
140  if( m_itemMap.find ( aItem ) != m_itemMap.end() )
141  return false;
142 
143  add( m_itemList, static_cast<D_PAD*>( aItem ) );
144 
145  break;
146 
147  case PCB_TRACE_T:
148  {
149  if( m_itemMap.find( aItem ) != m_itemMap.end() )
150  return false;
151 
152  add( m_itemList, static_cast<TRACK*>( aItem ) );
153 
154  break;
155  }
156 
157  case PCB_ARC_T:
158  {
159  if( m_itemMap.find( aItem ) != m_itemMap.end() )
160  return false;
161 
162  add( m_itemList, static_cast<ARC*>( aItem ) );
163 
164  break;
165  }
166 
167  case PCB_VIA_T:
168  if( m_itemMap.find( aItem ) != m_itemMap.end() )
169  return false;
170 
171  add( m_itemList, static_cast<VIA*>( aItem ) );
172 
173  break;
174 
175  case PCB_ZONE_AREA_T:
176  {
177  auto zone = static_cast<ZONE_CONTAINER*>( aItem );
178 
179  if( m_itemMap.find( aItem ) != m_itemMap.end() )
180  return false;
181 
182  m_itemMap[zone] = ITEM_MAP_ENTRY();
183 
184  for( auto zitem : m_itemList.Add( zone ) )
185  m_itemMap[zone].Link(zitem);
186 
187  break;
188  }
189 
190  default:
191  return false;
192  }
193 
194  return true;
195 }
196 
197 
199 {
200 #ifdef CONNECTIVITY_DEBUG
201  printf("Search start\n");
202 #endif
203 
204 #ifdef PROFILE
205  PROF_COUNTER garbage_collection( "garbage-collection" );
206 #endif
207  std::vector<CN_ITEM*> garbage;
208  garbage.reserve( 1024 );
209 
210  m_itemList.RemoveInvalidItems( garbage );
211 
212  for( auto item : garbage )
213  delete item;
214 
215 #ifdef PROFILE
216  garbage_collection.Show();
217  PROF_COUNTER search_basic( "search-basic" );
218 #endif
219 
220  std::vector<CN_ITEM*> dirtyItems;
221  std::copy_if( m_itemList.begin(), m_itemList.end(), std::back_inserter( dirtyItems ),
222  [] ( CN_ITEM* aItem ) { return aItem->Dirty(); } );
223 
224  if( m_progressReporter )
225  {
226  m_progressReporter->SetMaxProgress( dirtyItems.size() );
228  }
229 
230  if( m_itemList.IsDirty() )
231  {
232  size_t parallelThreadCount = std::min<size_t>( std::thread::hardware_concurrency(),
233  ( dirtyItems.size() + 7 ) / 8 );
234 
235  std::atomic<size_t> nextItem( 0 );
236  std::vector<std::future<size_t>> returns( parallelThreadCount );
237 
238  auto conn_lambda = [&nextItem, &dirtyItems]
239  ( CN_LIST* aItemList, PROGRESS_REPORTER* aReporter) -> size_t
240  {
241  for( size_t i = nextItem++; i < dirtyItems.size(); i = nextItem++ )
242  {
243  CN_VISITOR visitor( dirtyItems[i] );
244  aItemList->FindNearby( dirtyItems[i], visitor );
245 
246  if( aReporter )
247  aReporter->AdvanceProgress();
248  }
249 
250  return 1;
251  };
252 
253  if( parallelThreadCount <= 1 )
254  conn_lambda( &m_itemList, m_progressReporter );
255  else
256  {
257  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
258  returns[ii] = std::async( std::launch::async, conn_lambda,
260 
261  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
262  {
263  // Here we balance returns with a 100ms timeout to allow UI updating
264  std::future_status status;
265  do
266  {
267  if( m_progressReporter )
269 
270  status = returns[ii].wait_for( std::chrono::milliseconds( 100 ) );
271  } while( status != std::future_status::ready );
272  }
273  }
274 
275  if( m_progressReporter )
277  }
278 
279 #ifdef PROFILE
280  search_basic.Show();
281 #endif
282 
284 
285 #ifdef CONNECTIVITY_DEBUG
286  printf("Search end\n");
287 #endif
288 
289 }
290 
291 
293 {
294  constexpr KICAD_T types[] =
296  constexpr KICAD_T no_zones[] =
298 
299  if( aMode == CSM_PROPAGATE )
300  return SearchClusters( aMode, no_zones, -1 );
301  else
302  return SearchClusters( aMode, types, -1 );
303 }
304 
305 
307  const KICAD_T aTypes[], int aSingleNet )
308 {
309  bool withinAnyNet = ( aMode != CSM_PROPAGATE );
310 
311  std::deque<CN_ITEM*> Q;
312  CN_ITEM* head = nullptr;
313  CLUSTERS clusters;
314 
315  if( m_itemList.IsDirty() )
317 
318  auto addToSearchList = [&head, withinAnyNet, aSingleNet, aTypes] ( CN_ITEM *aItem )
319  {
320  if( withinAnyNet && aItem->Net() <= 0 )
321  return;
322 
323  if( !aItem->Valid() )
324  return;
325 
326  if( aSingleNet >=0 && aItem->Net() != aSingleNet )
327  return;
328 
329  bool found = false;
330 
331  for( int i = 0; aTypes[i] != EOT; i++ )
332  {
333  if( aItem->Parent()->Type() == aTypes[i] )
334  {
335  found = true;
336  break;
337  }
338  }
339 
340  if( !found )
341  return;
342 
343  aItem->ListClear();
344  aItem->SetVisited( false );
345 
346  if( !head )
347  head = aItem;
348  else
349  head->ListInsert( aItem );
350  };
351 
352  std::for_each( m_itemList.begin(), m_itemList.end(), addToSearchList );
353 
354  while( head )
355  {
356  CN_CLUSTER_PTR cluster ( new CN_CLUSTER() );
357 
358  Q.clear();
359  CN_ITEM* root = head;
360  root->SetVisited ( true );
361 
362  head = root->ListRemove();
363 
364  Q.push_back( root );
365 
366  while( Q.size() )
367  {
368  CN_ITEM* current = Q.front();
369 
370  Q.pop_front();
371  cluster->Add( current );
372 
373  for( auto n : current->ConnectedItems() )
374  {
375  if( withinAnyNet && n->Net() != root->Net() )
376  continue;
377 
378  if( !n->Visited() && n->Valid() )
379  {
380  n->SetVisited( true );
381  Q.push_back( n );
382  head = n->ListRemove();
383  }
384  }
385  }
386 
387  clusters.push_back( cluster );
388  }
389 
390 
391  std::sort( clusters.begin(), clusters.end(), []( CN_CLUSTER_PTR a, CN_CLUSTER_PTR b ) {
392  return a->OriginNet() < b->OriginNet();
393  } );
394 
395 #ifdef CONNECTIVITY_DEBUG
396  printf("Active clusters: %d\n", clusters.size() );
397 
398  for( auto cl : clusters )
399  {
400  printf( "Net %d\n", cl->OriginNet() );
401  cl->Dump();
402  }
403 #endif
404 
405  return clusters;
406 }
407 
408 
410 {
411  for( int i = 0; i<aBoard->GetAreaCount(); i++ )
412  {
413  auto zone = aBoard->GetArea( i );
414  Add( zone );
415  }
416 
417  for( auto tv : aBoard->Tracks() )
418  Add( tv );
419 
420  for( auto mod : aBoard->Modules() )
421  {
422  for( auto pad : mod->Pads() )
423  Add( pad );
424  }
425 
426  /*wxLogTrace( "CN", "zones : %lu, pads : %lu vias : %lu tracks : %lu\n",
427  m_zoneList.Size(), m_padList.Size(),
428  m_viaList.Size(), m_trackList.Size() );*/
429 }
430 
431 
432 void CN_CONNECTIVITY_ALGO::Build( const std::vector<BOARD_ITEM*>& aItems )
433 {
434  for( auto item : aItems )
435  {
436  switch( item->Type() )
437  {
438  case PCB_TRACE_T:
439  case PCB_ARC_T:
440  case PCB_VIA_T:
441  case PCB_PAD_T:
442  Add( item );
443  break;
444 
445  case PCB_MODULE_T:
446  {
447  for( auto pad : static_cast<MODULE*>( item )->Pads() )
448  {
449  Add( pad );
450  }
451 
452  break;
453  }
454 
455  default:
456  break;
457  }
458  }
459 }
460 
461 
463 {
464  for( const auto& cluster : m_connClusters )
465  {
466  if( cluster->IsConflicting() )
467  {
468  wxLogTrace( "CN", "Conflicting nets in cluster %p\n", cluster.get() );
469  }
470  else if( cluster->IsOrphaned() )
471  {
472  wxLogTrace( "CN", "Skipping orphaned cluster %p [net: %s]\n", cluster.get(),
473  (const char*) cluster->OriginNetName().c_str() );
474  }
475  else if( cluster->HasValidNet() )
476  {
477  // normal cluster: just propagate from the pads
478  int n_changed = 0;
479 
480  for( auto item : *cluster )
481  {
482  if( item->CanChangeNet() )
483  {
484  if( item->Valid() && item->Parent()->GetNetCode() != cluster->OriginNet() )
485  {
486  MarkNetAsDirty( item->Parent()->GetNetCode() );
487  MarkNetAsDirty( cluster->OriginNet() );
488 
489  if( aCommit )
490  aCommit->Modify( item->Parent() );
491 
492  item->Parent()->SetNetCode( cluster->OriginNet() );
493  n_changed++;
494  }
495  }
496  }
497 
498  if( n_changed )
499  {
500  wxLogTrace( "CN", "Cluster %p : net : %d %s\n", cluster.get(),
501  cluster->OriginNet(), (const char*) cluster->OriginNetName().c_str() );
502  }
503  else
504  wxLogTrace( "CN", "Cluster %p : nothing to propagate\n", cluster.get() );
505  }
506  else
507  {
508  wxLogTrace( "CN", "Cluster %p : connected to unused net\n", cluster.get() );
509  }
510  }
511 }
512 
513 
515 {
517  propagateConnections( aCommit );
518 }
519 
520 
521 void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, std::vector<int>& aIslands )
522 {
523  if( aZone->GetFilledPolysList().IsEmpty() )
524  return;
525 
526  aIslands.clear();
527 
528  Remove( aZone );
529  Add( aZone );
530 
532 
533  for( const auto& cluster : m_connClusters )
534  {
535  if( cluster->Contains( aZone ) && cluster->IsOrphaned() )
536  {
537  for( auto z : *cluster )
538  {
539  if( z->Parent() == aZone )
540  {
541  aIslands.push_back( static_cast<CN_ZONE*>(z)->SubpolyIndex() );
542  }
543  }
544  }
545  }
546 
547  wxLogTrace( "CN", "Found %u isolated islands\n", (unsigned)aIslands.size() );
548 }
549 
550 void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_ISLAND_LIST>& aZones )
551 {
552  for ( auto& z : aZones )
553  Remove( z.m_zone );
554 
555  for ( auto& z : aZones )
556  {
557  if( !z.m_zone->GetFilledPolysList().IsEmpty() )
558  Add( z.m_zone );
559  }
560 
562 
563  for ( auto& zone : aZones )
564  {
565  if( zone.m_zone->GetFilledPolysList().IsEmpty() )
566  continue;
567 
568  for( const auto& cluster : m_connClusters )
569  {
570  if( cluster->Contains( zone.m_zone ) && cluster->IsOrphaned() )
571  {
572  for( auto z : *cluster )
573  {
574  if( z->Parent() == zone.m_zone )
575  {
576  zone.m_islands.push_back( static_cast<CN_ZONE*>(z)->SubpolyIndex() );
577  }
578  }
579  }
580  }
581  }
582 }
583 
584 
586 {
588  return m_ratsnestClusters;
589 }
590 
591 
593 {
594  if( aNet < 0 )
595  return;
596 
597  if( (int) m_dirtyNets.size() <= aNet )
598  {
599  int lastNet = m_dirtyNets.size() - 1;
600 
601  if( lastNet < 0 )
602  lastNet = 0;
603 
604  m_dirtyNets.resize( aNet + 1 );
605 
606  for( int i = lastNet; i < aNet + 1; i++ )
607  m_dirtyNets[i] = true;
608  }
609 
610  m_dirtyNets[aNet] = true;
611 }
612 
613 
615 {
616  if( aZone->Net() != aItem->Net() && !aItem->CanChangeNet() )
617  return;
618 
619  if( !aZone->BBox().Intersects( aItem->BBox() ) )
620  return;
621 
622  auto zoneItem = static_cast<CN_ZONE*> ( aZone );
623 
624  for( int i = 0; i < aItem->AnchorCount(); ++i )
625  {
626  if( zoneItem->ContainsPoint( aItem->GetAnchor( i ) ) )
627  {
628  zoneItem->Connect( aItem );
629  aItem->Connect( zoneItem );
630  return;
631  }
632  }
633 }
634 
636 {
637  const auto refParent = static_cast<const ZONE_CONTAINER*>( aZoneA->Parent() );
638  const auto testedParent = static_cast<const ZONE_CONTAINER*>( aZoneB->Parent() );
639 
640  if( testedParent->Type () != PCB_ZONE_AREA_T )
641  return;
642 
643  if( aZoneB == aZoneA || refParent == testedParent )
644  return;
645 
646  if( aZoneB->Net() != aZoneA->Net() )
647  return; // we only test zones belonging to the same net
648 
649  const auto& outline = refParent->GetFilledPolysList().COutline( aZoneA->SubpolyIndex() );
650 
651  for( int i = 0; i < outline.PointCount(); i++ )
652  {
653  if( aZoneB->ContainsPoint( outline.CPoint( i ) ) )
654  {
655  aZoneA->Connect( aZoneB );
656  aZoneB->Connect( aZoneA );
657  return;
658  }
659  }
660 
661  const auto& outline2 = testedParent->GetFilledPolysList().COutline( aZoneB->SubpolyIndex() );
662 
663  for( int i = 0; i < outline2.PointCount(); i++ )
664  {
665  if( aZoneA->ContainsPoint( outline2.CPoint( i ) ) )
666  {
667  aZoneA->Connect( aZoneB );
668  aZoneB->Connect( aZoneA );
669  return;
670  }
671  }
672 }
673 
674 
675 bool CN_VISITOR::operator()( CN_ITEM* aCandidate )
676 {
677  const auto parentA = aCandidate->Parent();
678  const auto parentB = m_item->Parent();
679 
680  if( !aCandidate->Valid() || !m_item->Valid() )
681  return true;
682 
683  if( parentA == parentB )
684  return true;
685 
686  if( !( parentA->GetLayerSet() & parentB->GetLayerSet() ).any() )
687  return true;
688 
689  // If both m_item and aCandidate are marked dirty, they will both be searched
690  // Since we are reciprocal in our connection, we arbitrarily pick one of the connections
691  // to conduct the expensive search
692  if( aCandidate->Dirty() && aCandidate < m_item )
693  return true;
694 
695  // We should handle zone-zone connection separately
696  if ( parentA->Type() == PCB_ZONE_AREA_T && parentB->Type() == PCB_ZONE_AREA_T )
697  {
698  checkZoneZoneConnection( static_cast<CN_ZONE*>( m_item ),
699  static_cast<CN_ZONE*>( aCandidate ) );
700  return true;
701  }
702 
703  if( parentA->Type() == PCB_ZONE_AREA_T )
704  {
705  checkZoneItemConnection( static_cast<CN_ZONE*>( aCandidate ), m_item );
706  return true;
707  }
708 
709  if( parentB->Type() == PCB_ZONE_AREA_T )
710  {
711  checkZoneItemConnection( static_cast<CN_ZONE*>( m_item ), aCandidate );
712  return true;
713  }
714 
715  // Items do not necessarily have reciprocity as we only check for anchors
716  // therefore, we check HitTest both directions A->B & B->A
717  for( int i = 0; i < aCandidate->AnchorCount(); ++i )
718  {
719  if( parentB->HitTest( wxPoint( aCandidate->GetAnchor( i ) ) ) )
720  {
721  m_item->Connect( aCandidate );
722  aCandidate->Connect( m_item );
723  return true;
724  }
725  }
726 
727  for( int i = 0; i < m_item->AnchorCount(); ++i )
728  {
729  if( parentA->HitTest( wxPoint( m_item->GetAnchor( i ) ) ) )
730  {
731  m_item->Connect( aCandidate );
732  aCandidate->Connect( m_item );
733  return true;
734  }
735  }
736 
737  return true;
738 };
739 
740 
742 {
743  m_ratsnestClusters.clear();
744  m_connClusters.clear();
745  m_itemMap.clear();
746  m_itemList.Clear();
747 
748 }
749 
751 {
752  m_progressReporter = aReporter;
753 }
void RemoveInvalidItems(std::vector< CN_ITEM * > &aGarbage)
const CONNECTED_ITEMS & ConnectedItems() const
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
void ListInsert(T *item)
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
void propagateConnections(BOARD_COMMIT *aCommit=nullptr)
bool Remove(BOARD_ITEM *aItem)
void SetHasInvalid(bool aInvalid=true)
void PropagateNets(BOARD_COMMIT *aCommit=nullptr)
Propagates nets from pads to other items in clusters.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
int SubpolyIndex() const
A progress reporter for use in multi-threaded environments.
void checkZoneItemConnection(CN_ZONE *aZone, CN_ITEM *aItem)
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
CN_ITEM * Add(D_PAD *pad)
void ClearDirtyFlags()
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
const BOX2I & BBox()
void SetVisited(bool aVisited)
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
bool IsDirty() const
void MarkNetAsDirty(int aNet)
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
bool Add(BOARD_ITEM *aItem)
bool Dirty() const
BOARD_CONNECTED_ITEM * Parent() const
void add(Container &c, BItem brditem)
The class PROF_COUNTER is a small class to help profiling.
Definition: profile.h:44
void SetDirty(bool aDirty=true)
int Net() const
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
std::vector< bool > m_dirtyNets
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
virtual int AnchorCount() const
const CLUSTERS SearchClusters(CLUSTER_SEARCH_MODE aMode, const KICAD_T aTypes[], int aSingleNet)
bool Intersects(const BOX2< Vec > &aRect) const
Function Intersects.
Definition: box2.h:235
class MODULE, a footprint
Definition: typeinfo.h:89
void markItemNetAsDirty(const BOARD_ITEM *aItem)
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:927
MODULES & Modules()
Definition: class_board.h:256
a few functions useful in geometry calculations.
bool ContainsPoint(const VECTOR2I p) const
virtual const VECTOR2I GetAnchor(int n) const
void FindIsolatedCopperIslands(ZONE_CONTAINER *aZone, std::vector< int > &aIslands)
void Build(BOARD *aBoard)
bool CanChangeNet() const
bool operator()(CN_ITEM *aCandidate)
const CLUSTERS & GetClusters()
void checkZoneZoneConnection(CN_ZONE *aZoneA, CN_ZONE *aZoneB)
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
Struct CN_VISTOR.
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:104
bool KeepRefreshing(bool aWait=false)
Update the UI dialog.
std::shared_ptr< CN_CLUSTER > CN_CLUSTER_PTR
virtual bool IsConnected() const
Function IsConnected() Returns information if the object is derived from BOARD_CONNECTED_ITEM.
void Connect(CN_ITEM *b)
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
void Show(std::ostream &aStream=std::cerr)
Print the elapsed time (in a suitable unit) to a stream.
Definition: profile.h:99
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:892
CN_ITEM * m_item
the item we are looking for connections to
void SetMaxProgress(int aMaxProgress)
Fix the value thar gives the 100 precent progress bar length (inside the current virtual zone)
std::vector< CN_CLUSTER_PTR > CLUSTERS
TRACKS & Tracks()
Definition: class_board.h:247
virtual bool IsOnCopperLayer() const
std::unordered_map< const BOARD_ITEM *, ITEM_MAP_ENTRY > m_itemMap
const BOX2I & BBox()
bool Valid() const
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:575
void SetProgressReporter(PROGRESS_REPORTER *aReporter)
PROGRESS_REPORTER * m_progressReporter