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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef CLASS_BOARD_H_
26#define CLASS_BOARD_H_
27
31#include <embedded_files.h>
32#include <common.h> // Needed for stl hash extensions
33#include <convert_shape_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
34#include <hash.h>
35#include <layer_ids.h>
36#include <lset.h>
37#include <netinfo.h>
38#include <pcb_item_containers.h>
39#include <pcb_plot_params.h>
40#include <title_block.h>
41#include <tools/pcb_selection.h>
42#include <shared_mutex>
43#include <list>
44
47class BOARD_COMMIT;
48class DRC_RTREE;
49class PCB_BASE_FRAME;
50class PCB_EDIT_FRAME;
52class BOARD;
53class FOOTPRINT;
54class ZONE;
55class PCB_TRACK;
56class PAD;
57class PCB_GROUP;
58class PCB_GENERATOR;
59class PCB_MARKER;
60class MSG_PANEL_ITEM;
61class NETLIST;
62class REPORTER;
63class SHAPE_POLY_SET;
65class COMPONENT;
66class PROJECT;
68namespace KIFONT
69{
70 class OUTLINE_FONT;
71}
72
73struct ISOLATED_ISLANDS;
74
75// The default value for m_outlinesChainingEpsilon to convert a board outlines to polygons
76// It is the max dist between 2 end points to see them connected
77#define DEFAULT_CHAINING_EPSILON_MM 0.01
78
79// Forward declare endpoint from class_track.h
80enum ENDPOINT_T : int;
81
82
84{
87
88 bool operator==(const PTR_PTR_CACHE_KEY& other) const
89 {
90 return A == other.A && B == other.B;
91 }
92};
93
95{
98
99 bool operator==(const PTR_LAYER_CACHE_KEY& other) const
100 {
101 return A == other.A && Layer == other.Layer;
102 }
103};
104
106{
110
111 bool operator==(const PTR_PTR_LAYER_CACHE_KEY& other) const
112 {
113 return A == other.A && B == other.B && Layer == other.Layer;
114 }
115};
116
117namespace std
118{
119 template <>
120 struct hash<PTR_PTR_CACHE_KEY>
121 {
122 std::size_t operator()( const PTR_PTR_CACHE_KEY& k ) const
123 {
124 std::size_t seed = 0xa82de1c0;
125 hash_combine( seed, k.A, k.B );
126 return seed;
127 }
128 };
129
130 template <>
132 {
133 std::size_t operator()( const PTR_LAYER_CACHE_KEY& k ) const
134 {
135 std::size_t seed = 0xa82de1c0;
136 hash_combine( seed, k.A, k.Layer );
137 return seed;
138 }
139 };
140
141 template <>
143 {
144 std::size_t operator()( const PTR_PTR_LAYER_CACHE_KEY& k ) const
145 {
146 std::size_t seed = 0xa82de1c0;
147 hash_combine( seed, k.A, k.B, k.Layer );
148 return seed;
149 }
150 };
151}
152
153
158{
166 LT_BACK
168
169
173struct LAYER
174{
176 {
177 clear();
178 }
179
180 void clear()
181 {
183 m_visible = true;
184 m_number = 0;
185 m_name.clear();
186 m_userName.clear();
188 }
189
190 /*
191 LAYER( const wxString& aName = wxEmptyString,
192 LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
193 m_name( aName ),
194 m_type( aType ),
195 m_visible( aVisible ),
196 m_number( aNumber )
197 {
198 }
199 */
200
201 wxString m_name;
202 wxString m_userName;
207
214 static const char* ShowType( LAYER_T aType );
215
223 static LAYER_T ParseType( const char* aType );
224};
225
226
227// Helper class to handle high light nets
229{
230protected:
231 std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
232 bool m_highLightOn; // highlight active
233
234 void Clear()
235 {
236 m_netCodes.clear();
237 m_highLightOn = false;
238 }
239
241 {
242 Clear();
243 }
244
245private:
246 friend class BOARD;
247};
248
254class BOARD;
255
257{
258public:
259 virtual ~BOARD_LISTENER() { }
260 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
261 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
262 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
263 virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
264 virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
265 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
266 virtual void OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItem ) { }
267 virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
268 virtual void OnBoardRatsnestChanged( BOARD& aBoard ) { }
269 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
270 std::vector<BOARD_ITEM*>& aRemovedItems,
271 std::vector<BOARD_ITEM*>& aDeletedItems )
272 {
273 }
274};
275
279typedef std::set<BOARD_ITEM*, CompareByUuid> BOARD_ITEM_SET;
280
284enum class BOARD_USE
285{
286 NORMAL, // A normal board
287 FPHOLDER // A board that holds a single footprint
288};
289
290
295{
296public:
297 static inline bool ClassOf( const EDA_ITEM* aItem )
298 {
299 return aItem && PCB_T == aItem->Type();
300 }
301
307 void SetBoardUse( BOARD_USE aUse ) { m_boardUse = aUse; }
308
314 BOARD_USE GetBoardUse() const { return m_boardUse; }
315
316 void IncrementTimeStamp();
317
318 int GetTimeStamp() const { return m_timeStamp; }
319
325 bool IsFootprintHolder() const
326 {
327 return m_boardUse == BOARD_USE::FPHOLDER;
328 }
329
330 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
331
332 const wxString &GetFileName() const { return m_fileName; }
333
334 const TRACKS& Tracks() const { return m_tracks; }
335
336 const FOOTPRINTS& Footprints() const { return m_footprints; }
337
338 const DRAWINGS& Drawings() const { return m_drawings; }
339
340 const ZONES& Zones() const { return m_zones; }
341
342 const GENERATORS& Generators() const { return m_generators; }
343
344 const MARKERS& Markers() const { return m_markers; }
345
346 // SWIG requires non-const accessors for some reason to make the custom iterators in board.i
347 // work. It would be good to remove this if we can figure out how to fix that.
348#ifdef SWIG
349 DRAWINGS& Drawings() { return m_drawings; }
350 TRACKS& Tracks() { return m_tracks; }
351#endif
352
354
363 const GROUPS& Groups() const { return m_groups; }
364
365 const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
366
367 const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
368 void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
369
370 void GetContextualTextVars( wxArrayString* aVars ) const;
371 bool ResolveTextVar( wxString* token, int aDepth ) const;
372
376
380
383
384 BOARD();
385 ~BOARD();
386
387 VECTOR2I GetPosition() const override;
388 void SetPosition( const VECTOR2I& aPos ) override;
389 const VECTOR2I GetFocusPosition() const override { return GetBoundingBox().GetCenter(); }
390
391 bool IsEmpty() const
392 {
393 return m_drawings.empty() && m_footprints.empty() && m_tracks.empty() && m_zones.empty();
394 }
395
396 void Move( const VECTOR2I& aMoveVector ) override;
397
398 void RunOnDescendants( const std::function<void ( BOARD_ITEM* )>& aFunction,
399 int aDepth = 0 ) const override;
400
401 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
403
404 void SetGenerator( const wxString& aGenerator ) { m_generator = aGenerator; }
405 const wxString& GetGenerator() const { return m_generator; }
406
408 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
409 bool aSkipConnectivity = false ) override;
410
412 void Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
413
422 void RemoveAll( std::initializer_list<KICAD_T> aTypes = { PCB_NETINFO_T, PCB_MARKER_T,
426
431 void FinalizeBulkAdd( std::vector<BOARD_ITEM*>& aNewItems );
432
437 void FinalizeBulkRemove( std::vector<BOARD_ITEM*>& aRemovedItems );
438
444 void FixupEmbeddedData();
445
446 void CacheTriangulation( PROGRESS_REPORTER* aReporter = nullptr,
447 const std::vector<ZONE*>& aZones = {} );
448
457 {
458 return m_footprints.empty() ? nullptr : m_footprints.front();
459 }
460
464 void DeleteAllFootprints();
465
469 BOARD_ITEM* GetItem( const KIID& aID ) const;
470
471 void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
472
476 wxString ConvertCrossReferencesToKIIDs( const wxString& aSource ) const;
477 wxString ConvertKIIDsToCrossReferences( const wxString& aSource ) const;
478
483 std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
484
490 bool BuildConnectivity( PROGRESS_REPORTER* aReporter = nullptr );
491
495 void DeleteMARKERs();
496
497 void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
498
499 PROJECT* GetProject() const { return m_project; }
500
509 void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
510
511 void ClearProject();
512
520 std::vector<PCB_MARKER*> ResolveDRCExclusions( bool aCreateMarkers );
521
525 void RecordDRCExclusions();
526
531
535 void ResetNetHighLight();
536
540 const std::set<int>& GetHighLightNetCodes() const
541 {
542 return m_highLight.m_netCodes;
543 }
544
551 void SetHighLightNet( int aNetCode, bool aMulti = false );
552
557
565 void HighLightON( bool aValue = true );
566
571 {
572 HighLightON( false );
573 }
574
578 int GetCopperLayerCount() const;
579 void SetCopperLayerCount( int aCount );
580
586
587 PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayer ) const;
588
589 int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
590
596 LSET GetEnabledLayers() const;
597
603 void SetEnabledLayers( LSET aLayerMask );
604
611 bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
612
620 bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
621
627 LSET GetVisibleLayers() const;
628
635 void SetVisibleLayers( LSET aLayerMask );
636
637 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
638 // are not stored in the bitmap.
639
647
654 void SetVisibleElements( const GAL_SET& aMask );
655
661 void SetVisibleAlls();
662
670 bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
671
679 void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
680
688 bool IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const;
689
694
696
697 const PAGE_INFO& GetPageSettings() const { return m_paper; }
698 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
699
701 void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
702
704 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
705 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
706
707 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
708
710 void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }
711
716 void UpdateUserUnits( BOARD_ITEM* aItem, KIGFX::VIEW* aView );
717
736 OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr,
737 bool aAllowUseArcsInPolygons = false,
738 bool aIncludeNPTHAsOutlines = false );
739
749
760 void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines ) const;
761
765 PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
766
773 const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
774
782 bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
783
794 static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
795 {
796 // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
797 return LayerName( aLayerId );
798 }
799
807 bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
808
815 LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
816
824 bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
825
830 unsigned GetNodesCount( int aNet = -1 ) const;
831
840 const std::vector<PAD*> GetPads() const;
841
843 {
845 }
846
853 NETINFO_ITEM* FindNet( int aNetcode ) const;
854
861 NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
862
872 int MatchDpSuffix( const wxString& aNetName, wxString& aComplementNet );
873
877 NETINFO_ITEM* DpCoupledNet( const NETINFO_ITEM* aNet );
878
880 {
881 return m_NetInfo;
882 }
883
885 {
886 m_NetInfo.RemoveUnusedNets( aCommit );
887 }
888
889#ifndef SWIG
894 {
895 return m_NetInfo.begin();
896 }
897
902 {
903 return m_NetInfo.end();
904 }
905#endif
906
910 unsigned GetNetCount() const
911 {
912 return m_NetInfo.GetNetCount();
913 }
914
921 BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
922
923 const BOX2I GetBoundingBox() const override
924 {
925 return ComputeBoundingBox( false );
926 }
927
938 {
939 return ComputeBoundingBox( true );
940 }
941
942 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
943
955 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
956 const std::vector<KICAD_T>& scanTypes ) override;
957
966 FOOTPRINT* FindFootprintByReference( const wxString& aReference ) const;
967
974 FOOTPRINT* FindFootprintByPath( const KIID_PATH& aPath ) const;
975
979 std::set<wxString> GetNetClassAssignmentCandidates() const;
980
988 void SynchronizeNetsAndNetClasses( bool aResetTrackAndViaSizes );
989
994
998 double Similarity( const BOARD_ITEM& aOther ) const override
999 {
1000 return 1.0;
1001 }
1002
1003 bool operator==( const BOARD_ITEM& aOther ) const override;
1004
1005 wxString GetClass() const override
1006 {
1007 return wxT( "BOARD" );
1008 }
1009
1010#if defined(DEBUG)
1011 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1012#endif
1013
1014
1015 /*************************/
1016 /* Copper Areas handling */
1017 /*************************/
1018
1029
1036 ZONE* GetArea( int index ) const
1037 {
1038 if( (unsigned) index < m_zones.size() )
1039 return m_zones[index];
1040
1041 return nullptr;
1042 }
1043
1047 std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false ) const;
1048
1052 int GetAreaCount() const
1053 {
1054 return static_cast<int>( m_zones.size() );
1055 }
1056
1057 /* Functions used in test, merge and cut outlines */
1058
1071 ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
1072 VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
1073
1081 bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
1082
1090 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1091 PAD* GetPad( const VECTOR2I& aPosition ) const
1092 {
1093 return GetPad( aPosition, LSET().set() );
1094 }
1095
1103 PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
1104
1114 PAD* GetPadFast( const VECTOR2I& aPosition, LSET aLayerMask ) const;
1115
1130 PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerMask ) const;
1131
1143 void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 ) const;
1144
1152 std::tuple<int, double, double> GetTrackLength( const PCB_TRACK& aTrack ) const;
1153
1161 TRACKS TracksInNet( int aNetCode );
1162
1175 FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer,
1176 bool aVisibleOnly, bool aIgnoreLocked = false ) const;
1177
1183 int GetMaxClearanceValue() const;
1184
1190 void MapNets( BOARD* aDestBoard );
1191
1192 void SanitizeNetcodes();
1193
1202 void AddListener( BOARD_LISTENER* aListener );
1203
1208 void RemoveListener( BOARD_LISTENER* aListener );
1209
1213 void RemoveAllListeners();
1214
1219 void OnItemChanged( BOARD_ITEM* aItem );
1220
1225 void OnItemsChanged( std::vector<BOARD_ITEM*>& aItems );
1226
1231 void OnItemsCompositeUpdate( std::vector<BOARD_ITEM*>& aAddedItems,
1232 std::vector<BOARD_ITEM*>& aRemovedItems,
1233 std::vector<BOARD_ITEM*>& aChangedItems );
1234
1238 void OnRatsnestChanged();
1239
1246 wxString GroupsSanityCheck( bool repair = false );
1247
1253 wxString GroupsSanityCheckInternal( bool repair );
1254
1256 {
1257 bool create : 1;
1258 bool ungroup : 1;
1259 bool removeItems : 1;
1260 };
1261
1267 GroupLegalOpsField GroupLegalOps( const PCB_SELECTION& selection ) const;
1268
1269 bool LegacyTeardrops() const { return m_legacyTeardrops; }
1270 void SetLegacyTeardrops( bool aFlag ) { m_legacyTeardrops = aFlag; }
1271
1272 EMBEDDED_FILES* GetEmbeddedFiles() override;
1273 const EMBEDDED_FILES* GetEmbeddedFiles() const;
1274
1278 std::set<KIFONT::OUTLINE_FONT*> GetFonts() const override;
1279
1283 void EmbedFonts() override;
1284
1289
1290 // --------- Item order comparators ---------
1291
1293 {
1294 bool operator() ( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1295 };
1296
1298 {
1299 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
1300 };
1301
1302public:
1303 // ------------ Run-time caches -------------
1304 mutable std::shared_mutex m_CachesMutex;
1305 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsCourtyardCache;
1306 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsFCourtyardCache;
1307 std::unordered_map<PTR_PTR_CACHE_KEY, bool> m_IntersectsBCourtyardCache;
1308 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_IntersectsAreaCache;
1309 std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, bool> m_EnclosedByAreaCache;
1310 std::unordered_map< wxString, LSET > m_LayerExpressionCache;
1311 std::unordered_map<ZONE*, std::unique_ptr<DRC_RTREE>> m_CopperZoneRTreeCache;
1312 std::shared_ptr<DRC_RTREE> m_CopperItemRTreeCache;
1313 mutable std::unordered_map<const ZONE*, BOX2I> m_ZoneBBoxCache;
1314 mutable std::optional<int> m_maxClearanceValue;
1315
1316 // ------------ DRC caches -------------
1317 std::vector<ZONE*> m_DRCZones;
1318 std::vector<ZONE*> m_DRCCopperZones;
1321 ZONE* m_SolderMaskBridges; // A container to build bridges on solder mask layers
1322 std::map<ZONE*, std::map<PCB_LAYER_ID, ISOLATED_ISLANDS>> m_ZoneIsolatedIslandsMap;
1323
1324private:
1325 // The default copy constructor & operator= are inadequate,
1326 // either write one or do not use it at all
1327 BOARD( const BOARD& aOther ) = delete;
1328
1329 BOARD& operator=( const BOARD& aOther ) = delete;
1330
1331 template <typename Func, typename... Args>
1332 void InvokeListeners( Func&& aFunc, Args&&... args )
1333 {
1334 for( auto&& l : m_listeners )
1335 ( l->*aFunc )( std::forward<Args>( args )... );
1336 }
1337
1338 // Refresh user layer opposites.
1339 void recalcOpposites();
1340
1341 friend class PCB_EDIT_FRAME;
1342
1343private:
1346
1349 int m_timeStamp; // actually a modification counter
1350
1351 wxString m_fileName;
1352
1353 // These containers only have const accessors and must only be modified by Add()/Remove()
1354 MARKERS m_markers;
1355 DRAWINGS m_drawings;
1356 FOOTPRINTS m_footprints;
1358 GROUPS m_groups;
1360 GENERATORS m_generators;
1361
1362 // Cache for fast access to items in the containers above by KIID, including children
1363 std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
1364
1365 std::map<int, LAYER> m_layers; // layer data
1366
1367 HIGH_LIGHT_INFO m_highLight; // current high light data
1368 HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
1369
1370 int m_fileFormatVersionAtLoad; // the version loaded from the file
1371 wxString m_generator; // the generator tag from the file
1372
1373 std::map<wxString, wxString> m_properties;
1374 std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
1375
1377 TITLE_BLOCK m_titles; // text in lower right of screen and plots
1379 PROJECT* m_project; // project this board is a part of
1381
1392 std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
1393
1398 bool m_legacyTeardrops = false;
1399
1400 NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
1401
1402 std::vector<BOARD_LISTENER*> m_listeners;
1403
1405
1407};
1408
1409
1410#endif // CLASS_BOARD_H_
BOARD_USE
Flags to specify how the board is being used.
Definition: board.h:285
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
Definition: board.h:158
@ LT_POWER
Definition: board.h:161
@ LT_FRONT
Definition: board.h:165
@ LT_MIXED
Definition: board.h:162
@ LT_BACK
Definition: board.h:166
@ LT_UNDEFINED
Definition: board.h:159
@ LT_JUMPER
Definition: board.h:163
@ LT_AUX
Definition: board.h:164
@ LT_SIGNAL
Definition: board.h:160
std::set< BOARD_ITEM *, CompareByUuid > BOARD_ITEM_SET
Set of BOARD_ITEMs ordered by UUID.
Definition: board.h:279
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
Container for design settings for a BOARD object.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Definition: board_item.cpp:139
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition: board.h:264
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:261
virtual void OnBoardRatsnestChanged(BOARD &aBoard)
Definition: board.h:268
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aDeletedItems)
Definition: board.h:269
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:266
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:265
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:262
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: board.h:260
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: board.h:267
virtual ~BOARD_LISTENER()
Definition: board.h:259
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItem)
Definition: board.h:263
Manage layers needed to make a physical board.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:295
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:1812
ZONE * m_SolderMaskBridges
Definition: board.h:1321
void GetContextualTextVars(wxArrayString *aVars) const
Definition: board.cpp:407
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:922
BOARD_STACKUP GetStackupOrDefault() const
Definition: board.cpp:2330
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: board.h:701
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_EnclosedByAreaCache
Definition: board.h:1309
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
Definition: board.h:1322
PCB_LAYER_ID GetCopperLayerStackMaxId() const
Definition: board.cpp:792
GENERATORS m_generators
Definition: board.h:1360
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
Definition: board.cpp:2536
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:2741
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:879
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: board.h:378
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:325
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:817
void recalcOpposites()
Definition: board.cpp:712
void SetPosition(const VECTOR2I &aPos) override
Definition: board.cpp:496
std::map< wxString, wxString > m_properties
Definition: board.h:1373
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: board.cpp:2589
int m_fileFormatVersionAtLoad
Definition: board.h:1370
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
Definition: board.cpp:2032
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:831
std::vector< ZONE * > m_DRCCopperZones
Definition: board.h:1318
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition: board.h:314
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:1042
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:540
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:2687
bool m_legacyTeardrops
Teardrops in 7.0 were applied as a post-processing step (rather than from pad and via properties).
Definition: board.h:1398
TITLE_BLOCK m_titles
Definition: board.h:1377
GAL_SET m_LegacyVisibleItems
Definition: board.h:375
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:307
ZONE * GetArea(int index) const
Return the Zone at a given index.
Definition: board.h:1036
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
Definition: board.h:937
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:923
void BuildListOfNets()
Definition: board.h:842
PAD * GetPadFast(const VECTOR2I &aPosition, LSET aLayerMask) const
Return pad found at aPosition on aLayerMask using the fast search method.
Definition: board.cpp:2188
const GENERATORS & Generators() const
Definition: board.h:342
void SetFileName(const wxString &aFileName)
Definition: board.h:330
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:794
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
Definition: board.cpp:2661
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:883
int m_outlinesChainingEpsilon
the max distance between 2 end point to see them connected when building the board outlines
Definition: board.h:1345
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
Definition: board.cpp:2071
BOARD_USE m_boardUse
What is this board being used for.
Definition: board.h:1348
PAGE_INFO m_paper
Definition: board.h:1376
void RemoveAllListeners()
Remove all listeners.
Definition: board.cpp:2735
FOOTPRINTS m_footprints
Definition: board.h:1356
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:1392
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:837
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:2716
const PAGE_INFO & GetPageSettings() const
Definition: board.h:697
void UpdateUserUnits(BOARD_ITEM *aItem, KIGFX::VIEW *aView)
Update any references within aItem (or its descendants) to the user units.
Definition: board.cpp:1374
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: board.h:368
BOARD(const BOARD &aOther)=delete
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition: board.cpp:877
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
Definition: board.cpp:2777
HIGH_LIGHT_INFO m_highLight
Definition: board.h:1367
bool SetLayerDescr(PCB_LAYER_ID aIndex, const LAYER &aLayer)
Return the type of the copper layer given by aLayer.
Definition: board.cpp:585
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1961
EDA_UNITS m_userUnits
Definition: board.h:1380
BOARD_ITEM * GetItem(const KIID &aID) const
Definition: board.cpp:1451
const ZONES & Zones() const
Definition: board.h:340
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: board.h:1332
void SanitizeNetcodes()
Definition: board.cpp:2706
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:2511
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition: board.h:363
~BOARD()
Definition: board.cpp:144
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:187
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:843
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
Definition: board.cpp:651
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition: board.cpp:327
DRAWINGS m_drawings
Definition: board.h:1355
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:2753
int SetAreasNetCodesFromNetNames()
Set the .m_NetCode member of all copper areas, according to the area Net Name The SetNetCodesFromNetN...
Definition: board.cpp:2124
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:2094
EDA_UNITS GetUserUnits()
Definition: board.h:709
void ResetNetHighLight()
Reset all high light data to the init state.
Definition: board.cpp:2768
PCB_PLOT_PARAMS m_plotOptions
Definition: board.h:1378
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition: board.cpp:631
std::list< ZONE * > GetZoneList(bool aIncludeZonesInFootprints=false) const
Definition: board.cpp:2491
void ConvertBrdLayerToPolygonalContours(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aOutlines) const
Build a set of polygons which are the outlines of copper items (pads, tracks, vias,...
Definition: board.cpp:2972
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:433
const MARKERS & Markers() const
Definition: board.h:344
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:456
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
Definition: board.cpp:773
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
Definition: board.cpp:2647
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: board.cpp:502
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:703
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1713
void FixupEmbeddedData()
After loading a file from disk, the footprints do not yet contain the full data for their embedded fi...
Definition: board.cpp:1022
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
Definition: board.cpp:940
ZONES m_zones
Definition: board.h:1359
PAD * GetPad(const VECTOR2I &aPosition) const
Definition: board.h:1091
PCB_LAYER_ID GetLayerID(const wxString &aLayerName) const
Return the ID of a layer.
Definition: board.cpp:593
HIGH_LIGHT_INFO m_highLightPrevious
Definition: board.h:1368
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition: board.h:389
void HighLightOFF()
Disable net highlight.
Definition: board.h:570
NETINFO_LIST m_NetInfo
Definition: board.h:1400
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:374
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition: board.cpp:866
void SetOutlinesChainingEpsilon(int aValue)
Definition: board.h:748
NETINFO_LIST::iterator EndNets() const
Definition: board.h:901
GroupLegalOpsField GroupLegalOps(const PCB_SELECTION &selection) const
Check which selection tool group operations are legal given the selection.
Definition: board.cpp:2882
int GetCopperLayerCount() const
Definition: board.cpp:780
int m_timeStamp
Definition: board.h:1349
std::vector< BOARD_LISTENER * > m_listeners
Definition: board.h:1402
const std::map< wxString, wxString > & GetProperties() const
Definition: board.h:367
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsCourtyardCache
Definition: board.h:1305
void IncrementTimeStamp()
Definition: board.cpp:255
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
Definition: board.cpp:1982
COMPONENT_CLASS_MANAGER m_componentClassManager
Definition: board.h:1406
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsFCourtyardCache
Definition: board.h:1306
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition: board.h:884
const FOOTPRINTS & Footprints() const
Definition: board.h:336
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: board.h:1374
std::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
Get the list of all outline fonts used in the board.
Definition: board.cpp:2607
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:1287
const BOARD_ITEM_SET GetItemSet()
Definition: board.cpp:3073
const TRACKS & Tracks() const
Definition: board.h:334
int m_DRCMaxPhysicalClearance
Definition: board.h:1320
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
Definition: board.cpp:2059
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:1170
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: board.h:698
std::unordered_map< wxString, LSET > m_LayerExpressionCache
Definition: board.h:1310
bool m_embedFonts
Definition: board.h:1404
wxString GroupsSanityCheckInternal(bool repair)
Definition: board.cpp:2813
void OnRatsnestChanged()
Notify the board and its listeners that the ratsnest has been recomputed.
Definition: board.cpp:2762
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition: board.cpp:1594
wxString GetClass() const override
Return the class name.
Definition: board.h:1005
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition: board.cpp:849
NETINFO_LIST::iterator BeginNets() const
Definition: board.h:893
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: board.h:382
void SetCopperLayerCount(int aCount)
Definition: board.cpp:786
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition: board.h:1313
wxString m_generator
Definition: board.h:1371
std::unordered_map< PTR_PTR_CACHE_KEY, bool > m_IntersectsBCourtyardCache
Definition: board.h:1307
TRACKS TracksInNet(int aNetCode)
Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
Definition: board.cpp:563
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:197
PROJECT * m_project
Definition: board.h:1379
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:2427
const wxString & GetFileName() const
Definition: board.h:332
bool operator==(const BOARD_ITEM &aOther) const override
Definition: board.cpp:3088
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:344
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition: board.cpp:2047
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1696
bool IsHighLightNetON() const
Definition: board.h:556
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:1555
int GetFileFormatVersionAtLoad() const
Definition: board.h:402
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition: board.cpp:889
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
Definition: board.h:1312
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
Definition: board.cpp:670
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: board.h:700
BOARD & operator=(const BOARD &aOther)=delete
wxString m_fileName
Definition: board.h:1351
const wxString & GetGenerator() const
Adds an item to the container.
Definition: board.h:405
int GetAreaCount() const
Definition: board.h:1052
void SetLegacyTeardrops(bool aFlag)
Definition: board.h:1270
std::map< int, LAYER > m_layers
Definition: board.h:1365
int GetOutlinesChainingEpsilon()
Definition: board.h:747
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:2315
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:823
int m_DRCMaxClearance
Definition: board.h:1319
void ClearProject()
Definition: board.cpp:235
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition: board.h:1311
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:1164
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Definition: board.cpp:805
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition: board.cpp:1438
PROJECT * GetProject() const
Definition: board.h:499
bool IsEmpty() const
Definition: board.h:391
bool LegacyTeardrops() const
Definition: board.h:1269
std::tuple< int, double, double > GetTrackLength(const PCB_TRACK &aTrack) const
Return data on the length and number of track segments connected to a given track.
Definition: board.cpp:2341
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:1774
const TITLE_BLOCK & GetTitleBlock() const
Definition: board.h:704
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction, int aDepth=0) const override
Invoke a function on all descendants.
Definition: board.cpp:524
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
Definition: board.cpp:2800
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:934
std::vector< ZONE * > m_DRCZones
Definition: board.h:1317
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask) const
Find a pad aPosition on aLayer.
Definition: board.cpp:2158
void SetGenerator(const wxString &aGenerator)
Definition: board.h:404
BOARD()
Definition: board.cpp:75
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition: board.cpp:296
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition: board.cpp:1648
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
Definition: board.cpp:2085
std::unordered_map< KIID, BOARD_ITEM * > m_itemByIdCache
Definition: board.h:1363
void RemoveListener(BOARD_LISTENER *aListener)
Remove the specified listener.
Definition: board.cpp:2723
COMPONENT_CLASS_MANAGER & GetComponentClassManager()
Gets the component class manager.
Definition: board.h:1288
std::shared_mutex m_CachesMutex
Definition: board.h:1304
unsigned GetNetCount() const
Definition: board.h:910
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition: board.cpp:1400
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: board.cpp:1176
GROUPS m_groups
Definition: board.h:1358
MARKERS m_markers
Definition: board.h:1354
std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, bool > m_IntersectsAreaCache
Definition: board.h:1308
std::optional< int > m_maxClearanceValue
Definition: board.h:1314
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Definition: board.cpp:2790
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: board.h:705
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
TRACKS m_tracks
Definition: board.h:1357
bool m_LegacyCopperEdgeClearanceLoaded
Definition: board.h:379
int GetTimeStamp() const
Definition: board.h:318
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:2747
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:483
VECTOR2I GetPosition() const override
Definition: board.cpp:490
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition: board.cpp:972
static bool ClassOf(const EDA_ITEM *aItem)
Definition: board.h:297
void SetUserUnits(EDA_UNITS aUnits)
Definition: board.h:710
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:856
void EmbedFonts() override
Finds all fonts used in the board and embeds them in the file if permissions allow.
Definition: board.cpp:2635
double Similarity(const BOARD_ITEM &aOther) const override
Return the Similarity.
Definition: board.h:998
const DRAWINGS & Drawings() const
Definition: board.h:338
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: board.cpp:1368
void SetFileFormatVersionAtLoad(int aVersion)
Definition: board.h:401
constexpr const Vec GetCenter() const
Definition: box2.h:230
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:88
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition: drc_rtree.h:48
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:355
void Clear()
Definition: board.h:234
HIGH_LIGHT_INFO()
Definition: board.h:240
std::set< int > m_netCodes
Definition: board.h:231
bool m_highLightOn
Definition: board.h:232
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
Definition: kiid.h:49
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Handle the data for a net.
Definition: netinfo.h:56
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:407
Container for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:346
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
iterator begin() const
Definition: netinfo.h:452
unsigned GetNetCount() const
Definition: netinfo.h:369
iterator end() const
Definition: netinfo.h:457
void buildListOfNets()
Rebuild the list of NETINFO_ITEMs.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition: pcb_netlist.h:241
Definition: pad.h:54
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
The main frame for Pcbnew.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:52
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.
Container for project specific data.
Definition: project.h:64
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
Represent a set of closed polygons.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
The common library.
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition: eda_item.h:82
EDA_UNITS
Definition: eda_units.h:46
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:32
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:191
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
STL namespace.
std::vector< ZONE * > ZONES
Definition: pcb_io_eagle.h:47
ENDPOINT_T
Definition: pcb_track.h:59
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2932
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
Definition: board.cpp:2911
A struct recording the isolated and single-pad islands within a zone.
Definition: zone.h:60
Container to hold information pertinent to a layer of a BOARD.
Definition: board.h:174
int m_opposite
Similar layer on opposite side of the board, if any.
Definition: board.h:206
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
Definition: board.cpp:699
void clear()
Definition: board.h:180
LAYER_T m_type
The type of the layer.
Definition: board.h:203
static const char * ShowType(LAYER_T aType)
Convert a LAYER_T enum to a string representation of the layer type.
Definition: board.cpp:683
LAYER()
Definition: board.h:175
wxString m_name
The canonical name of the layer.
Definition: board.h:201
wxString m_userName
The user defined name of the layer.
Definition: board.h:202
bool m_visible
Definition: board.h:204
int m_number
The layer ID.
Definition: board.h:205
BOARD_ITEM * A
Definition: board.h:96
bool operator==(const PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:99
PCB_LAYER_ID Layer
Definition: board.h:97
BOARD_ITEM * A
Definition: board.h:85
BOARD_ITEM * B
Definition: board.h:86
bool operator==(const PTR_PTR_CACHE_KEY &other) const
Definition: board.h:88
bool operator==(const PTR_PTR_LAYER_CACHE_KEY &other) const
Definition: board.h:111
BOARD_ITEM * B
Definition: board.h:108
BOARD_ITEM * A
Definition: board.h:107
PCB_LAYER_ID Layer
Definition: board.h:109
std::size_t operator()(const PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:133
std::size_t operator()(const PTR_PTR_CACHE_KEY &k) const
Definition: board.h:122
std::size_t operator()(const PTR_PTR_LAYER_CACHE_KEY &k) const
Definition: board.h:144
@ PCB_T
Definition: typeinfo.h:82
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition: typeinfo.h:91
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:99
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:109
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:50