KiCad PCB EDA Suite
Loading...
Searching...
No Matches
netclass.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) 2009 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 2009 Jean-Pierre Charras, [email protected]
6 * Copyright (C) 2009-2022 KiCad Developers, see change_log.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef CLASS_NETCLASS_H
27#define CLASS_NETCLASS_H
28
29#include <kicommon.h>
30#include <gal/color4d.h>
31#include <optional>
32#include <macros_swig.h>
33
34using KIGFX::COLOR4D;
35
36
37DECL_SET_FOR_SWIG( STRINGSET, wxString )
38
39
40
44{
45public:
46 static const char Default[];
47
53 NETCLASS( const wxString& aName );
54
55 ~NETCLASS();
56
57 wxString GetClass() const
58 {
59 return wxT( "NETCLASS" );
60 }
61
62 const wxString GetName() const { return m_Name; }
63 void SetName( const wxString& aName ) { m_Name = aName; }
64
65 const wxString& GetDescription() const { return m_Description; }
66 void SetDescription( const wxString& aDesc ) { m_Description = aDesc; }
67
68 bool HasClearance() const { return (bool) m_Clearance; }
69 int GetClearance() const { return m_Clearance.value_or(-1); }
70 void SetClearance( int aClearance ) { m_Clearance = aClearance; }
71
72 bool HasTrackWidth() const { return (bool) m_TrackWidth; }
73 int GetTrackWidth() const { return m_TrackWidth.value_or( -1 ); }
74 void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; }
75
76 bool HasViaDiameter() const { return (bool) m_ViaDia; }
77 int GetViaDiameter() const { return m_ViaDia.value_or( -1 ); }
78 void SetViaDiameter( int aDia ) { m_ViaDia = aDia; }
79
80 int HasViaDrill() const { return (bool) m_ViaDrill; }
81 int GetViaDrill() const { return m_ViaDrill.value_or( -1 ); }
82 void SetViaDrill( int aSize ) { m_ViaDrill = aSize; }
83
84 bool HasuViaDiameter() const { return (bool) m_uViaDia; }
85 int GetuViaDiameter() const { return m_uViaDia.value_or( -1 ); }
86 void SetuViaDiameter( int aSize ) { m_uViaDia = aSize; }
87
88 bool HasuViaDrill() const { return (bool) m_uViaDrill; }
89 int GetuViaDrill() const { return m_uViaDrill.value_or( -1 ); }
90 void SetuViaDrill( int aSize ) { m_uViaDrill = aSize; }
91
92 bool HasDiffPairWidth() const { return (bool) m_diffPairWidth; }
93 int GetDiffPairWidth() const { return m_diffPairWidth.value_or( -1 ); }
94 void SetDiffPairWidth( int aSize ) { m_diffPairWidth = aSize; }
95
96 bool HasDiffPairGap() const { return (bool) m_diffPairGap; }
97 int GetDiffPairGap() const { return m_diffPairGap.value_or( -1 ); }
98 void SetDiffPairGap( int aSize ) { m_diffPairGap = aSize; }
99
100 bool HasDiffPairViaGap() const { return (bool) m_diffPairViaGap; }
101 int GetDiffPairViaGap() const { return m_diffPairViaGap.value_or( -1 ); }
102 void SetDiffPairViaGap( int aSize ) { m_diffPairViaGap = aSize; }
103
104 COLOR4D GetPcbColor() const { return m_PcbColor; }
105 void SetPcbColor( const COLOR4D& aColor ) { m_PcbColor = aColor; }
106
107 int GetWireWidth() const { return m_wireWidth; }
108 void SetWireWidth( int aWidth ) { m_wireWidth = aWidth; }
109
110 int GetBusWidth() const { return m_busWidth; }
111 void SetBusWidth( int aWidth ) { m_busWidth = aWidth; }
112
113 COLOR4D GetSchematicColor() const { return m_schematicColor; }
114 void SetSchematicColor( COLOR4D aColor ) { m_schematicColor = aColor; }
115
116 int GetLineStyle() const { return m_lineStyle; }
117 void SetLineStyle( int aStyle ) { m_lineStyle = aStyle; }
118
119protected:
120 wxString m_Name;
121 wxString m_Description;
122
123
124
125 std::optional<int> m_Clearance;
126
127 std::optional<int> m_TrackWidth;
128 std::optional<int> m_ViaDia;
129 std::optional<int> m_ViaDrill;
130
131 std::optional<int> m_uViaDia;
132 std::optional<int> m_uViaDrill;
133
134 std::optional<int> m_diffPairWidth;
135 std::optional<int> m_diffPairGap;
136 std::optional<int> m_diffPairViaGap;
137
142
144};
145
146
147
148#endif // CLASS_NETCLASS_H
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
A collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:44
void SetViaDiameter(int aDia)
Definition: netclass.h:78
void SetViaDrill(int aSize)
Definition: netclass.h:82
int GetViaDiameter() const
Definition: netclass.h:77
int GetViaDrill() const
Definition: netclass.h:81
int m_lineStyle
Definition: netclass.h:141
bool HasuViaDrill() const
Definition: netclass.h:88
void SetuViaDiameter(int aSize)
Definition: netclass.h:86
void SetDiffPairWidth(int aSize)
Definition: netclass.h:94
std::optional< int > m_ViaDrill
via drill hole diameter
Definition: netclass.h:129
int HasViaDrill() const
Definition: netclass.h:80
int GetDiffPairViaGap() const
Definition: netclass.h:101
int GetDiffPairGap() const
Definition: netclass.h:97
int GetuViaDrill() const
Definition: netclass.h:89
void SetLineStyle(int aStyle)
Definition: netclass.h:117
bool HasViaDiameter() const
Definition: netclass.h:76
std::optional< int > m_TrackWidth
track width used to route NETs in this NETCLASS
Definition: netclass.h:127
COLOR4D GetSchematicColor() const
Definition: netclass.h:113
int GetLineStyle() const
Definition: netclass.h:116
COLOR4D m_PcbColor
Optional color override for this netclass (PCB context)
Definition: netclass.h:143
void SetSchematicColor(COLOR4D aColor)
Definition: netclass.h:114
std::optional< int > m_diffPairWidth
Definition: netclass.h:134
bool HasDiffPairWidth() const
Definition: netclass.h:92
const wxString GetName() const
Definition: netclass.h:62
COLOR4D m_schematicColor
Definition: netclass.h:140
std::optional< int > m_diffPairViaGap
Definition: netclass.h:136
std::optional< int > m_ViaDia
via diameter
Definition: netclass.h:128
void SetDiffPairViaGap(int aSize)
Definition: netclass.h:102
bool HasuViaDiameter() const
Definition: netclass.h:84
int GetuViaDiameter() const
Definition: netclass.h:85
wxString GetClass() const
Definition: netclass.h:57
bool HasTrackWidth() const
Definition: netclass.h:72
void SetPcbColor(const COLOR4D &aColor)
Definition: netclass.h:105
std::optional< int > m_Clearance
clearance when routing
Definition: netclass.h:125
std::optional< int > m_uViaDia
microvia diameter
Definition: netclass.h:131
int GetDiffPairWidth() const
Definition: netclass.h:93
void SetuViaDrill(int aSize)
Definition: netclass.h:90
int GetWireWidth() const
Definition: netclass.h:107
void SetDiffPairGap(int aSize)
Definition: netclass.h:98
void SetClearance(int aClearance)
Definition: netclass.h:70
bool HasDiffPairGap() const
Definition: netclass.h:96
void SetDescription(const wxString &aDesc)
Definition: netclass.h:66
const wxString & GetDescription() const
Definition: netclass.h:65
std::optional< int > m_uViaDrill
microvia drill hole diameter
Definition: netclass.h:132
int m_wireWidth
Definition: netclass.h:138
void SetBusWidth(int aWidth)
Definition: netclass.h:111
int GetTrackWidth() const
Definition: netclass.h:73
void SetWireWidth(int aWidth)
Definition: netclass.h:108
int GetClearance() const
Definition: netclass.h:69
COLOR4D GetPcbColor() const
Definition: netclass.h:104
void SetName(const wxString &aName)
Definition: netclass.h:63
void SetTrackWidth(int aWidth)
Definition: netclass.h:74
std::optional< int > m_diffPairGap
Definition: netclass.h:135
int m_busWidth
Definition: netclass.h:139
bool HasDiffPairViaGap() const
Definition: netclass.h:100
int GetBusWidth() const
Definition: netclass.h:110
bool HasClearance() const
Definition: netclass.h:68
wxString m_Name
Name of the net class.
Definition: netclass.h:120
wxString m_Description
what this NETCLASS is for.
Definition: netclass.h:121
#define KICOMMON_API
Definition: kicommon.h:28
This file contains macros just for swig binding.
#define DECL_SET_FOR_SWIG(TypeName, MemberType)
Definition: macros_swig.h:54