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. | |
ITEM_PICKER | PopItem () |
bool | ContainsItem (const EDA_ITEM *aItem) const |
bool | ContainsItemType (KICAD_T aItemType) const |
Check the undo/redo list for any EDA_ITEM of type aItemType. | |
int | FindItem (const EDA_ITEM *aItem) const |
void | ClearItemsList () |
Delete only the list of pickers NOT the picked data itself. | |
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. | |
unsigned | GetCount () const |
void | ReversePickersListOrder () |
Reverse the order of pickers stored in this list. | |
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 |
KIID | GetPickedItemGroupId (unsigned int aIdx) const |
EDA_ITEM_FLAGS | GetPickerFlags (unsigned aIdx) const |
Return the value of the picker flag. | |
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. | |
bool | SetPickedItemGroupId (KIID aId, unsigned aIdx) |
Set the group id associated to a given picked item. | |
bool | SetPickedItemStatus (UNDO_REDO aStatus, unsigned aIdx) |
Set the type of undo/redo operation for a given picked item. | |
bool | SetPickerFlags (EDA_ITEM_FLAGS aFlags, unsigned aIdx) |
Set the flags of the picker (usually to the picked item m_flags value). | |
bool | RemovePicker (unsigned aIdx) |
Remove one entry (one picker) from the list of picked items. | |
void | CopyList (const PICKED_ITEMS_LIST &aSource) |
Copy all data from aSource to the list. | |
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 138 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 127 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by 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 133 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().
bool PICKED_ITEMS_LIST::ContainsItemType | ( | KICAD_T | aItemType | ) | const |
Check the undo/redo list for any EDA_ITEM of type aItemType.
Definition at line 99 of file undo_redo_container.cpp.
References m_ItemsList, and EDA_ITEM::Type().
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 308 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 115 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem().
|
inline |
Definition at line 189 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 317 of file undo_redo_container.h.
References m_description.
Referenced by PCB_BASE_EDIT_FRAME::AppendCopyToUndoList(), 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 160 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 171 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().
KIID PICKED_ITEMS_LIST::GetPickedItemGroupId | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picked item in the picked list. |
Definition at line 216 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by PCB_BASE_EDIT_FRAME::PutDataInPreviousState().
EDA_ITEM * PICKED_ITEMS_LIST::GetPickedItemLink | ( | unsigned int | aIdx | ) | const |
aIdx | Index of the picked item in the picked list. |
Definition at line 189 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RecalculateConnections(), 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 198 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RecalculateConnections(), 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 207 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 180 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(), 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(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), 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_EDIT_FRAME::RunActionPlugin(), PL_EDITOR_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), 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 298 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 314 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 318 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(), SCH_COMMIT::pushSchEdit(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), and SCH_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 261 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 237 of file undo_redo_container.cpp.
References m_ItemsList.
bool PICKED_ITEMS_LIST::SetPickedItemGroupId | ( | KIID | aId, |
unsigned | aIdx | ||
) |
Set the group id associated to a given picked item.
aId | is the group id to associate to the picked item. |
aIdx | is index of the picker in the picked list. |
Definition at line 225 of file undo_redo_container.cpp.
References m_ItemsList.
Referenced by PCB_BASE_EDIT_FRAME::PutDataInPreviousState().
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 249 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 274 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 286 of file undo_redo_container.cpp.
References m_ItemsList.
|
private |
Definition at line 321 of file undo_redo_container.h.
Referenced by GetDescription(), and SetDescription().
|
private |
Definition at line 322 of file undo_redo_container.h.
Referenced by ClearItemsList(), ContainsItem(), ContainsItemType(), CopyList(), FindItem(), GetCount(), GetItemWrapper(), GetPickedItem(), GetPickedItemGroupId(), GetPickedItemLink(), GetPickedItemStatus(), GetPickerFlags(), GetScreenForItem(), PopItem(), PushItem(), RemovePicker(), ReversePickersListOrder(), SetPickedItem(), SetPickedItemGroupId(), SetPickedItemLink(), SetPickedItemStatus(), and SetPickerFlags().