|
KiCad PCB EDA Suite
|
One open footprint tab owning its fp-holder board, lent to the frame by raw pointer while active. More...
#include <footprint_editor_tab_context.h>
Public Member Functions | |
| FOOTPRINT_EDITOR_TAB_CONTEXT (const wxString &aLib, const wxString &aName, std::unique_ptr< BOARD > aBoard) | |
| FOOTPRINT_EDITOR_TAB_CONTEXT (const KIID &aSourceUuid, const wxString &aReference, std::unique_ptr< BOARD > aBoard) | |
| Construct an instance (board) tab over an fp-holder board carrying a clone of a placed footprint. | |
| ~FOOTPRINT_EDITOR_TAB_CONTEXT () override | |
| wxString | GetTabKey () const override |
| Stable identity for persistence and de-duplication. | |
| wxString | GetDisplayName () const override |
| Short label shown on the tab. | |
| bool | IsTransient () const |
| True for an instance (board) tab, which is session-only and never persisted. | |
| bool | IsFromBoard () const |
| const KIID & | GetSourceUuid () const |
| const wxString & | GetReference () const |
| std::map< KIID, KIID > & | BoardFootprintUuids () |
| Editor-to-board UUID remap captured at load, used by SaveFootprintToBoard to restore the original board item identities. | |
| bool | IsModified () const override |
| True only when dirty and the board actually holds a footprint to edit. | |
| void | SetModified (bool aModified) |
| BOARD * | GetBoard () const |
| The fp-holder board owned by this context. | |
| const wxString & | GetLib () const |
| const wxString & | GetName () const |
| void | SetName (const wxString &aName) |
| FOOTPRINT * | GetOriginalFootprintCopy () const |
| Baseline clone captured at load, used to detect edits and to revert. | |
| void | SetOriginalFootprintCopy (std::unique_ptr< FOOTPRINT > aCopy) |
| const wxString & | GetFootprintNameWhenLoaded () const |
| void | SetFootprintNameWhenLoaded (const wxString &aName) |
| bool | IsPreview () const |
| void | SetPreview (bool aPreview) |
| UNDO_REDO_CONTAINER & | UndoList () |
| UNDO_REDO_CONTAINER & | RedoList () |
| VIEW_SNAPSHOT & | ViewSnapshot () |
| std::vector< KIID > & | SavedSelection () |
| Selection saved as resolved KIIDs, restored after the view is rebuilt. | |
Static Public Member Functions | |
| static wxString | MakeInstanceTabKey (const KIID &aSourceUuid) |
| De-duplication key for a placed board footprint, in a namespace disjoint from library keys. | |
Protected Attributes | |
| bool | m_preview = false |
| std::unique_ptr< UNDO_REDO_CONTAINER > | m_undo |
| std::unique_ptr< UNDO_REDO_CONTAINER > | m_redo |
| VIEW_SNAPSHOT | m_viewSnapshot |
| std::vector< KIID > | m_savedSelection |
Private Attributes | |
| wxString | m_lib |
| wxString | m_name |
| std::unique_ptr< BOARD > | m_board |
| std::unique_ptr< FOOTPRINT > | m_originalFootprintCopy |
| wxString | m_footprintNameWhenLoaded |
| bool | m_modified = false |
| True for an instance tab edited in place from a placed board footprint. | |
| bool | m_fromBoard = false |
| Source board footprint UUID, used as the de-dup key and save-back target. | |
| KIID | m_sourceUuid |
| Reference designator of the source footprint, shown as the tab label. | |
| wxString | m_reference |
| Editor-to-board UUID remap used to save instance edits back to the original board items. | |
| std::map< KIID, KIID > | m_boardFootprintUuids |
One open footprint tab owning its fp-holder board, lent to the frame by raw pointer while active.
A tab is one of two kinds. A library tab edits a library footprint, is keyed by its library:name pair and persisted across sessions. An instance tab edits a footprint pulled from a placed board footprint (Ctrl-E); it is keyed by the source board footprint UUID, carries the board-uuid remap used to save the edits back to that instance, and is session-only so it is never persisted.
Definition at line 43 of file footprint_editor_tab_context.h.
| FOOTPRINT_EDITOR_TAB_CONTEXT::FOOTPRINT_EDITOR_TAB_CONTEXT | ( | const wxString & | aLib, |
| const wxString & | aName, | ||
| std::unique_ptr< BOARD > | aBoard ) |
Definition at line 26 of file footprint_editor_tab_context.cpp.
References m_board, m_footprintNameWhenLoaded, m_lib, m_name, and move.
| FOOTPRINT_EDITOR_TAB_CONTEXT::FOOTPRINT_EDITOR_TAB_CONTEXT | ( | const KIID & | aSourceUuid, |
| const wxString & | aReference, | ||
| std::unique_ptr< BOARD > | aBoard ) |
Construct an instance (board) tab over an fp-holder board carrying a clone of a placed footprint.
| aSourceUuid | is the source board footprint's UUID, used as the de-dup key and tab label. |
| aReference | is the placed footprint reference shown on the tab. |
Definition at line 37 of file footprint_editor_tab_context.cpp.
References m_board, m_fromBoard, m_reference, m_sourceUuid, and move.
|
overridedefault |
Editor-to-board UUID remap captured at load, used by SaveFootprintToBoard to restore the original board item identities.
Empty for a library tab.
Definition at line 92 of file footprint_editor_tab_context.h.
References m_boardFootprintUuids.
Referenced by BOOST_AUTO_TEST_CASE(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inline |
The fp-holder board owned by this context.
The frame borrows this pointer when active.
Definition at line 104 of file footprint_editor_tab_context.h.
References m_board.
Referenced by FOOTPRINT_EDIT_FRAME::activateFootprintTab(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), and FOOTPRINT_EDIT_FRAME::promptAndCloseFootprintTab().
|
inlineoverridevirtual |
Short label shown on the tab.
Implements EDITOR_TAB_CONTEXT.
Definition at line 77 of file footprint_editor_tab_context.h.
References m_fromBoard, m_name, and m_reference.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and FOOTPRINT_EDIT_FRAME::promptAndCloseFootprintTab().
|
inline |
Definition at line 116 of file footprint_editor_tab_context.h.
References m_footprintNameWhenLoaded.
Referenced by FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inline |
Definition at line 106 of file footprint_editor_tab_context.h.
References m_lib.
|
inline |
Definition at line 107 of file footprint_editor_tab_context.h.
References m_name.
|
inline |
Baseline clone captured at load, used to detect edits and to revert.
Definition at line 113 of file footprint_editor_tab_context.h.
References m_originalFootprintCopy.
Referenced by FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inline |
Definition at line 86 of file footprint_editor_tab_context.h.
References m_reference.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 85 of file footprint_editor_tab_context.h.
References m_sourceUuid.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineoverridevirtual |
Stable identity for persistence and de-duplication.
Implements EDITOR_TAB_CONTEXT.
Definition at line 72 of file footprint_editor_tab_context.h.
References m_fromBoard, m_lib, m_name, m_sourceUuid, and MakeInstanceTabKey().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 84 of file footprint_editor_tab_context.h.
References m_fromBoard.
Referenced by BOOST_AUTO_TEST_CASE().
|
overridevirtual |
True only when dirty and the board actually holds a footprint to edit.
Implements EDITOR_TAB_CONTEXT.
Definition at line 51 of file footprint_editor_tab_context.cpp.
References m_board, and m_modified.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME(), FOOTPRINT_EDIT_FRAME::installFootprintTabBoard(), and FOOTPRINT_EDIT_FRAME::promptAndCloseFootprintTab().
|
inlineinherited |
Definition at line 58 of file editor_tab_context.h.
References m_preview.
|
inline |
True for an instance (board) tab, which is session-only and never persisted.
Definition at line 82 of file footprint_editor_tab_context.h.
References m_fromBoard.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlinestatic |
De-duplication key for a placed board footprint, in a namespace disjoint from library keys.
The leading control character cannot appear in a library nickname, so an instance key can never collide with a library:name key.
Definition at line 67 of file footprint_editor_tab_context.h.
References KIID::AsString().
Referenced by BOOST_AUTO_TEST_CASE(), FOOTPRINT_EDIT_FRAME::findOrCreateFootprintInstanceTab(), GetTabKey(), and FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard().
|
inlineinherited |
Definition at line 62 of file editor_tab_context.h.
References m_redo.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), SYMBOL_EDIT_FRAME::clearSymbolTabUndoRedo(), FOOTPRINT_EDIT_FRAME::freeFootprintTabUndoRedo(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inlineinherited |
Selection saved as resolved KIIDs, restored after the view is rebuilt.
Definition at line 77 of file editor_tab_context.h.
References m_savedSelection.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inline |
Definition at line 117 of file footprint_editor_tab_context.h.
References m_footprintNameWhenLoaded.
|
inline |
Definition at line 99 of file footprint_editor_tab_context.h.
References m_modified.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and FOOTPRINT_EDIT_FRAME::promptAndCloseFootprintTab().
|
inline |
Definition at line 108 of file footprint_editor_tab_context.h.
References m_name.
| void FOOTPRINT_EDITOR_TAB_CONTEXT::SetOriginalFootprintCopy | ( | std::unique_ptr< FOOTPRINT > | aCopy | ) |
Definition at line 57 of file footprint_editor_tab_context.cpp.
References m_originalFootprintCopy.
|
inlineinherited |
Definition at line 59 of file editor_tab_context.h.
References m_preview.
|
inlineinherited |
Definition at line 61 of file editor_tab_context.h.
References m_undo.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), SYMBOL_EDIT_FRAME::clearSymbolTabUndoRedo(), FOOTPRINT_EDIT_FRAME::freeFootprintTabUndoRedo(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inlineinherited |
Definition at line 72 of file editor_tab_context.h.
References m_viewSnapshot.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
private |
Definition at line 122 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), FOOTPRINT_EDITOR_TAB_CONTEXT(), GetBoard(), and IsModified().
Definition at line 137 of file footprint_editor_tab_context.h.
Referenced by BoardFootprintUuids().
|
private |
Definition at line 124 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), GetFootprintNameWhenLoaded(), and SetFootprintNameWhenLoaded().
|
private |
Source board footprint UUID, used as the de-dup key and save-back target.
Definition at line 128 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), GetDisplayName(), GetTabKey(), IsFromBoard(), and IsTransient().
|
private |
Definition at line 120 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), GetLib(), and GetTabKey().
|
private |
True for an instance tab edited in place from a placed board footprint.
Definition at line 125 of file footprint_editor_tab_context.h.
Referenced by IsModified(), and SetModified().
|
private |
Definition at line 121 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), GetDisplayName(), GetName(), GetTabKey(), and SetName().
|
private |
Definition at line 123 of file footprint_editor_tab_context.h.
Referenced by GetOriginalFootprintCopy(), and SetOriginalFootprintCopy().
|
protectedinherited |
Definition at line 80 of file editor_tab_context.h.
Referenced by IsPreview(), and SetPreview().
|
protectedinherited |
Definition at line 82 of file editor_tab_context.h.
Referenced by EDITOR_TAB_CONTEXT(), and RedoList().
|
private |
Editor-to-board UUID remap used to save instance edits back to the original board items.
Definition at line 134 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), GetDisplayName(), and GetReference().
|
protectedinherited |
Definition at line 84 of file editor_tab_context.h.
Referenced by SavedSelection().
|
private |
Reference designator of the source footprint, shown as the tab label.
Definition at line 131 of file footprint_editor_tab_context.h.
Referenced by FOOTPRINT_EDITOR_TAB_CONTEXT(), GetSourceUuid(), and GetTabKey().
|
protectedinherited |
Definition at line 81 of file editor_tab_context.h.
Referenced by EDITOR_TAB_CONTEXT(), and UndoList().
|
protectedinherited |
Definition at line 83 of file editor_tab_context.h.
Referenced by ViewSnapshot().