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
26#include <core/mirror.h>
27#include <embedded_files.h>
28#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
30#include <hash.h>
31#include <layer_ids.h>
32#include <lset.h>
33#include <netinfo.h>
34#include <pcb_item_containers.h>
35#include <pcb_plot_params.h>
36#include <title_block.h>
37#include <zone_settings.h>
38#include <shared_mutex>
39#include <sharded_cache.h>
40#include <unordered_set>
41#include <project.h>
42#include <list>
43
47class BOARD_COMMIT;
49class DRC_RTREE;
50class PCB_BASE_FRAME;
51class PCB_EDIT_FRAME;
54class BOARD;
55class FOOTPRINT;
57class ZONE;
58class PCB_TRACK;
59class PAD;
60class PCB_GROUP;
61class PCB_GENERATOR;
62class PCB_MARKER;
63class MSG_PANEL_ITEM;
64class NETLIST;
65class REPORTER;
67class COMPONENT;
68class PROJECT;
71
72namespace KIGFX
73{
74class RENDER_SETTINGS;
75};
76
77
78namespace KIFONT
79{
80 class OUTLINE_FONT;
81}
82
83struct ISOLATED_ISLANDS;
84
85// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
86// It is the max dist between 2 end points to see them connected
87#define DEFAULT_CHAINING_EPSILON_MM 0.01
88
89// Forward declare endpoint from class_track.h
90enum ENDPOINT_T : int;
91
92
94{
97
98 bool operator==(const PTR_PTR_CACHE_KEY& other) const
99 {
100 return A == other.A && B == other.B;
101 }
102};
103
105{
108
109 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
110 {
111 return A == other.A && Layer == other.Layer;
112 }
113};
114
116{
120
121 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
122 {
123 return A == other.A && B == other.B && Layer == other.Layer;
124 }
125};
126
127// Caches the whole-predicate result of a footprint-selector query (e.g. intersectsCourtyard)
128// for one item, so a rule set that repeats the same condition does not re-scan every footprint.
130{
131 const BOARD_ITEM* A;
132 wxString Selector; // the selector argument string, compared verbatim
134 int Constraint; // some predicates (intersectsArea) branch on the constraint
135
136 bool operator==( const ITEM_SELECTOR_LAYER_CACHE_KEY& other ) const
137 {
138 return A == other.A && Selector == other.Selector && Layer == other.Layer
139 && Constraint == other.Constraint;
140 }
141};
142
143// Caches getField('x') text per (item, field name)
145{
146 const BOARD_ITEM* A;
147 std::size_t FieldHash;
148
149 bool operator==( const ITEM_FIELD_CACHE_KEY& other ) const
150 {
151 return A == other.A && FieldHash == other.FieldHash;
152 }
153};
154
156{
158 layers(),
159 has_error( false )
160 {}
161
163 layers( { aLayer } ),
164 has_error( false )
165 {}
166
169};
170
171
172namespace std
173{
174 template <>
175 struct hash<PTR_PTR_CACHE_KEY>
176 {
177 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
178 {
179 std::size_t seed = 0xa82de1c0;
180 hash_combine( seed, k.A, k.B );
181 return seed;
182 }
183 };
184
185 template <>
187 {
188 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
189 {
190 std::size_t seed = 0xa82de1c0;
191 hash_combine( seed, k.A, k.Layer );
192 return seed;
193 }
194 };
195
196 template <>
198 {
199 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
200 {
201 std::size_t seed = 0xa82de1c0;
202 hash_combine( seed, k.A, k.B, k.Layer );
203 return seed;
204 }
205 };
206
207 template <>
209 {
210 std::size_t operator()( const ITEM_SELECTOR_LAYER_CACHE_KEY& k ) const
211 {
212 std::size_t seed = 0xa82de1c0;
214 return seed;
215 }
216 };
217
218 template <>
220 {
221 std::size_t operator()( const ITEM_FIELD_CACHE_KEY& k ) const
222 {
223 std::size_t seed = 0xa82de1c0;
224 hash_combine( seed, k.A, k.FieldHash );
225 return seed;
226 }
227 };
228}
229
230
245
246
250struct LAYER
251{
253 {
254 clear();
255 }
256
257 void clear()
258 {
260 m_visible = true;
261 m_number = 0;
262 m_name.clear();
263 m_userName.clear();
265 }
266
267 /*
268 LAYER( const wxString& aName = wxEmptyString,
269 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
270 m_name( aName ),
271 m_type( aType ),
272 m_visible( aVisible ),
273 m_number( aNumber )
274 {
275 }
276 */
277
278 wxString m_name;
279 wxString m_userName;
284
291 static const char* ShowType( LAYER_T aType );
292
300 static LAYER_T ParseType( const char* aType );
301};
302
303
304// Helper class to handle high light nets
306{
307protected:
308 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
309 bool m_highLightOn; // highlight active
310
311 void Clear()
312 {
313 m_netCodes.clear();
314 m_highLightOn = false;
315 }
316
318 {
319 Clear();
320 }
321
322private:
323 friend class BOARD;
324};
325
331class BOARD;
332
334{
335public:
336 virtual ~BOARD_LISTENER() { }
337 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
338 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
339 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
340 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
341 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
342 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
343 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) { }
344 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
345 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
346 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
347 std::vector<BOARD_ITEM*>& aRemovedItems,
348 std::vector<BOARD_ITEM*>& aChangedItems )
349 {
350 }
351};
352
356typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
357
361enum class BOARD_USE
362{
363 NORMAL, // A normal board
364 FPHOLDER // A board that holds a single footprint
365};
366
367
372{
373public:
374 static inline bool ClassOf( const EDA_ITEM* aItem )
375 {
376 return aItem && PCB_T == aItem->Type();
377 }
378
384 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
385
391 BOARD_USE GetBoardUse() const { return m_boardUse; }
392
393 void IncrementTimeStamp();
394
395 int GetTimeStamp() const { return m_timeStamp; }
396
402 bool IsFootprintHolder() const
403 {
405 }
406
407 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
408
409 const wxString &GetFileName() const { return m_fileName; }
410
416 wxString GetDesignRulesPath() const;
417
418 const TRACKS& Tracks() const { return m_tracks; }
419
420 const FOOTPRINTS& Footprints() const { return m_footprints; }
421
422 const DRAWINGS& Drawings() const { return m_drawings; }
423
424 const ZONES& Zones() const { return m_zones; }
425
426 const GENERATORS& Generators() const { return m_generators; }
427
430 void UpdateBoardOutline();
431
432 const MARKERS& Markers() const { return m_markers; }
433
434 const PCB_POINTS& Points() const { return m_points; }
435
439
443 const BOARD_ITEM_SET GetItemSet() const;
444
453 const GROUPS& Groups() const { return m_groups; }
454
455 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
456
457 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
458 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
459
460 // Variant system
461 wxString GetCurrentVariant() const { return m_currentVariant; }
462 void SetCurrentVariant( const wxString& aVariant );
463
464 const std::vector<wxString>& GetVariantNames() const { return m_variantNames; }
465 void SetVariantNames( const std::vector<wxString>& aNames ) { m_variantNames = aNames; }
466
467 bool HasVariant( const wxString& aVariantName ) const;
468 void AddVariant( const wxString& aVariantName );
469 void DeleteVariant( const wxString& aVariantName );
470 void RenameVariant( const wxString& aOldName, const wxString& aNewName );
471
472 wxString GetVariantDescription( const wxString& aVariantName ) const;
473 void SetVariantDescription( const wxString& aVariantName, const wxString& aDescription );
474
483 wxArrayString GetVariantNamesForUI() const;
484
485 void GetContextualTextVars( wxArrayString* aVars ) const;
486 bool ResolveTextVar( wxString* token, int aDepth ) const;
487
491
495
498
499 BOARD();
500 ~BOARD();
501
502 VECTOR2I GetPosition() const override;
503 void SetPosition( const VECTOR2I& aPos ) override;
504 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
505
506 bool IsEmpty() const;
507
508 void Move( const VECTOR2I& aMoveVector ) override;
509
510 void RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction, RECURSE_MODE aMode ) const override;
511
512 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
514
515 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
516 const wxString& GetGenerator() const { return m_generator; }
517
519 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
520 bool aSkipConnectivity = false ) override;
521
523 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
524
533 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
537
538 bool HasItemsOnLayer( PCB_LAYER_ID aLayer );
539
548 bool RemoveAllItemsOnLayer( PCB_LAYER_ID aLayer );
549
554 void BulkRemoveStaleTeardrops( BOARD_COMMIT& aCommit );
555
560 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
561
566 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
567
573 void FixupEmbeddedData();
574
575 void RunOnNestedEmbeddedFiles( const std::function<void( EMBEDDED_FILES* )>& aFunction ) override;
576
577 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
578 const std::vector<ZONE*>& aZones = {} );
579
588 {
589 return m_footprints.empty() ? nullptr : m_footprints.front();
590 }
591
595 void DeleteAllFootprints();
596
600 void DetachAllFootprints();
601
606 BOARD_ITEM* ResolveItem( const KIID& aID, bool aAllowNullptrReturn = false ) const;
607
611 void RebindItemUuid( BOARD_ITEM* aItem, const KIID& aNewId );
612
621
622 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
623
627 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
628 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
629
634 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
635
641 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
642
646 void DeleteMARKERs();
647
648 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
649
650 PROJECT* GetProject() const { return m_project; }
651
660 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
661
662 void ClearProject();
663
671 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
672
676 void RecordDRCExclusions();
677
682
688 void CompileRatsnest();
689
693 void ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, BOARD_COMMIT& aCommit,
694 bool matchPadPositions,
695 bool deleteExtraTexts = true, bool resetTextLayers = true,
696 bool resetTextEffects = true, bool resetTextPositions = true,
697 bool resetTextContent = true, bool resetFabricationAttrs = true,
698 bool resetClearanceOverrides = true, bool reset3DModels = true,
699 bool resetTransform = false,
700 bool* aUpdated = nullptr );
701
705 void ResetNetHighLight();
706
710 const std::set<int>& GetHighLightNetCodes() const
711 {
712 return m_highLight.m_netCodes;
713 }
714
721 void SetHighLightNet( int aNetCode, bool aMulti = false );
722
726 bool IsHighLightNetON() const { return m_highLight.m_highLightOn; }
727
735 void HighLightON( bool aValue = true );
736
741 {
742 HighLightON( false );
743 }
744
748 int GetCopperLayerCount() const;
749 void SetCopperLayerCount( int aCount );
750
751 int GetUserDefinedLayerCount() const;
752 void SetUserDefinedLayerCount( int aCount );
753
759
760 PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayer ) const;
761
762 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
763
769 const LSET& GetEnabledLayers() const;
770 LSET GetLayerSet() const override { return GetEnabledLayers(); }
771
777 void SetEnabledLayers( const LSET& aLayerMask );
778 void SetLayerSet( const LSET& aLayerMask ) override { SetEnabledLayers( aLayerMask ); }
779
786 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
787
795 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
796
802 const LSET& GetVisibleLayers() const;
803
810 void SetVisibleLayers( const LSET& aLayerMask );
811
812 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
813 // are not stored in the bitmap.
814
822
829 void SetVisibleElements( const GAL_SET& aMask );
830
836 void SetVisibleAlls();
837
845 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
846
854 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
855
863 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
864
869 void SetDesignSettings( const BOARD_DESIGN_SETTINGS& aSettings );
870
878 void InvalidateClearanceCache( const KIID& aUuid );
879
886
888
889 const PAGE_INFO& GetPageSettings() const { return m_paper; }
890 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
891
893 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
894
896 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
897 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
898
899 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
900
902 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
903
908 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
909
930 bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines, bool aInferOutlineIfNecessary,
931 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
932 bool aAllowUseArcsInPolygons = false, bool aIncludeNPTHAsOutlines = false );
933
943
957 KIGFX::RENDER_SETTINGS* aRenderSettings = nullptr ) const;
958
962 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
963
970 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
971
979 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
980
991 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
992 {
993 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
994 return LayerName( aLayerId );
995 }
996
1004 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
1005
1009 bool IsFrontLayer( PCB_LAYER_ID aLayer ) const;
1010
1014 bool IsBackLayer( PCB_LAYER_ID aLayer ) const;
1015
1022 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
1023
1031 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
1032
1037 unsigned GetNodesCount( int aNet = -1 ) const;
1038
1047 const std::vector<PAD*> GetPads() const;
1048
1050 {
1051 m_NetInfo.buildListOfNets();
1052 }
1053
1060 NETINFO_ITEM* FindNet( int aNetcode ) const;
1061
1068 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
1069
1079 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
1080
1084 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
1085
1087 {
1088 return m_NetInfo;
1089 }
1090
1092 {
1093 m_NetInfo.RemoveUnusedNets( aCommit );
1094 }
1095
1100 {
1101 return m_NetInfo.begin();
1102 }
1103
1108 {
1109 return m_NetInfo.end();
1110 }
1111
1115 unsigned GetNetCount() const
1116 {
1117 return m_NetInfo.GetNetCount();
1118 }
1119
1124
1129
1136 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false, bool aPhysicalLayersOnly = false ) const;
1137
1138 const BOX2I GetBoundingBox() const override
1139 {
1140 return ComputeBoundingBox( false, false );
1141 }
1142
1153 {
1154 return ComputeBoundingBox( true, true );
1155 }
1156
1157 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
1158
1170 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
1171 const std::vector<KICAD_T>& scanTypes ) override;
1172
1181 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
1182
1189 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
1190
1191 PAD* FindPadByUuid( const KIID& aUuid ) const;
1192
1193 void ReplaceNetChainTerminalPad( const wxString& aNetChain, const KIID& aPrev, const KIID& aNew );
1194
1198 void SetNetChainColor( const wxString& aChain, const KIGFX::COLOR4D& aColor )
1199 {
1200 if( aColor == KIGFX::COLOR4D::UNSPECIFIED )
1201 m_netChainColors.erase( aChain );
1202 else
1203 m_netChainColors[aChain] = aColor;
1204 }
1205
1206 KIGFX::COLOR4D GetNetChainColor( const wxString& aChain ) const
1207 {
1208 auto it = m_netChainColors.find( aChain );
1209 return it != m_netChainColors.end() ? it->second : KIGFX::COLOR4D::UNSPECIFIED;
1210 }
1211
1212 const std::map<wxString, KIGFX::COLOR4D>& GetNetChainColors() const
1213 {
1214 return m_netChainColors;
1215 }
1216
1220 std::set<wxString> GetNetClassAssignmentCandidates() const;
1221
1229 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
1230
1234 bool SynchronizeComponentClasses( const std::unordered_set<wxString>& aNewSheetPaths ) const;
1235
1239 void SynchronizeProperties();
1240
1245
1249 double Similarity( const BOARD_ITEM& aOther ) const override
1250 {
1251 return 1.0;
1252 }
1253
1254 bool operator==( const BOARD_ITEM& aOther ) const override;
1255
1256 wxString GetClass() const override
1257 {
1258 return wxT( "BOARD" );
1259 }
1260
1261#if defined(DEBUG)
1262 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1263#endif
1264
1265
1266 /*************************/
1267 /* Copper Areas handling */
1268 /*************************/
1269
1280
1287 ZONE* GetArea( int index ) const
1288 {
1289 if( (unsigned) index < m_zones.size() )
1290 return m_zones[index];
1291
1292 return nullptr;
1293 }
1294
1298 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1299
1303 int GetAreaCount() const
1304 {
1305 return static_cast<int>( m_zones.size() );
1306 }
1307
1308 /* Functions used in test, merge and cut outlines */
1309
1322 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1323 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1324
1332 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1333
1341 PAD* GetPad( const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
1342 PAD* GetPad( const VECTOR2I& aPosition ) const
1343 {
1344 return GetPad( aPosition, LSET().set() );
1345 }
1346
1354 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1355
1370 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
1371
1383 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1384
1392 std::tuple<int, double, double, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1393
1401 TRACKS TracksInNet( int aNetCode );
1402
1415 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1416 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1417
1423 int GetMaxClearanceValue() const;
1424
1430 void MapNets( BOARD* aDestBoard );
1431
1432 void SanitizeNetcodes();
1433
1442 void AddListener( BOARD_LISTENER* aListener );
1443
1448 void RemoveListener( BOARD_LISTENER* aListener );
1449
1453 void RemoveAllListeners();
1454
1459 void OnItemChanged( BOARD_ITEM* aItem );
1460
1465 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1466
1471 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1472 std::vector<BOARD_ITEM*>& aRemovedItems,
1473 std::vector<BOARD_ITEM*>& aChangedItems );
1474
1478 void OnRatsnestChanged();
1479
1486 wxString GroupsSanityCheck( bool repair = false );
1487
1493 wxString GroupsSanityCheckInternal( bool repair );
1494
1495 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1496 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1497
1498 EMBEDDED_FILES* GetEmbeddedFiles() override;
1499 const EMBEDDED_FILES* GetEmbeddedFiles() const;
1500
1502
1506 std::set<KIFONT::OUTLINE_FONT*> GetFonts() const override;
1507
1511 void EmbedFonts() override;
1512
1517
1522
1524
1534 void SaveToHistory( const wxString& aProjectPath, std::vector<HISTORY_FILE_DATA>& aFileData );
1535
1536 const std::unordered_map<KIID, BOARD_ITEM*>& GetItemByIdCache() const
1537 {
1538 return m_itemByIdCache;
1539 }
1540
1541 bool IsItemIndexedById( const BOARD_ITEM* aItem ) const
1542 {
1543 return m_cachedIdByItem.contains( aItem );
1544 }
1545
1553 BOARD_ITEM* GetCachedItemById( const KIID& aId ) const;
1554
1561 void CacheItemById( BOARD_ITEM* aItem ) const;
1562
1569 void UncacheItemById( const KIID& aId ) const;
1570
1572 {
1573 wxCHECK( aItem, /* void */ );
1574
1575 CacheItemById( aItem );
1576
1577 aItem->RunOnChildren(
1578 [this]( BOARD_ITEM* aChild )
1579 {
1580 CacheItemSubtreeById( aChild );
1581 },
1583 }
1584
1585 void CacheChildrenById( const BOARD_ITEM* aParent )
1586 {
1587 wxCHECK( aParent, /* void */ );
1588
1589 aParent->RunOnChildren(
1590 [this]( BOARD_ITEM* aChild )
1591 {
1592 CacheItemSubtreeById( aChild );
1593 },
1595 }
1596
1598 {
1599 wxCHECK( aItem, /* void */ );
1600
1601 // Pointer-keyed eviction: never remove an entry that belongs to a
1602 // different live item with the same UUID (e.g. a temporary copy).
1603 UncacheItemByPtr( aItem );
1604
1605 aItem->RunOnChildren(
1606 [this]( BOARD_ITEM* aChild )
1607 {
1608 UncacheItemSubtreeById( aChild );
1609 },
1611 }
1612
1613 void UncacheChildrenById( const BOARD_ITEM* aParent )
1614 {
1615 wxCHECK( aParent, /* void */ );
1616
1617 aParent->RunOnChildren(
1618 [this]( BOARD_ITEM* aChild )
1619 {
1620 UncacheItemSubtreeById( aChild );
1621 },
1623 }
1624
1631 void UncacheItemByPtr( const BOARD_ITEM* aItem );
1632
1633 BOARD_ITEM* CacheAndReturnItemById( const KIID& aId, BOARD_ITEM* aItem ) const;
1634
1635 // --------- Item order comparators ---------
1636
1638 {
1639 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1640 };
1641
1643 {
1644 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1645 };
1646
1647public:
1657 std::shared_ptr<const FOOTPRINT_COURTYARD_INDEX> GetFootprintCourtyardIndex();
1658
1659 // ------------ Run-time caches -------------
1660 mutable std::shared_mutex m_CachesMutex;
1661 // These predicate caches are written per item-pair from every DRC worker thread, so they
1662 // carry their own internal sharded locks and are NOT covered by m_CachesMutex.
1674 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1675 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1676 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1677 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1678 mutable std::optional<int> m_maxClearanceValue;
1679
1680 mutable std::unordered_map<const BOARD_ITEM*, wxString> m_ItemNetclassCache;
1681
1682 // Zone name lookup cache for DRC rule area functions like enclosedByArea/intersectsArea.
1683 // Maps zone names to vectors of matching zones to avoid O(n) zone iteration per lookup.
1684 mutable std::unordered_map<wxString, std::vector<ZONE*>> m_ZonesByNameCache;
1685
1686 // Deflated zone outline cache for DRC area checks. Caches the deflated outline for each zone
1687 // to avoid repeated expensive deflation operations during collidesWithArea calls.
1688 mutable std::unordered_map<const ZONE*, SHAPE_POLY_SET> m_DeflatedZoneOutlineCache;
1689
1690 // Spatial index of footprint courtyards, built lazily by GetFootprintCourtyardIndex().
1691 std::shared_ptr<const FOOTPRINT_COURTYARD_INDEX> m_footprintCourtyardIndex;
1692
1693 // ------------ DRC caches -------------
1694 std::vector<ZONE*> m_DRCZones;
1695 std::vector<ZONE*> m_DRCCopperZones;
1696 std::map<PCB_LAYER_ID, std::vector<ZONE*>> m_DRCCopperZonesByLayer;
1699 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1700 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1701
1702private:
1703 // The default copy constructor & operator= are inadequate,
1704 // either write one or do not use it at all
1705 BOARD( const BOARD& aOther ) = delete;
1706
1707 BOARD& operator=( const BOARD& aOther ) = delete;
1708
1709 template <typename Func, typename... Args>
1710 void InvokeListeners( Func&& aFunc, Args&&... args )
1711 {
1712 for( auto&& l : m_listeners )
1713 ( l->*aFunc )( std::forward<Args>( args )... );
1714 }
1715
1716 // Refresh user layer opposites.
1717 void recalcOpposites();
1718
1719 friend class PCB_EDIT_FRAME;
1720
1721private:
1724
1727 int m_timeStamp; // actually a modification counter
1728
1729 wxString m_fileName;
1730
1731 std::map<wxString, KIGFX::COLOR4D> m_netChainColors;
1732
1733 // These containers only have const accessors and must only be modified by Add()/Remove()
1743
1744 // Cache for fast access to items in the containers above by KIID, including children.
1745 // Mutable because it's a performance cache that can be populated during const lookups.
1746 // NOT protected by m_CachesMutex. Only safe for single-threaded access (UI, serialization).
1747 mutable std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1748 mutable std::unordered_map<const BOARD_ITEM*, KIID> m_cachedIdByItem;
1749
1750 std::map<int, LAYER> m_layers; // layer data
1751
1752 HIGH_LIGHT_INFO m_highLight; // current high light data
1753 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1754
1755 int m_fileFormatVersionAtLoad; // the version loaded from the file
1756 wxString m_generator; // the generator tag from the file
1757
1758 std::map<wxString, wxString> m_properties;
1759 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1760
1762 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1764 PROJECT* m_project; // project this board is a part of
1766
1767 // Variant system
1768 wxString m_currentVariant; // Currently active variant (empty = default)
1769 std::vector<wxString> m_variantNames; // All variant names in the board
1770 std::map<wxString, wxString> m_variantDescriptions; // Descriptions for each variant
1771
1782 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1783
1788 bool m_legacyTeardrops = false;
1789
1790 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1791
1792 std::vector<BOARD_LISTENER*> m_listeners;
1793
1795
1796 // Used for dummy boards, such as a footprint holder, where we don't want to make a copy
1797 // of all the parent's embedded data.
1799
1800 std::unique_ptr<COMPONENT_CLASS_MANAGER> m_componentClassManager;
1801 std::unique_ptr<LENGTH_DELAY_CALCULATION> m_lengthDelayCalc;
1802
1803 // Reactive text-variable dependency adapter. Installed as a listener
1804 // during BOARD construction; destructor order ensures it outlives no
1805 // listener calls.
1806 std::unique_ptr<class BOARD_TEXT_VAR_ADAPTER> m_textVarAdapter;
1807
1808public:
1810};
1811
1812
1813#endif // CLASS_BOARD_H_
int index
BOARD_USE
Flags to specify how the board is being used.
Definition board.h:362
@ FPHOLDER
Definition board.h:364
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition board.h:235
@ LT_POWER
Definition board.h:238
@ LT_FRONT
Definition board.h:242
@ LT_MIXED
Definition board.h:239
@ LT_BACK
Definition board.h:243
@ LT_UNDEFINED
Definition board.h:236
@ LT_JUMPER
Definition board.h:240
@ LT_AUX
Definition board.h:241
@ LT_SIGNAL
Definition board.h:237
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition board.h:356
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:341
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition board.h:345
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:338
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:342
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:339
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition board.h:337
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition board.h:344
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:340
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems)
Definition board.h:346
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems)
Definition board.h:343
virtual ~BOARD_LISTENER()
Definition board.h:336
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:372
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:2506
ZONE * m_SolderMaskBridges
Definition board.h:1699
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:3227
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition board.h:893
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition board.h:1700
PCB_LAYER_ID GetCopperLayerStackMaxId() const
Definition board.cpp:1009
GENERATORS m_generators
Definition board.h:1740
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:3570
const NETINFO_LIST & GetNetInfo() const
Definition board.h:1086
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition board.h:493
BOARD_TEXT_VAR_ADAPTER * GetTextVarAdapter() const
Definition board.h:1809
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition board.h:402
PAD * GetPad(const VECTOR2I &aPosition, const LSET &aLayerMask) const
Find a pad aPosition on aLayer.
Definition board.cpp:3077
SHARDED_CACHE< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition board.h:1666
int GetUserDefinedLayerCount() const
Definition board.cpp:998
void recalcOpposites()
Definition board.cpp:918
void CacheItemSubtreeById(BOARD_ITEM *aItem)
Definition board.h:1571
void SetPosition(const VECTOR2I &aPos) override
Definition board.cpp:674
std::map< wxString, wxString > m_properties
Definition board.h:1758
void CacheItemById(BOARD_ITEM *aItem) const
Add an item to the item-by-id cache.
Definition board.cpp:1986
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsCourtyardResultCache
Definition board.h:1668
std::unordered_map< const BOARD_ITEM *, wxString > m_ItemNetclassCache
Definition board.h:1680
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition board.cpp:3413
SHARDED_CACHE< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition board.h:1667
int m_fileFormatVersionAtLoad
Definition board.h:1755
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition board.cpp:2724
void UncacheItemById(const KIID &aId) const
Remove an item from the item-by-id cache.
Definition board.cpp:2015
void SetCurrentVariant(const wxString &aVariant)
Definition board.cpp:2829
std::vector< ZONE * > m_DRCCopperZones
Definition board.h:1695
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:391
void SetVariantNames(const std::vector< wxString > &aNames)
Definition board.h:465
const std::vector< wxString > & GetVariantNames() const
Definition board.h:464
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition board.cpp:1295
const std::set< int > & GetHighLightNetCodes() const
Definition board.h:710
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaResultCache
Definition board.h:1672
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:3517
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition board.h:1788
TITLE_BLOCK m_titles
Definition board.h:1762
GAL_SET m_LegacyVisibleItems
Definition board.h:490
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition board.h:384
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition board.h:1287
std::vector< wxString > m_variantNames
Definition board.h:1769
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition board.h:1152
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition board.h:1138
LENGTH_DELAY_CALCULATION * GetLengthCalculation() const
Returns the track length calculator.
Definition board.h:1516
wxArrayString GetVariantNamesForUI() const
Return the variant names for UI display.
Definition board.cpp:2984
void BuildListOfNets()
Definition board.h:1049
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:1198
const GENERATORS & Generators() const
Definition board.h:426
void SetFileName(const wxString &aFileName)
Definition board.h:407
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition board.h:991
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition board.cpp:3482
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition board.h:770
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:1723
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:3238
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition board.cpp:2795
BOARD_USE m_boardUse
What is this board being used for.
Definition board.h:1726
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:428
PAGE_INFO m_paper
Definition board.h:1761
void RemoveAllListeners()
Remove all listeners.
Definition board.cpp:3564
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition board.h:1665
FOOTPRINTS m_footprints
Definition board.h:1736
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:1782
friend class PCB_EDIT_FRAME
Definition board.h:1719
void SetEmbeddedFilesDelegate(EMBEDDED_FILES *aDelegate)
Definition board.h:1501
const PCB_POINTS & Points() const
Definition board.h:434
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:3792
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:3545
const PAGE_INFO & GetPageSettings() const
Definition board.h:889
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition board.cpp:1763
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition board.h:458
bool IsBackLayer(PCB_LAYER_ID aLayer) const
Definition board.cpp:843
const std::map< wxString, KIGFX::COLOR4D > & GetNetChainColors() const
Definition board.h:1212
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:3612
void CompileRatsnest()
Rebuild the entire board ratsnest.
Definition board.cpp:3595
HIGH_LIGHT_INFO m_highLight
Definition board.h:1752
std::map< wxString, wxString > m_variantDescriptions
Definition board.h:1770
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:2657
EDA_UNITS m_userUnits
Definition board.h:1765
void UpdateBoardOutline()
Definition board.cpp:3988
const ZONES & Zones() const
Definition board.h:424
void BulkRemoveStaleTeardrops(BOARD_COMMIT &aCommit)
Remove all teardrop zones with the STRUCT_DELETED flag set.
Definition board.cpp:1425
void DeleteVariant(const wxString &aVariantName)
Definition board.cpp:2872
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition board.h:1710
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:3535
void InitializeClearanceCache()
Initialize the clearance cache for all board items.
Definition board.cpp:1168
EMBEDDED_FILES * m_embeddedFilesDelegate
Definition board.h:1798
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:3347
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:453
~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:4035
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:1735
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:3582
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition board.cpp:3043
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition board.cpp:3004
EDA_UNITS GetUserUnits()
Definition board.h:901
void ResetNetHighLight()
Reset all high light data to the init state.
Definition board.cpp:3603
PCB_PLOT_PARAMS m_plotOptions
Definition board.h:1763
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition board.h:1663
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:3327
bool ResolveTextVar(wxString *token, int aDepth) const
Definition board.cpp:563
const MARKERS & Markers() const
Definition board.h:432
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition board.h:587
void UncacheChildrenById(const BOARD_ITEM *aParent)
Definition board.h:1613
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:3468
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:1806
TITLE_BLOCK & GetTitleBlock()
Definition board.h:895
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:1739
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:1342
PAD * FindPadByUuid(const KIID &aUuid) const
Definition board.cpp:2763
std::unordered_map< const BOARD_ITEM *, KIID > m_cachedIdByItem
Definition board.h:1748
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:1753
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition board.h:504
void HighLightOFF()
Disable net highlight.
Definition board.h:740
NETINFO_LIST m_NetInfo
Definition board.h:1790
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition board.h:489
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition board.cpp:1083
void SetOutlinesChainingEpsilon(int aValue)
Definition board.h:942
bool HasVariant(const wxString &aVariantName) const
Definition board.cpp:2855
NETINFO_LIST::iterator EndNets() const
Definition board.h:1107
void AddVariant(const wxString &aVariantName)
Definition board.cpp:2861
int GetCopperLayerCount() const
Definition board.cpp:985
int m_timeStamp
Definition board.h:1727
std::vector< BOARD_LISTENER * > m_listeners
Definition board.h:1792
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:1677
const std::map< wxString, wxString > & GetProperties() const
Definition board.h:457
void IncrementTimeStamp()
Definition board.cpp:283
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition board.cpp:2676
PCB_POINTS m_points
Definition board.h:1742
std::unique_ptr< LENGTH_DELAY_CALCULATION > m_lengthDelayCalc
Definition board.h:1801
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition board.h:1091
const FOOTPRINTS & Footprints() const
Definition board.h:420
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition board.h:1759
std::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
Get the list of all outline fonts used in the board.
Definition board.cpp:3431
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:1538
const BOARD_ITEM_SET GetItemSet()
Collect every owned item (tracks, zones, generators, footprints, drawings, markers,...
Definition board.cpp:3894
const TRACKS & Tracks() const
Definition board.h:418
int m_DRCMaxPhysicalClearance
Definition board.h:1698
const PCB_BOARD_OUTLINE * BoardOutline() const
Definition board.h:429
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition board.cpp:2751
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:1419
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition board.h:890
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition board.h:1674
BOARD_ITEM * GetCachedItemById(const KIID &aId) const
Return a cached item for aId if the entry is still self-consistent.
Definition board.cpp:1969
bool m_embedFonts
Definition board.h:1794
wxString GroupsSanityCheckInternal(bool repair)
Definition board.cpp:3651
std::shared_ptr< const FOOTPRINT_COURTYARD_INDEX > m_footprintCourtyardIndex
Definition board.h:1691
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition board.cpp:3589
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition board.cpp:2229
wxString GetClass() const override
Return the class name.
Definition board.h:1256
std::unique_ptr< COMPONENT_CLASS_MANAGER > m_componentClassManager
Definition board.h:1800
SHARDED_CACHE< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition board.h:1664
NETINFO_LIST::iterator BeginNets() const
Definition board.h:1099
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:3372
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition board.h:497
void SetCopperLayerCount(int aCount)
Definition board.cpp:991
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition board.h:1677
std::unordered_map< const ZONE *, SHAPE_POLY_SET > m_DeflatedZoneOutlineCache
Definition board.h:1688
wxString m_generator
Definition board.h:1756
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsFCourtyardResultCache
Definition board.h:1669
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:1764
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:3263
bool HasItemsOnLayer(PCB_LAYER_ID aLayer)
Definition board.cpp:1631
const wxString & GetFileName() const
Definition board.h:409
bool operator==(const BOARD_ITEM &aOther) const override
Definition board.cpp:3920
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:4017
wxString GetVariantDescription(const wxString &aVariantName) const
Definition board.cpp:2948
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition board.cpp:2739
unsigned GetNodesCount(int aNet=-1) const
Definition board.cpp:2382
bool IsHighLightNetON() const
Definition board.h:726
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition board.cpp:2187
SHARDED_CACHE< ITEM_FIELD_CACHE_KEY, wxString > m_ItemFieldCache
Definition board.h:1673
int GetFileFormatVersionAtLoad() const
Definition board.h:513
std::map< PCB_LAYER_ID, std::vector< ZONE * > > m_DRCCopperZonesByLayer
Definition board.h:1696
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:1676
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:892
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition board.h:1729
const wxString & GetGenerator() const
Adds an item to the container.
Definition board.h:516
int GetAreaCount() const
Definition board.h:1303
void DetachAllFootprints()
Remove all footprints without deleting.
Definition board.cpp:1834
void SetLegacyTeardrops(bool aFlag)
Definition board.h:1496
std::map< int, LAYER > m_layers
Definition board.h:1750
wxString GetCurrentVariant() const
Definition board.h:461
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:941
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:3212
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:1671
int m_DRCMaxClearance
Definition board.h:1697
void ClearProject()
Definition board.cpp:252
void ReplaceNetChainTerminalPad(const wxString &aNetChain, const KIID &aPrev, const KIID &aNew)
Definition board.cpp:2775
void UncacheItemByPtr(const BOARD_ITEM *aItem)
Remove every cache entry that still points to aItem.
Definition board.cpp:2065
void SetLayerSet(const LSET &aLayerMask) override
Definition board.h:778
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition board.h:1675
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:1413
wxString m_currentVariant
Definition board.h:1768
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:1822
PROJECT * GetProject() const
Definition board.h:650
bool IsEmpty() const
Definition board.cpp:662
int GetPadWithPressFitAttrCount()
Definition board.cpp:3999
bool LegacyTeardrops() const
Definition board.h:1495
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:2468
const TITLE_BLOCK & GetTitleBlock() const
Definition board.h:896
KIGFX::COLOR4D GetNetChainColor(const wxString &aChain) const
Definition board.h:1206
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:3637
void RenameVariant(const wxString &aOldName, const wxString &aNewName)
Definition board.cpp:2900
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1149
std::vector< ZONE * > m_DRCZones
Definition board.h:1694
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:515
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:2309
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:2088
int RepairDuplicateItemUuids()
Rebind duplicate attached-item UUIDs so each live board item has a unique ID.
Definition board.cpp:2114
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition board.cpp:2809
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition board.h:1747
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition board.cpp:3552
COMPONENT_CLASS_MANAGER & GetComponentClassManager()
Gets the component class manager.
Definition board.h:1521
std::shared_mutex m_CachesMutex
Definition board.h:1660
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false, bool aPhysicalLayersOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition board.cpp:2399
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:1115
const std::unordered_map< KIID, BOARD_ITEM * > & GetItemByIdCache() const
Definition board.h:1536
bool SynchronizeComponentClasses(const std::unordered_set< wxString > &aNewSheetPaths) const
Copy component class / component class generator information from the project settings.
Definition board.cpp:3034
BOARD_ITEM * CacheAndReturnItemById(const KIID &aId, BOARD_ITEM *aItem) const
Definition board.cpp:2034
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition board.cpp:1785
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition board.cpp:1442
std::unordered_map< wxString, std::vector< ZONE * > > m_ZonesByNameCache
Definition board.h:1684
GROUPS m_groups
Definition board.h:1738
PROJECT::ELEM ProjectElementType() override
Definition board.h:1523
MARKERS m_markers
Definition board.h:1734
bool IsItemIndexedById(const BOARD_ITEM *aItem) const
Definition board.h:1541
std::optional< int > m_maxClearanceValue
Definition board.h:1678
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition board.cpp:3627
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:897
void CacheChildrenById(const BOARD_ITEM *aParent)
Definition board.h:1585
void SynchronizeTuningProfileProperties()
Ensure that all time domain properties providers are in sync with current settings.
Definition board.cpp:2998
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition board.h:1737
std::map< wxString, KIGFX::COLOR4D > m_netChainColors
Definition board.h:1731
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
Definition board.cpp:1846
bool m_LegacyCopperEdgeClearanceLoaded
Definition board.h:494
int GetTimeStamp() const
Definition board.h:395
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:3576
SHARDED_CACHE< ITEM_SELECTOR_LAYER_CACHE_KEY, bool > m_IntersectsBCourtyardResultCache
Definition board.h:1670
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition board.h:634
VECTOR2I GetPosition() const override
Definition board.cpp:668
void SetVariantDescription(const wxString &aVariantName, const wxString &aDescription)
Definition board.cpp:2967
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:374
void SetUserUnits(EDA_UNITS aUnits)
Definition board.h:902
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:3458
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition board.h:1249
PCB_BOARD_OUTLINE * m_boardOutline
Definition board.h:1741
void SetUserDefinedLayerCount(int aCount)
Definition board.cpp:1004
const DRAWINGS & Drawings() const
Definition board.h:422
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition board.cpp:1757
void UncacheItemSubtreeById(const BOARD_ITEM *aItem)
Definition board.h:1597
void SetFileFormatVersionAtLoad(int aVersion)
Definition board.h:512
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:311
friend class BOARD
Definition board.h:323
std::set< int > m_netCodes
Definition board.h:308
bool m_highLightOn
Definition board.h:309
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:3741
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition board.cpp:3720
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:147
bool operator==(const ITEM_FIELD_CACHE_KEY &other) const
Definition board.h:149
const BOARD_ITEM * A
Definition board.h:146
bool operator==(const ITEM_SELECTOR_LAYER_CACHE_KEY &other) const
Definition board.h:136
const BOARD_ITEM * A
Definition board.h:131
LAYERS_CHECKED(PCB_LAYER_ID aLayer)
Definition board.h:162
bool has_error
Definition board.h:168
LSET layers
Definition board.h:167
int m_opposite
Similar layer on opposite side of the board, if any.
Definition board.h:283
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition board.cpp:897
void clear()
Definition board.h:257
LAYER_T m_type
The type of the layer.
Definition board.h:280
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:252
wxString m_name
The canonical name of the layer.
Definition board.h:278
wxString m_userName
The user defined name of the layer.
Definition board.h:279
bool m_visible
Definition board.h:281
int m_number
The layer ID.
Definition board.h:282
BOARD_ITEM * A
Definition board.h:106
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition board.h:109
PCB_LAYER_ID Layer
Definition board.h:107
BOARD_ITEM * A
Definition board.h:95
BOARD_ITEM * B
Definition board.h:96
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition board.h:98
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition board.h:121
BOARD_ITEM * B
Definition board.h:118
BOARD_ITEM * A
Definition board.h:117
PCB_LAYER_ID Layer
Definition board.h:119
std::size_t operator()(const ITEM_FIELD_CACHE_KEY &k) const
Definition board.h:221
std::size_t operator()(const ITEM_SELECTOR_LAYER_CACHE_KEY &k) const
Definition board.h:210
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition board.h:188
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition board.h:177
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition board.h:199
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.