KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board.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) 2007 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef CLASS_BOARD_H_
26#define CLASS_BOARD_H_
27
30#include <common.h> // Needed for stl hash extensions
31#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
32#include <hash.h>
33#include <layer_ids.h>
34#include <netinfo.h>
35#include <pcb_item_containers.h>
36#include <pcb_plot_params.h>
37#include <title_block.h>
38#include <tools/pcb_selection.h>
39#include <shared_mutex>
40#include <list>
41
44class BOARD_COMMIT;
45class DRC_RTREE;
46class PCB_BASE_FRAME;
47class PCB_EDIT_FRAME;
49class BOARD;
50class FOOTPRINT;
51class ZONE;
52class PCB_TRACK;
53class PAD;
54class PCB_GROUP;
55class PCB_GENERATOR;
56class PCB_MARKER;
57class MSG_PANEL_ITEM;
58class NETLIST;
59class REPORTER;
60class SHAPE_POLY_SET;
62class COMPONENT;
63class PROJECT;
65struct ISOLATED_ISLANDS;
66
67// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
68// It is the max dist between 2 end points to see them connected
69#define DEFAULT_CHAINING_EPSILON_MM 0.01
70
71// Forward declare endpoint from class_track.h
72enum ENDPOINT_T : int;
73
74
76{
79
80 bool operator==(const PTR_PTR_CACHE_KEY& other) const
81 {
82 return A == other.A && B == other.B;
83 }
84};
85
87{
90
91 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
92 {
93 return A == other.A && Layer == other.Layer;
94 }
95};
96
98{
102
103 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
104 {
105 return A == other.A && B == other.B && Layer == other.Layer;
106 }
107};
108
109namespace std
110{
111 template <>
112 struct hash<PTR_PTR_CACHE_KEY>
113 {
114 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
115 {
116 std::size_t seed = 0xa82de1c0;
117 hash_combine( seed, k.A, k.B );
118 return seed;
119 }
120 };
121
122 template <>
124 {
125 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
126 {
127 std::size_t seed = 0xa82de1c0;
128 hash_combine( seed, k.A, k.Layer );
129 return seed;
130 }
131 };
132
133 template <>
135 {
136 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
137 {
138 std::size_t seed = 0xa82de1c0;
139 hash_combine( seed, k.A, k.B, k.Layer );
140 return seed;
141 }
142 };
143}
144
145
150{
157
158
162struct LAYER
163{
165 {
166 clear();
167 }
168
169 void clear()
170 {
172 m_visible = true;
173 m_number = 0;
174 m_name.clear();
175 m_userName.clear();
176 }
177
178 /*
179 LAYER( const wxString& aName = wxEmptyString,
180 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
181 m_name( aName ),
182 m_type( aType ),
183 m_visible( aVisible ),
184 m_number( aNumber )
185 {
186 }
187 */
188
189 wxString m_name;
190 wxString m_userName;
194
201 static const char* ShowType( LAYER_T aType );
202
210 static LAYER_T ParseType( const char* aType );
211};
212
213
214// Helper class to handle high light nets
216{
217protected:
218 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
219 bool m_highLightOn; // highlight active
220
221 void Clear()
222 {
223 m_netCodes.clear();
224 m_highLightOn = false;
225 }
226
228 {
229 Clear();
230 }
231
232private:
233 friend class BOARD;
234};
235
241class BOARD;
242
244{
245public:
246 virtual ~BOARD_LISTENER() { }
247 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
248 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
249 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
250 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
251 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
252 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
253 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
254 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
255 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
256 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
257 std::vector<BOARD_ITEM*>& aRemovedItems,
258 std::vector<BOARD_ITEM*>& aDeletedItems )
259 {
260 }
261};
262
266typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
267
271enum class BOARD_USE
272{
273 NORMAL, // A normal board
274 FPHOLDER // A board that holds a single footprint
275};
276
277
282{
283public:
284 static inline bool ClassOf( const EDA_ITEM* aItem )
285 {
286 return aItem && PCB_T == aItem->Type();
287 }
288
294 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
295
301 BOARD_USE GetBoardUse() const { return m_boardUse; }
302
303 void IncrementTimeStamp();
304
305 int GetTimeStamp() const { return m_timeStamp; }
306
312 bool IsFootprintHolder() const
313 {
314 return m_boardUse == BOARD_USE::FPHOLDER;
315 }
316
317 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
318
319 const wxString &GetFileName() const { return m_fileName; }
320
321 const TRACKS& Tracks() const { return m_tracks; }
322
323 const FOOTPRINTS& Footprints() const { return m_footprints; }
324
325 const DRAWINGS& Drawings() const { return m_drawings; }
326
327 const ZONES& Zones() const { return m_zones; }
328
329 const GENERATORS& Generators() const { return m_generators; }
330
331 const MARKERS& Markers() const { return m_markers; }
332
333 // SWIG requires non-const accessors for some reason to make the custom iterators in board.i
334 // work. It would be good to remove this if we can figure out how to fix that.
335#ifdef SWIG
336 DRAWINGS& Drawings() { return m_drawings; }
337 TRACKS& Tracks() { return m_tracks; }
338#endif
339
341
350 const GROUPS& Groups() const { return m_groups; }
351
352 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
353
354 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
355 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
356
357 void GetContextualTextVars( wxArrayString* aVars ) const;
358 bool ResolveTextVar( wxString* token, int aDepth ) const;
359
363
367
370
371 BOARD();
372 ~BOARD();
373
374 VECTOR2I GetPosition() const override;
375 void SetPosition( const VECTOR2I& aPos ) override;
376 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
377
378 bool IsEmpty() const
379 {
380 return m_drawings.empty() && m_footprints.empty() && m_tracks.empty() && m_zones.empty();
381 }
382
383 void Move( const VECTOR2I& aMoveVector ) override;
384
385 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
387
388 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
389 const wxString& GetGenerator() const { return m_generator; }
390
392 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
393 bool aSkipConnectivity = false ) override;
394
396 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
397
406 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
410
415 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
416
421 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
422
423 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
424 const std::vector<ZONE*>& aZones = {} );
425
434 {
435 return m_footprints.empty() ? nullptr : m_footprints.front();
436 }
437
441 void DeleteAllFootprints();
442
446 BOARD_ITEM* GetItem( const KIID& aID ) const;
447
448 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
449
453 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
454 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
455
460 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
461
467 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
468
472 void DeleteMARKERs();
473
474 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
475
476 PROJECT* GetProject() const { return m_project; }
477
486 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
487
488 void ClearProject();
489
497 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
498
502 void RecordDRCExclusions();
503
508
512 void ResetNetHighLight();
513
517 const std::set<int>& GetHighLightNetCodes() const
518 {
519 return m_highLight.m_netCodes;
520 }
521
528 void SetHighLightNet( int aNetCode, bool aMulti = false );
529
534
542 void HighLightON( bool aValue = true );
543
548 {
549 HighLightON( false );
550 }
551
555 int GetCopperLayerCount() const;
556 void SetCopperLayerCount( int aCount );
557
558 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
559
565 LSET GetEnabledLayers() const;
566
572 void SetEnabledLayers( LSET aLayerMask );
573
580 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
581
589 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
590
596 LSET GetVisibleLayers() const;
597
604 void SetVisibleLayers( LSET aLayerMask );
605
606 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
607 // are not stored in the bitmap.
608
616
623 void SetVisibleElements( const GAL_SET& aMask );
624
630 void SetVisibleAlls();
631
639 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
640
648 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
649
657 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
658
663
665
666 // Tented vias are vias covered by solder mask. So because the solder mask is a negative
667 // layer, tented vias are NOT plotted on solder mask layers
669 void SetTentVias( bool aFlag ) { m_plotOptions.SetPlotViaOnMaskLayer( !aFlag ); }
670
671 const PAGE_INFO& GetPageSettings() const { return m_paper; }
672 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
673
675 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
676
678 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
679 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
680
681 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
682
684 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
685
690 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
691
710 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
711 bool aAllowUseArcsInPolygons = false,
712 bool aIncludeNPTHAsOutlines = false );
713
723
734 void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines ) const;
735
739 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
740
747 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
748
756 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
757
768 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
769 {
770 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
771 return LayerName( aLayerId );
772 }
773
781 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
782
789 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
790
798 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
799
804 unsigned GetNodesCount( int aNet = -1 ) const;
805
814 const std::vector<PAD*> GetPads() const;
815
817 {
819 }
820
827 NETINFO_ITEM* FindNet( int aNetcode ) const;
828
835 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
836
846 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
847
851 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
852
854 {
855 return m_NetInfo;
856 }
857
859 {
860 m_NetInfo.RemoveUnusedNets( aCommit );
861 }
862
863#ifndef SWIG
868 {
869 return m_NetInfo.begin();
870 }
871
876 {
877 return m_NetInfo.end();
878 }
879#endif
880
884 unsigned GetNetCount() const
885 {
886 return m_NetInfo.GetNetCount();
887 }
888
895 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
896
897 const BOX2I GetBoundingBox() const override
898 {
899 return ComputeBoundingBox( false );
900 }
901
912 {
913 return ComputeBoundingBox( true );
914 }
915
916 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
917
929 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
930 const std::vector<KICAD_T>& scanTypes ) override;
931
940 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
941
948 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
949
953 std::set<wxString> GetNetClassAssignmentCandidates() const;
954
962 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
963
968
972 double Similarity( const BOARD_ITEM& aOther ) const override
973 {
974 return 1.0;
975 }
976
977 bool operator==( const BOARD_ITEM& aOther ) const override;
978
979 wxString GetClass() const override
980 {
981 return wxT( "BOARD" );
982 }
983
984#if defined(DEBUG)
985 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
986#endif
987
988
989 /*************************/
990 /* Copper Areas handling */
991 /*************************/
992
1003
1010 ZONE* GetArea( int index ) const
1011 {
1012 if( (unsigned) index < m_zones.size() )
1013 return m_zones[index];
1014
1015 return nullptr;
1016 }
1017
1021 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1022
1026 int GetAreaCount() const
1027 {
1028 return static_cast<int>( m_zones.size() );
1029 }
1030
1031 /* Functions used in test, merge and cut outlines */
1032
1045 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1046 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1047
1055 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1056
1064 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1065 PAD* GetPad( const VECTOR2I& aPosition ) const
1066 {
1067 return GetPad( aPosition, LSET().set() );
1068 }
1069
1077 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1078
1088 PAD* GetPadFast( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1089
1104 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerMask ) const;
1105
1117 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1118
1126 std::tuple<int, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1127
1135 TRACKS TracksInNet( int aNetCode );
1136
1149 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1150 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1151
1158 {
1159 return m_maxClearanceValue;
1160 };
1161
1167 void MapNets( BOARD* aDestBoard );
1168
1169 void SanitizeNetcodes();
1170
1179 void AddListener( BOARD_LISTENER* aListener );
1180
1185 void RemoveListener( BOARD_LISTENER* aListener );
1186
1190 void RemoveAllListeners();
1191
1196 void OnItemChanged( BOARD_ITEM* aItem );
1197
1202 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1203
1208 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1209 std::vector<BOARD_ITEM*>& aRemovedItems,
1210 std::vector<BOARD_ITEM*>& aChangedItems );
1211
1215 void OnRatsnestChanged();
1216
1223 wxString GroupsSanityCheck( bool repair = false );
1224
1230 wxString GroupsSanityCheckInternal( bool repair );
1231
1233 {
1234 bool create : 1;
1235 bool ungroup : 1;
1236 bool removeItems : 1;
1237 };
1238
1244 GroupLegalOpsField GroupLegalOps( const PCB_SELECTION& selection ) const;
1245
1246 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1247 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1248
1249 // --------- Item order comparators ---------
1250
1252 {
1253 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1254 };
1255
1257 {
1258 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1259 };
1260
1261 // ------------ Run-time caches -------------
1262 mutable std::shared_mutex m_CachesMutex;
1263 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsCourtyardCache;
1264 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsFCourtyardCache;
1265 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsBCourtyardCache;
1266 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_IntersectsAreaCache;
1267 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_EnclosedByAreaCache;
1268 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1269 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1270 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1271 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1272
1273 // ------------ DRC caches -------------
1274 std::vector<ZONE*> m_DRCZones;
1275 std::vector<ZONE*> m_DRCCopperZones;
1278 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1279 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1280
1281private:
1282 // The default copy constructor & operator= are inadequate,
1283 // either write one or do not use it at all
1284 BOARD( const BOARD& aOther ) = delete;
1285
1286 BOARD& operator=( const BOARD& aOther ) = delete;
1287
1288 template <typename Func, typename... Args>
1289 void InvokeListeners( Func&& aFunc, Args&&... args )
1290 {
1291 for( auto&& l : m_listeners )
1292 ( l->*aFunc )( std::forward<Args>( args )... );
1293 }
1294
1295
1297
1298 friend class PCB_EDIT_FRAME;
1299
1300
1303
1306 int m_timeStamp; // actually a modification counter
1307
1308 wxString m_fileName;
1309
1310 // These containers only have const accessors and must only be modified by Add()/Remove()
1311 MARKERS m_markers;
1312 DRAWINGS m_drawings;
1313 FOOTPRINTS m_footprints;
1314 TRACKS m_tracks;
1315 GROUPS m_groups;
1317 GENERATORS m_generators;
1318
1319 // Cache for fast access to items in the containers above by KIID, including children
1320 std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1321
1323
1324 HIGH_LIGHT_INFO m_highLight; // current high light data
1325 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1326
1327 int m_fileFormatVersionAtLoad; // the version loaded from the file
1328 wxString m_generator; // the generator tag from the file
1329
1330 std::map<wxString, wxString> m_properties;
1331 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1332
1334 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1336 PROJECT* m_project; // project this board is a part of
1338
1349 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1350
1355 bool m_legacyTeardrops = false;
1356
1358 int m_maxClearanceValue; // cached value
1359
1360 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1361
1362 std::vector<BOARD_LISTENER*> m_listeners;
1363};
1364
1365
1366#endif // CLASS_BOARD_H_
BOARD_USE
Flags to specify how the board is being used.
Definition: board.h:272
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition: board.h:150
@ LT_POWER
Definition: board.h:153
@ LT_MIXED
Definition: board.h:154
@ LT_UNDEFINED
Definition: board.h:151
@ LT_JUMPER
Definition: board.h:155
@ LT_SIGNAL
Definition: board.h:152
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition: board.h:266
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
Container for design settings for a BOARD object.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Definition: board_item.cpp:103
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition: board.h:251
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:248
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition: board.h:255
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aDeletedItems)
Definition: board.h:256
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:253
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:252
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:249
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:247
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: board.h:254
virtual ~BOARD_LISTENER()
Definition: board.h:246
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:250
Manage layers needed to make a physical board.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:282
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: board.cpp:1661
ZONE * m_SolderMaskBridges
Definition: board.h:1278
void GetContextualTextVars(wxArrayString *aVars) const
Definition: board.cpp:400
bool IsFootprintLayerVisible(PCB_LAYER_ID aLayer) const
Expect either of the two layers on which a footprint can reside, and returns whether that layer is vi...
Definition: board.cpp:785
BOARD_STACKUP GetStackupOrDefault() const
Definition: board.cpp:2177
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: board.h:675
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition: board.h:1267
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition: board.h:1279
GENERATORS m_generators
Definition: board.h:1317
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:2380
void OnItemChanged(BOARD_ITEM *aItem)
Notify the board and its listeners that an item on the board has been modified in some way.
Definition: board.cpp:2524
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:853
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: board.h:365
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:312
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:680
void SetPosition(const VECTOR2I &aPos) override
Definition: board.cpp:487
std::map< wxString, wxString > m_properties
Definition: board.h:1330
int m_fileFormatVersionAtLoad
Definition: board.h:1327
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition: board.cpp:1881
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:694
void SetTentVias(bool aFlag)
Definition: board.h:669
std::vector< ZONE * > m_DRCCopperZones
Definition: board.h:1275
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition: board.h:301
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:882
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:517
void MapNets(BOARD *aDestBoard)
Map all nets in the given board to nets with the same name (if any) in the destination board.
Definition: board.cpp:2470
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition: board.h:1355
TITLE_BLOCK m_titles
Definition: board.h:1334
GAL_SET m_LegacyVisibleItems
Definition: board.h:362
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:294
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition: board.h:1010
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition: board.h:911
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:897
void BuildListOfNets()
Definition: board.h:816
PAD * GetPadFast(const VECTOR2I &aPosition, LSET aLayerMask) const
Return pad found at aPosition on aLayerMask using the fast search method.
Definition: board.cpp:2035
LAYER m_layers[PCB_LAYER_ID_COUNT]
Definition: board.h:1322
const GENERATORS & Generators() const
Definition: board.h:329
void SetFileName(const wxString &aFileName)
Definition: board.h:317
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:768
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition: board.cpp:2444
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:746
int m_outlinesChainingEpsilon
the max distance between 2 end point to see them connected when building the board outlines
Definition: board.h:1302
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition: board.cpp:1920
BOARD_USE m_boardUse
What is this board being used for.
Definition: board.h:1305
PAGE_INFO m_paper
Definition: board.h:1333
void RemoveAllListeners()
Remove all listeners.
Definition: board.cpp:2518
FOOTPRINTS m_footprints
Definition: board.h:1313
std::unique_ptr< BOARD_DESIGN_SETTINGS > m_designSettings
All of the board design settings are stored as a JSON object inside the project file.
Definition: board.h:1349
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:700
void AddListener(BOARD_LISTENER *aListener)
Add a listener to the board to receive calls whenever something on the board has been modified.
Definition: board.cpp:2499
const PAGE_INFO & GetPageSettings() const
Definition: board.h:671
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition: board.cpp:1213
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: board.h:355
BOARD(const BOARD &aOther)=delete
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition: board.cpp:740
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition: board.cpp:2560
HIGH_LIGHT_INFO m_highLight
Definition: board.h:1324
bool SetLayerDescr(PCB_LAYER_ID aIndex, const LAYER &aLayer)
Return the type of the copper layer given by aLayer.
Definition: board.cpp:535
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1810
EDA_UNITS m_userUnits
Definition: board.h:1337
BOARD_ITEM * GetItem(const KIID &aID) const
Definition: board.cpp:1293
const ZONES & Zones() const
Definition: board.h:327
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: board.h:1289
void SanitizeNetcodes()
Definition: board.cpp:2489
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: board.cpp:1207
ZONE * AddArea(PICKED_ITEMS_LIST *aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer, VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch)
Add an empty copper area to board areas list.
Definition: board.cpp:2355
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition: board.h:350
~BOARD()
Definition: board.cpp:135
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition: board.cpp:180
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition: board.cpp:706
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition: board.cpp:601
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition: board.cpp:320
DRAWINGS m_drawings
Definition: board.h:1312
void OnItemsCompositeUpdate(std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems)
Notify the board and its listeners that items on the board have been modified in a composite operatio...
Definition: board.cpp:2536
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition: board.cpp:1971
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1943
EDA_UNITS GetUserUnits()
Definition: board.h:683
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:2551
PCB_PLOT_PARAMS m_plotOptions
Definition: board.h:1335
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition: board.cpp:583
std::list< ZONE * > GetZoneList(bool aIncludeZonesInFootprints=false) const
Definition: board.cpp:2335
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines) const
Build a set of polygons which are the outlines of copper items (pads, tracks, vias,...
Definition: board.cpp:2753
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:424
const MARKERS & Markers() const
Definition: board.h:331
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:433
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
Definition: board.cpp:2430
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: board.cpp:493
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:677
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1555
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
Definition: board.h:1157
ZONES m_zones
Definition: board.h:1316
PAD * GetPad(const VECTOR2I &aPosition) const
Definition: board.h:1065
PCB_LAYER_ID GetLayerID(const wxString &aLayerName) const
Return the ID of a layer.
Definition: board.cpp:547
HIGH_LIGHT_INFO m_highLightPrevious
Definition: board.h:1325
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: board.h:376
void HighLightOFF()
Disable net highlight.
Definition: board.h:547
NETINFO_LIST m_NetInfo
Definition: board.h:1360
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:361
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition: board.cpp:729
void SetOutlinesChainingEpsilon(int aValue)
Definition: board.h:722
NETINFO_LIST::iterator EndNets() const
Definition: board.h:875
GroupLegalOpsField GroupLegalOps(const PCB_SELECTION &selection) const
Check which selection tool group operations are legal given the selection.
Definition: board.cpp:2665
int GetCopperLayerCount() const
Definition: board.cpp:656
int m_timeStamp
Definition: board.h:1306
std::vector< BOARD_LISTENER * > m_listeners
Definition: board.h:1362
const std::map< wxString, wxString > & GetProperties() const
Definition: board.h:354
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition: board.h:1263
void IncrementTimeStamp()
Definition: board.cpp:249
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition: board.cpp:1831
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition: board.h:1264
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition: board.h:858
const FOOTPRINTS & Footprints() const
Definition: board.h:323
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: board.h:1331
void RemoveAll(std::initializer_list< KICAD_T > aTypes={ PCB_NETINFO_T, PCB_MARKER_T, PCB_GROUP_T, PCB_ZONE_T, PCB_GENERATOR_T, PCB_FOOTPRINT_T, PCB_TRACE_T, PCB_SHAPE_T })
An efficient way to remove all items of a certain type from the board.
Definition: board.cpp:1126
const BOARD_ITEM_SET GetItemSet()
Definition: board.cpp:2854
const TRACKS & Tracks() const
Definition: board.h:321
int m_DRCMaxPhysicalClearance
Definition: board.h:1277
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition: board.cpp:1908
void FinalizeBulkRemove(std::vector< BOARD_ITEM * > &aRemovedItems)
Must be used if Remove() is used using a BULK_x REMOVE_MODE to generate a change event for listeners.
Definition: board.cpp:1014
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: board.h:672
bool GetTentVias() const
Definition: board.h:668
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition: board.h:1268
wxString GroupsSanityCheckInternal(bool repair)
Definition: board.cpp:2596
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition: board.cpp:2545
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition: board.cpp:1436
wxString GetClass() const override
Return the class name.
Definition: board.h:979
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition: board.cpp:712
NETINFO_LIST::iterator BeginNets() const
Definition: board.h:867
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: board.h:369
void SetCopperLayerCount(int aCount)
Definition: board.cpp:662
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition: board.h:1271
wxString m_generator
Definition: board.h:1328
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition: board.h:1265
TRACKS TracksInNet(int aNetCode)
Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
Definition: board.cpp:513
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:190
PROJECT * m_project
Definition: board.h:1336
FOOTPRINT * GetFootprint(const VECTOR2I &aPosition, PCB_LAYER_ID aActiveLayer, bool aVisibleOnly, bool aIgnoreLocked=false) const
Get a footprint by its bounding rectangle at aPosition on aLayer.
Definition: board.cpp:2271
const wxString & GetFileName() const
Definition: board.h:319
bool operator==(const BOARD_ITEM &aOther) const override
Definition: board.cpp:2869
bool m_skipMaxClearanceCacheUpdate
Definition: board.h:1357
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:337
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition: board.cpp:1896
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1538
bool IsHighLightNetON() const
Definition: board.h:533
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:1397
int GetFileFormatVersionAtLoad() const
Definition: board.h:386
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition: board.cpp:752
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition: board.h:1270
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
Definition: board.cpp:613
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:674
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition: board.h:1308
const wxString & GetGenerator() const
Adds an item to the container.
Definition: board.h:389
int GetAreaCount() const
Definition: board.h:1026
void SetLegacyTeardrops(bool aFlag)
Definition: board.h:1247
int GetOutlinesChainingEpsilon()
Definition: board.h:721
void GetSortedPadListByXthenYCoord(std::vector< PAD * > &aVector, int aNetCode=-1) const
First empties then fills the vector with all pads and sorts them by increasing x coordinate,...
Definition: board.cpp:2162
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition: board.cpp:686
int m_DRCMaxClearance
Definition: board.h:1276
void ClearProject()
Definition: board.cpp:229
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition: board.h:1269
void FinalizeBulkAdd(std::vector< BOARD_ITEM * > &aNewItems)
Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for listeners.
Definition: board.cpp:1008
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Definition: board.cpp:668
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition: board.cpp:1277
PROJECT * GetProject() const
Definition: board.h:476
bool IsEmpty() const
Definition: board.h:378
bool LegacyTeardrops() const
Definition: board.h:1246
std::tuple< int, double, double > GetTrackLength(const PCB_TRACK &aTrack) const
Return data on the length and number of track segments connected to a given track.
Definition: board.cpp:2188
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: board.cpp:1623
const TITLE_BLOCK & GetTitleBlock() const
Definition: board.h:678
void UpdateMaxClearanceCache()
Definition: board.cpp:803
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
Definition: board.cpp:2583
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:797
std::vector< ZONE * > m_DRCZones
Definition: board.h:1274
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask) const
Find a pad aPosition on aLayer.
Definition: board.cpp:2005
void SetGenerator(const wxString &aGenerator)
Definition: board.h:388
BOARD()
Definition: board.cpp:73
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition: board.cpp:289
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition: board.cpp:1490
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition: board.cpp:1934
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition: board.h:1320
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition: board.cpp:2506
std::shared_mutex m_CachesMutex
Definition: board.h:1262
unsigned GetNetCount() const
Definition: board.h:884
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition: board.cpp:1239
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: board.cpp:1020
GROUPS m_groups
Definition: board.h:1315
MARKERS m_markers
Definition: board.h:1311
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition: board.h:1266
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:2573
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: board.h:679
int m_maxClearanceValue
Definition: board.h:1358
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition: board.h:1314
bool m_LegacyCopperEdgeClearanceLoaded
Definition: board.h:366
int GetTimeStamp() const
Definition: board.h:305
void OnItemsChanged(std::vector< BOARD_ITEM * > &aItems)
Notify the board and its listeners that an item on the board has been modified in some way.
Definition: board.cpp:2530
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:460
VECTOR2I GetPosition() const override
Definition: board.cpp:481
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition: board.cpp:832
static bool ClassOf(const EDA_ITEM *aItem)
Definition: board.h:284
void SetUserUnits(EDA_UNITS aUnits)
Definition: board.h:684
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:719
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition: board.h:972
const DRAWINGS & Drawings() const
Definition: board.h:325
void SetFileFormatVersionAtLoad(int aVersion)
Definition: board.h:385
const Vec GetCenter() const
Definition: box2.h:220
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:86
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition: drc_rtree.h:48
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:88
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:307
void Clear()
Definition: board.h:221
HIGH_LIGHT_INFO()
Definition: board.h:227
std::set< int > m_netCodes
Definition: board.h:218
bool m_highLightOn
Definition: board.h:219
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
Definition: kiid.h:49
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:575
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Handle the data for a net.
Definition: netinfo.h:56
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:401
Container for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:342
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
iterator begin() const
Definition: netinfo.h:446
unsigned GetNetCount() const
Definition: netinfo.h:365
iterator end() const
Definition: netinfo.h:451
void buildListOfNets()
Rebuild the list of NETINFO_ITEMs.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition: pcb_netlist.h:223
Definition: pad.h:59
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
The main frame for Pcbnew.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:51
Parameters and options when plotting/printing a board.
void SetPlotViaOnMaskLayer(bool aFlag)
bool GetPlotViaOnMaskLayer() const
A holder to handle information on schematic or board items.
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
Definition: project.h:62
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
Represent a set of closed polygons.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41
Handle a list of polygons defining a copper zone.
Definition: zone.h:72
The common library.
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:81
EDA_UNITS
Definition: eda_units.h:46
static void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
Definition: hash.h:34
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:30
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:194
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
STL namespace.
std::vector< ZONE * > ZONES
Definition: pcb_io_eagle.h:46
ENDPOINT_T
Definition: pcb_track.h:57
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2713
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2692
A struct recording the isolated and single-pad islands within a zone.
Definition: zone.h:59
Container to hold information pertinent to a layer of a BOARD.
Definition: board.h:163
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition: board.cpp:641
void clear()
Definition: board.h:169
LAYER_T m_type
The type of the layer.
Definition: board.h:191
static const char * ShowType(LAYER_T aType)
Convert a LAYER_T enum to a string representation of the layer type.
Definition: board.cpp:628
LAYER()
Definition: board.h:164
wxString m_name
The canonical name of the layer.
Definition: board.h:189
wxString m_userName
The user defined name of the layer.
Definition: board.h:190
bool m_visible
Definition: board.h:192
int m_number
The layer ID.
Definition: board.h:193
BOARD_ITEM * A
Definition: board.h:88
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:91
PCB_LAYER_ID Layer
Definition: board.h:89
BOARD_ITEM * A
Definition: board.h:77
BOARD_ITEM * B
Definition: board.h:78
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition: board.h:80
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:103
BOARD_ITEM * B
Definition: board.h:100
BOARD_ITEM * A
Definition: board.h:99
PCB_LAYER_ID Layer
Definition: board.h:101
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:125
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition: board.h:114
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:136
@ PCB_T
Definition: typeinfo.h:82
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition: typeinfo.h:91
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:99
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:109
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:49