KiCad PCB EDA Suite
TRACKS_CLEANER Class Reference
Inheritance diagram for TRACKS_CLEANER:
CONNECTIONS

Public Member Functions

 TRACKS_CLEANER (BOARD *aPcb, BOARD_COMMIT &aCommit)
 
bool CleanupBoard (bool aCleanVias, bool aRemoveMisConnected, bool aMergeSegments, bool aDeleteUnconnected)
 the cleanup function. More...
 

Private Member Functions

bool removeBadTrackSegments ()
 
bool clean_vias ()
 Removes redundant vias like vias at same location or on pad through. More...
 
bool remove_duplicates_of_via (const VIA *aVia)
 Removes all the following THT vias on the same position of the specified one. More...
 
bool remove_duplicates_of_track (const TRACK *aTrack)
 Removes all the following duplicates tracks of the specified one. More...
 
bool deleteDanglingTracks ()
 Removes dangling tracks. More...
 
bool delete_null_segments ()
 Delete null length track segments. More...
 
bool merge_collinear_of_track (TRACK *aSegment)
 Try to merge the segment to a following collinear one. More...
 
bool clean_segments ()
 Merge collinear segments and remove duplicated and null len segments. More...
 
void buildTrackConnectionInfo ()
 helper function Rebuild list of tracks, and connected tracks this info must be rebuilt when tracks are erased More...
 
TRACKmergeCollinearSegmentIfPossible (TRACK *aTrackRef, TRACK *aCandidate, ENDPOINT_T aEndType)
 helper function merge aTrackRef and aCandidate, when possible, i.e. More...
 
const ZONE_CONTAINERzoneForTrackEndpoint (const TRACK *aTrack, ENDPOINT_T aEndPoint)
 Utility for checking if a track/via ends on a zone. More...
 
bool testTrackEndpointDangling (TRACK *aTrack, ENDPOINT_T aEndPoint)
 Utility: does the endpoint unconnected processed for one endpoint of one track Returns true if the track must be deleted, false if not necessarily. More...
 
void BuildPadsList (int aNetcode=-1)
 Function BuildPadsList Fills m_sortedPads with all pads that be connected to tracks pads are sorted by X then Y coordinates to allow fast binary search in list. More...
 
std::vector< D_PAD * > & GetPadsList ()
 Function GetPadsList. More...
 
void Build_CurrNet_SubNets_Connections (TRACK *aFirstTrack, TRACK *aLastTrack, int aNetcode)
 Function Build_CurrNet_SubNets_Connections should be called after a track change (delete or add a track): Connections to pads and to tracks are recalculated If a track is deleted, the other pointers to pads do not change. More...
 
void BuildTracksCandidatesList (TRACK *aBegin, TRACK *aEnd=NULL)
 Function BuildTracksCandidatesList Fills m_Candidates with all connecting points (track ends or via location) with tracks from aBegin to aEnd. More...
 
void BuildPadsCandidatesList ()
 Function BuildPadsCandidatesList Populates m_candidates with all pads connecting points (pads position) m_sortedPads is expected to be populated by the pad candidates list. More...
 
int SearchConnectedTracks (const TRACK *aTrack)
 function SearchConnectedTracks Populates .m_connected with tracks/vias connected to aTrack m_candidates is expected to be populated by the track candidates ends list More...
 
void GetConnectedTracks (TRACK *aTrack)
 Function GetConnectedTracks Copy m_Connected that contains the list of tracks connected calculated by SearchConnectedTracks in aTrack->m_TracksConnected. More...
 
void SearchConnectionsPadsToIntersectingPads ()
 function SearchConnectionsPadsToIntersectingPads Explores the list of pads and adds to m_PadsConnected member of each pad pads connected to Here, connections are due to intersecting pads, not tracks m_sortedPads must be initialized More...
 
void SearchTracksConnectedToPads (bool add_to_padlist=true, bool add_to_tracklist=true)
 function SearchTracksConnectedToPads Explores the list of pads. More...
 
void CollectItemsNearTo (std::vector< CONNECTED_POINT * > &aList, const wxPoint &aPosition, int aDistMax)
 function CollectItemsNearTo Used by SearchTracksConnectedToPads Fills aList with pads near to aPosition near means aPosition to pad position <= aDistMax More...
 
void Propagate_SubNets ()
 Function Propagate_SubNets Test a list of tracks, to create or propagate a sub netcode to pads and segments connected together. More...
 

Private Attributes

BOARDm_brd
 
BOARD_COMMITm_commit
 

Detailed Description

Definition at line 45 of file clean.cpp.

Constructor & Destructor Documentation

TRACKS_CLEANER::TRACKS_CLEANER ( BOARD aPcb,
BOARD_COMMIT aCommit 
)

Definition at line 217 of file clean.cpp.

References CONNECTIONS::BuildPadsList().

218  : CONNECTIONS( aPcb ), m_brd( aPcb ), m_commit( aCommit )
219 {
220  // Be sure pad list is up to date
221  BuildPadsList();
222 }
BOARD * m_brd
Definition: clean.cpp:122
CONNECTIONS(BOARD *aBrd)
Definition: connect.cpp:49
void BuildPadsList(int aNetcode=-1)
Function BuildPadsList Fills m_sortedPads with all pads that be connected to tracks pads are sorted b...
Definition: connect.cpp:61
BOARD_COMMIT & m_commit
Definition: clean.cpp:123

Member Function Documentation

void CONNECTIONS::Build_CurrNet_SubNets_Connections ( TRACK aFirstTrack,
TRACK aLastTrack,
int  aNetcode 
)
inherited

Function Build_CurrNet_SubNets_Connections should be called after a track change (delete or add a track): Connections to pads and to tracks are recalculated If a track is deleted, the other pointers to pads do not change.

When a new track is added in track list, its pointers to pads are already initialized Builds the subnets inside a net (tracks from aFirstTrack to aFirstTrack). subnets are clusters of pads and tracks that are connected together. When all tracks are created relative to the net, there is only a cluster when not tracks there are a cluster per pad

Parameters
aFirstTrack= first track of the given net
aLastTrack= last track of the given net
aNetcode= the netcode of the given net

Definition at line 459 of file connect.cpp.

References CONNECTIONS::BuildPadsList(), CONNECTIONS::BuildTracksCandidatesList(), CONNECTIONS::m_connected, CONNECTIONS::m_firstTrack, CONNECTIONS::m_lastTrack, BOARD_CONNECTED_ITEM::m_PadsConnected, BOARD_CONNECTED_ITEM::m_TracksConnected, TRACK::Next(), CONNECTIONS::Propagate_SubNets(), CONNECTIONS::SearchConnectedTracks(), CONNECTIONS::SearchConnectionsPadsToIntersectingPads(), CONNECTIONS::SearchTracksConnectedToPads(), and BOARD_CONNECTED_ITEM::SetSubNet().

Referenced by PCB_BASE_FRAME::TestConnections(), and PCB_BASE_FRAME::TestNetConnection().

