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,
EXCLUDE_ZONES );
148 PAD* toPad =
nullptr;
152 if( pitem ==
path.from )
158 const PAD *
pad =
static_cast<const PAD*
>( pitem );
160 wxString toName =
pad->GetParentFootprint()->GetReference()
161 + wxT(
"-" ) +
pad->GetNumber();
165 if(
pad == endpoint.parent )
170 toPad = endpoint.parent;
173 path.fromName = fromName;
174 path.toName = toName;
175 path.fromWildcard = aFrom;
176 path.toWildcard = aTo;
196 CN_ITEM* cnFrom = cnAlgo->ItemEntry(
path.from ).GetItems().front();
197 CN_ITEM* cnTo = cnAlgo->ItemEntry(
path.to ).GetItems().front();
198 std::vector<CN_ITEM*> upath;
202 if( result ==
PS_OK )
203 path.isUnique =
true;
205 path.isUnique =
false;
210 for(
const auto item : upath )
212 path.pathItems.insert( item->Parent() );
226 int nFromTosFound = 0;
231 for(
int attempt = 0; attempt < 2; attempt++ )
236 if( aFrom == ftPath.fromWildcard && aTo == ftPath.toWildcard )
240 if( ftPath.pathItems.count( aItem ) )
267 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