KiCad PCB EDA Suite
Loading...
Searching...
No Matches
conn_navigation.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 The KiCad Developers, see AUTHORS.txt for contributors.
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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <sch_sheet_path.h>
23#include <map>
24#include <set>
25#include <unordered_set>
26#include <vector>
27
29class SCHEMATIC;
30class SCH_ITEM;
31
32namespace SCH_CONNECTIVITY
33{
34using NET_ITEMS_BY_SHEET = std::map<SCH_SHEET_PATH, std::vector<SCH_ITEM*>, SHEET_PATH_CMP>;
35
40{
41public:
42 explicit NAVIGATION_QUERY( const SCHEMATIC& aSchematic );
43 std::vector<wxString> NetNames() const;
45 std::vector<wxString> SignalNames( const wxString& aName ) const;
46 bool HasNet( const wxString& aName ) const;
47 std::set<KIID_PATH> NetSheets( const wxString& aName ) const;
48 NET_ITEMS_BY_SHEET NetItems( const wxString& aName, bool aIncludeBusParents,
49 bool aIncludeBusMembers = false ) const;
51 void CollectNetItems( const wxString& aName, const SCH_SHEET_PATH& aSheet,
52 std::unordered_set<SCH_ITEM*>& aItems, bool aIncludeBusParents = false,
53 bool aIncludeBusMembers = false ) const;
55 std::vector<SCH_ITEM*> WholeNetItems( const std::vector<SCH_ITEM*>& aSeeds,
56 const SCH_SHEET_PATH& aSheet ) const;
57
58private:
59 std::set<const CONNECTION_SUBGRAPH*> netSubgraphs( const wxString& aName, bool aIncludeBusParents,
60 bool aIncludeBusMembers ) const;
61
63};
64}
A subgraph is a set of items that are electrically connected on a single sheet.
Holds all the data relating to one schematic.
Definition schematic.h:148
void CollectNetItems(const wxString &aName, const SCH_SHEET_PATH &aSheet, std::unordered_set< SCH_ITEM * > &aItems, bool aIncludeBusParents=false, bool aIncludeBusMembers=false) const
Add the items of a net on one sheet to aItems without building other sheets.
bool HasNet(const wxString &aName) const
std::vector< wxString > SignalNames(const wxString &aName) const
Signal itself or leaf signals of a bus, suitable for PCB cross-probing.
std::set< const CONNECTION_SUBGRAPH * > netSubgraphs(const wxString &aName, bool aIncludeBusParents, bool aIncludeBusMembers) const
NET_ITEMS_BY_SHEET NetItems(const wxString &aName, bool aIncludeBusParents, bool aIncludeBusMembers=false) const
NAVIGATION_QUERY(const SCHEMATIC &aSchematic)
std::vector< SCH_ITEM * > WholeNetItems(const std::vector< SCH_ITEM * > &aSeeds, const SCH_SHEET_PATH &aSheet) const
Whole nets containing the seeds on this instance; excludes bus parents and members.
std::set< KIID_PATH > NetSheets(const wxString &aName) const
std::vector< wxString > NetNames() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
std::map< SCH_SHEET_PATH, std::vector< SCH_ITEM * >, SHEET_PATH_CMP > NET_ITEMS_BY_SHEET
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.