460 {
461  m_firstTrack = aFirstTrack; // The first track used to build m_Candidates
462  m_lastTrack = aLastTrack; // The last track used to build m_Candidates
463 
464  // Pads subnets are expected already cleared, because this function
465  // does not know the full list of pads
466  BuildTracksCandidatesList( aFirstTrack, aLastTrack );
467  TRACK* curr_track;
468  for( curr_track = aFirstTrack; curr_track != NULL; curr_track = curr_track->Next() )
469  {
470  // Clear track subnet id (Pads subnets are cleared outside this function)
471  curr_track->SetSubNet( 0 );
472  curr_track->m_TracksConnected.clear();
473  curr_track->m_PadsConnected.clear();
474 
475  // Update connections between tracks:
476  SearchConnectedTracks( curr_track );
477  curr_track->m_TracksConnected = m_connected;
478 
479  if( curr_track == aLastTrack )
480  break;
481  }
482 
483  // Update connections between tracks and pads
484  BuildPadsList( aNetcode );
486 
487  // Update connections between intersecting pads (no tracks)
489 
490  // Creates sub nets (clusters) for the current net:
492 }
const TRACK * m_lastTrack
Definition: connect.h:100
void Propagate_SubNets()
Function Propagate_SubNets Test a list of tracks, to create or propagate a sub netcode to pads and se...
Definition: connect.cpp:584
void BuildPadsList(int aNetcode=-1)
Function BuildPadsList Fills m_sortedPads with all pads that be connected to tracks pads are sorted b...
Definition: connect.cpp:61
void BuildTracksCandidatesList(TRACK *aBegin, TRACK *aEnd=NULL)
Function BuildTracksCandidatesList Fills m_Candidates with all connecting points (track ends or via l...
Definition: connect.cpp:252
int SearchConnectedTracks(const TRACK *aTrack)
function SearchConnectedTracks Populates .m_connected with tracks/vias connected to aTrack m_candidat...
Definition: connect.cpp:306
void SearchConnectionsPadsToIntersectingPads()
function SearchConnectionsPadsToIntersectingPads Explores the list of pads and adds to m_PadsConnecte...
Definition: connect.cpp:72
void SearchTracksConnectedToPads(bool add_to_padlist=true, bool add_to_tracklist=true)
function SearchTracksConnectedToPads Explores the list of pads.
Definition: connect.cpp:114
std::vector< D_PAD * > m_PadsConnected
void SetSubNet(int aSubNetCode)
TRACK * Next() const
Definition: class_track.h:97
const TRACK * m_firstTrack
Definition: connect.h:99
std::vector< TRACK * > m_TracksConnected
std::vector< TRACK * > m_connected
Definition: connect.h:94
void CONNECTIONS::BuildPadsCandidatesList ( )
inherited

Function BuildPadsCandidatesList Populates m_candidates with all pads connecting points (pads position) m_sortedPads is expected to be populated by the pad candidates list.

Definition at line 227 of file connect.cpp.

References D_PAD::GetPosition(), CONNECTIONS::m_candidates, and CONNECTIONS::m_sortedPads.

Referenced by CONNECTIONS::SearchConnectionsPadsToIntersectingPads().

228 {
229  m_candidates.clear();
230  m_candidates.reserve( m_sortedPads.size() );
231 
232  for( unsigned ii = 0; ii < m_sortedPads.size(); ii++ )
233  {
234  D_PAD * pad = m_sortedPads[ii];
235  CONNECTED_POINT candidate( pad, pad->GetPosition() );
236  m_candidates.push_back( candidate );
237  }
238 }
std::vector< D_PAD * > m_sortedPads
Definition: connect.h:101
const wxPoint & GetPosition() const override
Definition: class_pad.h:170
std::vector< CONNECTED_POINT > m_candidates
Definition: connect.h:96
void CONNECTIONS::BuildPadsList ( int  aNetcode = -1)
inherited

Function BuildPadsList Fills m_sortedPads with all pads that be connected to tracks pads are sorted by X then Y coordinates to allow fast binary search in list.

Parameters
aNetcode= net code to use to filter pads if aNetcode < 0, all pads will be put in list (default)

Definition at line 61 of file connect.cpp.

References BOARD::GetSortedPadListByXthenYCoord(), CONNECTIONS::m_brd, and CONNECTIONS::m_sortedPads.

Referenced by CONNECTIONS::Build_CurrNet_SubNets_Connections(), PCB_BASE_FRAME::RecalculateAllTracksNetcode(), and TRACKS_CLEANER().

62 {
63  // Creates sorted pad list if not exists
64  m_sortedPads.clear();
65  m_brd->GetSortedPadListByXthenYCoord( m_sortedPads, aNetcode < 0 ? -1 : aNetcode );
66 }
void GetSortedPadListByXthenYCoord(std::vector< D_PAD * > &aVector, int aNetCode=-1)
Function GetSortedPadListByXthenYCoord first empties then fills the vector with all pads and sorts th...
BOARD * m_brd
Definition: connect.h:98
std::vector< D_PAD * > m_sortedPads
Definition: connect.h:101
void TRACKS_CLEANER::buildTrackConnectionInfo ( )
private

helper function Rebuild list of tracks, and connected tracks this info must be rebuilt when tracks are erased

Definition at line 225 of file clean.cpp.

References CONNECTIONS::BuildTracksCandidatesList(), BUSY, END_ON_PAD, D_PAD::HitTest(), m_brd, BOARD_CONNECTED_ITEM::m_PadsConnected, BOARD::m_Track, TRACK::Next(), CONNECTIONS::SearchTracksConnectedToPads(), EDA_ITEM::SetState(), and START_ON_PAD.

Referenced by CleanupBoard().

226 {
228 
229  // clear flags and variables used in cleanup
230  for( TRACK* track = m_brd->m_Track; track != NULL; track = track->Next() )
231  {
232  track->start = NULL;
233  track->end = NULL;
234  track->m_PadsConnected.clear();
235  track->SetState( START_ON_PAD | END_ON_PAD | BUSY, false );
236  }
237 
238  // Build connections info tracks to pads
240 
241  for( TRACK* track = m_brd->m_Track; track != NULL; track = track->Next() )
242  {
243  // Mark track if connected to pads
244  for( unsigned jj = 0; jj < track->m_PadsConnected.size(); jj++ )
245  {
246  D_PAD * pad = track->m_PadsConnected[jj];
247 
248  if( pad->HitTest( track->GetStart() ) )
249  {
250  track->start = pad;
251  track->SetState( START_ON_PAD, true );
252  }
253 
254  if( pad->HitTest( track->GetEnd() ) )
255  {
256  track->end = pad;
257  track->SetState( END_ON_PAD, true );
258  }
259  }
260  }
261 }
BOARD * m_brd
Definition: clean.cpp:122
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
Definition: class_pad.cpp:700
#define END_ON_PAD
#define BUSY
Pcbnew: flag indicating that the structure has.
Definition: base_struct.h:134
#define START_ON_PAD
void BuildTracksCandidatesList(TRACK *aBegin, TRACK *aEnd=NULL)
Function BuildTracksCandidatesList Fills m_Candidates with all connecting points (track ends or via l...
Definition: connect.cpp:252
void SearchTracksConnectedToPads(bool add_to_padlist=true, bool add_to_tracklist=true)
function SearchTracksConnectedToPads Explores the list of pads.
Definition: connect.cpp:114
std::vector< D_PAD * > m_PadsConnected
TRACK * Next() const
Definition: class_track.h:97
void SetState(int type, int state)
Definition: base_struct.h:242
DLIST< TRACK > m_Track
Definition: class_board.h:244
void CONNECTIONS::BuildTracksCandidatesList ( TRACK aBegin,
TRACK aEnd = NULL 
)
inherited

Function BuildTracksCandidatesList Fills m_Candidates with all connecting points (track ends or via location) with tracks from aBegin to aEnd.

Parameters
aBegin= first track to store in list (should not be NULL)
aEnd= last track to store in list if aEnd == NULL, uses all tracks from aBegin

Definition at line 252 of file connect.cpp.

References CONNECTIONS::m_candidates, CONNECTIONS::m_firstTrack, CONNECTIONS::m_lastTrack, TRACK::Next(), PCB_VIA_T, and sortConnectedPointByXthenYCoordinates().

Referenced by CONNECTIONS::Build_CurrNet_SubNets_Connections(), buildTrackConnectionInfo(), DRAG_LIST::fillList(), PCB_BASE_FRAME::RecalculateAllTracksNetcode(), and removeBadTrackSegments().

253 {
254  m_candidates.clear();
255  m_firstTrack = m_lastTrack = aBegin;
256 
257  unsigned ii = 0;
258 
259  // Count candidates ( i.e. end points )
260  for( const TRACK* track = aBegin; track; track = track->Next() )
261  {
262  if( track->Type() == PCB_VIA_T )
263  ii++;
264  else
265  ii += 2;
266 
267  m_lastTrack = track;
268 
269  if( track == aEnd )
270  break;
271  }
272 
273  // Build candidate list
274  m_candidates.reserve( ii );
275  for( TRACK* track = aBegin; track; track = track->Next() )
276  {
277  CONNECTED_POINT candidate( track, track->GetStart() );
278 
279  m_candidates.push_back( candidate );
280  if( track->Type() != PCB_VIA_T )
281  {
282  CONNECTED_POINT candidate2( track, track->GetEnd());
283  m_candidates.push_back( candidate2 );
284  }
285 
286  if( track == aEnd )
287  break;
288  }
289 
290  // Sort list by increasing X coordinate,
291  // and for increasing Y coordinate when items have the same X coordinate
292  // So candidates to the same location are consecutive in list.
294 }
static bool sortConnectedPointByXthenYCoordinates(const CONNECTED_POINT &aRef, const CONNECTED_POINT &aTst)
Definition: connect.cpp:244
const TRACK * m_lastTrack
Definition: connect.h:100
std::vector< CONNECTED_POINT > m_candidates
Definition: connect.h:96
TRACK * Next() const
Definition: class_track.h:97
const TRACK * m_firstTrack
Definition: connect.h:99
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:108
bool TRACKS_CLEANER::clean_segments ( )
private

Merge collinear segments and remove duplicated and null len segments.

Definition at line 627 of file clean.cpp.

References delete_null_segments(), m_brd, BOARD::m_Track, merge_collinear_of_track(), TRACK::Next(), PCB_TRACE_T, and remove_duplicates_of_track().

Referenced by CleanupBoard().

628 {
629  bool modified = false;
630 
631  // Easy things first
632  modified |= delete_null_segments();
633 
634  // Delete redundant segments, i.e. segments having the same end points and layers
635  // (can happens when blocks are copied on themselve)
636  for( TRACK* segment = m_brd->m_Track; segment; segment = segment->Next() )
637  modified |= remove_duplicates_of_track( segment );
638 
639  // merge collinear segments:
640  TRACK* nextsegment;
641 
642  for( TRACK* segment = m_brd->m_Track; segment; segment = nextsegment )
643  {
644  nextsegment = segment->Next();
645 
646  if( segment->Type() == PCB_TRACE_T )
647  {
648  bool merged_this = merge_collinear_of_track( segment );
649 
650  if( merged_this ) // The current segment was modified, retry to merge it again
651  {
652  nextsegment = segment->Next();
653  modified = true;
654  }
655  }
656  }
657 
658  return modified;
659 }
BOARD * m_brd
Definition: clean.cpp:122
bool delete_null_segments()
Delete null length track segments.
Definition: clean.cpp:520
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
bool merge_collinear_of_track(TRACK *aSegment)
Try to merge the segment to a following collinear one.
Definition: clean.cpp:576
TRACK * Next() const
Definition: class_track.h:97
bool remove_duplicates_of_track(const TRACK *aTrack)
Removes all the following duplicates tracks of the specified one.
Definition: clean.cpp:542
DLIST< TRACK > m_Track
Definition: class_board.h:244
bool TRACKS_CLEANER::clean_vias ( )
private

Removes redundant vias like vias at same location or on pad through.

Definition at line 357 of file clean.cpp.

References LSET::AllCuMask(), GetFirstVia(), D_PAD::GetLayerSet(), m_brd, m_commit, BOARD_CONNECTED_ITEM::m_PadsConnected, BOARD::m_Track, BOARD::Remove(), remove_duplicates_of_via(), COMMIT::Removed(), and VIA_THROUGH.

Referenced by CleanupBoard().

358 {
359  bool modified = false;
360 
361  for( VIA* via = GetFirstVia( m_brd->m_Track ); via != NULL;
362  via = GetFirstVia( via->Next() ) )
363  {
364  // Correct via m_End defects (if any), should never happen
365  if( via->GetStart() != via->GetEnd() )
366  {
367  wxFAIL_MSG( "Malformed via with mismatching ends" );
368  via->SetEnd( via->GetStart() );
369  }
370 
371  /* Important: these cleanups only do thru hole vias, they don't
372  * (yet) handle high density interconnects */
373  if( via->GetViaType() == VIA_THROUGH )
374  {
375  modified |= remove_duplicates_of_via( via );
376 
377  /* To delete through Via on THT pads at same location
378  * Examine the list of connected pads:
379  * if one through pad is found, the via can be removed */
380  for( unsigned ii = 0; ii < via->m_PadsConnected.size(); ++ii )
381  {
382  const D_PAD* pad = via->m_PadsConnected[ii];
383  const LSET all_cu = LSET::AllCuMask();
384 
385  if( ( pad->GetLayerSet() & all_cu ) == all_cu )
386  {
387  // redundant: delete the via
388  m_brd->Remove( via );
389  m_commit.Removed( via );
390  modified = true;
391  break;
392  }
393  }
394  }
395  }
396 
397  return modified;
398 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu LAYER_IDs.
Definition: lset.cpp:638
BOARD * m_brd
Definition: clean.cpp:122
bool remove_duplicates_of_via(const VIA *aVia)
Removes all the following THT vias on the same position of the specified one.
Definition: clean.cpp:334
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
Class LSET is a set of LAYER_IDs.
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:235
std::vector< D_PAD * > m_PadsConnected
DLIST< TRACK > m_Track
Definition: class_board.h:244
void Remove(BOARD_ITEM *aBoardItem) override
>
VIA * GetFirstVia(TRACK *aTrk, const TRACK *aStopPoint=NULL)
Scan a track list for the first VIA o NULL if not found (or NULL passed)
Definition: class_track.h:493
bool TRACKS_CLEANER::CleanupBoard ( bool  aCleanVias,
bool  aRemoveMisConnected,
bool  aMergeSegments,
bool  aDeleteUnconnected 
)

the cleanup function.

return true if some item was modified

Parameters
aFrame= the PCB_EDIT_FRAME which handles the board
aRemoveMisConnected= true to remove segments connecting 2 different nets
aCleanVias= true to remove superimposed vias
aMergeSegments= true to merge collinear segmenst and remove 0 len segm
aDeleteUnconnected= true to remove dangling tracks (short circuits)

Definition at line 164 of file clean.cpp.

References buildTrackConnectionInfo(), clean_segments(), clean_vias(), delete_null_segments(), deleteDanglingTracks(), and removeBadTrackSegments().

Referenced by PCB_EDIT_FRAME::Clean_Pcb(), and PCB_EDIT_FRAME::RemoveMisConnectedTracks().

168 {
170 
171  bool modified = false;
172 
173  // delete redundant vias
174  if( aCleanVias )
175  modified |= clean_vias();
176 
177  // Remove null segments and intermediate points on aligned segments
178  // If not asked, remove null segments only if remove misconnected is asked
179  if( aMergeSegments )
180  modified |= clean_segments();
181  else if( aRemoveMisConnected )
182  modified |= delete_null_segments();
183 
184  if( aRemoveMisConnected )
185  {
186  if( removeBadTrackSegments() )
187  {
188  modified = true;
189 
190  // Refresh track connection info
192  }
193  }
194 
195  // Delete dangling tracks
196  if( aDeleteUnconnected )
197  {
198  if( modified ) // Refresh track connection info
200 
201  if( deleteDanglingTracks() )
202  {
203  modified = true;
204 
205  // Removed tracks can leave aligned segments
206  // (when a T was formed by tracks and the "vertical" segment
207  // is removed)
208  if( aMergeSegments )
209  clean_segments();
210  }
211  }
212 
213  return modified;
214 }
bool deleteDanglingTracks()
Removes dangling tracks.
Definition: clean.cpp:468
bool clean_segments()
Merge collinear segments and remove duplicated and null len segments.
Definition: clean.cpp:627
bool delete_null_segments()
Delete null length track segments.
Definition: clean.cpp:520
bool clean_vias()
Removes redundant vias like vias at same location or on pad through.
Definition: clean.cpp:357
bool removeBadTrackSegments()
Definition: clean.cpp:264
void buildTrackConnectionInfo()
helper function Rebuild list of tracks, and connected tracks this info must be rebuilt when tracks ar...
Definition: clean.cpp:225
void CONNECTIONS::CollectItemsNearTo ( std::vector< CONNECTED_POINT * > &  aList,
const wxPoint aPosition,
int  aDistMax 
)
inherited

function CollectItemsNearTo Used by SearchTracksConnectedToPads Fills aList with pads near to aPosition near means aPosition to pad position <= aDistMax

Parameters
aList= list to fill
aPosition= aPosition to use as reference
aDistMax= dist max from aPosition to a candidate to select it

Definition at line 146 of file connect.cpp.

References abs, delta, dist, CONNECTED_POINT::GetPoint(), CONNECTIONS::m_candidates, wxPoint::x, and wxPoint::y.

Referenced by CONNECTIONS::SearchConnectedTracks(), CONNECTIONS::SearchConnectionsPadsToIntersectingPads(), and CONNECTIONS::SearchTracksConnectedToPads().

148 {
149  /* Search items in m_Candidates that position is <= aDistMax from aPosition
150  * (Rectilinear distance)
151  * m_Candidates is sorted by X then Y values, so a fast binary search is used
152  * to locate the "best" entry point in list
153  * The best entry is a pad having its m_Pos.x == (or near) aPosition.x
154  * All candidates are near this candidate in list
155  * So from this entry point, a linear search is made to find all candidates
156  */
157  int idxmax = m_candidates.size()-1;
158 
159  int delta = m_candidates.size();
160 
161  int idx = 0; // Starting index is the beginning of list
162  while( delta )
163  {
164  // Calculate half size of remaining interval to test.
165  // Ensure the computed value is not truncated (too small)
166  if( (delta & 1) && ( delta > 1 ) )
167  delta++;
168  delta /= 2;
169 
170  CONNECTED_POINT& item = m_candidates[idx];
171 
172  int dist = item.GetPoint().x - aPosition.x;
173  if( abs(dist) <= aDistMax )
174  {
175  break; // A good entry point is found. The list can be scanned from this point.
176  }
177 
178  else if( item.GetPoint().x < aPosition.x ) // We should search after this item
179  {
180  idx += delta;
181  if( idx > idxmax )
182  idx = idxmax;
183  }
184  else // We should search before this item
185  {
186  idx -= delta;
187  if( idx < 0 )
188  idx = 0;
189  }
190  }
191 
192  /* Now explore the candidate list from the "best" entry point found
193  * (candidate "near" aPosition.x)
194  * We explore the list until abs(candidate->m_Point.x - aPosition.x) > aDistMax
195  * because the list is sorted by X position (and for a given X pos, by Y pos)
196  * Currently a linear search is made because the number of candidates
197  * having the right X position is usually small
198  */
199  // search next candidates in list
200  wxPoint diff;
201  for( int ii = idx; ii <= idxmax; ii++ )
202  {
203  CONNECTED_POINT* item = &m_candidates[ii];
204  diff = item->GetPoint() - aPosition;
205  if( abs(diff.x) > aDistMax )
206  break; // Exit: the distance is to long, we cannot find other candidates
207  if( abs(diff.y) > aDistMax )
208  continue; // the y distance is to long, but we can find other candidates
209  // We have here a good candidate: add it
210  aList.push_back( item );
211  }
212  // search previous candidates in list
213  for( int ii = idx-1; ii >=0; ii-- )
214  {
215  CONNECTED_POINT * item = &m_candidates[ii];
216  diff = item->GetPoint() - aPosition;
217  if( abs(diff.x) > aDistMax )
218  break;
219  if( abs(diff.y) > aDistMax )
220  continue;
221  // We have here a good candidate:add it
222  aList.push_back( item );
223  }
224 }
static const int dist[10][10]
Definition: dist.cpp:57
#define abs(a)
Definition: auxiliary.h:84
static const int delta[8][2]
Definition: solve.cpp:112
const wxPoint & GetPoint() const
Definition: connect.h:87
std::vector< CONNECTED_POINT > m_candidates
Definition: connect.h:96
bool TRACKS_CLEANER::delete_null_segments ( )
private

Delete null length track segments.

Definition at line 520 of file clean.cpp.

References m_brd, m_commit, BOARD::m_Track, TRACK::Next(), BOARD::Remove(), and COMMIT::Removed().

Referenced by clean_segments(), and CleanupBoard().

521 {
522  bool modified = false;
523  TRACK* nextsegment;
524 
525  // Delete null segments
526  for( TRACK* segment = m_brd->m_Track; segment; segment = nextsegment )
527  {
528  nextsegment = segment->Next();
529 
530  if( segment->IsNull() ) // Length segment = 0; delete it
531  {
532  m_brd->Remove( segment );
533  m_commit.Removed( segment );
534  modified = true;
535  }
536  }
537 
538  return modified;
539 }
BOARD * m_brd
Definition: clean.cpp:122
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
TRACK * Next() const
Definition: class_track.h:97
DLIST< TRACK > m_Track
Definition: class_board.h:244
void Remove(BOARD_ITEM *aBoardItem) override
>
bool TRACKS_CLEANER::deleteDanglingTracks ( )
private

Removes dangling tracks.

Definition at line 468 of file clean.cpp.

References END_ON_PAD, ENDPOINT_END, ENDPOINT_START, m_brd, m_commit, BOARD::m_Track, TRACK::Next(), BOARD::Remove(), COMMIT::Removed(), START_ON_PAD, and testTrackEndpointDangling().

Referenced by CleanupBoard().

469 {
470  if( m_brd->m_Track == NULL )
471  return false;
472 
473  bool modified = false;
474  bool item_erased;
475 
476  do // Iterate when at least one track is deleted
477  {
478  item_erased = false;
479  TRACK* next_track;
480 
481  for( TRACK *track = m_brd->m_Track; track != NULL; track = next_track )
482  {
483  next_track = track->Next();
484 
485  bool flag_erase = false; // Start without a good reason to erase it
486 
487  /* if a track endpoint is not connected to a pad, test if
488  * the endpoint is connected to another track or to a zone.
489  * For via test, an enhancement could be to test if
490  * connected to 2 items on different layers. Currently
491  * a via must be connected to 2 items, that can be on the
492  * same layer */
493 
494  // Check if there is nothing attached on the start
495  if( !( track->GetState( START_ON_PAD ) ) )
496  flag_erase |= testTrackEndpointDangling( track, ENDPOINT_START );
497 
498  // If not sure about removal, then check if there is nothing attached on the end
499  if( !flag_erase && !track->GetState( END_ON_PAD ) )
500  flag_erase |= testTrackEndpointDangling( track, ENDPOINT_END );
501 
502  if( flag_erase )
503  {
504  m_brd->Remove( track );
505  m_commit.Removed( track );
506 
507  /* keep iterating, because a track connected to the deleted track
508  * now perhaps is not connected and should be deleted */
509  item_erased = true;
510  modified = true;
511  }
512  }
513  } while( item_erased );
514 
515  return modified;
516 }
BOARD * m_brd
Definition: clean.cpp:122
#define END_ON_PAD
bool testTrackEndpointDangling(TRACK *aTrack, ENDPOINT_T aEndPoint)
Utility: does the endpoint unconnected processed for one endpoint of one track Returns true if the tr...
Definition: clean.cpp:424
#define START_ON_PAD
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
TRACK * Next() const
Definition: class_track.h:97
DLIST< TRACK > m_Track
Definition: class_board.h:244
void Remove(BOARD_ITEM *aBoardItem) override
>
void CONNECTIONS::GetConnectedTracks ( TRACK aTrack)
inlineinherited

Function GetConnectedTracks Copy m_Connected that contains the list of tracks connected calculated by SearchConnectedTracks in aTrack->m_TracksConnected.

Parameters
aTrack= track or via to fill with connected tracks

Definition at line 170 of file connect.h.

References CONNECTIONS::m_connected, and BOARD_CONNECTED_ITEM::m_TracksConnected.

Referenced by PCB_BASE_FRAME::RecalculateAllTracksNetcode(), and removeBadTrackSegments().

171  {
172  aTrack->m_TracksConnected = m_connected;
173  }
std::vector< TRACK * > m_TracksConnected
std::vector< TRACK * > m_connected
Definition: connect.h:94
std::vector<D_PAD*>& CONNECTIONS::GetPadsList ( )
inlineinherited

Function GetPadsList.

Returns
the pads list used in connections calculations

Definition at line 120 of file connect.h.

References CONNECTIONS::m_sortedPads.

Referenced by DRAG_LIST::BuildDragListe(), and DRAG_LIST::fillList().

120 { return m_sortedPads; }
std::vector< D_PAD * > m_sortedPads
Definition: connect.h:101
bool TRACKS_CLEANER::merge_collinear_of_track ( TRACK aSegment)
private

Try to merge the segment to a following collinear one.

Definition at line 576 of file clean.cpp.

References BUSY, ENDPOINT_END, ENDPOINT_START, TRACK::GetTrack(), TRACK::GetWidth(), m_brd, m_commit, BOARD::m_Track, mergeCollinearSegmentIfPossible(), TRACK::Next(), PCB_TRACE_T, BOARD::Remove(), COMMIT::Removed(), EDA_ITEM::SetState(), and EDA_ITEM::Type().

Referenced by clean_segments().

577 {
578  bool merged_this = false;
579 
580  for( ENDPOINT_T endpoint = ENDPOINT_START; endpoint <= ENDPOINT_END;
581  endpoint = ENDPOINT_T( endpoint + 1 ) )
582  {
583  // search for a possible segment connected to the current endpoint of the current one
584  TRACK* other = aSegment->Next();
585 
586  if( other )
587  {
588  other = aSegment->GetTrack( other, NULL, endpoint, true, false );
589 
590  if( other )
591  {
592  // the two segments must have the same width and the other
593  // cannot be a via
594  if( ( aSegment->GetWidth() == other->GetWidth() ) &&
595  ( other->Type() == PCB_TRACE_T ) )
596  {
597  // There can be only one segment connected
598  other->SetState( BUSY, true );
599  TRACK* yet_another = aSegment->GetTrack( m_brd->m_Track, NULL,
600  endpoint, true, false );
601  other->SetState( BUSY, false );
602 
603  if( !yet_another )
604  {
605  // Try to merge them
606  TRACK* segDelete = mergeCollinearSegmentIfPossible( aSegment,
607  other, endpoint );
608 
609  // Merge succesful, the other one has to go away
610  if( segDelete )
611  {
612  m_brd->Remove( segDelete );
613  m_commit.Removed( segDelete );
614  merged_this = true;
615  }
616  }
617  }
618  }
619  }
620  }
621 
622  return merged_this;
623 }
BOARD * m_brd
Definition: clean.cpp:122
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
TRACK * GetTrack(TRACK *aStartTrace, TRACK *aEndTrace, ENDPOINT_T aEndPoint, bool aSameNetOnly, bool aSequential)
Function GetTrack returns the trace segment connected to the segment at aEndPoint from aStartTrace to...
#define BUSY
Pcbnew: flag indicating that the structure has.
Definition: base_struct.h:134
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
ENDPOINT_T
Flag used in locate routines (from which endpoint work)
Definition: pcbnew.h:54
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
TRACK * Next() const
Definition: class_track.h:97
TRACK * mergeCollinearSegmentIfPossible(TRACK *aTrackRef, TRACK *aCandidate, ENDPOINT_T aEndType)
helper function merge aTrackRef and aCandidate, when possible, i.e.
Definition: clean.cpp:702
void SetState(int type, int state)
Definition: base_struct.h:242
int GetWidth() const
Definition: class_track.h:114
DLIST< TRACK > m_Track
Definition: class_board.h:244
void Remove(BOARD_ITEM *aBoardItem) override
>
TRACK * TRACKS_CLEANER::mergeCollinearSegmentIfPossible ( TRACK aTrackRef,
TRACK aCandidate,
ENDPOINT_T  aEndType 
)
private

helper function merge aTrackRef and aCandidate, when possible, i.e.

Function used by clean_segments.

when they are colinear, same width, and obviously same layer

Test if aTrackRef and aCandidate (which must have a common end) are collinear. and see if the common point is not on a pad (i.e. if this common point can be removed). the ending point of aTrackRef is the start point (aEndType == START) or the end point (aEndType != START) flags START_ON_PAD and END_ON_PAD must be set before calling this function if the common point can be deleted, this function change the common point coordinate of the aTrackRef segm (and therefore connect the 2 other ending points) and return aCandidate (which can be deleted). else return NULL

Definition at line 702 of file clean.cpp.

References TRACK::end, END_ON_PAD, ENDPOINT_START, TRACK::GetEnd(), TRACK::GetStart(), EDA_ITEM::GetState(), TRACK::GetWidth(), parallelism_test(), PCB_TRACE_T, TRACK::SetEnd(), TRACK::SetStart(), EDA_ITEM::SetState(), TRACK::start, START_ON_PAD, EDA_ITEM::Type(), wxPoint::x, and wxPoint::y.

Referenced by merge_collinear_of_track().

704 {
705  // First of all, they must be of the same width and must be both actual tracks
706  if( ( aTrackRef->GetWidth() != aCandidate->GetWidth() ) ||
707  ( aTrackRef->Type() != PCB_TRACE_T ) ||
708  ( aCandidate->Type() != PCB_TRACE_T ) )
709  return NULL;
710 
711  // Trivial case: exactly the same track
712  if( ( aTrackRef->GetStart() == aCandidate->GetStart() ) &&
713  ( aTrackRef->GetEnd() == aCandidate->GetEnd() ) )
714  return aCandidate;
715 
716  if( ( aTrackRef->GetStart() == aCandidate->GetEnd() ) &&
717  ( aTrackRef->GetEnd() == aCandidate->GetStart() ) )
718  return aCandidate;
719 
720  // Weed out non-parallel tracks
721  if ( !parallelism_test( aTrackRef->GetEnd().x - aTrackRef->GetStart().x,
722  aTrackRef->GetEnd().y - aTrackRef->GetStart().y,
723  aCandidate->GetEnd().x - aCandidate->GetStart().x,
724  aCandidate->GetEnd().y - aCandidate->GetStart().y ) )
725  return NULL;
726 
727  /* Here we have 2 aligned segments:
728  * We must change the pt_ref common point only if not on a pad
729  * (this function) is called when there is only 2 connected segments,
730  * and if this point is not on a pad, it can be removed and the 2 segments will be merged
731  */
732  if( aEndType == ENDPOINT_START )
733  {
734  // We do not have a pad, which is a always terminal point for a track
735  if( aTrackRef->GetState( START_ON_PAD ) )
736  return NULL;
737 
738  /* change the common point coordinate of pt_segm to use the other point
739  * of pt_segm (pt_segm will be removed later) */
740  if( aTrackRef->GetStart() == aCandidate->GetStart() )
741  {
742  aTrackRef->SetStart( aCandidate->GetEnd() );
743  aTrackRef->start = aCandidate->end;
744  aTrackRef->SetState( START_ON_PAD, aCandidate->GetState( END_ON_PAD ) );
745  return aCandidate;
746  }
747  else
748  {
749  aTrackRef->SetStart( aCandidate->GetStart() );
750  aTrackRef->start = aCandidate->start;
751  aTrackRef->SetState( START_ON_PAD, aCandidate->GetState( START_ON_PAD ) );
752  return aCandidate;
753  }
754  }
755  else // aEndType == END
756  {
757  // We do not have a pad, which is a always terminal point for a track
758  if( aTrackRef->GetState( END_ON_PAD ) )
759  return NULL;
760 
761  /* change the common point coordinate of pt_segm to use the other point
762  * of pt_segm (pt_segm will be removed later) */
763  if( aTrackRef->GetEnd() == aCandidate->GetStart() )
764  {
765  aTrackRef->SetEnd( aCandidate->GetEnd() );
766  aTrackRef->end = aCandidate->end;
767  aTrackRef->SetState( END_ON_PAD, aCandidate->GetState( END_ON_PAD ) );
768  return aCandidate;
769  }
770  else
771  {
772  aTrackRef->SetEnd( aCandidate->GetStart() );
773  aTrackRef->end = aCandidate->start;
774  aTrackRef->SetState( END_ON_PAD, aCandidate->GetState( START_ON_PAD ) );
775  return aCandidate;
776  }
777  }
778 
779  return NULL;
780 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
static bool parallelism_test(int dx1, int dy1, int dx2, int dy2)
Definition: clean.cpp:663
#define END_ON_PAD
void SetEnd(const wxPoint &aEnd)
Definition: class_track.h:116
int GetState(int type) const
Definition: base_struct.h:237
#define START_ON_PAD
const wxPoint & GetEnd() const
Definition: class_track.h:117
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
const wxPoint & GetStart() const
Definition: class_track.h:120
void SetState(int type, int state)
Definition: base_struct.h:242
int GetWidth() const
Definition: class_track.h:114
void SetStart(const wxPoint &aStart)
Definition: class_track.h:119
BOARD_CONNECTED_ITEM * end
Definition: class_track.h:89
BOARD_CONNECTED_ITEM * start
Definition: class_track.h:88
void CONNECTIONS::Propagate_SubNets ( )
inherited

Function Propagate_SubNets Test a list of tracks, to create or propagate a sub netcode to pads and segments connected together.

The track list must be sorted by nets, and all segments from m_firstTrack to m_lastTrack have the same net. When 2 items are connected (a track to a pad, or a track to an other track), they are grouped in a cluster. For pads, this is the .m_physical_connexion member which is a cluster identifier For tracks, this is the .m_Subnet member which is a cluster identifier For a given net, if all tracks are created, there is only one cluster. but if not all tracks are created, there are more than one cluster, and some ratsnests will be left active.

Definition at line 584 of file connect.cpp.

References BOARD_CONNECTED_ITEM::GetSubNet(), CONNECTIONS::m_firstTrack, CONNECTIONS::m_lastTrack, BOARD_CONNECTED_ITEM::m_PadsConnected, CONNECTIONS::m_sortedPads, BOARD_CONNECTED_ITEM::m_TracksConnected, CONNECTIONS::Merge_PadsSubNets(), CONNECTIONS::Merge_SubNets(), TRACK::Next(), and BOARD_CONNECTED_ITEM::SetSubNet().

Referenced by CONNECTIONS::Build_CurrNet_SubNets_Connections().

585 {
586  int sub_netcode = 1;
587 
588  TRACK* curr_track = (TRACK*)m_firstTrack;
589  if( curr_track )
590  curr_track->SetSubNet( sub_netcode );
591 
592  // Examine connections between tracks and pads
593  for( ; curr_track != NULL; curr_track = curr_track->Next() )
594  {
595  // First: handling connections to pads
596  for( unsigned ii = 0; ii < curr_track->m_PadsConnected.size(); ii++ )
597  {
598  D_PAD * pad = curr_track->m_PadsConnected[ii];
599 
600  if( curr_track->GetSubNet() ) // the track segment is already a cluster member
601  {
602  if( pad->GetSubNet() > 0 )
603  {
604  // The pad is already a cluster member, so we can merge the 2 clusters
605  Merge_SubNets( pad->GetSubNet(), curr_track->GetSubNet() );
606  }
607  else
608  {
609  /* The pad is not yet attached to a cluster , so we can add this pad to
610  * the cluster */
611  pad->SetSubNet( curr_track->GetSubNet() );
612  }
613  }
614  else // the track segment is not attached to a cluster
615  {
616  if( pad->GetSubNet() > 0 )
617  {
618  // it is connected to a pad in a cluster, merge this track
619  curr_track->SetSubNet( pad->GetSubNet() );
620  }
621  else
622  {
623  /* it is connected to a pad not in a cluster, so we must create a new
624  * cluster (only with the 2 items: the track and the pad) */
625  sub_netcode++;
626  curr_track->SetSubNet( sub_netcode );
627  pad->SetSubNet( curr_track->GetSubNet() );
628  }
629  }
630  }
631 
632  // Test connections between segments
633  for( unsigned ii = 0; ii < curr_track->m_TracksConnected.size(); ii++ )
634  {
635  BOARD_CONNECTED_ITEM* track = curr_track->m_TracksConnected[ii];
636 
637  if( curr_track->GetSubNet() ) // The current track is already a cluster member
638  {
639  // The other track is already a cluster member, so we can merge the 2 clusters
640  if( track->GetSubNet() )
641  {
642  Merge_SubNets( track->GetSubNet(), curr_track->GetSubNet() );
643  }
644  else
645  {
646  // The other track is not yet attached to a cluster , so we can add this
647  // other track to the cluster
648  track->SetSubNet( curr_track->GetSubNet() );
649  }
650  }
651  else // the current track segment is not yet attached to a cluster
652  {
653  if( track->GetSubNet() )
654  {
655  // The other track is already a cluster member, so we can add
656  // the current segment to the cluster
657  curr_track->SetSubNet( track->GetSubNet() );
658  }
659  else
660  {
661  // it is connected to an other segment not in a cluster, so we must
662  // create a new cluster (only with the 2 track segments)
663  sub_netcode++;
664  curr_track->SetSubNet( sub_netcode );
665  track->SetSubNet( curr_track->GetSubNet() );
666  }
667  }
668  }
669 
670  if( curr_track == m_lastTrack )
671  break;
672  }
673 
674  // Examine connections between intersecting pads, and propagate
675  // sub_netcodes to intersecting pads
676  for( unsigned ii = 0; ii < m_sortedPads.size(); ii++ )
677  {
678  D_PAD* curr_pad = m_sortedPads[ii];
679 
680  for( unsigned jj = 0; jj < curr_pad->m_PadsConnected.size(); jj++ )
681  {
682  D_PAD* pad = curr_pad->m_PadsConnected[jj];
683 
684  if( curr_pad->GetSubNet() ) // the current pad is already attached to a cluster
685  {
686  if( pad->GetSubNet() > 0 )
687  {
688  // The pad is already a cluster member, so we can merge the 2 clusters
689  // Store the initial subnets, which will be modified by Merge_PadsSubNets
690  int subnet1 = pad->GetSubNet();
691  int subnet2 = curr_pad->GetSubNet();
692 
693  // merge subnets of pads only, even those not connected by tracks
694  Merge_PadsSubNets( subnet1, subnet2 );
695 
696  // merge subnets of tracks (and pads, which are already merged)
697  Merge_SubNets( subnet1, subnet2 );
698  }
699  else
700  {
701  // The pad is not yet attached to a cluster,
702  // so we can add this pad to the cluster
703  pad->SetSubNet( curr_pad->GetSubNet() );
704  }
705  }
706  else // the current pad is not attached to a cluster
707  {
708  if( pad->GetSubNet() > 0 )
709  {
710  // the connected pad is in a cluster,
711  // so we can add the current pad to the cluster
712  curr_pad->SetSubNet( pad->GetSubNet() );
713  }
714  else
715  {
716  // the connected pad is not in a cluster,
717  // so we must create a new cluster, with the 2 pads.
718  sub_netcode++;
719  curr_pad->SetSubNet( sub_netcode );
720  pad->SetSubNet( curr_pad->GetSubNet() );
721  }
722  }
723  }
724  }
725 }
int Merge_PadsSubNets(int aOldSubNet, int aNewSubNet)
Function Merge_PadsSubNets Change a subnet value to a new value, in m_sortedPads pad list After that...
Definition: connect.cpp:500
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
const TRACK * m_lastTrack
Definition: connect.h:100
std::vector< D_PAD * > m_sortedPads
Definition: connect.h:101
int Merge_SubNets(int aOldSubNet, int aNewSubNet)
Function Merge_SubNets Change a subnet old value to a new value, for tracks and pads which are connec...
Definition: connect.cpp:529
std::vector< D_PAD * > m_PadsConnected
void SetSubNet(int aSubNetCode)
TRACK * Next() const
Definition: class_track.h:97
int GetSubNet() const
Function GetSubNet.
const TRACK * m_firstTrack
Definition: connect.h:99
std::vector< TRACK * > m_TracksConnected
bool TRACKS_CLEANER::remove_duplicates_of_track ( const TRACK aTrack)
private

Removes all the following duplicates tracks of the specified one.

Definition at line 542 of file clean.cpp.

References TRACK::GetEnd(), BOARD_ITEM::GetLayer(), BOARD_CONNECTED_ITEM::GetNetCode(), TRACK::GetStart(), m_brd, m_commit, TRACK::Next(), BOARD::Remove(), COMMIT::Removed(), and EDA_ITEM::Type().

Referenced by clean_segments().

543 {
544  bool modified = false;
545  TRACK* nextsegment;
546 
547  for( TRACK* other = aTrack->Next(); other; other = nextsegment )
548  {
549  nextsegment = other->Next();
550 
551  // New netcode, break out (can't be there any other)
552  if( aTrack->GetNetCode() != other->GetNetCode() )
553  break;
554 
555  // Must be of the same type, on the same layer and the endpoints
556  // must be the same (maybe swapped)
557  if( ( aTrack->Type() == other->Type() ) &&
558  ( aTrack->GetLayer() == other->GetLayer() ) )
559  {
560  if( ( ( aTrack->GetStart() == other->GetStart() ) &&
561  ( aTrack->GetEnd() == other->GetEnd() ) ) ||
562  ( ( aTrack->GetStart() == other->GetEnd() ) &&
563  ( aTrack->GetEnd() == other->GetStart() ) ) )
564  {
565  m_brd->Remove( other );
566  m_commit.Removed( other );
567  modified = true;
568  }
569  }
570  }
571 
572  return modified;
573 }
BOARD * m_brd
Definition: clean.cpp:122
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
const wxPoint & GetEnd() const
Definition: class_track.h:117
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
const wxPoint & GetStart() const
Definition: class_track.h:120
int GetNetCode() const
Function GetNetCode.
TRACK * Next() const
Definition: class_track.h:97
void Remove(BOARD_ITEM *aBoardItem) override
>
bool TRACKS_CLEANER::remove_duplicates_of_via ( const VIA aVia)
private

Removes all the following THT vias on the same position of the specified one.

Definition at line 334 of file clean.cpp.

References GetFirstVia(), TRACK::GetStart(), m_brd, m_commit, TRACK::Next(), BOARD::Remove(), COMMIT::Removed(), and VIA_THROUGH.

Referenced by clean_vias().

335 {
336  bool modified = false;
337 
338  // Search and delete others vias at same location
339  VIA* next_via;
340 
341  for( VIA* alt_via = GetFirstVia( aVia->Next() ); alt_via != NULL; alt_via = next_via )
342  {
343  next_via = GetFirstVia( alt_via->Next() );
344 
345  if( ( alt_via->GetViaType() == VIA_THROUGH ) &&
346  ( alt_via->GetStart() == aVia->GetStart() ) )
347  {
348  m_brd->Remove( alt_via );
349  m_commit.Removed( alt_via );
350  modified = true;
351  }
352  }
353  return modified;
354 }
BOARD * m_brd
Definition: clean.cpp:122
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
const wxPoint & GetStart() const
Definition: class_track.h:120
TRACK * Next() const
Definition: class_track.h:97
void Remove(BOARD_ITEM *aBoardItem) override
>
VIA * GetFirstVia(TRACK *aTrk, const TRACK *aStopPoint=NULL)
Scan a track list for the first VIA o NULL if not found (or NULL passed)
Definition: class_track.h:493
bool TRACKS_CLEANER::removeBadTrackSegments ( )
private

Definition at line 264 of file clean.cpp.

References CONNECTIONS::BuildTracksCandidatesList(), FLAG0, CONNECTIONS::GetConnectedTracks(), BOARD_CONNECTED_ITEM::GetNetCode(), EDA_ITEM::GetState(), m_brd, m_commit, BOARD_CONNECTED_ITEM::m_PadsConnected, BOARD::m_Status_Pcb, BOARD::m_Track, BOARD_CONNECTED_ITEM::m_TracksConnected, TRACK::Next(), next(), BOARD::Remove(), COMMIT::Removed(), CONNECTIONS::SearchConnectedTracks(), CONNECTIONS::SearchTracksConnectedToPads(), and EDA_ITEM::SetState().

Referenced by CleanupBoard().

265 {
266  // The rastsnet is expected to be up to date (Compile_Ratsnest was called)
267 
268  // Rebuild physical connections.
269  // the list of physical connected items to a given item is in
270  // m_PadsConnected and m_TracksConnected members of each item
272 
273  // build connections between track segments and pads.
275 
276  TRACK* segment;
277 
278  // build connections between track ends
279  for( segment = m_brd->m_Track; segment; segment = segment->Next() )
280  {
281  SearchConnectedTracks( segment );
282  GetConnectedTracks( segment );
283  }
284 
285  bool isModified = false;
286 
287  for( segment = m_brd->m_Track; segment; segment = segment->Next() )
288  {
289  segment->SetState( FLAG0, false );
290 
291  for( unsigned ii = 0; ii < segment->m_PadsConnected.size(); ++ii )
292  {
293  if( segment->GetNetCode() != segment->m_PadsConnected[ii]->GetNetCode() )
294  segment->SetState( FLAG0, true );
295  }
296 
297  for( unsigned ii = 0; ii < segment->m_TracksConnected.size(); ++ii )
298  {
299  TRACK* tested = segment->m_TracksConnected[ii];
300 
301  if( segment->GetNetCode() != tested->GetNetCode() && !tested->GetState( FLAG0 ) )
302  segment->SetState( FLAG0, true );
303  }
304  }
305 
306  // Remove tracks having a flagged segment
307  TRACK* next;
308 
309  for( segment = m_brd->m_Track; segment; segment = next )
310  {
311  next = segment->Next();
312 
313  if( segment->GetState( FLAG0 ) ) // Segment is flagged to be removed
314  {
315  isModified = true;
316  m_brd->Remove( segment );
317  m_commit.Removed( segment );
318  }
319  }
320 
321  if( isModified )
322  { // some pointers are invalid. Clear the m_TracksConnected list,
323  // to avoid any issue
324  for( segment = m_brd->m_Track; segment; segment = segment->Next() )
325  segment->m_TracksConnected.clear();
326 
327  m_brd->m_Status_Pcb = 0;
328  }
329 
330  return isModified;
331 }
CITER next(CITER it)
Definition: ptree.cpp:130
BOARD * m_brd
Definition: clean.cpp:122
void GetConnectedTracks(TRACK *aTrack)
Function GetConnectedTracks Copy m_Connected that contains the list of tracks connected calculated by...
Definition: connect.h:170
int GetState(int type) const
Definition: base_struct.h:237
BOARD_COMMIT & m_commit
Definition: clean.cpp:123
COMMIT & Removed(EDA_ITEM *aItem)
Notifies observers that aItem has been removed
Definition: commit.h:96
void BuildTracksCandidatesList(TRACK *aBegin, TRACK *aEnd=NULL)
Function BuildTracksCandidatesList Fills m_Candidates with all connecting points (track ends or via l...
Definition: connect.cpp:252
int SearchConnectedTracks(const TRACK *aTrack)
function SearchConnectedTracks Populates .m_connected with tracks/vias connected to aTrack m_candidat...
Definition: connect.cpp:306
void SearchTracksConnectedToPads(bool add_to_padlist=true, bool add_to_tracklist=true)
function SearchTracksConnectedToPads Explores the list of pads.
Definition: connect.cpp:114
std::vector< D_PAD * > m_PadsConnected
#define FLAG0
Pcbnew: flag used in local computations.
Definition: base_struct.h:131
int GetNetCode() const
Function GetNetCode.
TRACK * Next() const
Definition: class_track.h:97
void SetState(int type, int state)
Definition: base_struct.h:242
std::vector< TRACK * > m_TracksConnected
DLIST< TRACK > m_Track
Definition: class_board.h:244
void Remove(BOARD_ITEM *aBoardItem) override
>
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
int CONNECTIONS::SearchConnectedTracks ( const TRACK aTrack)
inherited

function SearchConnectedTracks Populates .m_connected with tracks/vias connected to aTrack m_candidates is expected to be populated by the track candidates ends list

Parameters
aTrack= track or via to use as reference

Definition at line 306 of file connect.cpp.

References CONNECTIONS::CollectItemsNearTo(), delta, dist, EuclideanNorm(), TRACK::GetEnd(), BOARD_ITEM::GetLayerSet(), TRACK::GetStart(), GetTrack(), TRACK::GetTrack(), TRACK::GetWidth(), KiROUND(), CONNECTIONS::m_candidates, CONNECTIONS::m_connected, PCB_VIA_T, CONNECTIONS::searchEntryPointInCandidatesList(), and EDA_ITEM::Type().

Referenced by CONNECTIONS::Build_CurrNet_SubNets_Connections(), PCB_BASE_FRAME::RecalculateAllTracksNetcode(), and removeBadTrackSegments().

307 {
308  int count = 0;
309  m_connected.clear();
310 
311  LSET layerMask = aTrack->GetLayerSet();
312 
313  // Search for connections to starting point:
314 #define USE_EXTENDED_SEARCH
315 
316 #ifdef USE_EXTENDED_SEARCH
317  int dist_max = aTrack->GetWidth() / 2;
318  static std::vector<CONNECTED_POINT*> tracks_candidates;
319 #endif
320 
321  wxPoint position = aTrack->GetStart();
322 
323  for( int kk = 0; kk < 2; kk++ )
324  {
325 #ifndef USE_EXTENDED_SEARCH
326  int idx = searchEntryPointInCandidatesList( position );
327 
328  if( idx >= 0 )
329  {
330  // search after:
331  for( unsigned ii = idx; ii < m_candidates.size(); ii ++ )
332  {
333  if( m_candidates[ii].GetTrack() == aTrack )
334  continue;
335 
336  if( m_candidates[ii].GetPoint() != position )
337  break;
338 
339  if( ( m_candidates[ii].GetTrack()->GetLayerSet() & layerMask ).any() )
340  m_connected.push_back( m_candidates[ii].GetTrack() );
341  }
342 
343  // search before:
344  for( int ii = idx-1; ii >= 0; ii -- )
345  {
346  if( m_candidates[ii].GetTrack() == aTrack )
347  continue;
348 
349  if( m_candidates[ii].GetPoint() != position )
350  break;
351 
352  if( ( m_candidates[ii].GetTrack()->GetLayerSet() & layerMask ).any() )
353  m_connected.push_back( m_candidates[ii].GetTrack() );
354  }
355  }
356 #else
357 
358  tracks_candidates.clear();
359 
360  CollectItemsNearTo( tracks_candidates, position, dist_max );
361 
362  for( unsigned ii = 0; ii < tracks_candidates.size(); ii++ )
363  {
364  TRACK* ctrack = tracks_candidates[ii]->GetTrack();
365 
366  if( !( ctrack->GetLayerSet() & layerMask ).any() )
367  continue;
368 
369  if( ctrack == aTrack )
370  continue;
371 
372  // We have a good candidate: calculate the actual distance
373  // between ends, which should be <= dist max.
374  wxPoint delta = tracks_candidates[ii]->GetPoint() - position;
375 
376  int dist = KiROUND( EuclideanNorm( delta ) );
377 
378  if( dist > dist_max )
379  continue;
380 
381  m_connected.push_back( ctrack );
382  }
383 #endif
384 
385  // Search for connections to ending point:
386  if( aTrack->Type() == PCB_VIA_T )
387  break;
388 
389  position = aTrack->GetEnd();
390  }
391 
392  return count;
393 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:104
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
TRACK * GetTrack(TRACK *aStartTrace, TRACK *aEndTrace, ENDPOINT_T aEndPoint, bool aSameNetOnly, bool aSequential)
Function GetTrack returns the trace segment connected to the segment at aEndPoint from aStartTrace to...
TRACK * GetTrack(TRACK *aStartTrace, const TRACK *aEndTrace, const wxPoint &aPosition, LSET aLayerMask)
Function GetTrack is a helper function to locate a trace segment having an end point at aPosition on ...
Definition: class_track.cpp:68
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
static const int dist[10][10]
Definition: dist.cpp:57
static const int delta[8][2]
Definition: solve.cpp:112
const wxPoint & GetEnd() const
Definition: class_track.h:117
Class LSET is a set of LAYER_IDs.
const wxPoint & GetStart() const
Definition: class_track.h:120
virtual LSET GetLayerSet() const
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
std::vector< CONNECTED_POINT > m_candidates
Definition: connect.h:96
int GetWidth() const
Definition: class_track.h:114
void CollectItemsNearTo(std::vector< CONNECTED_POINT * > &aList, const wxPoint &aPosition, int aDistMax)
function CollectItemsNearTo Used by SearchTracksConnectedToPads Fills aList with pads near to aPositi...
Definition: connect.cpp:146
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:108
int searchEntryPointInCandidatesList(const wxPoint &aPoint)
function searchEntryPointInCandidatesList Search an item in m_Connected connected to aPoint note m_Co...
Definition: connect.cpp:396
std::vector< TRACK * > m_connected
Definition: connect.h:94
void CONNECTIONS::SearchConnectionsPadsToIntersectingPads ( )
inherited

function SearchConnectionsPadsToIntersectingPads Explores the list of pads and adds to m_PadsConnected member of each pad pads connected to Here, connections are due to intersecting pads, not tracks m_sortedPads must be initialized

Definition at line 72 of file connect.cpp.

References CONNECTIONS::BuildPadsCandidatesList(), CONNECTIONS::CollectItemsNearTo(), D_PAD::GetBoundingRadius(), D_PAD::GetLayerSet(), CONNECTED_POINT::GetPad(), CONNECTED_POINT::GetPoint(), D_PAD::HitTest(), BOARD_CONNECTED_ITEM::m_PadsConnected, CONNECTIONS::m_sortedPads, and D_PAD::ShapePos().

Referenced by CONNECTIONS::Build_CurrNet_SubNets_Connections().

73 {
74  std::vector<CONNECTED_POINT*> candidates;
75 
77 
78  for( unsigned ii = 0; ii < m_sortedPads.size(); ii++ )
79  {
80  D_PAD* pad = m_sortedPads[ii];
81 
82  pad->m_PadsConnected.clear();
83  candidates.clear();
84 
85  CollectItemsNearTo( candidates, pad->ShapePos(), pad->GetBoundingRadius() );
86 
87  // add pads to pad.m_PadsConnected, if they are connected
88  for( unsigned jj = 0; jj < candidates.size(); jj++ )
89  {
90  CONNECTED_POINT* item = candidates[jj];
91 
92  D_PAD* candidate_pad = item->GetPad();
93 
94  if( pad == candidate_pad )
95  continue;
96 
97  if( !( pad->GetLayerSet() & candidate_pad->GetLayerSet() ).any() )
98  continue;
99 
100  if( pad->HitTest( item->GetPoint() ) )
101  {
102  pad->m_PadsConnected.push_back( candidate_pad );
103  }
104  }
105  }
106 }
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
Definition: class_pad.cpp:700
void BuildPadsCandidatesList()
Function BuildPadsCandidatesList Populates m_candidates with all pads connecting points (pads positio...
Definition: connect.cpp:227
std::vector< D_PAD * > m_sortedPads
Definition: connect.h:101
const wxPoint & GetPoint() const
Definition: connect.h:87
int GetBoundingRadius() const
Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad...
Definition: class_pad.h:428
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:235
std::vector< D_PAD * > m_PadsConnected
void CollectItemsNearTo(std::vector< CONNECTED_POINT * > &aList, const wxPoint &aPosition, int aDistMax)
function CollectItemsNearTo Used by SearchTracksConnectedToPads Fills aList with pads near to aPositi...
Definition: connect.cpp:146
wxPoint ShapePos() const
Definition: class_pad.cpp:367
D_PAD * GetPad() const
Function GetPad.
Definition: connect.h:82
void CONNECTIONS::SearchTracksConnectedToPads ( bool  add_to_padlist = true,
bool  add_to_tracklist = true 
)
inherited

function SearchTracksConnectedToPads Explores the list of pads.

if( add_to_padlist ) adds to m_PadsConnected member of each track the pad(s) connected to if add_to_tracklist adds to m_TracksConnected member of each pad the track(s) connected to D_PAD::m_TracksConnected is cleared before adding items TRACK::m_PadsConnected is not cleared

Parameters
add_to_padlist= true to fill m_PadsConnected member of each track
add_to_tracklist= true to fill m_TracksConnected member of each pad

Definition at line 114 of file connect.cpp.

References CONNECTIONS::CollectItemsNearTo(), D_PAD::GetBoundingRadius(), BOARD_ITEM::GetLayerSet(), D_PAD::GetLayerSet(), CONNECTED_POINT::GetPoint(), D_PAD::GetPosition(), CONNECTED_POINT::GetTrack(), D_PAD::HitTest(), BOARD_CONNECTED_ITEM::m_PadsConnected, CONNECTIONS::m_sortedPads, and BOARD_CONNECTED_ITEM::m_TracksConnected.

Referenced by CONNECTIONS::Build_CurrNet_SubNets_Connections(), buildTrackConnectionInfo(), DRAG_LIST::fillList(), PCB_BASE_FRAME::RecalculateAllTracksNetcode(), and removeBadTrackSegments().

115 {
116  std::vector<CONNECTED_POINT*> candidates;
117 
118  for( unsigned ii = 0; ii < m_sortedPads.size(); ii++ )
119  {
120  D_PAD * pad = m_sortedPads[ii];
121  pad->m_TracksConnected.clear();
122  candidates.clear();
123 
124  CollectItemsNearTo( candidates, pad->GetPosition(), pad->GetBoundingRadius() );
125 
126  // add this pad to track.m_PadsConnected, if it is connected
127  for( unsigned jj = 0; jj < candidates.size(); jj++ )
128  {
129  CONNECTED_POINT* cp_item = candidates[jj];
130 
131  if( !( pad->GetLayerSet() & cp_item->GetTrack()->GetLayerSet() ).any() )
132  continue;
133 
134  if( pad->HitTest( cp_item->GetPoint() ) )
135  {
136  if( add_to_padlist )
137  cp_item->GetTrack()->m_PadsConnected.push_back( pad );
138 
139  if( add_to_tracklist )
140  pad->m_TracksConnected.push_back( cp_item->GetTrack() );
141  }
142  }
143  }
144 }
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
Definition: class_pad.cpp:700
std::vector< D_PAD * > m_sortedPads
Definition: connect.h:101
const wxPoint & GetPoint() const
Definition: connect.h:87
TRACK * GetTrack() const
Function GetTrack.
Definition: connect.h:72
int GetBoundingRadius() const
Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad...
Definition: class_pad.h:428
const wxPoint & GetPosition() const override
Definition: class_pad.h:170
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:235
virtual LSET GetLayerSet() const
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
std::vector< D_PAD * > m_PadsConnected
void CollectItemsNearTo(std::vector< CONNECTED_POINT * > &aList, const wxPoint &aPosition, int aDistMax)
function CollectItemsNearTo Used by SearchTracksConnectedToPads Fills aList with pads near to aPositi...
Definition: connect.cpp:146
std::vector< TRACK * > m_TracksConnected
bool TRACKS_CLEANER::testTrackEndpointDangling ( TRACK aTrack,
ENDPOINT_T  aEndPoint 
)
private

Utility: does the endpoint unconnected processed for one endpoint of one track Returns true if the track must be deleted, false if not necessarily.

Definition at line 424 of file clean.cpp.

References BUSY, dyn_cast(), TRACK::end, ENDPOINT_START, TRACK::GetTrack(), m_brd, BOARD::m_Track, EDA_ITEM::SetState(), TRACK::start, and zoneForTrackEndpoint().

Referenced by deleteDanglingTracks().

425 {
426  bool flag_erase = false;
427 
428  TRACK* other = aTrack->GetTrack( m_brd->m_Track, NULL, aEndPoint, true, false );
429 
430  if( !other && !zoneForTrackEndpoint( aTrack, aEndPoint ) )
431  flag_erase = true; // Start endpoint is neither on pad, zone or other track
432  else // segment, via or zone connected to this end
433  {
434  // Fill connectivity informations
435  if( aEndPoint == ENDPOINT_START )
436  aTrack->start = other;
437  else
438  aTrack->end = other;
439 
440  /* If a via is connected to this end, test if this via has a second item connected.
441  * If not, remove the current segment (the via would then become
442  * unconnected and remove on the following pass) */
443  VIA* via = dyn_cast<VIA*>( other );
444 
445  if( via )
446  {
447  // search for another segment following the via
448  aTrack->SetState( BUSY, true );
449 
450  other = via->GetTrack( m_brd->m_Track, NULL, aEndPoint, true, false );
451 
452  // There is a via on the start but it goes nowhere
453  if( !other && !zoneForTrackEndpoint( via, aEndPoint ) )
454  flag_erase = true;
455 
456  aTrack->SetState( BUSY, false );
457  }
458  }
459 
460  return flag_erase;
461 }
BOARD * m_brd
Definition: clean.cpp:122
TRACK * GetTrack(TRACK *aStartTrace, TRACK *aEndTrace, ENDPOINT_T aEndPoint, bool aSameNetOnly, bool aSequential)
Function GetTrack returns the trace segment connected to the segment at aEndPoint from aStartTrace to...
#define BUSY
Pcbnew: flag indicating that the structure has.
Definition: base_struct.h:134
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:73
const ZONE_CONTAINER * zoneForTrackEndpoint(const TRACK *aTrack, ENDPOINT_T aEndPoint)
Utility for checking if a track/via ends on a zone.
Definition: clean.cpp:402
void SetState(int type, int state)
Definition: base_struct.h:242
DLIST< TRACK > m_Track
Definition: class_board.h:244
BOARD_CONNECTED_ITEM * end
Definition: class_track.h:89
BOARD_CONNECTED_ITEM * start
Definition: class_track.h:88
const ZONE_CONTAINER * TRACKS_CLEANER::zoneForTrackEndpoint ( const TRACK aTrack,
ENDPOINT_T  aEndPoint 
)
private

Utility for checking if a track/via ends on a zone.

Definition at line 402 of file clean.cpp.

References dyn_cast(), TRACK::GetEndPoint(), BOARD_ITEM::GetLayer(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD::HitTestForAnyFilledArea(), VIA::LayerPair(), and m_brd.

Referenced by testTrackEndpointDangling().

404 {
405  // Vias are special cased, since they get a layer range, not a single one
406  LAYER_ID top_layer, bottom_layer;
407  const VIA* via = dyn_cast<const VIA*>( aTrack );
408 
409  if( via )
410  via->LayerPair( &top_layer, &bottom_layer );
411  else
412  {
413  top_layer = aTrack->GetLayer();
414  bottom_layer = top_layer;
415  }
416 
417  return m_brd->HitTestForAnyFilledArea( aTrack->GetEndPoint( aEndPoint ),
418  top_layer, bottom_layer, aTrack->GetNetCode() );
419 }
BOARD * m_brd
Definition: clean.cpp:122
ZONE_CONTAINER * HitTestForAnyFilledArea(const wxPoint &aRefPos, LAYER_ID aStartLayer, LAYER_ID aEndLayer, int aNetCode)
Function HitTestForAnyFilledArea tests if the given wxPoint is within the bounds of a filled area of ...
LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:73
const wxPoint & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition: class_track.h:124
int GetNetCode() const
Function GetNetCode.
void LayerPair(LAYER_ID *top_layer, LAYER_ID *bottom_layer) const
Function LayerPair Return the 2 layers used by the via (the via actually uses all layers between thes...
LAYER_ID
Enum LAYER_ID is the set of PCB layers.

Member Data Documentation


The documentation for this class was generated from the following file: