43 for(
PAD*
pad : footprint->Pads() )
46 ent.
name = footprint->GetReference() + wxT(
"-" ) +
pad->GetNumber();
49 ent.
name = footprint->GetReference();
78 using Path = std::vector<CN_ITEM*>;
82 bool pathFound =
false;
84 Q.push_back( std::move( pInit ) );
88 Path
path =
Q.front();
106 for( std::vector<CN_ITEM*>& p :
Q )
110 vertexVisited =
true;
117 Path newpath(
path );
118 newpath.push_back( ci );
119 Q.push_back( std::move( newpath ) );
130 std::vector<FT_PATH> paths;
131 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
m_board->GetConnectivity();
132 std::shared_ptr<CN_CONNECTIVITY_ALGO> cnAlgo = connectivity->GetConnectivityAlgo();
139 p.
net = endpoint.parent->GetNetCode();
140 p.
from = endpoint.parent;
142 paths.push_back( std::move( p ) );
150 wxString fromName =
path.from->GetParentFootprint()->GetReference()
151 + wxT(
"-" ) +
path.from->GetNumber();
153 auto padCandidates = connectivity->GetConnectedItems(
path.from,
EXCLUDE_ZONES );
154 PAD* toPad =
nullptr;
158 if( pitem ==
path.from )
164 const PAD *
pad =
static_cast<const PAD*
>( pitem );
166 wxString toName =
pad->GetParentFootprint()->GetReference()
167 + wxT(
"-" ) +
pad->GetNumber();
171 if(
pad == endpoint.parent )
176 toPad = endpoint.parent;
179 path.fromName = fromName;
180 path.toName = toName;
181 path.fromWildcard = aFrom;
182 path.toWildcard = aTo;
202 CN_ITEM* cnFrom = cnAlgo->ItemEntry(
path.from ).GetItems().front();
203 CN_ITEM* cnTo = cnAlgo->ItemEntry(
path.to ).GetItems().front();
204 std::vector<CN_ITEM*> upath;
209 path.isUnique =
true;
211 path.isUnique =
false;
216 for(
const CN_ITEM* item : upath )
217 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.
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.
wxString result
Test unit parsing edge cases and error handling.
@ PCB_PAD_T
class PAD, a pad in a footprint