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 <board_design_settings.h>
29 #include <board_item_container.h>
30 #include <class_pcb_group.h>
31 #include <class_module.h>
32 #include <common.h> // PAGE_INFO
34 #include <netinfo.h>
35 #include <pcb_plot_params.h>
36 #include <title_block.h>
37 #include <tools/pcbnew_selection.h>
38 
39 class BOARD_COMMIT;
40 class PCB_BASE_FRAME;
41 class PCB_EDIT_FRAME;
42 class PICKED_ITEMS_LIST;
43 class BOARD;
44 class ZONE_CONTAINER;
45 class TRACK;
46 class D_PAD;
47 class MARKER_PCB;
48 class MSG_PANEL_ITEM;
49 class NETLIST;
50 class REPORTER;
51 class SHAPE_POLY_SET;
52 class CONNECTIVITY_DATA;
53 class COMPONENT;
54 class PROJECT;
55 
56 // Forward declare endpoint from class_track.h
57 enum ENDPOINT_T : int;
58 
63 enum LAYER_T
64 {
70 };
71 
72 
77 struct LAYER
78 {
80  {
81  clear();
82  }
83 
84  void clear()
85  {
86  m_type = LT_SIGNAL;
87  m_visible = true;
88  m_number = 0;
89  m_name.clear();
90  }
91 
92  /*
93  LAYER( const wxString& aName = wxEmptyString,
94  LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
95  m_name( aName ),
96  m_type( aType ),
97  m_visible( aVisible ),
98  m_number( aNumber )
99  {
100  }
101  */
102 
103  wxString m_name;
105  bool m_visible;
106  int m_number;
107 
114  static const char* ShowType( LAYER_T aType );
115 
123  static LAYER_T ParseType( const char* aType );
124 };
125 
126 
127 // Helper class to handle high light nets
129 {
130  friend class BOARD;
131 
132 protected:
133  std::set<int> m_netCodes; // net(s) selected for highlight (-1 when no net selected )
134  bool m_highLightOn; // highlight active
135 
136  void Clear()
137  {
138  m_netCodes.clear();
139  m_highLightOn = false;
140  }
141 
143  {
144  Clear();
145  }
146 };
147 
154 class BOARD;
155 
157 {
158 public:
159  virtual ~BOARD_LISTENER() { }
160  virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
161  virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
162  virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) { }
163  virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) { }
164  virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) { }
165 };
166 
167 
168 DECL_VEC_FOR_SWIG( MARKERS, MARKER_PCB* )
169 DECL_VEC_FOR_SWIG( ZONE_CONTAINERS, ZONE_CONTAINER* )
170 DECL_DEQ_FOR_SWIG( TRACKS, TRACK* )
171 // Dequeue rather than Vector just so we can use moveUnflaggedItems in pcbnew_control.cpp
172 DECL_DEQ_FOR_SWIG( GROUPS, PCB_GROUP* )
173 
174 
179 {
180  friend class PCB_EDIT_FRAME;
181 
182 private:
183  wxString m_fileName;
184  MARKERS m_markers;
185  DRAWINGS m_drawings;
186  MODULES m_modules;
187  TRACKS m_tracks;
188  GROUPS m_groups;
189  ZONE_CONTAINERS m_zones;
190 
192 
193  // if true m_highLight_NetCode is used
194  HIGH_LIGHT_INFO m_highLight; // current high light data
195  HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
196 
197  int m_fileFormatVersionAtLoad; // the version loaded from the file
198 
199  std::map<wxString, wxString> m_properties;
200  std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
201 
203  TITLE_BLOCK m_titles; // text in lower right of screen and plots
205  PROJECT* m_project; // project this board is a part of
206 
217  std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
218 
219  NETINFO_LIST m_NetInfo; // net info list (name, design constraints ..
220 
221  std::vector<BOARD_LISTENER*> m_listeners;
222 
223  // The default copy constructor & operator= are inadequate,
224  // either write one or do not use it at all
225  BOARD( const BOARD& aOther ) = delete;
226 
227  BOARD& operator=( const BOARD& aOther ) = delete;
228 
229  template <typename Func, typename... Args>
230  void InvokeListeners( Func&& aFunc, Args&&... args )
231  {
232  for( auto&& l : m_listeners )
233  ( l->*aFunc )( std::forward<Args>( args )... );
234  }
235 
236 public:
237  static inline bool ClassOf( const EDA_ITEM* aItem )
238  {
239  return aItem && PCB_T == aItem->Type();
240  }
241 
242  void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
243 
244  const wxString &GetFileName() const { return m_fileName; }
245 
246  TRACKS& Tracks() { return m_tracks; }
247  const TRACKS& Tracks() const { return m_tracks; }
248 
249  MODULES& Modules() { return m_modules; }
250  const MODULES& Modules() const { return m_modules; }
251 
252  DRAWINGS& Drawings() { return m_drawings; }
253 
254  ZONE_CONTAINERS& Zones() { return m_zones; }
255  const ZONE_CONTAINERS& Zones() const { return m_zones; }
256 
257  MARKERS& Markers() { return m_markers; }
258 
267  GROUPS& Groups() { return m_groups; }
268 
269  const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
270 
271  const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
272  void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
273 
274  bool ResolveTextVar( wxString* token, int aDepth ) const;
275 
279 
282 
285 
286  BOARD();
287  ~BOARD();
288 
289  wxPoint GetPosition() const override;
290  void SetPosition( const wxPoint& aPos ) override;
291 
292  bool IsEmpty() const
293  {
294  return m_drawings.empty() && m_modules.empty() && m_tracks.empty() && m_zones.empty();
295  }
296 
297  void Move( const wxPoint& aMoveVector ) override;
298 
299  void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
300  int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
301 
302  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT ) override;
303 
304  void Remove( BOARD_ITEM* aBoardItem ) override;
305 
311  {
312  return m_modules.empty() ? nullptr : m_modules.front();
313  }
314 
319  {
320  for( MODULE* mod : m_modules )
321  delete mod;
322 
323  m_modules.clear();
324  }
325 
330  BOARD_ITEM* GetItem( const KIID& aID );
331 
332  void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
333 
337  wxString ConvertCrossReferencesToKIIDs( const wxString& aSource );
338  wxString ConvertKIIDsToCrossReferences( const wxString& aSource );
339 
345  std::shared_ptr<CONNECTIVITY_DATA> GetConnectivity() const { return m_connectivity; }
346 
352  void BuildConnectivity();
353 
358  void DeleteMARKERs();
359 
360  void DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions );
361 
362  PROJECT* GetProject() const { return m_project; }
363 
369  void SetProject( PROJECT* aProject );
370 
371  void ClearProject();
372 
377  void ResetNetHighLight();
378 
383  const std::set<int>& GetHighLightNetCodes() const
384  {
385  return m_highLight.m_netCodes;
386  }
387 
394  void SetHighLightNet( int aNetCode, bool aMulti = false );
395 
400  bool IsHighLightNetON() const { return m_highLight.m_highLightOn; }
401 
408  void HighLightON( bool aValue = true );
409 
415  {
416  HighLightON( false );
417  }
418 
423  int GetCopperLayerCount() const;
424  void SetCopperLayerCount( int aCount );
425 
432  LSET GetEnabledLayers() const;
433 
440  void SetEnabledLayers( LSET aLayerMask );
441 
449  bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const
450  {
451  return GetDesignSettings().IsLayerEnabled( aLayer );
452  }
453 
461  bool IsLayerVisible( PCB_LAYER_ID aLayer ) const;
462 
469  LSET GetVisibleLayers() const;
470 
477  void SetVisibleLayers( LSET aLayerMask );
478 
479  // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
480  // are not stored in the bitmap.
481 
487  GAL_SET GetVisibleElements() const;
488 
496  void SetVisibleElements( const GAL_SET& aMask );
497 
503  void SetVisibleAlls();
504 
513  bool IsElementVisible( GAL_LAYER_ID aLayer ) const;
514 
522  void SetElementVisibility( GAL_LAYER_ID aLayer, bool aNewState );
523 
531  bool IsModuleLayerVisible( PCB_LAYER_ID aLayer );
532 
538  {
539  return *m_designSettings;
540  }
541 
542  const ZONE_SETTINGS& GetZoneSettings() const override
543  {
545  }
546 
547  void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override
548  {
550  }
551 
552  const PAGE_INFO& GetPageSettings() const { return m_paper; }
553  void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
554 
555  const PCB_PLOT_PARAMS& GetPlotOptions() const { return m_plotOptions; }
556  void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
557 
558  TITLE_BLOCK& GetTitleBlock() { return m_titles; }
559  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
560 
561  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
562 
578  bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines, wxString* aErrorText = nullptr,
579  wxPoint* aErrorLocation = nullptr );
580 
592  void ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines );
593 
598  const PCB_LAYER_ID GetLayerID( const wxString& aLayerName ) const;
599 
604  const wxString GetLayerName( PCB_LAYER_ID aLayer ) const;
605 
615  bool SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName );
616 
628  static wxString GetStandardLayerName( PCB_LAYER_ID aLayerId )
629  {
630  // a BOARD's standard layer name is the PCB_LAYER_ID fixed name
631  return LayerName( aLayerId );
632  }
633 
642  bool SetLayerDescr( PCB_LAYER_ID aIndex, const LAYER& aLayer );
643 
652  LAYER_T GetLayerType( PCB_LAYER_ID aLayer ) const;
653 
662  bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
663 
669  unsigned GetNodesCount( int aNet = -1 );
670 
675  unsigned GetUnconnectedNetCount() const;
676 
681  unsigned GetPadCount();
682 
690  const std::vector<D_PAD*> GetPads();
691 
693  {
694  m_NetInfo.buildListOfNets();
695  }
696 
703  NETINFO_ITEM* FindNet( int aNetcode ) const;
704 
711  NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
712 
713  const NETINFO_LIST& GetNetInfo() const
714  {
715  return m_NetInfo;
716  }
717 
719  {
720  return m_NetInfo;
721  }
722 
723 #ifndef SWIG
724 
729  {
730  return m_NetInfo.begin();
731  }
732 
738  {
739  return m_NetInfo.end();
740  }
741 #endif
742 
747  unsigned GetNetCount() const
748  {
749  return m_NetInfo.GetNetCount();
750  }
751 
758  EDA_RECT ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
759 
760  const EDA_RECT GetBoundingBox() const override
761  {
762  return ComputeBoundingBox( false );
763  }
764 
773  {
774  return ComputeBoundingBox( true );
775  }
776 
777  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
778 
792  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
793 
801  MODULE* FindModuleByReference( const wxString& aReference ) const;
802 
809  MODULE* FindModuleByPath( const KIID_PATH& aPath ) const;
810 
818  int SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
819 
825  std::vector<wxString> GetNetClassAssignmentCandidates();
826 
834  void SynchronizeNetsAndNetClasses();
835 
840  void SynchronizeProperties();
841 
842  wxString GetClass() const override
843  {
844  return wxT( "BOARD" );
845  }
846 
847 #if defined(DEBUG)
848  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
849 #endif
850 
851 
852  /*************************/
853  /* Copper Areas handling */
854  /*************************/
855 
866  int SetAreasNetCodesFromNetNames();
867 
874  ZONE_CONTAINER* GetArea( int index ) const
875  {
876  if( (unsigned) index < m_zones.size() )
877  return m_zones[index];
878 
879  return NULL;
880  }
881 
886  int GetAreaCount() const
887  {
888  return static_cast<int>( m_zones.size() );
889  }
890 
891  /* Functions used in test, merge and cut outlines */
892 
904  ZONE_CONTAINER* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
905  wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
906 
916  bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE_CONTAINER* aCurrArea );
917 
928  bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
929  ZONE_CONTAINER* modified_area );
930 
941  bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
942  int aNetCode,
943  bool aUseLocalFlags );
944 
952  void RemoveArea( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_to_remove );
953 
959  bool TestAreaIntersections( ZONE_CONTAINER* area_to_test );
960 
968  bool TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test );
969 
981  bool CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
982  ZONE_CONTAINER* area_ref,
983  ZONE_CONTAINER* area_to_combine );
984 
993  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask );
994  D_PAD* GetPad( const wxPoint& aPosition )
995  {
996  return GetPad( aPosition, LSET().set() );
997  }
998 
1007  D_PAD* GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint );
1008 
1019  D_PAD* GetPadFast( const wxPoint& aPosition, LSET aLayerMask );
1020 
1036  D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerMask );
1037 
1044  void PadDelete( D_PAD* aPad );
1045 
1058  void GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNetCode = -1 );
1059 
1067  std::tuple<int, double, double> GetTrackLength( const TRACK& aTrack ) const;
1068 
1076  TRACKS TracksInNet( int aNetCode );
1077 
1092  MODULE* GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer,
1093  bool aVisibleOnly, bool aIgnoreLocked = false );
1094 
1099  void ClearAllNetCodes();
1100 
1106  void MapNets( const BOARD* aDestBoard );
1107 
1108  void SanitizeNetcodes();
1109 
1118  void AddListener( BOARD_LISTENER* aListener );
1119 
1124  void RemoveListener( BOARD_LISTENER* aListener );
1125 
1130  void OnItemChanged( BOARD_ITEM* aItem );
1131 
1132  /*
1133  * Consistency check of internal m_groups structure.
1134  * @param repair if true, modify groups structure until it passes the sanity check.
1135  * @return empty string on success. Or error description if there's a problem.
1136  */
1137  wxString GroupsSanityCheck( bool repair = false );
1138 
1139  /*
1140  * @param repair if true, make one modification to groups structure that brings it
1141  * closer to passing the sanity check.
1142  * @return empty string on success. Or error description if there's a problem.
1143  */
1144  wxString GroupsSanityCheckInternal( bool repair );
1145 
1146  /*
1147  * Searches for highest level group containing item.
1148  * @param scope restricts the search to groups within the group scope.
1149  * @return group containing item, if it exists, otherwise, NULL
1150  */
1151  PCB_GROUP* TopLevelGroup( BOARD_ITEM* item, PCB_GROUP* scope );
1152 
1153 
1154  /*
1155  * @return The group containing item as a child, or NULL if there is no
1156  * such group.
1157  */
1158  PCB_GROUP* ParentGroup( BOARD_ITEM* item );
1159 
1160  /*
1161  * Given a selection of items, remove them from their groups and also
1162  * recursively remove empty groups that result.
1163  */
1164  void GroupRemoveItems( const PCBNEW_SELECTION& selection, BOARD_COMMIT* commit );
1165 
1166 
1168  {
1169  bool create : 1;
1170  bool merge : 1;
1171  bool ungroup : 1;
1172  bool removeItems : 1;
1173  bool flatten : 1;
1174  bool enter : 1;
1175  };
1176 
1177  /*
1178  * Check which selection tool group operations are legal given the selection.
1179  * @return bit field of legal ops.
1180  */
1181  GroupLegalOpsField GroupLegalOps( const PCBNEW_SELECTION& selection ) const;
1182 };
1183 #endif // CLASS_BOARD_H_
const ZONE_SETTINGS & GetZoneSettings() const override
Fetch the zone settings for this container.
Definition: class_board.h:542
MODULES m_modules
Definition: class_board.h:186
EDA_UNITS
Definition: common.h:198
iterator end() const
Definition: netinfo.h:554
void InvokeListeners(Func &&aFunc, Args &&... args)
Definition: class_board.h:230
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:503
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: class_board.h:161
void SetFileFormatVersionAtLoad(int aVersion)
Definition: class_board.h:299
D_PAD * GetPad(const wxPoint &aPosition)
Definition: class_board.h:994
void BuildListOfNets()
Definition: class_board.h:692
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_board.h:760
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:552
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:237
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:555
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:281
wxString m_name
The name of the layer, there should be no spaces in this name.
Definition: class_board.h:103
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
Definition: class_board.h:284
EDA_ITEM * GetItem(const KIID &aId) override
Fetch an item by KIID.
wxString m_fileName
Definition: class_board.h:183
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)
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: class_board.h:272
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:559
PAGE_INFO m_paper
Definition: class_board.h:202
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:772
GROUPS & Groups()
The groups must maintain the folowing invariants.
Definition: class_board.h:267
PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
GROUPS m_groups
Definition: class_board.h:188
std::map< wxString, wxString > m_properties
Definition: class_board.h:199
bool IsHighLightNetON() const
Function IsHighLightNetON.
Definition: class_board.h:400
MARKERS & Markers()
Definition: class_board.h:257
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: class_board.h:553
LAYER_T m_type
The type of the layer.
Definition: class_board.h:104
NETINFO_LIST::iterator EndNets() const
Function EndNets.
Definition: class_board.h:737
PROJECT * GetProject() const
Definition: class_board.h:362
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
void HighLightOFF()
Function HighLightOFF Disable net highlight.
Definition: class_board.h:414
LAYER()
Definition: class_board.h:79
#define DECL_DEQ_FOR_SWIG(TypeName, MemberType)
Definition: macros.h:191
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:537
const NETINFO_LIST & GetNetInfo() const
Definition: class_board.h:713
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem)
Definition: class_board.h:163
HIGH_LIGHT_INFO m_highLight
Definition: class_board.h:194
NETINFO_LIST m_NetInfo
Definition: class_board.h:219
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:195
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:449
TRACKS m_tracks
Definition: class_board.h:187
const wxString & GetFileName() const
Definition: class_board.h:244
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:160
PCB_PLOT_PARAMS m_plotOptions
Definition: class_board.h:204
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:728
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
const std::map< wxString, wxString > & GetProperties() const
Definition: class_board.h:271
Definition: common.h:68
PCB_LAYER_ID
A quick note on layer IDs:
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:886
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:194
#define NULL
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:747
MODULES & Modules()
Definition: class_board.h:249
NETINFO_LIST is a container class for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:422
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:549
LAYER_T
Enum LAYER_T gives the allowed types of layers, same as Specctra DSN spec.
Definition: class_board.h:63
virtual void OnBoardNetSettingsChanged(BOARD &aBoard)
Definition: class_board.h:162
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:345
TITLE_BLOCK m_titles
Definition: class_board.h:203
MODULE * GetFirstModule() const
Gets the first module in the list (used in footprint viewer/editor) or NULL if none.
Definition: class_board.h:310
Helper for storing and iterating over GAL_LAYER_IDs.
bool m_visible
Definition: class_board.h:105
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)
Declare a std::vector but no swig template.
Definition: macros.h:190
wxString LayerName(int aLayer)
Returns the string equivalent of a given layer.
Definition: layer_id.cpp:24
const ZONE_CONTAINERS & Zones() const
Definition: class_board.h:255
ENDPOINT_T
Definition: class_track.h:60
MARKERS m_markers
Definition: class_board.h:184
void SetFileName(const wxString &aFileName)
Definition: class_board.h:242
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: class_board.h:556
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:217
static LAYER_T ParseType(const char *aType)
Function ParseType converts a string to a LAYER_T.
const MODULES & Modules() const
Definition: class_board.h:250
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:718
DRAWINGS m_drawings
Definition: class_board.h:185
int GetFileFormatVersionAtLoad() const
Definition: class_board.h:300
COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:80
ZONE_CONTAINERS m_zones
Definition: class_board.h:189
const std::set< int > & GetHighLightNetCodes() const
Function GetHighLightNetCode.
Definition: class_board.h:383
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:67
void clear()
Definition: class_board.h:84
std::set< int > m_netCodes
Definition: class_board.h:133
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
ZONE_CONTAINERS & Zones()
Definition: class_board.h:254
virtual void OnBoardHighlightNetChanged(BOARD &aBoard)
Definition: class_board.h:164
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:558
Board layer functions and definitions.
int m_fileFormatVersionAtLoad
Definition: class_board.h:197
LAYER holds information pertinent to a layer of a BOARD.
Definition: class_board.h:77
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
std::shared_ptr< CONNECTIVITY_DATA > m_connectivity
Definition: class_board.h:200
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:547
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:842
const TRACKS & Tracks() const
Definition: class_board.h:247
unsigned GetNetCount() const
Function GetNetCount.
Definition: netinfo.h:449
void DeleteAllModules()
Removes all modules from the deque and frees the memory associated with them.
Definition: class_board.h:318
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:46
virtual ~BOARD_LISTENER()
Definition: class_board.h:159
ZONE_SETTINGS & GetDefaultZoneSettings()
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:874
Abstract interface for BOARD_ITEMs capable of storing other items inside.
int m_number
Definition: class_board.h:106
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
bool IsElementVisible(GAL_LAYER_ID aElement) const
Function IsElementVisible tests whether a given element category is visible.
SEARCH_RESULT
Definition: base_struct.h:51
DRAWINGS & Drawings()
Definition: class_board.h:252
bool IsEmpty() const
Definition: class_board.h:292
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: class_board.h:277
std::vector< BOARD_LISTENER * > m_listeners
Definition: class_board.h:221
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: class_board.h:246
void buildListOfNets()
Function buildListOfNets builds or rebuilds the list of NETINFO_ITEMs The list is sorted by names.
Class to handle a set of BOARD_ITEMs.
PROJECT * m_project
Definition: class_board.h:205
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:628
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
GAL_SET m_LegacyVisibleItems
Definition: class_board.h:278