KiCad PCB EDA Suite
Loading...
Searching...
No Matches
COMMIT Class Referenceabstract

Represent a set of changes (additions, deletions or modifications) of a data model (e.g. More...

#include <commit.h>

Inheritance diagram for COMMIT:
BOARD_COMMIT SCH_COMMIT TEST_COMMIT

Classes

struct  COMMIT_LINE
 

Public Member Functions

 COMMIT ()
 
virtual ~COMMIT ()
 
COMMITAdd (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 Add a new item to the model.
 
COMMITAdded (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 Notify observers that aItem has been added.
 
COMMITRemove (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 Remove a new item from the model.
 
COMMITRemoved (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 
COMMITModify (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
 Modify a given item in the model.
 
COMMITModified (EDA_ITEM *aItem, EDA_ITEM *aCopy, BASE_SCREEN *aScreen=nullptr)
 Create an undo entry for an item that has been already modified.
 
virtual COMMITStage (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.
 
virtual COMMITStage (std::vector< EDA_ITEM * > &container, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr)
 
virtual COMMITStage (const PICKED_ITEMS_LIST &aItems, UNDO_REDO aModFlag=UNDO_REDO::UNSPECIFIED, BASE_SCREEN *aScreen=nullptr)
 
void Unstage (EDA_ITEM *aItem, BASE_SCREEN *aScreen)
 
void Unmodify (EDA_ITEM *aItem, BASE_SCREEN *aScreen)
 
virtual void Push (const wxString &aMessage=wxT("A commit"), int aFlags=0)=0
 Execute the changes.
 
virtual void Revert ()=0
 Revert the commit by restoring the modified items state.
 
virtual EDA_ITEMResolveItem (KIID &aID)=0
 Search for an item in this commit that matches the provided KIID.
 
bool Empty () const
 
int GetStatus (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 Returns status of an item.
 
EDA_ITEMGetFirst () const
 

Protected Member Functions

void clear ()
 Should be called in Push() & Revert() methods.
 
virtual void makeEntry (EDA_ITEM *aItem, CHANGE_TYPE aType, EDA_ITEM *aCopy=nullptr, BASE_SCREEN *aScreen=nullptr)
 
COMMIT_LINEfindEntry (EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
 Search for an entry describing change for a particular item.
 
virtual EDA_ITEMundoLevelItem (EDA_ITEM *aItem) const =0
 
virtual EDA_ITEMmakeImage (EDA_ITEM *aItem) const =0
 
CHANGE_TYPE convert (UNDO_REDO aType) const
 
UNDO_REDO convert (CHANGE_TYPE aType) const
 

Protected Attributes

std::set< std::pair< EDA_ITEM *, BASE_SCREEN * > > m_addedItems
 
std::set< std::pair< EDA_ITEM *, BASE_SCREEN * > > m_changedItems
 
std::set< std::pair< EDA_ITEM *, BASE_SCREEN * > > m_deletedItems
 
std::vector< COMMIT_LINEm_entries
 

Detailed Description

Represent a set of changes (additions, deletions or modifications) of a data model (e.g.

the BOARD) class.

The class can be used to propagate changes to subscribed objects (e.g. views, ratsnest), and automatically create undo/redo points.

Definition at line 67 of file commit.h.

Constructor & Destructor Documentation

◆ COMMIT()

◆ ~COMMIT()

COMMIT::~COMMIT ( )
virtual

Definition at line 35 of file commit.cpp.

References m_entries.

Member Function Documentation

◆ Add()

COMMIT & COMMIT::Add ( EDA_ITEM * aItem,
BASE_SCREEN * aScreen = nullptr )
inline

Add a new item to the model.

Definition at line 74 of file commit.h.

References CHT_ADD, COMMIT(), and Stage().

Referenced by PCB_POINT_EDITOR::addCorner(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_VIA_STACK::addMember(), CONSTRAINT_EDIT_TOOL::AddPointConstraint(), PCB_CONTROL::AppendBoard(), MULTICHANNEL_TOOL::AutogenerateRuleAreas(), bindDimensionEndpoints(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CONSTRAINT_EDIT_TOOL::commitConstraint(), EE_GRAPHIC_TOOL::commitItem(), RULE_AREA_CREATE_HELPER::commitRuleArea(), ZONE_CREATE_HELPER::commitZone(), MULTICHANNEL_TOOL::copyRuleAreaContents(), MICROWAVE_TOOL::createInductorBetween(), CONVERT_TOOL::CreateLines(), CONVERT_TOOL::CreatePolys(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawBarcode(), DRAWING_TOOL::DrawBezier(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawEllipseArc(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawTable(), SCH_DRAWING_TOOLS::DrawTable(), DRAWING_TOOL::DrawVia(), EDIT_TOOL::Duplicate(), PCB_TUNING_PATTERN::EditFinish(), PCB_TUNING_PATTERN::EditStart(), PCB_VIA_STACK::EditStart(), PCB_VIA_STITCH::EditStart(), BOARD::ExchangeFootprint(), PCB_VIA_STACK::ExpandMultiHopMicrovias(), PAD_TOOL::explodePad(), EDIT_TOOL::FilletTracks(), DSN::SPECCTRA_DB::FromSESSION(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_PCB::handlePlaceFootprintFromLibrary(), API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), EE_GRAPHIC_TOOL::ImportGraphics(), SCH_DRAWING_TOOLS::ImportSheet(), PCBNEW_JOBS_HANDLER::JobExportDrc(), SCH_SELECTION_TOOL::Main(), GENERATOR_TOOL::MakeViaStackFromSelection(), EDIT_TOOL::ModifyLines(), ARRAY_TOOL::onDialogClosed(), CONVERT_TOOL::OutsetItems(), ZONE_CREATE_HELPER::performZoneCutout(), PCB_CONTROL::placeBoardItems(), PCB_CONTROL::PlaceDrillMap(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceGridItem(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), INTERACTIVE_PLACER_BASE::PlaceItem(), PAD_TOOL::PlacePad(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), PCB_TUNING_PATTERN::Remove(), MULTICHANNEL_TOOL::RepeatLayout(), PCB_EDIT_FRAME::ResolveDRCExclusions(), GRAPHIC_EDIT_TOOL::runInteractive(), DRAWING_TOOL::runSimpleShapeDraw(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), CONVERT_TOOL::SegmentToArc(), stageAutoConstraints(), DIALOG_FP_EDIT_PAD_TABLE::TransferDataFromWindow(), PCB_VIA_STITCH::Update(), PCB_EDIT_FRAME::UpdateDesignBlockFromSelection(), SCH_EDIT_FRAME::UpdateDesignBlockFromSelection(), PCB_PROPERTIES_PANEL::valueChanged(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().

◆ Added()

◆ clear()

void COMMIT::clear ( )
inlineprotected

◆ convert() [1/2]

UNDO_REDO COMMIT::convert ( CHANGE_TYPE aType) const
protected

Definition at line 288 of file commit.cpp.

References CHANGED, CHT_ADD, CHT_MODIFY, CHT_REMOVE, DELETED, and NEWITEM.

◆ convert() [2/2]

CHANGE_TYPE COMMIT::convert ( UNDO_REDO aType) const
protected

Definition at line 276 of file commit.cpp.

References CHANGED, CHT_ADD, CHT_MODIFY, CHT_REMOVE, DELETED, and NEWITEM.

◆ Empty()

bool COMMIT::Empty ( ) const
inline

Definition at line 142 of file commit.h.

References m_entries.

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), SCH_EDIT_TOOL::ChangeTextType(), SCH_EDIT_FRAME::CopyVariant(), SCH_EDIT_TOOL::CycleBodyStyle(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), SCH_EDIT_TOOL::editFieldText(), EDIT_TOOL::Flip(), SCH_EDITOR_CONTROL::IncrementAnnotations(), EDIT_TOOL::JustifyText(), SCH_EDIT_TOOL::JustifyText(), SCH_POINT_EDITOR::Main(), SCH_SELECTION_TOOL::Main(), EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), SCH_EDIT_TOOL::modifyLockSelected(), DIALOG_SYMBOL_FIELDS_TABLE::onDeleteVariant(), HIERARCHY_PANE::onTreeEditFinished(), DIALOG_FOOTPRINT_FIELDS_TABLE::onVariantSelectionChange(), DIALOG_SYMBOL_FIELDS_TABLE::onVariantSelectionChange(), BOARD_COMMIT::Push(), SCH_COMMIT::Push(), SCH_COMMIT::pushSchEdit(), SCHEMATIC::RecalculateConnections(), SCH_EDIT_FRAME::RemoveVariant(), SCH_EDIT_FRAME::RenameVariant(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), DIALOG_DIMENSION_PROPERTIES::resolveDrivingConstraint(), SCH_COMMIT::revertLibEdit(), EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_FRAME::SaveSymbolToSchematic(), SCH_EDIT_FRAME::SelectUnit(), SCH_EDIT_TOOL::SetAttribute(), snapAutoConstraints(), CONSTRAINT_EDIT_TOOL::solveAddedConstraint(), CONSTRAINT_EDIT_TOOL::SolveAfterEdit(), CONSTRAINT_EDIT_TOOL::SolveAfterMove(), EDIT_TOOL::Swap(), SCH_EDIT_TOOL::Swap(), EDIT_TOOL::SwapGateNets(), EDIT_TOOL::SwapPadNets(), SCH_EDIT_TOOL::SwapPins(), SCH_EDIT_TOOL::SwapUnitLabels(), EDIT_TOOL::ToggleFootprintAttribute(), DIALOG_FOOTPRINT_FIELDS_TABLE::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_IMAGE_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_SHAPE_PROPERTIES::TransferDataFromWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_FIELDS_TABLE::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TABLE_PROPERTIES::TransferDataFromWindow(), DIALOG_TABLECELL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), and PCB_PROPERTIES_PANEL::valueChanged().

◆ findEntry()

COMMIT::COMMIT_LINE * COMMIT::findEntry ( EDA_ITEM * aItem,
BASE_SCREEN * aScreen = nullptr )
protected

Search for an entry describing change for a particular item.

Returns
null if there is no related entry.

Definition at line 264 of file commit.cpp.

References m_entries.

Referenced by GetStatus(), and SCH_COMMIT::RemovedForCleanup().

◆ GetFirst()

EDA_ITEM * COMMIT::GetFirst ( ) const
inline

Definition at line 150 of file commit.h.

References m_entries.

◆ GetStatus()

◆ makeEntry()

void COMMIT::makeEntry ( EDA_ITEM * aItem,
CHANGE_TYPE aType,
EDA_ITEM * aCopy = nullptr,
BASE_SCREEN * aScreen = nullptr )
protectedvirtual

◆ makeImage()

virtual EDA_ITEM * COMMIT::makeImage ( EDA_ITEM * aItem) const
protectedpure virtual

Implemented in BOARD_COMMIT, SCH_COMMIT, and TEST_COMMIT.

Referenced by Stage().

◆ Modified()

COMMIT & COMMIT::Modified ( EDA_ITEM * aItem,
EDA_ITEM * aCopy,
BASE_SCREEN * aScreen = nullptr )

Create an undo entry for an item that has been already modified.

Note
Requires a copy done before the modification.

Definition at line 221 of file commit.cpp.

References CHT_MODIFY, COMMIT(), makeEntry(), and undoLevelItem().

Referenced by FOOTPRINT_FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SYMBOL_FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), BOOST_AUTO_TEST_CASE(), DIALOG_CHANGE_SYMBOLS::processSymbols(), and Stage().

◆ Modify()

COMMIT & COMMIT::Modify ( EDA_ITEM * aItem,
BASE_SCREEN * aScreen = nullptr,
RECURSE_MODE aRecurse = RECURSE_MODE::NO_RECURSE )
inline

Modify a given item in the model.

Note
Must be called before modification is performed.

Definition at line 102 of file commit.h.

References CHT_MODIFY, COMMIT(), NO_RECURSE, and Stage().

Referenced by PCB_PROPERTIES_PANEL::addBlankCustomProperty(), SCH_PROPERTIES_PANEL::addBlankCustomProperty(), PCB_PROPERTIES_PANEL::addBlankField(), SCH_PROPERTIES_PANEL::addBlankField(), PCB_POINT_EDITOR::addCorner(), SCH_POINT_EDITOR::addCorner(), SYMBOL_EDITOR_MOVE_TOOL::AlignElements(), SCH_MOVE_TOOL::AlignToGrid(), SCH_EDIT_FRAME::AnnotateSymbols(), PCB_CONTROL::AppendBoard(), BACK_ANNOTATE::applyChangelist(), BACK_ANNOTATE::applyPinSwaps(), DIALOG_RESOLVE_FIELD_CASE_CONFLICTS::applyResolutions(), MATCH_PROPERTIES_TOOL::applyToTargets(), SCH_EDITOR_CONTROL::AssignFootprints(), MULTICHANNEL_TOOL::AutogenerateRuleAreas(), DIALOG_MIGRATE_3D_MODELS::AutoMigrateByFilename(), SCH_DRAWING_TOOLS::AutoPlaceAllSheetPins(), SCH_EDIT_TOOL::AutoplaceFields(), AR_AUTOPLACER::AutoplaceFootprints(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), SCH_LINE_WIRE_BUS_TOOL::BreakSegment(), PCB_POINT_EDITOR::chamferCorner(), EDIT_TOOL::ChangeTrackLayer(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), VIA_STITCH_TOOL::ClearStitchViaExclusions(), SCH_EDIT_TOOL::ClearVariantSymbol(), PCB_CONTROL::CollectAndEmbed3DModels(), EE_GRAPHIC_TOOL::commitItem(), SYMBOL_EDITOR_EDIT_TOOL::ConvertStackedPins(), MULTICHANNEL_TOOL::copyRuleAreaContents(), SCH_SCREEN::CopyVariant(), SCH_EDIT_TOOL::CycleBodyStyle(), SCH_EDIT_FRAME::DeleteAnnotation(), EDIT_TOOL::DeleteItems(), SCH_SCREEN::DeleteVariant(), SCH_EDIT_TOOL::DoDelete(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), EDIT_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), doPushPadProperties(), SCH_DRAWING_TOOLS::doSyncSheetsPins(), RECTANGLE_POINT_EDIT_BEHAVIOR::dragPinsOnEdge(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawVia(), BOARD_ITEM::Duplicate(), PCB_TABLE::Duplicate(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::Edit_Zone_Params(), EditConstraintValue(), SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), SCH_EDIT_TOOL::editFieldText(), PAD_TOOL::EditPad(), SCH_EDIT_TOOL::EditPageNumber(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDIT_TOOL::EditProperties(), PCB_TUNING_PATTERN::EditStart(), PCB_VIA_STACK::EditStart(), PCB_VIA_STITCH::EditStart(), PAD_TOOL::EnumeratePads(), BOARD::ExchangeFootprint(), VIA_STITCH_TOOL::ExcludeStitchVia(), SYMBOL_EDITOR_EDIT_TOOL::ExplodeStackedPin(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), EDIT_TOOL::FilletTracks(), EDIT_TOOL::Flip(), DSN::SPECCTRA_DB::FromSESSION(), GENERATOR_TOOL::GENERATOR_TOOL(), SCH_MOVE_TOOL::getConnectedDragItems(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_BOARD::handleFlipItems(), SCH_PROPERTIES_PANEL::handleSheetFilenameChange(), EE_GRAPHIC_TOOL::ImportGraphics(), EDIT_TOOL::Increment(), SCH_TOOL_BASE< T >::Increment(), SCH_EDITOR_CONTROL::IncrementAnnotations(), SCH_MOVE_TOOL::initializeMoveOperation(), EDIT_TOOL::JustifyText(), SCH_EDIT_TOOL::JustifyText(), SCH_POINT_EDITOR::Main(), GENERATOR_TOOL::MakeViaStackFromSelection(), mergeZones(), SCH_MOVE_TOOL::migrateHiddenJunctions(), EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::ModifyLines(), BOARD_EDITOR_CONTROL::modifyLockSelected(), SCH_EDIT_TOOL::modifyLockSelected(), EDIT_TOOL::MoveExact(), SCH_ALIGN_TOOL::moveItem(), moveSelectionBy(), ARRAY_TOOL::onDialogClosed(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_VERTEX_EDITOR_PANE::OnGridCellChange(), PCB_PROPERTIES_PANEL::onKeyRenamed(), SCH_PROPERTIES_PANEL::onKeyRenamed(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), DIALOG_MIGRATE_3D_MODELS::OnReplaceClick(), HIERARCHY_PANE::onRightClick(), HIERARCHY_PANE::onTreeEditFinished(), SCH_MOVE_TOOL::orthoLineDrag(), EDIT_TOOL::PackAndMoveFootprints(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PAD_TOOL::pastePadProperties(), SYMBOL_EDITOR_EDIT_TOOL::PinTable(), PCB_CONTROL::placeBoardItems(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BACK_ANNOTATE::processNetNameChange(), CN_CONNECTIVITY_ALGO::propagateConnections(), MULTICHANNEL_TOOL::pruneExistingGroups(), BOARD_COMMIT::Push(), SCH_COMMIT::pushSchEdit(), DIALOG_BOARD_REANNOTATE::ReannotateBoard(), PCB_POINT_EDITOR::removeCorner(), SCH_POINT_EDITOR::removeCorner(), PCB_PROPERTIES_PANEL::removeCustomProperty(), SCH_PROPERTIES_PANEL::removeCustomProperty(), PCB_PROPERTIES_PANEL::removeField(), SCH_PROPERTIES_PANEL::removeField(), SCH_EDITOR_CONTROL::RemoveFromNetChain(), HIERARCHY_PANE::renameIdenticalSheets(), SCH_SCREEN::RenameVariant(), MULTICHANNEL_TOOL::RepeatLayout(), MULTICHANNEL_TOOL::RepeatLayout(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), SCH_FIND_REPLACE_TOOL::ReplaceAll(), SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext(), PCB_VIA_STACK::reuseMembers(), EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), GRAPHIC_EDIT_TOOL::runInteractive(), PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSymbolToSchematic(), SCHEMATIC::SCHEMATIC(), SCH_EDIT_FRAME::SelectBodyStyle(), SCH_EDIT_FRAME::SelectUnit(), SCH_EDIT_FRAME::SetAltPinFunction(), DRAWING_TOOL::SetAnchor(), SCH_EDIT_TOOL::SetAttribute(), SCH_EDIT_TOOL::SetVariantSymbol(), PCB_TUNING_PATTERN::ShowPropertiesDialog(), PCB_VIA_STACK::ShowPropertiesDialog(), PCB_VIA_STITCH::ShowPropertiesDialog(), snapAutoConstraints(), CONSTRAINT_EDIT_TOOL::solveAddedConstraint(), CONSTRAINT_EDIT_TOOL::SolveAfterEdit(), CONSTRAINT_EDIT_TOOL::SolveAfterMove(), Stage(), EDIT_TOOL::Swap(), SCH_EDIT_TOOL::Swap(), EDIT_TOOL::SwapGateNets(), EDIT_TOOL::SwapPadNets(), SCH_EDIT_TOOL::SwapPinLabels(), SCH_EDIT_TOOL::SwapPins(), SCH_EDIT_TOOL::SwapUnitLabels(), SCHEMATIC::SyncLibSymbolPinMaps(), SCH_SYMBOL::SyncOtherUnits(), EDIT_TOOL::ToggleFootprintAttribute(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), DIALOG_BARCODE_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_DRILL_CHART_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), DIALOG_FP_EDIT_PAD_TABLE::TransferDataFromWindow(), DIALOG_GRID_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_IMAGE_PROPERTIES::TransferDataFromWindow(), DIALOG_JUNCTION_PROPS::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_LINE_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_SHAPE_PROPERTIES::TransferDataFromWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TABLE_PROPERTIES::TransferDataFromWindow(), DIALOG_TABLECELL_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_WIRE_BUS_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PCB_VIA_STITCH::Update(), PCB_EDIT_FRAME::UpdateDesignBlockFromSelection(), SCH_EDIT_FRAME::UpdateDesignBlockFromSelection(), DIALOG_FIELD_PROPERTIES::UpdateField(), LINE_POINT_EDIT_BEHAVIOR::UpdateItem(), PCB_TABLECELL_POINT_EDIT_BEHAVIOR::UpdateItem(), SCH_TABLECELL_POINT_EDIT_BEHAVIOR::UpdateItem(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR::UpdateItem(), SHEET_POINT_EDIT_BEHAVIOR::UpdateItem(), PCB_POINT_EDITOR::updateItem(), PCB_PROPERTIES_PANEL::valueChanged(), SCH_PROPERTIES_PANEL::valueChanged(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), BOARD_EDITOR_CONTROL::ZonePriorityLower(), BOARD_EDITOR_CONTROL::ZonePriorityMoveToBottom(), BOARD_EDITOR_CONTROL::ZonePriorityMoveToTop(), BOARD_EDITOR_CONTROL::ZonePriorityRaise(), GLOBAL_EDIT_TOOL::ZonesManager(), ZONE_FILLER_TOOL::ZoneUnfill(), and ZONE_FILLER_TOOL::ZoneUnfillAll().

◆ Push()

virtual void COMMIT::Push ( const wxString & aMessage = wxT("A commit"),
int aFlags = 0 )
pure virtual

Execute the changes.

Implemented in BOARD_COMMIT, SCH_COMMIT, and TEST_COMMIT.

Referenced by API_HANDLER_PCB::handleInjectDrcError().

◆ Remove()

COMMIT & COMMIT::Remove ( EDA_ITEM * aItem,
BASE_SCREEN * aScreen = nullptr )
inline

Remove a new item from the model.

Notify observers that aItem has been removed

Definition at line 86 of file commit.h.

References CHT_REMOVE, COMMIT(), and Stage().

Referenced by MULTICHANNEL_TOOL::AutogenerateRuleAreas(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), PCB_POINT_EDITOR::chamferCorner(), MULTICHANNEL_TOOL::copyRuleAreaContents(), CONVERT_TOOL::CreateLines(), CONVERT_TOOL::CreatePolys(), EDIT_TOOL::DeleteItems(), API_HANDLER_BOARD::deleteItemsInternal(), API_HANDLER_SCH::deleteItemsInternal(), SCH_EDIT_TOOL::DoDelete(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), PCB_TUNING_PATTERN::EditFinish(), PCB_VIA_STITCH::EditFinish(), PAD_TOOL::EditPad(), BOARD::ExchangeFootprint(), PCB_VIA_STACK::ExpandMultiHopMicrovias(), SCH_EDIT_TOOL::FixERCError(), DSN::SPECCTRA_DB::FromSESSION(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), mergeZones(), EDIT_TOOL::ModifyLines(), CONVERT_TOOL::OutsetItems(), ZONE_CREATE_HELPER::performZoneCutout(), MULTICHANNEL_TOOL::pruneExistingGroups(), PCB_VIA_STACK::Regenerate(), PCB_TUNING_PATTERN::Remove(), PCB_VIA_STACK::Remove(), PCB_VIA_STITCH::Remove(), CONSTRAINT_EDIT_TOOL::removeConstraint(), CONSTRAINT_EDIT_TOOL::RemoveConstraints(), PCB_POINT_EDITOR::removeCorner(), GRAPHIC_EDIT_TOOL::runInteractive(), DIALOG_FP_EDIT_PAD_TABLE::TransferDataFromWindow(), PCB_SELECTION_TOOL::unrouteSegment(), PCB_SELECTION_TOOL::unrouteSelected(), PCB_PROPERTIES_PANEL::valueChanged(), and GLOBAL_EDIT_TOOL::ZonesManager().

◆ Removed()

◆ ResolveItem()

virtual EDA_ITEM * COMMIT::ResolveItem ( KIID & aID)
pure virtual

Search for an item in this commit that matches the provided KIID.

Parameters
aIDis the KIID to search for in the committed items.
Returns
null pointer if aID is null or the item is not found.

Implemented in BOARD_COMMIT, SCH_COMMIT, and TEST_COMMIT.

Referenced by PCB_GROUP::DeserializeGroup(), and SCH_GROUP::DeserializeGroup().

◆ Revert()

virtual void COMMIT::Revert ( )
pure virtual

Revert the commit by restoring the modified items state.

Implemented in BOARD_COMMIT, SCH_COMMIT, and TEST_COMMIT.

◆ Stage() [1/3]

◆ Stage() [2/3]

◆ Stage() [3/3]

COMMIT & COMMIT::Stage ( std::vector< EDA_ITEM * > & container,
CHANGE_TYPE aChangeType,
BASE_SCREEN * aScreen = nullptr )
virtual

Reimplemented in BOARD_COMMIT, and SCH_COMMIT.

Definition at line 141 of file commit.cpp.

References COMMIT(), and Stage().

◆ undoLevelItem()

virtual EDA_ITEM * COMMIT::undoLevelItem ( EDA_ITEM * aItem) const
protectedpure virtual

Implemented in BOARD_COMMIT, SCH_COMMIT, and TEST_COMMIT.

Referenced by GetStatus(), Modified(), and Stage().

◆ Unmodify()

◆ Unstage()

Member Data Documentation

◆ m_addedItems

std::set<std::pair<EDA_ITEM*, BASE_SCREEN*> > COMMIT::m_addedItems
protected

Definition at line 188 of file commit.h.

Referenced by clear(), makeEntry(), and Stage().

◆ m_changedItems

std::set<std::pair<EDA_ITEM*, BASE_SCREEN*> > COMMIT::m_changedItems
protected

Definition at line 189 of file commit.h.

Referenced by clear(), makeEntry(), Stage(), and Unmodify().

◆ m_deletedItems

std::set<std::pair<EDA_ITEM*, BASE_SCREEN*> > COMMIT::m_deletedItems
protected

Definition at line 190 of file commit.h.

Referenced by clear(), makeEntry(), BOARD_COMMIT::Stage(), and Stage().

◆ m_entries


The documentation for this class was generated from the following files: