KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_editor_tab_context.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
21
22#include <board.h>
23#include <footprint.h>
24
25
27 const wxString& aName,
28 std::unique_ptr<BOARD> aBoard ) :
29 m_lib( aLib ),
30 m_name( aName ),
31 m_board( std::move( aBoard ) ),
33{
34}
35
36
38 const wxString& aReference,
39 std::unique_ptr<BOARD> aBoard ) :
40 m_board( std::move( aBoard ) ),
41 m_fromBoard( true ),
42 m_sourceUuid( aSourceUuid ),
43 m_reference( aReference )
44{
45}
46
47
49
50
52{
53 return m_modified && m_board && m_board->GetFirstFootprint();
54}
55
56
57void FOOTPRINT_EDITOR_TAB_CONTEXT::SetOriginalFootprintCopy( std::unique_ptr<FOOTPRINT> aCopy )
58{
59 m_originalFootprintCopy = std::move( aCopy );
60}
KIID m_sourceUuid
Reference designator of the source footprint, shown as the tab label.
std::unique_ptr< FOOTPRINT > m_originalFootprintCopy
~FOOTPRINT_EDITOR_TAB_CONTEXT() override
bool m_modified
True for an instance tab edited in place from a placed board footprint.
void SetOriginalFootprintCopy(std::unique_ptr< FOOTPRINT > aCopy)
bool IsModified() const override
True only when dirty and the board actually holds a footprint to edit.
FOOTPRINT_EDITOR_TAB_CONTEXT(const wxString &aLib, const wxString &aName, std::unique_ptr< BOARD > aBoard)
bool m_fromBoard
Source board footprint UUID, used as the de-dup key and save-back target.
wxString m_reference
Editor-to-board UUID remap used to save instance edits back to the original board items.
Definition kiid.h:44
STL namespace.