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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef CLASS_BOARD_H_
22#define CLASS_BOARD_H_
23
24#include <atomic>
27#include <core/mirror.h>
28#include <embedded_files.h>
29#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
31#include <hash.h>
32#include <layer_ids.h>
33#include <lset.h>
34#include <netinfo.h>
35#include <pcb_item_containers.h>
36#include <pcb_plot_params.h>
37#include <title_block.h>
38#include <zone_settings.h>
39#include <shared_mutex>
40#include <sharded_cache.h>
41#include <unordered_set>
42#include <project.h>
43#include <list>
44
48class BOARD_COMMIT;
50class DRC_RTREE;
51class PCB_BASE_FRAME;
52class PCB_EDIT_FRAME;
55class BOARD;
56class FOOTPRINT;
58class ZONE;
59class PCB_TRACK;
60class PAD;
61class PCB_GROUP;
62class PCB_GENERATOR;
63class PCB_MARKER;
64class MSG_PANEL_ITEM;
65class NETLIST;
66class REPORTER;
68class COMPONENT;
69class PROJECT;
72
73namespace KIGFX
74{
75class RENDER_SETTINGS;
76};
77
78
79namespace KIFONT
80{
81 class OUTLINE_FONT;
82}
83
84struct ISOLATED_ISLANDS;
85
86// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
87// It is the max dist between 2 end points to see them connected
88#define DEFAULT_CHAINING_EPSILON_MM 0.01
89
90// Forward declare endpoint from class_track.h
91enum ENDPOINT_T : int;
92
93
95{
98
99 bool operator==(const PTR_PTR_CACHE_KEY& other) const
100 {
101 return A == other.A && B == other.B;
102 }
103};
104
106{
109
110 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
111 {
112 return A == other.A && Layer == other.Layer;
113 }
114};
115
117{
121
122 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
123 {
124 return A == other.A && B == other.B && Layer == other.Layer;
125 }
126};
127
128// Caches the whole-predicate result of a footprint-selector query (e.g. intersectsCourtyard)
129// for one item, so a rule set that repeats the same condition does not re-scan every footprint.
131{
132 const BOARD_ITEM* A;
133 wxString Selector; // the selector argument string, compared verbatim
135 int Constraint; // some predicates (intersectsArea) branch on the constraint
136
137 bool operator==( const ITEM_SELECTOR_LAYER_CACHE_KEY& other ) const
138 {
139 return A == other.A && Selector == other.Selector && Layer == other.Layer
140 && Constraint == other.Constraint;
141 }
142};
143
144// Caches getField('x') text per (item, field name)
146{
147 const BOARD_ITEM* A;
148 std::size_t FieldHash;
149
150 bool operator==( const ITEM_FIELD_CACHE_KEY& other ) const
151 {
152 return A == other.A && FieldHash == other.FieldHash;
153 }
154};
155
157{
159 layers(),
160 has_error( false )
161 {}
162
164 layers( { aLayer } ),
165 has_error( false )
166 {}
167
170};
171
172
173namespace std
174{
175 template <>
176 struct hash<PTR_PTR_CACHE_KEY>
177 {
178 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
179 {
180 std::size_t seed = 0xa82de1c0;
181 hash_combine( seed, k.A, k.B );
182 return seed;
183 }
184 };
185
186 template <>
188 {
189 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
190 {
191 std::size_t seed = 0xa82de1c0;
192 hash_combine( seed, k.A, k.Layer );
193 return seed;
194 }
195 };
196
197 template <>
199 {
200 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
201 {
202 std::size_t seed = 0xa82de1c0;
203 hash_combine( seed, k.A, k.B, k.Layer );
204 return seed;
205 }
206 };
207
208 template <>
210 {
211 std::size_t operator()( const ITEM_SELECTOR_LAYER_CACHE_KEY& k ) const
212 {
213 std::size_t seed = 0xa82de1c0;
215 return seed;
216 }
217 };
218
219 template <>
221 {
222 std::size_t operator()( const ITEM_FIELD_CACHE_KEY& k ) const
223 {
224 std::size_t seed = 0xa82de1c0;
225 hash_combine( seed, k.A, k.FieldHash );
226 return seed;
227 }
228 };
229}
230
231
246
247
251struct LAYER
252{
254 {
255 clear();
256 }
257
258 void clear()
259 {
261 m_visible = true;
262 m_number = 0;
263 m_name.clear();
264 m_userName.clear();
266 }
267
268 /*
269 LAYER( const wxString& aName = wxEmptyString,
270 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
271 m_name( aName ),
272 m_type( aType ),
273 m_visible( aVisible ),
274 m_number( aNumber )
275 {
276 }
277 */
278
279 wxString m_name;
280 wxString m_userName;
285
292 static const char* ShowType( LAYER_T aType );
293
301 static LAYER_T ParseType( const char* aType );
302};
303
304
305// Helper class to handle high light nets
307{
308protected:
309 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
310 bool m_highLightOn; // highlight active
311
312 void Clear()
313 {
314 m_netCodes.clear();
315 m_highLightOn = false;
316 }
317
319 {
320 Clear();
321 }
322
323private:
324 friend class BOARD;
325};
326
332class BOARD;
333
335{
336public:
337 virtual ~BOARD_LISTENER() { }
338 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
339 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
340 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
341 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
342 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
343 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
344 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
345 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
346 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
347 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
348 std::vector<BOARD_ITEM*>& aRemovedItems,
349 std::vector<BOARD_ITEM*>& aChangedItems )
350 {
351 }
352};
353
357typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
358
362enum class BOARD_USE
363{
364 NORMAL, // A normal board
365 FPHOLDER // A board that holds a single footprint
366};
367
368
373{
374public:
375 static inline bool ClassOf( const EDA_ITEM* aItem )
376 {
377 return aItem && PCB_T == aItem->Type();
378 }
379
385 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
386
392 BOARD_USE GetBoardUse() const { return m_boardUse; }
393
394 void IncrementTimeStamp();
395
396 int GetTimeStamp() const { return m_timeStamp.load( std::memory_order_acquire ); }
397
403 bool IsFootprintHolder() const
404 {
406 }
407
408 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
409
410 const wxString &GetFileName() const { return m_fileName; }
411
417 wxString GetDesignRulesPath() const;
418
419 const TRACKS& Tracks() const { return m_tracks; }
420
421 const FOOTPRINTS& Footprints() const { return m_footprints; }
422
423 const DRAWINGS& Drawings() const { return m_drawings; }
424
425 const ZONES& Zones() const { return m_zones; }
426
432 wxString GetUniqueZoneName( const wxString& aBaseName, const ZONE* aExclude = nullptr ) const;
433
434 const GENERATORS& Generators() const { return m_generators; }
435
438 void UpdateBoardOutline();
439
440 const MARKERS& Markers() const { return m_markers; }
441
442 const PCB_POINTS& Points() const { return m_points; }
443
447
451 const BOARD_ITEM_SET GetItemSet() const;
452
461 const GROUPS& Groups() const { return m_groups; }
462
463 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
464
465 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
466 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
467
468 // Variant system
469 wxString GetCurrentVariant() const { return m_currentVariant; }
470 void SetCurrentVariant( const wxString& aVariant );
471
472 const std::vector<wxString>& GetVariantNames() const { return m_variantNames; }
473 void SetVariantNames( const std::vector<wxString>& aNames ) { m_variantNames = aNames; }
474
475 bool HasVariant( const wxString& aVariantName ) const;
476 void AddVariant( const wxString& aVariantName );
477 void DeleteVariant( const wxString& aVariantName );
478 void RenameVariant( const wxString& aOldName, const wxString& aNewName );
479
480 wxString GetVariantDescription( const wxString& aVariantName ) const;
481 void SetVariantDescription( const wxString& aVariantName, const wxString& aDescription );
482
491 wxArrayString GetVariantNamesForUI() const;
492
493 void GetContextualTextVars( wxArrayString* aVars ) const;
494 bool ResolveTextVar( wxString* token, int aDepth ) const;
495
499
503
506
507 BOARD();
508 ~BOARD();
509
510 VECTOR2I GetPosition() const override;
511 void SetPosition( const VECTOR2I& aPos ) override;
512 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
513
514 bool IsEmpty() const;
515
516 void Move( const VECTOR2I& aMoveVector ) override;
517
518 void RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction, RECURSE_MODE aMode ) const override;
519
520 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
522
523 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
524 const wxString& GetGenerator() const { return m_generator; }
525
527 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
528 bool aSkipConnectivity = false ) override;
529
531 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
532
541 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
545
546 bool HasItemsOnLayer( PCB_LAYER_ID aLayer );
547
556 bool RemoveAllItemsOnLayer( PCB_LAYER_ID aLayer );
557
562 void BulkRemoveStaleTeardrops( BOARD_COMMIT& aCommit );
563
568 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
569
574 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
575
581 void FixupEmbeddedData();
582
583 void RunOnNestedEmbeddedFiles( const std::function<void( EMBEDDED_FILES* )>& aFunction ) override;
584
585 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
586 const std::vector<ZONE*>& aZones = {} );
587
596 {
597 return m_footprints.empty() ? nullptr : m_footprints.front();
598 }
599
603 void DeleteAllFootprints();
604
608 void DetachAllFootprints();
609
614 BOARD_ITEM* ResolveItem( const KIID& aID, bool aAllowNullptrReturn = false ) const;
615
619 void RebindItemUuid( BOARD_ITEM* aItem, const KIID& aNewId );
620
629
630 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
631
635 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
636 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
637
642 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
643
649 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
650
654 void DeleteMARKERs();
655
656 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
657
658 PROJECT* GetProject() const { return m_project; }
659
668 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
669
670 void ClearProject();
671
679 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
680
684 void RecordDRCExclusions();
685
690
696 void CompileRatsnest();
697
701 void ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, BOARD_COMMIT& aCommit,
702 bool matchPadPositions,
703 bool deleteExtraTexts = true, bool resetTextLayers = true,
704 bool resetTextEffects = true, bool resetTextPositions = true,
705 bool resetTextContent = true, bool resetFabricationAttrs = true,
706 bool resetClearanceOverrides = true, bool reset3DModels = true,
707 bool resetTransform = false,
708 bool* aUpdated = nullptr );
709
713 void ResetNetHighLight();
714
718 const std::set<int>& GetHighLightNetCodes() const
719 {
720 return m_highLight.m_netCodes;
721 }
722
729 void SetHighLightNet( int aNetCode, bool aMulti = false );
730
734 bool IsHighLightNetON() const { return m_highLight.m_highLightOn; }
735
743 void HighLightON( bool aValue = true );
744
749 {
750 HighLightON( false );
751 }
752
756 int GetCopperLayerCount() const;
757 void SetCopperLayerCount( int aCount );
758
759 int GetUserDefinedLayerCount() const;
760 void SetUserDefinedLayerCount( int aCount );
761
767
768 PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayer ) const;
769
770 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
771
777 const LSET& GetEnabledLayers() const;
778 LSET GetLayerSet() const override { return GetEnabledLayers(); }
779
785 void SetEnabledLayers( const LSET& aLayerMask );
786 void SetLayerSet( const LSET& aLayerMask ) override { SetEnabledLayers( aLayerMask ); }
787
794 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
795
803 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
804
810 const LSET& GetVisibleLayers() const;
811
818 void SetVisibleLayers( const LSET& aLayerMask );
819
820 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
821 // are not stored in the bitmap.
822
830
837 void SetVisibleElements( const GAL_SET& aMask );
838
844 void SetVisibleAlls();
845
853 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
854
862 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
863
871 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
872
877 void SetDesignSettings( const BOARD_DESIGN_SETTINGS& aSettings );
878
886 void InvalidateClearanceCache( const KIID& aUuid );
887
894
896
897 const PAGE_INFO& GetPageSettings() const { return m_paper; }
898 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
899
901 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
902
904 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
905 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
906
907 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
908
910 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
911
916 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
917
938 bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines, bool aInferOutlineIfNecessary,
939 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
940 bool aAllowUseArcsInPolygons = false, bool aIncludeNPTHAsOutlines = false );
941
951
965 KIGFX::RENDER_SETTINGS* aRenderSettings = nullptr ) const;
966
970 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
971
978 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
979
987 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
988
999 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
1000 {
1001 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
1002 return LayerName( aLayerId );
1003 }
1004
1012 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
1013
1017 bool IsFrontLayer( PCB_LAYER_ID aLayer ) const;
1018
1022 bool IsBackLayer( PCB_LAYER_ID aLayer ) const;
1023
1030 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
1031
1039 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
1040
1045 unsigned GetNodesCount( int aNet = -1 ) const;
1046
1055 const std::vector<PAD*> GetPads() const;
1056
1058 {
1059 m_NetInfo.buildListOfNets();
1060 }
1061
1068 NETINFO_ITEM* FindNet( int aNetcode ) const;
1069
1076 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
1077
1087 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
1088
1092 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
1093
1095 {
1096 return m_NetInfo;
1097 }
1098
1100 {
1101 m_NetInfo.RemoveUnusedNets( aCommit );
1102 }
1103
1108 {
1109 return m_NetInfo.begin();
1110 }
1111
1116 {
1117 return m_NetInfo.end();
1118 }
1119
1123 unsigned GetNetCount() const
1124 {
1125 return m_NetInfo.GetNetCount();
1126 }
1127
1132
1137
1144 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false, bool aPhysicalLayersOnly = false ) const;
1145
1146 const BOX2I GetBoundingBox() const override
1147 {
1148 return ComputeBoundingBox( false, false );
1149 }
1150
1161 {
1162 return ComputeBoundingBox( true, true );
1163 }
1164
1165 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
1166
1178 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
1179 const std::vector<KICAD_T>& scanTypes ) override;
1180
1189 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
1190
1197 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
1198
1199 PAD* FindPadByUuid( const KIID& aUuid ) const;
1200
1201 void ReplaceNetChainTerminalPad( const wxString& aNetChain, const KIID& aPrev, const KIID& aNew );
1202
1206 void SetNetChainColor( const wxString& aChain, const KIGFX::COLOR4D& aColor )
1207 {
1208 if( aColor == KIGFX::COLOR4D::UNSPECIFIED )
1209 m_netChainColors.erase( aChain );
1210 else
1211 m_netChainColors[aChain] = aColor;
1212 }
1213
1214 KIGFX::COLOR4D GetNetChainColor( const wxString& aChain ) const
1215 {
1216 auto it = m_netChainColors.find( aChain );
1217 return it != m_netChainColors.end() ? it->second : KIGFX::COLOR4D::UNSPECIFIED;
1218 }
1219
1220 const std::map<wxString, KIGFX::COLOR4D>& GetNetChainColors() const
1221 {
1222 return m_netChainColors;
1223 }
1224
1228 std::set<wxString> GetNetClassAssignmentCandidates() const;
1229
1237 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
1238
1242 bool SynchronizeComponentClasses( const std::unordered_set<wxString>& aNewSheetPaths ) const;
1243
1247 void SynchronizeProperties();
1248
1253
1257 double Similarity( const BOARD_ITEM& aOther ) const override
1258 {
1259 return 1.0;
1260 }
1261
1262 bool operator==( const BOARD_ITEM& aOther ) const override;
1263
1264 wxString GetClass() const override
1265 {
1266 return wxT( "BOARD" );
1267 }
1268
1269#if defined(DEBUG)
1270 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1271#endif
1272
1273
1274 /*************************/
1275 /* Copper Areas handling */
1276 /*************************/
1277
1288
1295 ZONE* GetArea( int index ) const
1296 {
1297 if( (unsigned) index < m_zones.size() )
1298 return m_zones[index];
1299
1300 return nullptr;
1301 }
1302
1306 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1307
1311 int GetAreaCount() const
1312 {
1313 return static_cast<int>( m_zones.size() );
1314 }
1315
1316 /* Functions used in test, merge and cut outlines */
1317
1330 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1331 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1332
1340 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1341
1349 PAD* GetPad( const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
1350 PAD* GetPad( const VECTOR2I& aPosition ) const
1351 {
1352 return GetPad( aPosition, LSET().set() );
1353 }
1354
1362 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1363
1378 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
1379
1391 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1392
1400 std::tuple<int, double, double, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1401
1409 TRACKS TracksInNet( int aNetCode );
1410
1423 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1424 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1425
1431 int GetMaxClearanceValue() const;
1432
1438 void MapNets( BOARD* aDestBoard );
1439
1440 void SanitizeNetcodes();
1441
1450 void AddListener( BOARD_LISTENER* aListener );
1451
1456 void RemoveListener( BOARD_LISTENER* aListener );
1457
1461 void RemoveAllListeners();
1462
1467 void OnItemChanged( BOARD_ITEM* aItem );
1468
1473 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1474
1479 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1480 std::vector<BOARD_ITEM*>& aRemovedItems,
1481 std::vector<BOARD_ITEM*>& aChangedItems );
1482
1486 void OnRatsnestChanged();
1487
1494 wxString GroupsSanityCheck( bool repair = false );
1495
1501 wxString GroupsSanityCheckInternal( bool repair );
1502
1503 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1504 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1505
1506 EMBEDDED_FILES* GetEmbeddedFiles() override;
1507 const EMBEDDED_FILES* GetEmbeddedFiles() const;
1508
1510
1514 std::set<KIFONT::OUTLINE_FONT*> GetFonts() const override;
1515
1519 void EmbedFonts() override;
1520
1525
1530
1532
1542 void SaveToHistory( const wxString& aProjectPath, std::vector<HISTORY_FILE_DATA>& aFileData );
1543
1544 const std::unordered_map<KIID, BOARD_ITEM*>& GetItemByIdCache() const
1545 {
1546 return m_itemByIdCache;
1547 }
1548
1549 bool IsItemIndexedById( const BOARD_ITEM* aItem ) const
1550 {
1551 return m_cachedIdByItem.contains( aItem );
1552 }
1553
1561 BOARD_ITEM* GetCachedItemById( const KIID& aId ) const;
1562
1569 void CacheItemById( BOARD_ITEM* aItem ) const;
1570
1577 void UncacheItemById( const KIID& aId ) const;
1578
1580 {
1581 wxCHECK( aItem, /* void */ );
1582
1583 CacheItemById( aItem );
1584
1585 aItem->RunOnChildren(
1586 [this]( BOARD_ITEM* aChild )
1587 {
1588 CacheItemSubtreeById( aChild );
1589 },
1591 }
1592
1593 void CacheChildrenById( const BOARD_ITEM* aParent )
1594 {
1595 wxCHECK( aParent, /* void */ );
1596
1597 aParent->RunOnChildren(
1598 [this]( BOARD_ITEM* aChild )
1599 {
1600 CacheItemSubtreeById( aChild );
1601 },
1603 }
1604
1606 {
1607 wxCHECK( aItem, /* void */ );
1608
1609 // Pointer-keyed eviction: never remove an entry that belongs to a
1610 // different live item with the same UUID (e.g. a temporary copy).
1611 UncacheItemByPtr( aItem );
1612
1613 aItem->RunOnChildren(
1614 [this]( BOARD_ITEM* aChild )
1615 {
1616 UncacheItemSubtreeById( aChild );
1617 },
1619 }
1620
1621 void UncacheChildrenById( const BOARD_ITEM* aParent )
1622 {
1623 wxCHECK( aParent, /* void */ );
1624
1625 aParent->RunOnChildren(
1626 [this]( BOARD_ITEM* aChild )
1627 {
1628 UncacheItemSubtreeById( aChild );
1629 },
1631 }
1632
1639 void UncacheItemByPtr( const BOARD_ITEM* aItem );
1640
1641 BOARD_ITEM* CacheAndReturnItemById( const KIID& aId, BOARD_ITEM* aItem ) const;
1642
1643 // --------- Item order comparators ---------
1644
1646 {
1647 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1648 };
1649
1651 {
1652 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1653 };
1654
1655public:
1665 std::shared_ptr<const FOOTPRINT_COURTYARD_INDEX> GetFootprintCourtyardIndex();
1666
1667 // ------------ Run-time caches -------------
1668 mutable std::shared_mutex m_CachesMutex;
1669 // These predicate caches are written per item-pair from every DRC worker thread, so they
1670 // carry their own internal sharded locks and are NOT covered by m_CachesMutex.
1682 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1683 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1684 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1685 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1686 mutable std::optional<int> m_maxClearanceValue;
1687
1688 mutable std::unordered_map<const BOARD_ITEM*, wxString> m_ItemNetclassCache;
1689
1690 // Zone name lookup cache for DRC rule area functions like enclosedByArea/intersectsArea.
1691 // Maps zone names to vectors of matching zones to avoid O(n) zone iteration per lookup.
1692 mutable std::unordered_map<wxString, std::vector<ZONE*>> m_ZonesByNameCache;
1693
1694 // Deflated zone outline cache for DRC area checks. Caches the deflated outline for each zone
1695 // to avoid repeated expensive deflation operations during collidesWithArea calls.
1696 mutable std::unordered_map<const ZONE*, SHAPE_POLY_SET> m_DeflatedZoneOutlineCache;
1697
1698 // Spatial index of footprint courtyards, built lazily by GetFootprintCourtyardIndex().
1699 std::shared_ptr<const FOOTPRINT_COURTYARD_INDEX> m_footprintCourtyardIndex;
1700
1701 // ------------ DRC caches -------------
1702 std::vector<ZONE*> m_DRCZones;
1703 std::vector<ZONE*> m_DRCCopperZones;
1704 std::map<PCB_LAYER_ID, std::vector<ZONE*>> m_DRCCopperZonesByLayer;
1707 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1708 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1709
1710private:
1711 // The default copy constructor & operator= are inadequate,
1712 // either write one or do not use it at all
1713 BOARD( const BOARD& aOther ) = delete;
1714
1715 BOARD& operator=( const BOARD& aOther ) = delete;
1716
1717 template <typename Func, typename... Args>
1718 void InvokeListeners( Func&& aFunc, Args&&... args )
1719 {
1720 for( auto&& l : m_listeners )
1721 ( l->*aFunc )( std::forward<Args>( args )... );
1722 }
1723
1724 // Refresh user layer opposites.
1725 void recalcOpposites();
1726
1727 friend class PCB_EDIT_FRAME;
1728
1729private:
1732
1735 std::atomic<int> m_timeStamp; // actually a modification counter
1736
1737 wxString m_fileName;
1738
1739 std::map<wxString, KIGFX::COLOR4D> m_netChainColors;
1740
1741 // These containers only have const accessors and must only be modified by Add()/Remove()
1751
1752 // Cache for fast access to items in the containers above by KIID, including children.
1753 // Mutable because it's a performance cache that can be populated during const lookups.
1754 // NOT protected by m_CachesMutex. Only safe for single-threaded access (UI, serialization).
1755 mutable std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1756 mutable std::unordered_map<const BOARD_ITEM*, KIID> m_cachedIdByItem;
1757
1758 std::map<int, LAYER> m_layers; // layer data
1759
1760 HIGH_LIGHT_INFO m_highLight; // current high light data
1761 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1762
1763 int m_fileFormatVersionAtLoad; // the version loaded from the file
1764 wxString m_generator; // the generator tag from the file
1765
1766 std::map<wxString, wxString> m_properties;
1767 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1768
1770 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1772 PROJECT* m_project; // project this board is a part of
1774
1775 // Variant system
1776 wxString m_currentVariant; // Currently active variant (empty = default)
1777 std::vector<wxString> m_variantNames; // All variant names in the board
1778 std::map<wxString, wxString> m_variantDescriptions; // Descriptions for each variant
1779
1790 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1791
1796 bool m_legacyTeardrops = false;
1797
1798 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1799
1800 std::vector<BOARD_LISTENER*> m_listeners;
1801
1803
1804 // Used for dummy boards, such as a footprint holder, where we don't want to make a copy
1805 // of all the parent's embedded data.
1807
1808 std::unique_ptr<COMPONENT_CLASS_MANAGER> m_componentClassManager;
1809 std::unique_ptr<LENGTH_DELAY_CALCULATION> m_lengthDelayCalc;
1810
1811 // Reactive text-variable dependency adapter. Installed as a listener
1812 // during BOARD construction; destructor order ensures it outlives no
1813 // listener calls.
1814 std::unique_ptr<class BOARD_TEXT_VAR_ADAPTER> m_textVarAdapter;
1815
1816public:
1818};
1819
1820
1821#endif // CLASS_BOARD_H_
int index
BOARD_USE
Flags to specify how the board is being used.
Definition board.h:363
@ FPHOLDER
Definition board.h:365
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition board.h:236
@ LT_POWER
Definition board.h:239
@ LT_FRONT
Definition board.h:243
@ LT_MIXED
Definition board.h:240
@ LT_BACK
Definition board.h:244
@ LT_UNDEFINED
Definition board.h:237
@ LT_JUMPER
Definition board.h:241
@ LT_AUX
Definition board.h:242
@ LT_SIGNAL
Definition board.h:238
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition board.h:357
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
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.
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:83
virtual void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const
Invoke a function on all children.
Definition board_item.h:229
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition board.h:342
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition board.h:346
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:339
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:343
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:340
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:338
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition board.h:345
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:341
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems)
Definition board.h:347
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:344
virtual ~BOARD_LISTENER()
Definition board.h:337
Manage layers needed to make a physical board.
Bridges BOARD's listener stream into the generic TEXT_VAR_TRACKER.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
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:2557
ZONE * m_SolderMaskBridges
Definition board.h:1707
void GetContextualTextVars(wxArrayString *aVars) const
Definition board.cpp:536
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:1138
BOARD_STACKUP GetStackupOrDefault() const
Definition board.cpp:3278
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition board.h:901
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition board.h:1708
PCB_LAYER_ID GetCopperLayerStackMaxId() const
Definition board.cpp:1009
GENERATORS m_generators
Definition board.h:1748
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:3621
const NETINFO_LIST & GetNetInfo() const
Definition board.h:1094
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition board.h:501
BOARD_TEXT_VAR_ADAPTER * GetTextVarAdapter() const
Definition board.h:1817
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition board.h:403
PAD * GetPad(const VECTOR2I &aPosition, const LSET &aLayerMask) const
Find a pad aPosition on aLayer.
Definition board.cpp:3128
SHARDED_CACHE< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition board.h:1674
int GetUserDefinedLayerCount() const
Definition board.cpp:998
void recalcOpposites()
Definition board.cpp:918
void CacheItemSubtreeById(BOARD_ITEM *aItem)
Definition board.h:1579
void SetPosition(const VECTOR2I &aPos) override
Definition board.cpp:674
std::map< wxString, wxString > m_properties
Definition board.h:1766
void CacheItemById(BOARD_ITEM *aItem) const
Add an item to the item-by-id cache.
Definition board.cpp:2037
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsCourtyardResultCache
Definition board.h:1676
std::unordered_map< const BOARD_ITEM *, wxString > m_ItemNetclassCache
Definition board.h:1688
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition board.cpp:3464
SHARDED_CACHE< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition board.h:1675
int m_fileFormatVersionAtLoad
Definition board.h:1763
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition board.cpp:2775
void UncacheItemById(const KIID &aId) const
Remove an item from the item-by-id cache.
Definition board.cpp:2066
void SetCurrentVariant(const wxString &aVariant)
Definition board.cpp:2880
std::vector< ZONE * > m_DRCCopperZones
Definition board.h:1703
void SetVisibleLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition board.cpp:1066
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition board.h:392
void SetVariantNames(const std::vector< wxString > &aNames)
Definition board.h:473
const std::vector< wxString > & GetVariantNames() const
Definition board.h:472
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition board.cpp:1346
const std::set< int > & GetHighLightNetCodes() const
Definition board.h:718
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaResultCache
Definition board.h:1680
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:3568
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition board.h:1796
TITLE_BLOCK m_titles
Definition board.h:1770
GAL_SET m_LegacyVisibleItems
Definition board.h:498
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition board.h:385
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition board.h:1295
std::vector< wxString > m_variantNames
Definition board.h:1777
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition board.h:1160
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition board.h:1146
LENGTH_DELAY_CALCULATION * GetLengthCalculation() const
Returns the track length calculator.
Definition board.h:1524
wxArrayString GetVariantNamesForUI() const
Return the variant names for UI display.
Definition board.cpp:3035
void BuildListOfNets()
Definition board.h:1057
void RunOnNestedEmbeddedFiles(const std::function< void(EMBEDDED_FILES *)> &aFunction) override
Provide access to nested embedded files, such as symbols in schematics and footprints in boards.
Definition board.cpp:1267
void SetNetChainColor(const wxString &aChain, const KIGFX::COLOR4D &aColor)
Per-net-chain colour override (empty COLOR4D::UNSPECIFIED = no override).
Definition board.h:1206
const GENERATORS & Generators() const
Definition board.h:434
void SetFileName(const wxString &aFileName)
Definition board.h:408
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition board.h:999
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition board.cpp:3533
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition board.h:778
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition board.cpp:1100
int m_outlinesChainingEpsilon
the max distance between 2 end point to see them connected when building the board outlines
Definition board.h:1731
std::tuple< int, double, double, 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:3289
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition board.cpp:2846
BOARD_USE m_boardUse
What is this board being used for.
Definition board.h:1734
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool matchPadPositions, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetTextPositions=true, bool resetTextContent=true, bool resetFabricationAttrs=true, bool resetClearanceOverrides=true, bool reset3DModels=true, bool resetTransform=false, bool *aUpdated=nullptr)
Replace aExisting with aNew, preserving connectivity and metadata.
PCB_BOARD_OUTLINE * BoardOutline()
Definition board.h:436
PAGE_INFO m_paper
Definition board.h:1769
void RemoveAllListeners()
Remove all listeners.
Definition board.cpp:3615
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition board.h:1673
FOOTPRINTS m_footprints
Definition board.h:1744
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:1790
friend class PCB_EDIT_FRAME
Definition board.h:1727
void SetEmbeddedFilesDelegate(EMBEDDED_FILES *aDelegate)
Definition board.h:1509
const PCB_POINTS & Points() const
Definition board.h:442
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines, KIGFX::RENDER_SETTINGS *aRenderSettings=nullptr) const
Build a set of polygons which are the outlines of copper items (pads, tracks, vias,...
Definition board.cpp:3843
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:3596
const PAGE_INFO & GetPageSettings() const
Definition board.h:897
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition board.cpp:1814
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition board.h:466
bool IsBackLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:843
const std::map< wxString, KIGFX::COLOR4D > & GetNetChainColors() const
Definition board.h:1220
BOARD(const BOARD &aOther)=delete
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition board.cpp:1094
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition board.cpp:3663
void CompileRatsnest()
Rebuild the entire board ratsnest.
Definition board.cpp:3646
HIGH_LIGHT_INFO m_highLight
Definition board.h:1760
std::map< wxString, wxString > m_variantDescriptions
Definition board.h:1778
bool SetLayerDescr(PCB_LAYER_ID aIndex, const LAYER &aLayer)
Return the type of the copper layer given by aLayer.
Definition board.cpp:765
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition board.cpp:2708
EDA_UNITS m_userUnits
Definition board.h:1773
void UpdateBoardOutline()
Definition board.cpp:4039
const ZONES & Zones() const
Definition board.h:425
void BulkRemoveStaleTeardrops(BOARD_COMMIT &aCommit)
Remove all teardrop zones with the STRUCT_DELETED flag set.
Definition board.cpp:1476
void DeleteVariant(const wxString &aVariantName)
Definition board.cpp:2923
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition board.h:1718
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aSettings)
Definition board.cpp:1155
const LSET & GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition board.cpp:1048
void SanitizeNetcodes()
Definition board.cpp:3586
void InitializeClearanceCache()
Initialize the clearance cache for all board items.
Definition board.cpp:1168
EMBEDDED_FILES * m_embeddedFilesDelegate
Definition board.h:1806
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:3398
bool IsFrontLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:837
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition board.h:461
~BOARD()
Definition board.cpp:169
void SaveToHistory(const wxString &aProjectPath, std::vector< HISTORY_FILE_DATA > &aFileData)
Serialize board into HISTORY_FILE_DATA for non-blocking history commit.
Definition board.cpp:4086
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:201
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:1060
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition board.cpp:849
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition board.cpp:391
DRAWINGS m_drawings
Definition board.h:1743
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:3633
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition board.cpp:3094
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition board.cpp:3055
EDA_UNITS GetUserUnits()
Definition board.h:909
void ResetNetHighLight()
Reset all high light data to the init state.
Definition board.cpp:3654
PCB_PLOT_PARAMS m_plotOptions
Definition board.h:1771
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition board.h:1671
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition board.cpp:811
std::list< ZONE * > GetZoneList(bool aIncludeZonesInFootprints=false) const
Definition board.cpp:3378
bool ResolveTextVar(wxString *token, int aDepth) const
Definition board.cpp:563
const MARKERS & Markers() const
Definition board.h:440
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition board.h:595
void UncacheChildrenById(const BOARD_ITEM *aParent)
Definition board.h:1621
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:978
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
Definition board.cpp:3519
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition board.cpp:680
std::unique_ptr< class BOARD_TEXT_VAR_ADAPTER > m_textVarAdapter
Definition board.h:1814
TITLE_BLOCK & GetTitleBlock()
Definition board.h:903
void FixupEmbeddedData()
After loading a file from disk, the footprints do not yet contain the full data for their embedded fi...
Definition board.cpp:1274
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
Definition board.cpp:1175
ZONES m_zones
Definition board.h:1747
void InvalidateClearanceCache(const KIID &aUuid)
Invalidate the clearance cache for a specific item.
Definition board.cpp:1161
PAD * GetPad(const VECTOR2I &aPosition) const
Definition board.h:1350
PAD * FindPadByUuid(const KIID &aUuid) const
Definition board.cpp:2814
std::unordered_map< const BOARD_ITEM *, KIID > m_cachedIdByItem
Definition board.h:1756
PCB_LAYER_ID GetLayerID(const wxString &aLayerName) const
Return the ID of a layer.
Definition board.cpp:773
HIGH_LIGHT_INFO m_highLightPrevious
Definition board.h:1761
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition board.h:512
void HighLightOFF()
Disable net highlight.
Definition board.h:748
NETINFO_LIST m_NetInfo
Definition board.h:1798
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition board.h:497
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition board.cpp:1083
void SetOutlinesChainingEpsilon(int aValue)
Definition board.h:950
bool HasVariant(const wxString &aVariantName) const
Definition board.cpp:2906
NETINFO_LIST::iterator EndNets() const
Definition board.h:1115
void AddVariant(const wxString &aVariantName)
Definition board.cpp:2912
int GetCopperLayerCount() const
Definition board.cpp:985
std::vector< BOARD_LISTENER * > m_listeners
Definition board.h:1800
bool RemoveAllItemsOnLayer(PCB_LAYER_ID aLayer)
Removes all owned items other than footprints existing on the given board layer, and modifies the sta...
Definition board.cpp:1728
const std::map< wxString, wxString > & GetProperties() const
Definition board.h:465
void IncrementTimeStamp()
Definition board.cpp:283
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition board.cpp:2727
wxString GetUniqueZoneName(const wxString &aBaseName, const ZONE *aExclude=nullptr) const
Return a name based on aBaseName that is not used by any other zone or rule area on the board.
Definition board.cpp:1295
PCB_POINTS m_points
Definition board.h:1750
std::unique_ptr< LENGTH_DELAY_CALCULATION > m_lengthDelayCalc
Definition board.h:1809
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition board.h:1099
const FOOTPRINTS & Footprints() const
Definition board.h:421
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition board.h:1767
std::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
Get the list of all outline fonts used in the board.
Definition board.cpp:3482
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:1589
const BOARD_ITEM_SET GetItemSet()
Collect every owned item (tracks, zones, generators, footprints, drawings, markers,...
Definition board.cpp:3945
const TRACKS & Tracks() const
Definition board.h:419
int m_DRCMaxPhysicalClearance
Definition board.h:1706
const PCB_BOARD_OUTLINE * BoardOutline() const
Definition board.h:437
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition board.cpp:2802
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:1470
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition board.h:898
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition board.h:1682
BOARD_ITEM * GetCachedItemById(const KIID &aId) const
Return a cached item for aId if the entry is still self-consistent.
Definition board.cpp:2020
bool m_embedFonts
Definition board.h:1802
wxString GroupsSanityCheckInternal(bool repair)
Definition board.cpp:3702
std::shared_ptr< const FOOTPRINT_COURTYARD_INDEX > m_footprintCourtyardIndex
Definition board.h:1699
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition board.cpp:3640
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition board.cpp:2280
wxString GetClass() const override
Return the class name.
Definition board.h:1264
std::unique_ptr< COMPONENT_CLASS_MANAGER > m_componentClassManager
Definition board.h:1808
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition board.h:1672
NETINFO_LIST::iterator BeginNets() const
Definition board.h:1107
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, bool aInferOutlineIfNecessary, 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:3423
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition board.h:505
void SetCopperLayerCount(int aCount)
Definition board.cpp:991
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition board.h:1685
std::unordered_map< const ZONE *, SHAPE_POLY_SET > m_DeflatedZoneOutlineCache
Definition board.h:1696
wxString m_generator
Definition board.h:1764
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsFCourtyardResultCache
Definition board.h:1677
TRACKS TracksInNet(int aNetCode)
Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
Definition board.cpp:743
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition board.cpp:211
PROJECT * m_project
Definition board.h:1772
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:3314
bool HasItemsOnLayer(PCB_LAYER_ID aLayer)
Definition board.cpp:1682
const wxString & GetFileName() const
Definition board.h:410
bool operator==(const BOARD_ITEM &aOther) const override
Definition board.cpp:3971
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition board.cpp:448
int GetPadWithCastellatedAttrCount()
Definition board.cpp:4068
wxString GetVariantDescription(const wxString &aVariantName) const
Definition board.cpp:2999
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition board.cpp:2790
unsigned GetNodesCount(int aNet=-1) const
Definition board.cpp:2433
bool IsHighLightNetON() const
Definition board.h:734
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition board.cpp:2238
SHARDED_CACHE< ITEM_FIELD_CACHE_KEY, wxString > m_ItemFieldCache
Definition board.h:1681
int GetFileFormatVersionAtLoad() const
Definition board.h:521
std::map< PCB_LAYER_ID, std::vector< ZONE * > > m_DRCCopperZonesByLayer
Definition board.h:1704
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition board.cpp:1106
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition board.h:1684
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
Definition board.cpp:868
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition board.h:900
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition board.h:1737
const wxString & GetGenerator() const
Adds an item to the container.
Definition board.h:524
int GetAreaCount() const
Definition board.h:1311
void DetachAllFootprints()
Remove all footprints without deleting.
Definition board.cpp:1885
void SetLegacyTeardrops(bool aFlag)
Definition board.h:1504
std::map< int, LAYER > m_layers
Definition board.h:1758
wxString GetCurrentVariant() const
Definition board.h:469
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const override
Invoke a function on all children.
Definition board.cpp:701
int GetOutlinesChainingEpsilon()
Definition board.h:949
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:3263
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:1040
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsAreaResultCache
Definition board.h:1679
int m_DRCMaxClearance
Definition board.h:1705
void ClearProject()
Definition board.cpp:252
void ReplaceNetChainTerminalPad(const wxString &aNetChain, const KIID &aPrev, const KIID &aNew)
Definition board.cpp:2826
void UncacheItemByPtr(const BOARD_ITEM *aItem)
Remove every cache entry that still points to aItem.
Definition board.cpp:2116
void SetLayerSet(const LSET &aLayerMask) override
Definition board.h:786
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition board.h:1683
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:1464
wxString m_currentVariant
Definition board.h:1776
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Definition board.cpp:1022
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition board.cpp:1873
PROJECT * GetProject() const
Definition board.h:658
bool IsEmpty() const
Definition board.cpp:662
int GetPadWithPressFitAttrCount()
Definition board.cpp:4050
bool LegacyTeardrops() const
Definition board.h:1503
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:2519
const TITLE_BLOCK & GetTitleBlock() const
Definition board.h:904
KIGFX::COLOR4D GetNetChainColor(const wxString &aChain) const
Definition board.h:1214
wxString GetDesignRulesPath() const
Return the absolute path to the design rules file for this board.
Definition board.cpp:272
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
Definition board.cpp:3688
void RenameVariant(const wxString &aOldName, const wxString &aNewName)
Definition board.cpp:2951
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1149
std::vector< ZONE * > m_DRCZones
Definition board.h:1702
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition board.cpp:1034
void SetGenerator(const wxString &aGenerator)
Definition board.h:523
BOARD()
Definition board.cpp:90
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition board.cpp:360
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition board.cpp:2360
void RebindItemUuid(BOARD_ITEM *aItem, const KIID &aNewId)
Rebind the UUID of an attached item and keep the item-by-id cache coherent.
Definition board.cpp:2139
int RepairDuplicateItemUuids()
Rebind duplicate attached-item UUIDs so each live board item has a unique ID.
Definition board.cpp:2165
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition board.cpp:2860
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition board.h:1755
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition board.cpp:3603
COMPONENT_CLASS_MANAGER & GetComponentClassManager()
Gets the component class manager.
Definition board.h:1529
std::shared_mutex m_CachesMutex
Definition board.h:1668
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false, bool aPhysicalLayersOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition board.cpp:2450
std::shared_ptr< const FOOTPRINT_COURTYARD_INDEX > GetFootprintCourtyardIndex()
Return a spatial index of footprint courtyards, building it on first use.
Definition board.cpp:336
unsigned GetNetCount() const
Definition board.h:1123
std::atomic< int > m_timeStamp
Definition board.h:1735
const std::unordered_map< KIID, BOARD_ITEM * > & GetItemByIdCache() const
Definition board.h:1544
bool SynchronizeComponentClasses(const std::unordered_set< wxString > &aNewSheetPaths) const
Copy component class / component class generator information from the project settings.
Definition board.cpp:3085
BOARD_ITEM * CacheAndReturnItemById(const KIID &aId, BOARD_ITEM *aItem) const
Definition board.cpp:2085
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition board.cpp:1836
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition board.cpp:1493
std::unordered_map< wxString, std::vector< ZONE * > > m_ZonesByNameCache
Definition board.h:1692
GROUPS m_groups
Definition board.h:1746
PROJECT::ELEM ProjectElementType() override
Definition board.h:1531
MARKERS m_markers
Definition board.h:1742
bool IsItemIndexedById(const BOARD_ITEM *aItem) const
Definition board.h:1549
std::optional< int > m_maxClearanceValue
Definition board.h:1686
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition board.cpp:3678
void SetEnabledLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition board.cpp:1054
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition board.h:905
void CacheChildrenById(const BOARD_ITEM *aParent)
Definition board.h:1593
void SynchronizeTuningProfileProperties()
Ensure that all time domain properties providers are in sync with current settings.
Definition board.cpp:3049
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition board.h:1745
std::map< wxString, KIGFX::COLOR4D > m_netChainColors
Definition board.h:1739
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
Definition board.cpp:1897
bool m_LegacyCopperEdgeClearanceLoaded
Definition board.h:502
int GetTimeStamp() const
Definition board.h:396
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:3627
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsBCourtyardResultCache
Definition board.h:1678
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition board.h:642
VECTOR2I GetPosition() const override
Definition board.cpp:668
void SetVariantDescription(const wxString &aVariantName, const wxString &aDescription)
Definition board.cpp:3018
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition board.cpp:1207
static bool ClassOf(const EDA_ITEM *aItem)
Definition board.h:375
void SetUserUnits(EDA_UNITS aUnits)
Definition board.h:910
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition board.cpp:1073
void EmbedFonts() override
Finds all fonts used in the board and embeds them in the file if permissions allow.
Definition board.cpp:3509
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition board.h:1257
PCB_BOARD_OUTLINE * m_boardOutline
Definition board.h:1749
void SetUserDefinedLayerCount(int aCount)
Definition board.cpp:1004
const DRAWINGS & Drawings() const
Definition board.h:423
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition board.cpp:1808
void UncacheItemSubtreeById(const BOARD_ITEM *aItem)
Definition board.h:1605
void SetFileFormatVersionAtLoad(int aVersion)
Definition board.h:520
constexpr const Vec GetCenter() const
Definition box2.h:226
A class to manage Component Classes in a board context.
Store all of the related component information found in a netlist.
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition drc_rtree.h:45
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:37
EMBEDDED_FILES()=default
Spatial index over footprint courtyard bounding boxes.
Helper for storing and iterating over GAL_LAYER_IDs.
Definition layer_ids.h:401
void Clear()
Definition board.h:312
friend class BOARD
Definition board.h:324
std::set< int > m_netCodes
Definition board.h:309
bool m_highLightOn
Definition board.h:310
Class OUTLINE_FONT implements outline font drawing.
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
Definition kiid.h:44
Class which calculates lengths (and associated routing statistics) in a BOARD context.
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:50
Handle the data for a net.
Definition netinfo.h:46
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition netinfo.h:281
Container for NETINFO_ITEM elements, which are the nets.
Definition netinfo.h:221
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition pad.h:61
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition page_info.h:75
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:49
Parameters and options when plotting/printing a board.
A holder to handle information on schematic or board items.
A progress reporter interface for use in multi-threaded environments.
A PROJECT can hold stuff it knows nothing about, in the form of _ELEM derivatives.
Definition project.h:89
Container for project specific data.
Definition project.h:62
ELEM
The set of #_ELEMs that a PROJECT can hold.
Definition project.h:68
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:71
Represent a set of closed polygons.
A concurrent key/value cache split into independently locked shards.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition title_block.h:37
Handle a list of polygons defining a copper zone.
Definition zone.h:70
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
#define LAYER(n, l)
RECURSE_MODE
Definition eda_item.h:48
@ NO_RECURSE
Definition eda_item.h:50
INSPECT_RESULT
Definition eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:89
EDA_UNITS
Definition eda_units.h:44
static constexpr void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
Definition hash.h:28
NORMAL
Follows standard pretty-printing rules.
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition layer_id.cpp:31
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition layer_ids.h:224
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29
STL namespace.
std::vector< ZONE * > ZONES
std::vector< PCB_MARKER * > MARKERS
std::deque< FOOTPRINT * > FOOTPRINTS
std::deque< PCB_TRACK * > TRACKS
std::deque< PCB_GROUP * > GROUPS
std::deque< PCB_GENERATOR * > GENERATORS
std::deque< BOARD_ITEM * > DRAWINGS
std::deque< PCB_POINT * > PCB_POINTS
ENDPOINT_T
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition board.cpp:3792
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition board.cpp:3771
Data produced by a registered saver on the UI thread, consumed by either the background local-history...
A struct recording the isolated and single-pad islands within a zone.
Definition zone.h:57
std::size_t FieldHash
Definition board.h:148
bool operator==(const ITEM_FIELD_CACHE_KEY &other) const
Definition board.h:150
const BOARD_ITEM * A
Definition board.h:147
bool operator==(const ITEM_SELECTOR_LAYER_CACHE_KEY &other) const
Definition board.h:137
const BOARD_ITEM * A
Definition board.h:132
LAYERS_CHECKED(PCB_LAYER_ID aLayer)
Definition board.h:163
bool has_error
Definition board.h:169
LSET layers
Definition board.h:168
int m_opposite
Similar layer on opposite side of the board, if any.
Definition board.h:284
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition board.cpp:897
void clear()
Definition board.h:258
LAYER_T m_type
The type of the layer.
Definition board.h:281
static const char * ShowType(LAYER_T aType)
Convert a LAYER_T enum to a string representation of the layer type.
Definition board.cpp:881
LAYER()
Definition board.h:253
wxString m_name
The canonical name of the layer.
Definition board.h:279
wxString m_userName
The user defined name of the layer.
Definition board.h:280
bool m_visible
Definition board.h:282
int m_number
The layer ID.
Definition board.h:283
BOARD_ITEM * A
Definition board.h:107
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition board.h:110
PCB_LAYER_ID Layer
Definition board.h:108
BOARD_ITEM * A
Definition board.h:96
BOARD_ITEM * B
Definition board.h:97
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition board.h:99
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition board.h:122
BOARD_ITEM * B
Definition board.h:119
BOARD_ITEM * A
Definition board.h:118
PCB_LAYER_ID Layer
Definition board.h:120
std::size_t operator()(const ITEM_FIELD_CACHE_KEY &k) const
Definition board.h:222
std::size_t operator()(const ITEM_SELECTOR_LAYER_CACHE_KEY &k) const
Definition board.h:211
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition board.h:189
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition board.h:178
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition board.h:200
netlist clear()
const uint32_t seed
@ PCB_T
Definition typeinfo.h:75
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:81
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition typeinfo.h:84
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:104
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:101
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition typeinfo.h:92
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:79
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition typeinfo.h:103
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:89
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.