KiCad PCB EDA Suite
Loading...
Searching...
No Matches
from_to_cache.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004-2022 KiCad Developers.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef FROM_TO_CACHE_H
21#define FROM_TO_CACHE_H
22
23#include <set>
24
25class PAD;
27
29{
30public:
31
33 {
34 wxString name;
36 };
37
38 struct FT_PATH
39 {
40 int net;
43 wxString fromName, toName;
46 std::set<BOARD_CONNECTED_ITEM*> pathItems;
47 };
48
49 FROM_TO_CACHE( BOARD* aBoard = nullptr ) :
50 m_board( aBoard )
51 {
52 }
53
55 {
56 }
57
58 void Rebuild( BOARD* aBoard );
59 bool IsOnFromToPath( BOARD_CONNECTED_ITEM* aItem, const wxString& aFrom, const wxString& aTo );
60
61 FT_PATH* QueryFromToPath( const std::set<BOARD_CONNECTED_ITEM*>& aItems );
62
63private:
64 int cacheFromToPaths( const wxString& aFrom, const wxString& aTo );
65 void buildEndpointList();
66
67private:
68 std::vector<FT_ENDPOINT> m_ftEndpoints;
69 std::vector<FT_PATH> m_ftPaths;
70
72};
73
74#endif
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.
Definition: board.h:290
int cacheFromToPaths(const wxString &aFrom, const wxString &aTo)
std::vector< FT_PATH > m_ftPaths
Definition: from_to_cache.h:69
FROM_TO_CACHE(BOARD *aBoard=nullptr)
Definition: from_to_cache.h:49
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
Definition: from_to_cache.h:68
BOARD * m_board
Definition: from_to_cache.h:71
void buildEndpointList()
void Rebuild(BOARD *aBoard)
Definition: pad.h:54
std::set< BOARD_CONNECTED_ITEM * > pathItems
Definition: from_to_cache.h:46