pcbnew: add QueryFromToPath() method to FROM_TO_CACHE
This commit is contained in:
parent
bd0bd5b84b
commit
3654e7b795
|
@ -260,9 +260,22 @@ bool FROM_TO_CACHE::IsOnFromToPath( BOARD_CONNECTED_ITEM* aItem, const wxString
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FROM_TO_CACHE::Rebuild( BOARD* aBoard )
|
void FROM_TO_CACHE::Rebuild( BOARD* aBoard )
|
||||||
{
|
{
|
||||||
m_board = aBoard;
|
m_board = aBoard;
|
||||||
buildEndpointList();
|
buildEndpointList();
|
||||||
m_ftPaths.clear();
|
m_ftPaths.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FROM_TO_CACHE::FT_PATH* FROM_TO_CACHE::QueryFromToPath( const std::set<BOARD_CONNECTED_ITEM*>& aItems )
|
||||||
|
{
|
||||||
|
for( auto& ftPath : m_ftPaths )
|
||||||
|
{
|
||||||
|
if ( ftPath.pathItems == aItems )
|
||||||
|
return &ftPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
|
@ -60,6 +60,8 @@ public:
|
||||||
void Rebuild( BOARD* aBoard );
|
void Rebuild( BOARD* aBoard );
|
||||||
bool IsOnFromToPath( BOARD_CONNECTED_ITEM* aItem, const wxString& aFrom, const wxString& aTo );
|
bool IsOnFromToPath( BOARD_CONNECTED_ITEM* aItem, const wxString& aFrom, const wxString& aTo );
|
||||||
|
|
||||||
|
FT_PATH* QueryFromToPath( const std::set<BOARD_CONNECTED_ITEM*>& aItems );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int cacheFromToPaths( const wxString& aFrom, const wxString& aTo );
|
int cacheFromToPaths( const wxString& aFrom, const wxString& aTo );
|
||||||
|
|
Loading…
Reference in New Issue