39 for(
PAD*
pad : footprint->Pads() )
42 ent.
name = footprint->GetReference() + wxT(
"-" ) +
pad->GetNumber();
45 ent.
name = footprint->GetReference();
74 using Path = std::vector<CN_ITEM*>;
78 bool pathFound =
false;
84 Path
path = Q.front();
102 for( std::vector<CN_ITEM*>& p : Q )
105 vertexVisited =
true;
111 Path newpath(
path );
112 newpath.push_back( ci );
113 Q.push_back( newpath );
124 std::vector<FT_PATH> paths;
126 std::shared_ptr<CN_CONNECTIVITY_ALGO> cnAlgo = connectivity->GetConnectivityAlgo();
133 p.
net = endpoint.parent->GetNetCode();
134 p.
from = endpoint.parent;
144 wxString fromName =
path.from->GetParentFootprint()->GetReference()
145 + wxT(
"-" ) +
path.from->GetNumber();
147 auto padCandidates = connectivity->GetConnectedItems(
path.from,
148 { PCB_PAD_T, PCB_ARC_T, PCB_VIA_T,
150 PAD* toPad =
nullptr;
154 if( pitem ==
path.from )
160 const PAD *
pad =
static_cast<const PAD*
>( pitem );
162 wxString toName =
pad->GetParentFootprint()->GetReference()
163 + wxT(
"-" ) +
pad->GetNumber();
167 if(
pad == endpoint.parent )
172 toPad = endpoint.parent;
175 path.fromName = fromName;
176 path.toName = toName;
177 path.fromWildcard = aFrom;
178 path.toWildcard = aTo;
198 CN_ITEM* cnFrom = cnAlgo->ItemEntry(
path.from ).GetItems().front();
199 CN_ITEM* cnTo = cnAlgo->ItemEntry(
path.to ).GetItems().front();
200 std::vector<CN_ITEM*> upath;
204 if( result ==
PS_OK )
205 path.isUnique =
true;
207 path.isUnique =
false;
212 for(
const auto item : upath )
214 path.pathItems.insert( item->Parent() );
228 int nFromTosFound = 0;
233 for(
int attempt = 0; attempt < 2; attempt++ )
238 if( aFrom == ftPath.fromWildcard && aTo == ftPath.toWildcard )
242 if( ftPath.pathItems.count( aItem ) )
269 if ( ftPath.pathItems == aItems )
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
Information pertinent to a Pcbnew printed circuit board.
const FOOTPRINTS & Footprints() const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
CN_ITEM represents a BOARD_CONNETED_ITEM in the connectivity system (ie: a pad, track/arc/via,...
const std::vector< CN_ITEM * > & ConnectedItems() const
int cacheFromToPaths(const wxString &aFrom, const wxString &aTo)
std::vector< FT_PATH > m_ftPaths
FT_PATH * QueryFromToPath(const std::set< BOARD_CONNECTED_ITEM * > &aItems)
bool IsOnFromToPath(BOARD_CONNECTED_ITEM *aItem, const wxString &aFrom, const wxString &aTo)
std::vector< FT_ENDPOINT > m_ftEndpoints
void Rebuild(BOARD *aBoard)
static bool isVertexVisited(CN_ITEM *v, const std::vector< CN_ITEM * > &path)
static PATH_STATUS uniquePathBetweenNodes(CN_ITEM *u, CN_ITEM *v, std::vector< CN_ITEM * > &outPath)
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
@ PCB_PAD_T
class PAD, a pad in a footprint