KiCad PCB EDA Suite
|
A holder to handle information on schematic or board items. More...
#include <undo_redo_container.h>
Public Member Functions | |
PICKED_ITEMS_LIST () | |
~PICKED_ITEMS_LIST () | |
void | PushItem (const ITEM_PICKER &aItem) |
Push aItem to the top of the list. More... | |
ITEM_PICKER | PopItem () |
bool | ContainsItem (const EDA_ITEM *aItem) const |
int | FindItem (const EDA_ITEM *aItem) const |
void | ClearItemsList () |
Delete only the list of pickers NOT the picked data itself. More... | |
void | ClearListAndDeleteItems (std::function< void(EDA_ITEM *)> aItemDeleter) |
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to the type of undo/redo command recorded. More... | |
unsigned | GetCount () const |
void | ReversePickersListOrder () |
Reverse the order of pickers stored in this list. More... | |
ITEM_PICKER | GetItemWrapper (unsigned int aIdx) const |
EDA_ITEM * | GetPickedItem (unsigned int aIdx) const |
BASE_SCREEN * | GetScreenForItem (unsigned int aIdx) const |
EDA_ITEM * | GetPickedItemLink (unsigned int aIdx) const |
UNDO_REDO | GetPickedItemStatus (unsigned int aIdx) const |
EDA_ITEM_FLAGS | GetPickerFlags (unsigned aIdx) const |
Return the value of the picker flag. More... | |
bool | SetPickedItem (EDA_ITEM *aItem, unsigned aIdx) |
bool | SetPickedItem (EDA_ITEM *aItem, UNDO_REDO aStatus, unsigned aIdx) |
bool | SetPickedItemLink (EDA_ITEM *aLink, unsigned aIdx) |
Set the link associated to a given picked item. More... | |
bool | SetPickedItemStatus (UNDO_REDO aStatus, unsigned aIdx) |
Set the type of undo/redo operation for a given picked item. More... | |
bool | SetPickerFlags (EDA_ITEM_FLAGS aFlags, unsigned aIdx) |
Set the flags of the picker (usually to the picked item m_flags value). More... | |
bool | RemovePicker (unsigned aIdx) |
Remove one entry (one picker) from the list of picked items. More... | |
void | CopyList (const PICKED_ITEMS_LIST &aSource) |
Copy all data from aSource to the list. More... | |
wxString | GetDescription () const |
void | SetDescription (const wxString &aDescription) |
Private Attributes | |
wxString | m_description |
std::vector< ITEM_PICKER > | m_ItemsList |
A holder to handle information on schematic or board items.
The information held is a pointer on each item, and the command made.
Definition at line 131 of file undo_redo_container.h.
PICKED_ITEMS_LIST::PICKED_ITEMS_LIST | ( | ) |
Definition at line 57 of file undo_redo_container.cpp.
PICKED_ITEMS_LIST::~PICKED_ITEMS_LIST | ( | ) |
Definition at line 62 of file undo_redo_container.cpp.
void PICKED_ITEMS_LIST::ClearItemsList | ( | ) |
Delete only the list of pickers NOT the picked data itself.
Definition at line 111 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by PCB_EDIT_FRAME::Edit_Zone_Params(), PCB_BASE_FRAME::PlaceFootprint(), and PCB_EDIT_FRAME::RunActionPlugin().
void PICKED_ITEMS_LIST::ClearListAndDeleteItems | ( | std::function< void(EDA_ITEM *)> | aItemDeleter | ) |
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to the type of undo/redo command recorded.
Definition at line 117 of file undo_redo_container.cpp.
References GetCount(), ITEM_PICKER::GetFlags(), ITEM_PICKER::GetItem(), ITEM_PICKER::GetLink(), ITEM_PICKER::GetStatus(), PopItem(), and UR_TRANSIENT.
Referenced by PCB_BASE_EDIT_FRAME::ClearListAndDeleteItems(), SCH_EDIT_FRAME::ClearUndoORRedoList(), SYMBOL_EDIT_FRAME::ClearUndoORRedoList(), and PL_EDITOR_FRAME::ClearUndoORRedoList().
bool PICKED_ITEMS_LIST::ContainsItem | ( | const EDA_ITEM * | aItem | ) | const |
Definition at line 87 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by PCB_EDIT_FRAME::RunActionPlugin().
void PICKED_ITEMS_LIST::CopyList | ( | const PICKED_ITEMS_LIST & | aSource | ) |
Copy all data from aSource to the list.
Items picked are not copied. just pointer in them are copied.
aSource | The list of items to copy to the list. |
Definition at line 271 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::SaveCopyInUndoList().
int PICKED_ITEMS_LIST::FindItem | ( | const EDA_ITEM * | aItem | ) | const |
Definition at line 99 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem().
|
inline |
Definition at line 174 of file undo_redo_container.h.
References m_ItemsList.
Referenced by ClearListAndDeleteItems(), PCB_BASE_FRAME::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RecalculateConnections(), PCB_EDIT_FRAME::RunActionPlugin(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), COMMIT::Stage(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow(), and UpdateCopyOfZonesList().
|
inline |
Definition at line 287 of file undo_redo_container.h.
References m_description.
Referenced by PCB_BASE_EDIT_FRAME::AppendCopyToUndoList(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), and SCH_EDIT_FRAME::SaveCopyInUndoList().
ITEM_PICKER PICKED_ITEMS_LIST::GetItemWrapper | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picker in the picked list if this picker does not exist, a picker is returned, with its members set to 0 or NULL. |
Definition at line 144 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by PCB_EDIT_FRAME::RunActionPlugin(), SCH_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), and UpdateCopyOfZonesList().
EDA_ITEM * PICKED_ITEMS_LIST::GetPickedItem | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picked item in the picked list. |
Definition at line 155 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RecalculateConnections(), PCB_EDIT_FRAME::RunActionPlugin(), SCH_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), COMMIT::Stage(), and UpdateCopyOfZonesList().
EDA_ITEM * PICKED_ITEMS_LIST::GetPickedItemLink | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picked item in the picked list. |
Definition at line 173 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), COMMIT::Stage(), and UpdateCopyOfZonesList().
UNDO_REDO PICKED_ITEMS_LIST::GetPickedItemStatus | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picked item in the picked list. |
Definition at line 182 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), COMMIT::Stage(), and UpdateCopyOfZonesList().
EDA_ITEM_FLAGS PICKED_ITEMS_LIST::GetPickerFlags | ( | unsigned | aIdx | ) | const |
Return the value of the picker flag.
aIdx | Index of the picker in the picked list. |
Definition at line 191 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().
BASE_SCREEN * PICKED_ITEMS_LIST::GetScreenForItem | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picked item in the picked list. |
Definition at line 164 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), and SCH_EDIT_FRAME::RecalculateConnections().
ITEM_PICKER PICKED_ITEMS_LIST::PopItem | ( | ) |
Definition at line 73 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by ClearListAndDeleteItems(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), and PL_EDITOR_FRAME::RollbackFromUndo().
void PICKED_ITEMS_LIST::PushItem | ( | const ITEM_PICKER & | aItem | ) |
Push aItem to the top of the list.
aItem | Picker to push on to the list. |
Definition at line 67 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by BOARD::AddArea(), PCB_TUNING_PATTERN::EditPush(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), GROUP_TOOL::Group(), BOARD_EDITOR_CONTROL::PageSettings(), SCH_EDITOR_CONTROL::PageSetup(), PCB_BASE_FRAME::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), SCH_COMMIT::pushSchEdit(), PCB_TUNING_PATTERN::Remove(), PCB_EDIT_FRAME::RunActionPlugin(), PL_EDITOR_FRAME::SaveCopyInUndoList(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), GROUP_TOOL::Ungroup(), and UpdateCopyOfZonesList().
bool PICKED_ITEMS_LIST::RemovePicker | ( | unsigned | aIdx | ) |
Remove one entry (one picker) from the list of picked items.
aIdx | Index of the picker in the picked list. |
Definition at line 261 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), and UpdateCopyOfZonesList().
void PICKED_ITEMS_LIST::ReversePickersListOrder | ( | ) |
Reverse the order of pickers stored in this list.
This is useful when pop a list from Undo to Redo (and vice-versa) because sometimes undo (or redo) a command needs to keep the order of successive changes. Obviously, undo and redo are in reverse order
Definition at line 277 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDITOR_CONTROL::Redo(), PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList(), PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList(), and SCH_EDITOR_CONTROL::Undo().
|
inline |
Definition at line 288 of file undo_redo_container.h.
References m_description.
Referenced by PCB_BASE_EDIT_FRAME::AppendCopyToUndoList(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), BOARD_EDITOR_CONTROL::PageSettings(), SCH_EDITOR_CONTROL::PageSetup(), BOARD_COMMIT::Push(), SCH_COMMIT::pushSchEdit(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), and SYMBOL_EDIT_FRAME::SaveCopyInUndoList().
aItem | A pointer to the item to pick. |
aStatus | The type of undo/redo operation associated to the item to pick. |
aIdx | Index of the picker in the picked list. |
Definition at line 224 of file undo_redo_container.cpp.
References m_ItemsList.
bool PICKED_ITEMS_LIST::SetPickedItem | ( | EDA_ITEM * | aItem, |
unsigned | aIdx | ||
) |
aItem | A pointer to the item to pick. |
aIdx | Index of the picker in the picked list. |
Definition at line 200 of file undo_redo_container.cpp.
References m_ItemsList.
bool PICKED_ITEMS_LIST::SetPickedItemLink | ( | EDA_ITEM * | aLink, |
unsigned | aIdx | ||
) |
Set the link associated to a given picked item.
aLink | is the link to the item associated to the picked item. |
aIdx | is index of the picker in the picked list. |
Definition at line 212 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), and UpdateCopyOfZonesList().
bool PICKED_ITEMS_LIST::SetPickedItemStatus | ( | UNDO_REDO | aStatus, |
unsigned | aIdx | ||
) |
Set the type of undo/redo operation for a given picked item.
aStatus | The type of undo/redo operation associated to the picked item |
aIdx | Index of the picker in the picked list |
Definition at line 237 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), and UpdateCopyOfZonesList().
bool PICKED_ITEMS_LIST::SetPickerFlags | ( | EDA_ITEM_FLAGS | aFlags, |
unsigned | aIdx | ||
) |
Set the flags of the picker (usually to the picked item m_flags value).
aFlags | The flag value to save in picker. |
aIdx | Index of the picker in the picked list. |
Definition at line 249 of file undo_redo_container.cpp.
References m_ItemsList.
|
private |
Definition at line 291 of file undo_redo_container.h.
Referenced by GetDescription(), and SetDescription().
|
private |
Definition at line 292 of file undo_redo_container.h.
Referenced by ClearItemsList(), ContainsItem(), CopyList(), FindItem(), GetCount(), GetItemWrapper(), GetPickedItem(), GetPickedItemLink(), GetPickedItemStatus(), GetPickerFlags(), GetScreenForItem(), PopItem(), PushItem(), RemovePicker(), ReversePickersListOrder(), SetPickedItem(), SetPickedItemLink(), SetPickedItemStatus(), and SetPickerFlags().