KiCad PCB EDA Suite
Loading...
Searching...
No Matches
odb_netlist.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 The KiCad Developers, see AUTHORS.txt for contributors.
5
* Author: SYSUEric <
[email protected]
>.
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
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
*/
20
21
#pragma once
22
23
#include <map>
24
#include <ostream>
25
#include <string>
26
#include <vector>
27
28
29
// Structure for holding the ODB net point record.
30
struct
ODB_NET_RECORD
31
{
38
enum class
SIDE
39
{
40
TOP
,
41
DOWN
,
42
BOTH
,
43
INNER
,
44
};
45
46
bool
smd
;
47
bool
hole
;
48
bool
is_via
;
49
bool
testpoint
;
50
std::string
refdes
;
51
int
drill_radius
;
52
bool
mechanical
;
53
SIDE
side
;
54
55
// All these in PCB units, will be output in decimils
56
int
x_location
;
57
int
y_location
;
58
// Width and height of non-drilled pads (only when radius = 0).
59
int
x_size
;
// Width
60
int
y_size
;
// Height
61
// int rotation;
62
63
std::string
epoint
;
// e: net end point, m: net mid point
64
65
int
soldermask
;
// !< e — Solder mask exposed point. soldermask = 0
66
// !< c — Solder mask covered point. = 3
67
// !< p — Solder mask covered point on top side of product model. = 1
68
// !< s — Solder mask covered point on bottom side of product model. = 2
69
};
70
71
72
class
BOARD
;
73
class
PCB_IO_ODBPP
;
74
struct
ODB_FORMAT
;
75
class
ODB_NET_LIST
76
{
77
public
:
78
ODB_NET_LIST
(
BOARD
* aBoard,
PCB_IO_ODBPP
* aPlugin ) :
m_board
( aBoard ),
m_plugin
( aPlugin ) {}
79
80
virtual
~ODB_NET_LIST
() {}
81
82
void
Write
( std::ostream& aStream,
const
ODB_FORMAT
& aFormat );
83
84
private
:
85
BOARD
*
m_board
;
86
PCB_IO_ODBPP
*
m_plugin
;
87
88
void
InitNetPoints
( std::map<
size_t
, std::vector<ODB_NET_RECORD>>& aRecords );
90
void
WriteNetPointRecords
( std::map<
size_t
, std::vector<ODB_NET_RECORD>>& aRecords,
91
std::ostream& aStream,
92
const
ODB_FORMAT
& aFormat );
93
};
BOARD
Information pertinent to a Pcbnew printed circuit board.
Definition
board.h:411
ODB_NET_LIST::m_board
BOARD * m_board
Definition
odb_netlist.h:85
ODB_NET_LIST::WriteNetPointRecords
void WriteNetPointRecords(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords, std::ostream &aStream, const ODB_FORMAT &aFormat)
Writes a list of records to the given output stream.
Definition
odb_netlist.cpp:148
ODB_NET_LIST::m_plugin
PCB_IO_ODBPP * m_plugin
Definition
odb_netlist.h:86
ODB_NET_LIST::ODB_NET_LIST
ODB_NET_LIST(BOARD *aBoard, PCB_IO_ODBPP *aPlugin)
Definition
odb_netlist.h:78
ODB_NET_LIST::Write
void Write(std::ostream &aStream, const ODB_FORMAT &aFormat)
Definition
odb_netlist.cpp:209
ODB_NET_LIST::~ODB_NET_LIST
virtual ~ODB_NET_LIST()
Definition
odb_netlist.h:80
ODB_NET_LIST::InitNetPoints
void InitNetPoints(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords)
Definition
odb_netlist.cpp:59
PCB_IO_ODBPP
Definition
pcb_io_odbpp.h:56
ODB_FORMAT
Definition
odb_util.h:66
ODB_NET_RECORD
Definition
odb_netlist.h:31
ODB_NET_RECORD::testpoint
bool testpoint
Definition
odb_netlist.h:49
ODB_NET_RECORD::y_location
int y_location
Definition
odb_netlist.h:57
ODB_NET_RECORD::side
SIDE side
Definition
odb_netlist.h:53
ODB_NET_RECORD::is_via
bool is_via
Definition
odb_netlist.h:48
ODB_NET_RECORD::soldermask
int soldermask
Definition
odb_netlist.h:65
ODB_NET_RECORD::x_size
int x_size
Definition
odb_netlist.h:59
ODB_NET_RECORD::y_size
int y_size
Definition
odb_netlist.h:60
ODB_NET_RECORD::epoint
std::string epoint
Definition
odb_netlist.h:63
ODB_NET_RECORD::hole
bool hole
Definition
odb_netlist.h:47
ODB_NET_RECORD::x_location
int x_location
Definition
odb_netlist.h:56
ODB_NET_RECORD::SIDE
SIDE
Possible values for the "side" of an ODB net point.
Definition
odb_netlist.h:39
ODB_NET_RECORD::SIDE::BOTH
@ BOTH
B.
Definition
odb_netlist.h:42
ODB_NET_RECORD::SIDE::TOP
@ TOP
T.
Definition
odb_netlist.h:40
ODB_NET_RECORD::SIDE::INNER
@ INNER
I.
Definition
odb_netlist.h:43
ODB_NET_RECORD::SIDE::DOWN
@ DOWN
D (i.e. bottom)
Definition
odb_netlist.h:41
ODB_NET_RECORD::drill_radius
int drill_radius
Definition
odb_netlist.h:51
ODB_NET_RECORD::mechanical
bool mechanical
Definition
odb_netlist.h:52
ODB_NET_RECORD::smd
bool smd
Definition
odb_netlist.h:46
ODB_NET_RECORD::refdes
std::string refdes
Definition
odb_netlist.h:50
src
pcbnew
pcb_io
odbpp
odb_netlist.h
Generated on Tue Oct 27 2026 00:06:34 for KiCad PCB EDA Suite by
1.13.2