KiCad PCB EDA Suite
class_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, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2020 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 
28 #include <tuple>
29 #include <board_design_settings.h>
30 #include <board_item_container.h>
31 #include <class_module.h>
32 #include <class_pad.h>
33 #include <common.h> // PAGE_INFO
34 #include <eda_rect.h>
36 #include <netinfo.h>
37 #include <pcb_plot_params.h>
38 #include <title_block.h>
39 #include <zone_settings.h>
40 
41 #include <memory>
42 
43 class PCB_BASE_FRAME;
44 class PCB_EDIT_FRAME;
45 class PICKED_ITEMS_LIST;
46 class BOARD;
47 class ZONE_CONTAINER;
48 class TRACK;
49 class D_PAD;
50 class MARKER_PCB;
51 class MSG_PANEL_ITEM;
52 class NETLIST;
53 class REPORTER;
54 class SHAPE_POLY_SET;
55 class CONNECTIVITY_DATA;
56 class COMPONENT;
57 class PROJECT;
58 
59 // Forward declare endpoint from class_track.h
60 enum ENDPOINT_T : int;
61 
66 enum LAYER_T
67 {
73 };
74 
75 
80 struct LAYER
81 {
83  {
84  clear();
85  }
86 
87  void clear()
88  {
89  m_type = LT_SIGNAL;
90  m_visible = true;
91  m_number = 0;
92  m_name.clear();
93  }
94 
95  /*
96  LAYER( const wxString& aName = wxEmptyString,
97  LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
98  m_name( aName ),
99  m_type( aType ),
100  m_visible( aVisible ),
101  m_number( aNumber )
102  {
103  }
104  */
105 
106  wxString m_name;
108  bool m_visible;
109  int m_number;
110 
117  static const char* ShowType( LAYER_T aType );
118 
126  static LAYER_T ParseType( const char* aType );
127 };
128 
129 
130 // Helper class to handle high light nets
132 {
133  friend class BOARD;
134 
135 protected:
136  std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
137  bool m_highLightOn; // highlight active
138 
139  void Clear()
140  {
141  m_netCodes.clear();
142  m_highLightOn = false;
143  }
144 
146  {
147  Clear();
148  }
149 };
150 
157 class BOARD;
158 
160 {
161 public:
162  virtual ~BOARD_LISTENER() { }
163  virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
164  virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
165  virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
166  virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
167  virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
168 };
169 
170 
171 DECL_VEC_FOR_SWIG( MARKERS, MARKER_PCB* )
172 DECL_VEC_FOR_SWIG( ZONE_CONTAINERS, ZONE_CONTAINER* )
173 DECL_DEQ_FOR_SWIG( TRACKS, TRACK* )
174 
175 
176 
181 {
182  friend class PCB_EDIT_FRAME;
183 
184 private:
186  wxString m_fileName;
187 
189  MARKERS m_markers;
190 
192  DRAWINGS m_drawings;
193 
195  MODULES m_modules;
196 
198  TRACKS m_tracks;
199 
201  ZONE_CONTAINERS m_ZoneDescriptorList;
202 
204 
205  // if true m_highLight_NetCode is used
206  HIGH_LIGHT_INFO m_highLight; // current high light data
207  HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
208 
209  int m_fileFormatVersionAtLoad; // the version loaded from the file
210 
211  std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
212 
214  TITLE_BLOCK m_titles; // text in lower right of screen and plots
216  PROJECT* m_project; // project this board is a part of
217 
228  std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
229 
230  NETINFO_LIST m_NetInfo; // net info list (name, design constraints ..
231 
232  std::vector<BOARD_LISTENER*> m_listeners;
233 
234  // The default copy constructor & operator= are inadequate,
235  // either write one or do not use it at all
236  BOARD( const BOARD& aOther ) = delete;
237 
238  BOARD& operator=( const BOARD& aOther ) = delete;
239 
240  template <typename Func, typename... Args>
241  void InvokeListeners( Func&& aFunc, Args&&... args )
242  {
243  for( auto&& l : m_listeners )
244  ( l->*aFunc )( std::forward<Args>( args )... );
245  }
246 
247 public:
248  static inline bool ClassOf( const EDA_ITEM* aItem )
249  {
250  return aItem && PCB_T == aItem->Type();
251  }
252 
253  void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
254 
255  const wxString &GetFileName() const { return m_fileName; }
256 
257  TRACKS& Tracks()
258  {
259  return m_tracks;
260  }
261  const TRACKS& Tracks() const
262  {
263  return m_tracks;
264  }
265 
266  MODULES& Modules()
267  {
268  return m_modules;
269  }
270  const MODULES& Modules() const
271  {
272  return m_modules;
273  }
274 
275  DRAWINGS& Drawings()
276  {
277  return m_drawings;
278  }
279 
280  ZONE_CONTAINERS& Zones()
281  {
282  return m_ZoneDescriptorList;
283  }
284 
285  MARKERS& Markers()
286  {
287  return m_markers;
288  }
289 
290  const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
291 
294 
298 
301 
304 
305  BOARD();
306  ~BOARD();
307 
308  const wxPoint GetPosition() const override;
309  void SetPosition( const wxPoint& aPos ) override;
310 
311  bool IsEmpty() const
312  {
313  return m_drawings.empty() && m_modules.empty() && m_tracks.empty() &&
314  m_ZoneDescriptorList.empty();
315  }
316 
317  void Move( const wxPoint& aMoveVector ) override;
318 
319  void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
320  int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
321 
322  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT ) override;
323 
324  void Remove( BOARD_ITEM* aBoardItem ) override;
325 
331  {
332  return m_modules.empty() ? nullptr : m_modules.front();
333  }
334 
339  {
340  for( MODULE* mod : m_modules )
341  delete mod;
342 
343  m_modules.clear();
344  }
345 
346  BOARD_ITEM* GetItem( const KIID& aID );
347 
348  void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
349 
355  std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
356 
362  void BuildConnectivity();
363 
368  void DeleteMARKERs();
369 
374  void DeleteZONEOutlines();
375 
376  PROJECT* GetProject() const { return m_project; }
377 
383  void SetProject( PROJECT* aProject );
384 
385  void ClearProject();
386 
391  void ResetNetHighLight();
392 
397  const std::set<int>& GetHighLightNetCodes() const
398  {
399  return m_highLight.m_netCodes;
400  }
401 
408  void SetHighLightNet( int aNetCode, bool aMulti = false );
409 
414  bool IsHighLightNetON() const { return m_highLight.m_highLightOn; }
415 
422  void HighLightON( bool aValue = true );
423 
429  {
430  HighLightON( false );
431  }
432 
437  int GetCopperLayerCount() const;
438  void SetCopperLayerCount( int aCount );
439 
446  LSET GetEnabledLayers() const;
447 
454  void SetEnabledLayers( LSET aLayerMask );
455 
463  bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const
464  {
465  return GetDesignSettings().IsLayerEnabled( aLayer );
466  }
467 
475  bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
476 
483  LSET GetVisibleLayers() const;
484 
491  void SetVisibleLayers( LSET aLayerMask );
492 
493  // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
494  // are not stored in the bitmap.
495 
501  GAL_SET GetVisibleElements() const;
502 
510  void SetVisibleElements( const GAL_SET& aMask );
511 
517  void SetVisibleAlls();
518 
527  bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
528 
536  void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
537 
545  bool IsModuleLayerVisible( PCB_LAYER_ID aLayer );
546 
552  {
553  // remove const-ness with cast. TODO(snh): Make GetDesignSettings const
554  // NOTE(JE) If we want this to be const, it's going to have to involve making BOARD and
555  // everything else that relies on BOARD_DESIGN_SETTINGS aware of the PROJECT so that it
556  // can be retrieved from there. This will also currently require constructing BOARD with
557  // a valid PROJECT passed in to the ctor.
558 
559  return const_cast<BOARD_DESIGN_SETTINGS&>( *m_designSettings.get() );
560  }
561 
562  const ZONE_SETTINGS& GetZoneSettings() const override
563  {
565  }
566 
567  void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override
568  {
570  }
571 
572  const PAGE_INFO& GetPageSettings() const { return m_paper; }
573  void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
574 
575  const PCB_PLOT_PARAMS& GetPlotOptions() const { return m_plotOptions; }
576  void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
577 
578  TITLE_BLOCK& GetTitleBlock() { return m_titles; }
579  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
580 
581  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
582 
598  bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
599  wxString* aErrorText = nullptr, wxPoint* aErrorLocation = nullptr );
600 
612  void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines );
613 
618  const PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
619 
624  const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
625 
635  bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
636 
648  static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
649  {
650  // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
651  return LSET::Name( aLayerId );
652  }
653 
662  bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
663 
672  LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
673 
682  bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
683 
689  unsigned GetNodesCount( int aNet = -1 );
690 
695  unsigned GetUnconnectedNetCount() const;
696 
701  unsigned GetPadCount();
702 
707  D_PAD* GetPad( unsigned aIndex ) const;
708 
716  const std::vector<D_PAD*> GetPads();
717 
719  {
720  m_NetInfo.buildListOfNets();
721  }
722 
729  NETINFO_ITEM* FindNet( int aNetcode ) const;
730 
737  NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
738 
740  {
741  return m_NetInfo;
742  }
743 
744 #ifndef SWIG
745 
750  {
751  return m_NetInfo.begin();
752  }
753 
759  {
760  return m_NetInfo.end();
761  }
762 #endif
763 
768  unsigned GetNetCount() const
769  {
770  return m_NetInfo.GetNetCount();
771  }
772 
779  EDA_RECT ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
780 
781  const EDA_RECT GetBoundingBox() const override
782  {
783  return ComputeBoundingBox( false );
784  }
785 
794  {
795  return ComputeBoundingBox( true );
796  }
797 
798  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
799 
813  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
814 
822  MODULE* FindModuleByReference( const wxString& aReference ) const;
823 
830  MODULE* FindModuleByPath( const KIID_PATH& aPath ) const;
831 
839  int SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
840 
848  void SynchronizeNetsAndNetClasses();
849 
850  /***************************************************************************/
851 
852  wxString GetClass() const override
853  {
854  return wxT( "BOARD" );
855  }
856 
857 #if defined(DEBUG)
858  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
859 #endif
860 
861 
862  /*************************/
863  /* Copper Areas handling */
864  /*************************/
865 
876  int SetAreasNetCodesFromNetNames( void );
877 
884  ZONE_CONTAINER* GetArea( int index ) const
885  {
886  if( (unsigned) index < m_ZoneDescriptorList.size() )
887  return m_ZoneDescriptorList[index];
888 
889  return NULL;
890  }
891 
898  int GetAreaIndex( const ZONE_CONTAINER* aArea ) const
899  {
900  for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list
901  {
902  if( aArea == GetArea( ii ) ) // Found !
903  return ii;
904  }
905 
906  return -1;
907  }
908 
913  std::list<ZONE_CONTAINER*> GetZoneList( bool aIncludeZonesInFootprints = false );
914 
919  int GetAreaCount() const
920  {
921  return static_cast<int>( m_ZoneDescriptorList.size() );
922  }
923 
924  /* Functions used in test, merge and cut outlines */
925 
937  ZONE_CONTAINER* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
938  wxPoint aStartPointPosition, ZONE_HATCH_STYLE aHatch );
939 
950  ZONE_CONTAINER* InsertArea( int aNetcode, int aAreaIdx, PCB_LAYER_ID aLayer, int aCornerX,
951  int aCornerY, ZONE_HATCH_STYLE aHatch );
952 
962  bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE_CONTAINER* aCurrArea );
963 
974  bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
975  ZONE_CONTAINER* modified_area );
976 
987  bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
988  int aNetCode,
989  bool aUseLocalFlags );
990 
998  void RemoveArea( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_to_remove );
999 
1005  bool TestAreaIntersections( ZONE_CONTAINER* area_to_test );
1006 
1015  bool TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test );
1016 
1028  bool CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
1029  ZONE_CONTAINER* area_ref,
1030  ZONE_CONTAINER* area_to_combine );
1031 
1040  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask );
1041  D_PAD* GetPad( const wxPoint& aPosition )
1042  {
1043  return GetPad( aPosition, LSET().set() );
1044  }
1045 
1054  D_PAD* GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint );
1055 
1066  D_PAD* GetPadFast( const wxPoint& aPosition, LSET aLayerMask );
1067 
1083  D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerMask );
1084 
1091  void PadDelete( D_PAD* aPad );
1092 
1105  void GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNetCode = -1 );
1106 
1114  std::tuple<int, double, double> GetTrackLength( const TRACK& aTrack ) const;
1115 
1123  TRACKS TracksInNet( int aNetCode );
1124 
1139  MODULE* GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
1140  bool aVisibleOnly, bool aIgnoreLocked = false );
1141 
1146  void ClearAllNetCodes();
1147 
1153  void MapNets( const BOARD* aDestBoard );
1154 
1155  void SanitizeNetcodes();
1156 
1165  void AddListener( BOARD_LISTENER* aListener );
1166 
1171  void RemoveListener( BOARD_LISTENER* aListener );
1172 
1177  void OnItemChanged( BOARD_ITEM* aItem );
1178 };
1179 
1180 #endif // CLASS_BOARD_H_
const ZONE_SETTINGS & GetZoneSettings() const override
Fetch the zone settings for this container.
Definition: class_board.h:562
MODULES m_modules
MODULES for components on the board, owned by pointer.
Definition: class_board.h:195
EDA_UNITS
Definition: common.h:198
iterator end() const
Definition: netinfo.h:537
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: class_board.h:241
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:486
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: class_board.h:164
void SetFileFormatVersionAtLoad(int aVersion)
Definition: class_board.h:319
D_PAD * GetPad(const wxPoint &aPosition)
Definition: class_board.h:1041
void BuildListOfNets()
Definition: class_board.h:718
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_board.h:781
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:572
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_board.h:248
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:575
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project Overloaded in FOOTPRINT_EDIT_FRAME.
Definition: typeinfo.h:85
PROJECT holds project specific data.
Definition: project.h:61
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: class_board.h:300
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:106
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: class_board.h:303
EDA_ITEM * GetItem(const KIID &aId) override
Fetch an item by KIID.
wxString m_fileName
the board filename
Definition: class_board.h:186
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
void SetDefaultZoneSettings(const ZONE_SETTINGS &aSettings)
bool IsLayerEnabled(PCB_LAYER_ID aLayerId) const
Function IsLayerEnabled tests whether a given layer is enabled.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: class_board.h:579
PAGE_INFO m_paper
Definition: class_board.h:213
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:793
bool IsHighLightNetON() const
Function IsHighLightNetON.
Definition: class_board.h:414
MARKERS & Markers()
Definition: class_board.h:285
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: class_board.h:573
LAYER_T m_type
The type of the layer.
Definition: class_board.h:107
NETINFO_LIST::iterator EndNets() const
Function EndNets.
Definition: class_board.h:758
ZONE_CONTAINER * m_CurrentZoneContour
zone contour currently in progress
Definition: class_board.h:293
PROJECT * GetProject() const
Definition: class_board.h:376
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
void HighLightOFF()
Function HighLightOFF Disable net highlight.
Definition: class_board.h:428
LAYER()
Definition: class_board.h:82
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:551
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: class_board.h:166
HIGH_LIGHT_INFO m_highLight
Definition: class_board.h:206
NETINFO_LIST m_NetInfo
Definition: class_board.h:230
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
HIGH_LIGHT_INFO m_highLightPrevious
Definition: class_board.h:207
The base class for create windows for drawing purpose.
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
Function IsLayerEnabled is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:463
TRACKS m_tracks
TRACKS for traces on the board, owned by pointer.
Definition: class_board.h:198
const wxString & GetFileName() const
Definition: class_board.h:255
TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout,...
Definition: title_block.h:40
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: class_board.h:163
PCB_PLOT_PARAMS m_plotOptions
Definition: class_board.h:215
void SetVisibleAlls()
Function SetVisibleAlls Set the status of all visible element categories and layers to VISIBLE.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
NETINFO_LIST::iterator BeginNets() const
Function BeginNets.
Definition: class_board.h:749
static const char * ShowType(LAYER_T aType)
Function ShowType converts a LAYER_T enum to a const char*.
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:105
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)
Definition: common.h:68
PCB_LAYER_ID
A quick note on layer IDs:
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:919
LSET is a set of PCB_LAYER_IDs.
NETLIST stores all of information read from a netlist along with the flags used to update the NETLIST...
Definition: pcb_netlist.h:212
#define NULL
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:768
MODULES & Modules()
Definition: class_board.h:266
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Function Name returns the fixed name association with aLayerId.
Definition: lset.cpp:78
NETINFO_LIST is a container class for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:407
SHAPE_POLY_SET.
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
iterator begin() const
Definition: netinfo.h:532
LAYER_T
Enum LAYER_T gives the allowed types of layers, same as Specctra DSN spec.
Definition: class_board.h:66
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition: class_board.h:165
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:355
TITLE_BLOCK m_titles
Definition: class_board.h:214
MODULE * GetFirstModule() const
Gets the first module in the list (used in footprint viewer/editor) or NULL if none.
Definition: class_board.h:330
bool m_visible
Definition: class_board.h:108
ENDPOINT_T
Definition: class_track.h:60
MARKERS m_markers
MARKER_PCBs for clearance problems, owned by pointer.
Definition: class_board.h:189
void SetFileName(const wxString &aFileName)
Definition: class_board.h:253
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: class_board.h:576
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
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: class_board.h:228
static LAYER_T ParseType(const char *aType)
Function ParseType converts a string to a LAYER_T.
const MODULES & Modules() const
Definition: class_board.h:270
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:739
DRAWINGS m_drawings
BOARD_ITEMs for drawings on the board, owned by pointer.
Definition: class_board.h:192
Pad object description.
int GetFileFormatVersionAtLoad() const
Definition: class_board.h:320
COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:80
const std::set< int > & GetHighLightNetCodes() const
Function GetHighLightNetCode.
Definition: class_board.h:397
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:67
#define DECL_DEQ_FOR_SWIG(TypeName, MemberType)
void clear()
Definition: class_board.h:87
std::set< int > m_netCodes
Definition: class_board.h:136
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
ZONE_CONTAINERS & Zones()
Definition: class_board.h:280
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: class_board.h:167
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:578
Board layer functions and definitions.
ZONE_HATCH_STYLE
Zone hatch styles.
Definition: zone_settings.h:46
int m_fileFormatVersionAtLoad
Definition: class_board.h:209
LAYER holds information pertinent to a layer of a BOARD.
Definition: class_board.h:80
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:180
ZONE_CONTAINERS m_ZoneDescriptorList
edge zone descriptors, owned by pointer.
Definition: class_board.h:201
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: class_board.h:211
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
PCB_EDIT_FRAME is the main frame for Pcbnew.
void SetZoneSettings(const ZONE_SETTINGS &aSettings) override
Set the zone settings for this container.
Definition: class_board.h:567
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
The common library.
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_board.h:852
const TRACKS & Tracks() const
Definition: class_board.h:261
unsigned GetNetCount() const
Function GetNetCount.
Definition: netinfo.h:434
void DeleteAllModules()
Removes all modules from the deque and frees the memory associated with them.
Definition: class_board.h:338
virtual ~BOARD_LISTENER()
Definition: class_board.h:162
ZONE_SETTINGS & GetDefaultZoneSettings()
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:884
Abstract interface for BOARD_ITEMs capable of storing other items inside.
int m_number
Definition: class_board.h:109
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
int GetAreaIndex(const ZONE_CONTAINER *aArea) const
Function GetAreaIndex returns the Area Index for the given Zone Container.
Definition: class_board.h:898
bool IsElementVisible(GAL_LAYER_ID aElement) const
Function IsElementVisible tests whether a given element category is visible.
SEARCH_RESULT
Definition: base_struct.h:51
std::bitset< GAL_LAYER_ID_COUNT > GAL_SET
DRAWINGS & Drawings()
Definition: class_board.h:275
bool IsEmpty() const
Definition: class_board.h:311
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: class_board.h:296
std::vector< BOARD_LISTENER * > m_listeners
Definition: class_board.h:232
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: class_board.h:257
void buildListOfNets()
Function buildListOfNets builds or rebuilds the list of NETINFO_ITEMs The list is sorted by names.
PROJECT * m_project
Definition: class_board.h:216
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Function GetStandardLayerName returns an "English Standard" name of a PCB layer when given aLayerNumb...
Definition: class_board.h:648
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
GAL_SET m_LegacyVisibleItems
Definition: class_board.h:297