KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcad_pcb_component.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) 2007, 2008 Lubo Racko <[email protected]>
5 * Copyright (C) 2007, 2008, 2012-2013 Alexander Lunev <[email protected]>
6 * Copyright The 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef PCB_COMPONENT_H_
23#define PCB_COMPONENT_H_
24
27#include <pcad/pcad_callbacks.h>
28
29#include <kiid.h>
30#include <layer_ids.h>
31#include <wx/object.h>
32
33class BOARD;
34class FOOTPRINT;
35class wxString;
36class wxRealPoint;
37
38namespace PCAD2KICAD {
39
40// basic parent class for PCB objects
41class PCAD_PCB_COMPONENT : public wxObject
42{
43public:
44 PCAD_PCB_COMPONENT( PCAD_CALLBACKS* aCallbacks, BOARD* aBoard );
46
47 virtual void SetPosOffset( int aX_offs, int aY_offs );
48 virtual void Flip();
49 virtual void AddToBoard( FOOTPRINT* aFootprint = nullptr ) = 0;
50
51 PCB_LAYER_ID GetKiCadLayer() const { return m_callbacks->GetKiCadLayer( m_PCadLayer ); }
52
53 int GetNetCode( const wxString& aNetName ) const
54 {
55 return m_callbacks->GetNetCode( aNetName );
56 }
57
58public:
66 TTEXTVALUE m_Name; // name has also private positions, rotations and so on....
67 wxString m_Net;
69 wxString m_CompRef; // internal usage for XL parsing
70 wxString m_PatGraphRefName; // internal usage for XL parsing
71
72protected:
75};
76
77} // namespace PCAD2KICAD
78
79#endif // PCB_COMPONENT_H_
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
Definition kiid.h:44
virtual void SetPosOffset(int aX_offs, int aY_offs)
virtual void AddToBoard(FOOTPRINT *aFootprint=nullptr)=0
int GetNetCode(const wxString &aNetName) const
PCAD_PCB_COMPONENT(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56