KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcad_pcb_component.cpp
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, 2008 Lubo Racko <
[email protected]
>
5
* Copyright (C) 2007, 2008, 2012-2013 Alexander Lunev <
[email protected]
>
6
* Copyright (C) 2012-2023 KiCad Developers, see AUTHORS.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
#include <
pcad/pcad_pcb_component.h
>
27
28
#include <
board.h
>
29
#include <
common.h
>
30
#include <
footprint.h
>
31
32
#include <wx/string.h>
33
34
35
namespace
PCAD2KICAD
{
36
37
PCAD_PCB_COMPONENT::PCAD_PCB_COMPONENT
(
PCAD_CALLBACKS
* aCallbacks,
BOARD
* aBoard ) :
38
m_Uuid(),
39
m_callbacks( aCallbacks ),
40
m_board( aBoard )
41
{
42
m_ObjType
= wxT(
'?'
);
43
m_PCadLayer
= 0;
44
m_KiCadLayer
=
F_Cu
;
// It *has* to be somewhere...
45
m_PositionX
= 0;
46
m_PositionY
= 0;
47
m_Rotation
=
ANGLE_0
;
48
InitTTextValue
( &
m_Name
);
49
m_Net
= wxEmptyString;
50
m_NetCode
= 0;
51
m_CompRef
= wxEmptyString;
52
m_PatGraphRefName
= wxEmptyString;
53
}
54
55
56
PCAD_PCB_COMPONENT::~PCAD_PCB_COMPONENT
()
57
{
58
}
59
60
61
void
PCAD_PCB_COMPONENT::SetPosOffset
(
int
aX_offs,
int
aY_offs )
62
{
63
m_PositionX
+= aX_offs;
64
m_PositionY
+= aY_offs;
65
}
66
67
void
PCAD_PCB_COMPONENT::Flip
()
68
{
69
m_PositionX
= -
m_PositionX
;
70
}
71
72
}
// namespace PCAD2KICAD
board.h
BOARD
Information pertinent to a Pcbnew printed circuit board.
Definition:
board.h:290
PCAD2KICAD::PCAD_CALLBACKS
Definition:
pcad_callbacks.h:50
PCAD2KICAD::PCAD_PCB_COMPONENT::SetPosOffset
virtual void SetPosOffset(int aX_offs, int aY_offs)
Definition:
pcad_pcb_component.cpp:61
PCAD2KICAD::PCAD_PCB_COMPONENT::m_NetCode
int m_NetCode
Definition:
pcad_pcb_component.h:72
PCAD2KICAD::PCAD_PCB_COMPONENT::m_ObjType
char m_ObjType
Definition:
pcad_pcb_component.h:63
PCAD2KICAD::PCAD_PCB_COMPONENT::Flip
virtual void Flip()
Definition:
pcad_pcb_component.cpp:67
PCAD2KICAD::PCAD_PCB_COMPONENT::m_PositionY
int m_PositionY
Definition:
pcad_pcb_component.h:68
PCAD2KICAD::PCAD_PCB_COMPONENT::m_PCadLayer
int m_PCadLayer
Definition:
pcad_pcb_component.h:64
PCAD2KICAD::PCAD_PCB_COMPONENT::m_PatGraphRefName
wxString m_PatGraphRefName
Definition:
pcad_pcb_component.h:74
PCAD2KICAD::PCAD_PCB_COMPONENT::~PCAD_PCB_COMPONENT
~PCAD_PCB_COMPONENT()
Definition:
pcad_pcb_component.cpp:56
PCAD2KICAD::PCAD_PCB_COMPONENT::m_PositionX
int m_PositionX
Definition:
pcad_pcb_component.h:67
PCAD2KICAD::PCAD_PCB_COMPONENT::m_Name
TTEXTVALUE m_Name
Definition:
pcad_pcb_component.h:70
PCAD2KICAD::PCAD_PCB_COMPONENT::m_Net
wxString m_Net
Definition:
pcad_pcb_component.h:71
PCAD2KICAD::PCAD_PCB_COMPONENT::m_CompRef
wxString m_CompRef
Definition:
pcad_pcb_component.h:73
PCAD2KICAD::PCAD_PCB_COMPONENT::PCAD_PCB_COMPONENT
PCAD_PCB_COMPONENT(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
Definition:
pcad_pcb_component.cpp:37
PCAD2KICAD::PCAD_PCB_COMPONENT::m_KiCadLayer
PCB_LAYER_ID m_KiCadLayer
Definition:
pcad_pcb_component.h:65
PCAD2KICAD::PCAD_PCB_COMPONENT::m_Rotation
EDA_ANGLE m_Rotation
Definition:
pcad_pcb_component.h:69
common.h
The common library.
ANGLE_0
static constexpr EDA_ANGLE ANGLE_0
Definition:
eda_angle.h:401
footprint.h
F_Cu
@ F_Cu
Definition:
layer_ids.h:64
PCAD2KICAD
Definition:
pcad2kicad_common.cpp:39
PCAD2KICAD::InitTTextValue
void InitTTextValue(TTEXTVALUE *aTextValue)
Definition:
pcad2kicad_common.cpp:591
pcad_pcb_component.h
src
pcbnew
pcb_io
pcad
pcad_pcb_component.cpp
Generated on Sun Nov 24 2024 00:04:55 for KiCad PCB EDA Suite by
1.9.6