49 int changeType = aChangeType &
CHT_TYPE;
52 if( undoItem != aItem )
57 wxASSERT( ( flags &
CHT_DONE ) == 0 );
103 Stage( item, aChangeType, aScreen);
111 for(
unsigned int i = 0; i < aItems.
GetCount(); i++ )
117 change_type = aModFlag;
159 wxFAIL_MSG(
"We've no way to get a copy of the undo level item at this point" );
171 return entry ? entry->
m_type : 0;
192 default: wxFAIL;
break;
203 if( entry.m_item == aItem && entry.m_screen == aScreen )
Handles how to draw a screen (a board, a schematic ...)
std::set< std::pair< EDA_ITEM *, BASE_SCREEN * > > m_deletedItems
virtual EDA_ITEM * undoLevelItem(EDA_ITEM *aItem) const =0
void Unstage(EDA_ITEM *aItem, BASE_SCREEN *aScreen)
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
COMMIT_LINE * findEntry(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Search for an entry describing change for a particular item.
std::set< std::pair< EDA_ITEM *, BASE_SCREEN * > > m_addedItems
virtual void makeEntry(EDA_ITEM *aItem, CHANGE_TYPE aType, EDA_ITEM *aCopy=nullptr, BASE_SCREEN *aScreen=nullptr)
std::vector< COMMIT_LINE > m_entries
std::set< std::pair< EDA_ITEM *, BASE_SCREEN * > > m_changedItems
virtual EDA_ITEM * makeImage(EDA_ITEM *aItem) const =0
CHANGE_TYPE convert(UNDO_REDO aType) const
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Returns status of an item.
virtual COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Add a change of the item aItem of type aChangeType to the change list.
A set of EDA_ITEMs (i.e., without duplicates).
A base class for most all the KiCad significant classes used in schematics and boards.
virtual EDA_GROUP * GetParentGroup() const
virtual wxString GetClass() const =0
Return the class name.
A holder to handle information on schematic or board items.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
unsigned GetCount() const
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
CHANGE_TYPE
Types of changes.
@ CHT_DONE
Flag to indicate the change is already applied.
#define STRUCT_DELETED
flag indication structures to be erased
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
EDA_ITEM * m_copy
Optional copy of the item.
CHANGE_TYPE m_type
Modification type.
EDA_ITEM * m_item
Main item that is added/deleted/modified.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...