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.
31{
38 enum class SIDE
39 {
44 };
45
46 bool smd;
47 bool hole;
48 bool is_via;
50 std::string refdes;
54
55 // All these in PCB units, will be output in decimils
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
72class BOARD;
73class PCB_IO_ODBPP;
74struct ODB_FORMAT;
76{
77public:
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
84private:
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};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
BOARD * m_board
Definition odb_netlist.h:85
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.
PCB_IO_ODBPP * m_plugin
Definition odb_netlist.h:86
ODB_NET_LIST(BOARD *aBoard, PCB_IO_ODBPP *aPlugin)
Definition odb_netlist.h:78
void Write(std::ostream &aStream, const ODB_FORMAT &aFormat)
virtual ~ODB_NET_LIST()
Definition odb_netlist.h:80
void InitNetPoints(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords)
std::string epoint
Definition odb_netlist.h:63
SIDE
Possible values for the "side" of an ODB net point.
Definition odb_netlist.h:39
@ DOWN
D (i.e. bottom)
Definition odb_netlist.h:41
std::string refdes
Definition odb_netlist.h:50