KiCad PCB EDA Suite
board_project_settings.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) 2020 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef KICAD_BOARD_PROJECT_SETTINGS_H
22 #define KICAD_BOARD_PROJECT_SETTINGS_H
23 
25 
37 {
38  bool lockedItems;
39  bool footprints;
40  bool text;
41  bool tracks;
42  bool vias;
43  bool pads;
44  bool graphics;
45  bool zones;
46  bool keepouts;
47  bool dimensions;
48  bool otherItems;
49 
51  {
52  lockedItems = true;
53  footprints = true;
54  text = true;
55  tracks = true;
56  vias = true;
57  pads = true;
58  graphics = true;
59  zones = true;
60  keepouts = true;
61  dimensions = true;
62  otherItems = true;
63  }
64 
65  bool Any()
66  {
67  return ( lockedItems || footprints || text || tracks || vias || pads || graphics || zones
68  || keepouts || dimensions || otherItems );
69  }
70 
71  bool All()
72  {
73  return ( lockedItems && footprints && text && tracks && vias && pads && graphics && zones
74  && keepouts && dimensions && otherItems );
75  }
76 };
77 
82 {
83  NORMAL = 0,
84  DIMMED,
85  HIDDEN
86 };
87 
90 {
91  SHOW_FILLED,
92  HIDE_FILLED,
94 };
95 
97 enum class NET_COLOR_MODE
98 {
99  OFF,
100  RATSNEST,
101  ALL
102 };
103 
105 enum class RATSNEST_MODE
106 {
107  ALL,
108  VISIBLE
109 };
110 
115 {
116  wxString name;
120  bool readOnly;
121 
122  LAYER_PRESET( const wxString& aName = wxEmptyString ) :
123  name( aName ),
125  {
128  readOnly = false;
129  }
130 
131  LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers ) :
132  name( aName ),
133  layers( aVisibleLayers ),
135  {
137  readOnly = false;
138  }
139 
140  LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers, const GAL_SET& aVisibleObjects,
141  PCB_LAYER_ID aActiveLayer ) :
142  name( aName ),
143  layers( aVisibleLayers ),
144  renderLayers( aVisibleObjects ),
145  activeLayer( aActiveLayer )
146  {
147  readOnly = false;
148  }
149 
150  bool LayersMatch( const LAYER_PRESET& aOther )
151  {
152  return aOther.layers == layers && aOther.renderLayers == renderLayers;
153  }
154 };
155 
156 #endif // KICAD_BOARD_PROJECT_SETTINGS_H
A saved set of layers that are visible.
Filled polygons are shown.
LAYER_PRESET(const wxString &aName, const LSET &aVisibleLayers)
bool otherItems
Anything not fitting one of the above categories.
Ratsnest lines are drawn to items on visible layers only.
ZONE_DISPLAY_MODE
Determines how zones should be displayed
Net/netclass colors are shown on all net copper.
Net/netclass colors are shown on ratsnest lines only.
LAYER_PRESET(const wxString &aName=wxEmptyString)
GAL_SET renderLayers
Render layers (e.g. object types) that are visible.
PCB_LAYER_ID activeLayer
Optional layer to set active when this preset is loaded.
Ratsnest lines are drawn to items on all layers (default)
Only the zone outline is shown.
wxString name
A name for this layer set.
bool LayersMatch(const LAYER_PRESET &aOther)
Non-active layers are shown normally (no high-contrast mode)
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
bool text
Text (free or attached to a footprint)
bool readOnly
True if this is a read-only (built-in) preset.
bool dimensions
Dimension items.
bool graphics
Graphic lines, shapes, polygons.
HIGH_CONTRAST_MODE
Determines how inactive layers should be displayed.
Helper for storing and iterating over GAL_LAYER_IDs.
static GAL_SET DefaultVisible()
Definition: lset.cpp:884
static LSET AllLayersMask()
Definition: lset.cpp:756
This file contains data structures that are saved in the project file or project local settings file ...
LSET layers
Board layers that are visible.
NET_COLOR_MODE
Determines how net color overrides should be applied
bool footprints
Allow selecting entire footprints.
bool lockedItems
Allow selecting locked items.
Board layer functions and definitions.
Net (and netclass) colors are not shown.
LAYER_PRESET(const wxString &aName, const LSET &aVisibleLayers, const GAL_SET &aVisibleObjects, PCB_LAYER_ID aActiveLayer)
Non-active layers are dimmed (old high-contrast mode)
RATSNEST_MODE
Determines how ratsnest lines are drawn
Outlines of filled polygons are shown.