![]() |
SUMO - Simulation of Urban MObility
|
#include <GNEUndoList.h>
Data Structures | |
class | CommandGroup |
class CommandGroup More... | |
Public Member Functions | |
int | currentCommandGroupSize () const |
get size of current CommandGroup More... | |
GNEUndoList (GNEApplicationWindow *parent) | |
FOX declaration. More... | |
bool | hasCommandGroup () const |
Check if undoList has command group. More... | |
void | p_abort () |
reverts and discards ALL active command groups More... | |
void | p_abortLastCommandGroup () |
reverts last command group More... | |
void | p_add (GNEChange_Attribute *cmd) |
special method, avoid empty changes, always execute More... | |
void | p_begin (const std::string &description) |
Begin undo command sub-group. This begins a new group of commands that are treated as a single command. Must eventually be followed by a matching end() after recording the sub-commands. The new sub-group will be appended to its parent group's undo list when end() is called. More... | |
void | p_clear () |
clears the undo list (implies abort) More... | |
void | p_end () |
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously. More... | |
void | redo () |
redo the last command group More... | |
void | undo () |
undo the last command group More... | |
FOX-callbacks | |
event after Undo | |
long | p_onUpdUndo (FXObject *, FXSelector, void *) |
long | p_onUpdRedo (FXObject *, FXSelector, void *) |
event after Redo More... | |
Private Attributes | |
std::stack< CommandGroup * > | myCommandGroups |
GNEApplicationWindow *const | myParent |
Definition at line 48 of file GNEUndoList.h.
GNEUndoList::GNEUndoList | ( | GNEApplicationWindow * | parent | ) |
FOX declaration.
constructor
Definition at line 66 of file GNEUndoList.cpp.
int GNEUndoList::currentCommandGroupSize | ( | ) | const |
get size of current CommandGroup
Definition at line 143 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEAdditionalDialog::initChanges().
bool GNEUndoList::hasCommandGroup | ( | ) | const |
Check if undoList has command group.
Definition at line 189 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEJunction::invalidateTLS(), GNEViewNet::onLeftBtnPress(), p_abort(), p_onUpdRedo(), p_onUpdUndo(), and GNEJunction::setLogicValid().
void GNEUndoList::p_abort | ( | ) |
reverts and discards ALL active command groups
Definition at line 94 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
Referenced by GNEViewNet::abortOperation(), GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPOILane(), GNEPolygonFrame::addPolygon(), GNETLSEditorFrame::onCmdCancel(), GNETAZFrame::TAZSaveChanges::onCmdCancelChanges(), GNEConnectorFrame::ConnectionModifications::onCmdCancelModifications(), and p_clear().
void GNEUndoList::p_abortLastCommandGroup | ( | ) |
reverts last command group
Definition at line 104 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEAdditionalDialog::acceptChanges(), GNEAdditionalDialog::cancelChanges(), and GNEAdditionalDialog::resetChanges().
void GNEUndoList::p_add | ( | GNEChange_Attribute * | cmd | ) |
special method, avoid empty changes, always execute
Definition at line 133 of file GNEUndoList.cpp.
References GNEChange_Attribute::trueChange().
Referenced by GNETAZ::commitGeometryMoving(), GNEDetectorE3::commitGeometryMoving(), GNEParkingSpace::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNEAccess::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEDetectorEntry::commitGeometryMoving(), GNEDetectorE1::commitGeometryMoving(), GNEDetectorExit::commitGeometryMoving(), GNEDetectorE1Instant::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNEPOI::commitGeometryMoving(), GNEDetectorE2::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNETAZ::commitShapeChange(), GNEPoly::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::commitShapeEndChange(), GNEEdge::commitShapeStartChange(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNENet::replaceIncomingEdge(), GNEChargingStation::setAttribute(), GNEContainerStop::setAttribute(), GNEBusStop::setAttribute(), GNEParkingArea::setAttribute(), GNEVaporizer::setAttribute(), GNETAZSource::setAttribute(), GNERouteProbe::setAttribute(), GNETAZSink::setAttribute(), GNEClosingReroute::setAttribute(), GNEClosingLaneReroute::setAttribute(), GNEDestProbReroute::setAttribute(), GNEDetectorE3::setAttribute(), GNERouteProbReroute::setAttribute(), GNEParkingAreaReroute::setAttribute(), GNEParkingSpace::setAttribute(), GNECalibratorRoute::setAttribute(), GNEVariableSpeedSignStep::setAttribute(), GNERerouterInterval::setAttribute(), GNECalibratorFlow::setAttribute(), GNEVariableSpeedSign::setAttribute(), GNERerouter::setAttribute(), GNEAccess::setAttribute(), GNECalibratorVehicleType::setAttribute(), GNEDetectorExit::setAttribute(), GNEDetectorEntry::setAttribute(), GNEDetectorE1::setAttribute(), GNEDetectorE1Instant::setAttribute(), GNECalibrator::setAttribute(), GNETAZ::setAttribute(), GNEConnection::setAttribute(), GNEDetectorE2::setAttribute(), GNEPoly::setAttribute(), GNELane::setAttribute(), GNEPOI::setAttribute(), GNEEdge::setAttribute(), and GNENet::splitJunction().
void GNEUndoList::p_begin | ( | const std::string & | description | ) |
Begin undo command sub-group. This begins a new group of commands that are treated as a single command. Must eventually be followed by a matching end() after recording the sub-commands. The new sub-group will be appended to its parent group's undo list when end() is called.
Definition at line 73 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEPolygonFrame::addPOI(), GNENet::addPOI(), GNEPolygonFrame::addPOILane(), GNEPolygonFrame::addPolygon(), GNENet::addPolygon(), GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildAccess(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildCalibratorFlow(), GNEAdditionalHandler::buildCalibratorRoute(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNEConnectorFrame::buildConnection(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::builDestProbReroute(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingSpace(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNEAdditionalHandler::buildTAZ(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSign(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNEAdditionalHandler::buildVehicleType(), GNEAdditionalHandler::builParkingAreaReroute(), GNEPoly::changeFirstGeometryPoint(), GNENet::cleanInvalidCrossings(), GNESelectorFrame::clearCurrentSelection(), GNENet::clearJunctionConnections(), GNEPoly::closePolygon(), GNETAZ::commitGeometryMoving(), GNEDetectorE3::commitGeometryMoving(), GNEParkingSpace::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNEAccess::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEDetectorE1::commitGeometryMoving(), GNEDetectorEntry::commitGeometryMoving(), GNEDetectorExit::commitGeometryMoving(), GNEDetectorE1Instant::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNEPOI::commitGeometryMoving(), GNEDetectorE2::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNETAZ::commitShapeChange(), GNEPoly::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::commitShapeEndChange(), GNEEdge::commitShapeStartChange(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteConnection(), GNENet::deleteCrossing(), GNENet::deleteEdge(), GNETAZ::deleteGeometryPoint(), GNEEdge::deleteGeometryPoint(), GNEPoly::deleteGeometryPoint(), GNENet::deleteJunction(), GNENet::deleteLane(), GNEViewNet::deleteSelectedAdditionals(), GNEViewNet::deleteSelectedConnections(), GNEViewNet::deleteSelectedCrossings(), GNEViewNet::deleteSelectedEdges(), GNEViewNet::deleteSelectedJunctions(), GNEViewNet::deleteSelectedLanes(), GNEViewNet::deleteSelectedShapes(), GNENet::deleteShape(), GNENet::duplicateLane(), GNEEdge::editEndpoint(), GNETLSEditorFrame::editJunction(), GNETAZFrame::TAZSaveChanges::enableButtonsAndBeginUndoList(), GNEViewNet::MoveMultipleElementValues::finishMoveSelection(), GNEApplicationWindow::handleEvent_NetworkLoaded(), GNESelectorFrame::handleIDs(), GNEViewNet::hotkeyDel(), GNEViewNet::hotkeyEnter(), GNEAdditionalDialog::initChanges(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEDialog_FixAdditionalPositions::onCmdAccept(), GNEViewNet::onCmdAddReversedEdge(), GNEViewNet::onCmdClearConnections(), GNEConnectorFrame::ConnectionOperations::onCmdClearSelectedConnections(), GNEViewNet::onCmdDuplicateLane(), GNEFrame::GenericParametersEditor::onCmdEditGenericParameter(), GNESelectorFrame::SelectionOperation::onCmdInvert(), GNESelectorFrame::SelectionOperation::onCmdLoad(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEInspectorFrame::AttributesEditor::AttributeInput::onCmdOpenAttributeDialog(), GNEApplicationWindow::onCmdOpenShapes(), GNEApplicationWindow::onCmdOpenTLSPrograms(), GNEViewNet::onCmdResetConnections(), GNEViewNet::onCmdResetJunctionShape(), GNEViewNet::onCmdResetLaneCustomShape(), GNEConnectorFrame::ConnectionOperations::onCmdResetSelectedConnections(), GNEViewNet::onCmdReverseEdge(), GNEInspectorFrame::AttributesEditor::AttributeInput::onCmdSetAttribute(), GNEFrame::GenericParametersEditor::onCmdSetGenericParameter(), GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(), GNEViewNet::onCmdSmoothEdges(), GNEViewNet::onCmdSmoothEdgesElevation(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onCmdStraightenEdgesElevation(), GNEViewNet::onCmdTransformPOI(), GNEViewNet::onLeftBtnPress(), GNEPoly::openPolygon(), GNEViewNet::SelectingArea::processBoundarySelection(), GNEAdditionalFrame::removeAdditional(), GNEViewNet::removeRestrictedLane(), GNEDeleteFrame::removeSelectedAttributeCarriers(), GNENet::removeSolitaryJunctions(), GNENet::replaceIncomingEdge(), GNENet::replaceJunctionByGeometry(), GNEAdditionalDialog::resetChanges(), GNENet::resetJunctionConnections(), GNEViewNet::restrictLane(), GNENet::reverseEdge(), GNEConnection::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), GNEEdge::setNumLanes(), GNEPoly::simplifyShape(), GNENet::splitEdge(), GNENet::splitEdgesBidi(), and GNENet::splitJunction().
void GNEUndoList::p_clear | ( | ) |
clears the undo list (implies abort)
Definition at line 87 of file GNEUndoList.cpp.
References p_abort().
Referenced by GNEApplicationWindow::closeAllWindows(), and GNEApplicationWindow::continueWithUnsavedChanges().
void GNEUndoList::p_end | ( | ) |
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition at line 80 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEAdditionalDialog::acceptChanges(), GNEPolygonFrame::addPOI(), GNENet::addPOI(), GNEPolygonFrame::addPOILane(), GNEPolygonFrame::addPolygon(), GNENet::addPolygon(), GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildAccess(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildCalibratorFlow(), GNEAdditionalHandler::buildCalibratorRoute(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::builDestProbReroute(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingSpace(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNEAdditionalHandler::buildTAZ(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSign(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNEAdditionalHandler::buildVehicleType(), GNEAdditionalHandler::builParkingAreaReroute(), GNEPoly::changeFirstGeometryPoint(), GNENet::cleanInvalidCrossings(), GNESelectorFrame::clearCurrentSelection(), GNENet::clearJunctionConnections(), GNEPoly::closePolygon(), GNETAZ::commitGeometryMoving(), GNEDetectorE3::commitGeometryMoving(), GNEParkingSpace::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNEAccess::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEDetectorE1::commitGeometryMoving(), GNEDetectorEntry::commitGeometryMoving(), GNEDetectorExit::commitGeometryMoving(), GNEDetectorE1Instant::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNEPOI::commitGeometryMoving(), GNEDetectorE2::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNETAZ::commitShapeChange(), GNEPoly::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::commitShapeEndChange(), GNEEdge::commitShapeStartChange(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteConnection(), GNENet::deleteCrossing(), GNENet::deleteEdge(), GNETAZ::deleteGeometryPoint(), GNEEdge::deleteGeometryPoint(), GNEPoly::deleteGeometryPoint(), GNENet::deleteJunction(), GNENet::deleteLane(), GNEViewNet::deleteSelectedAdditionals(), GNEViewNet::deleteSelectedConnections(), GNEViewNet::deleteSelectedCrossings(), GNEViewNet::deleteSelectedEdges(), GNEViewNet::deleteSelectedJunctions(), GNEViewNet::deleteSelectedLanes(), GNEViewNet::deleteSelectedShapes(), GNENet::deleteShape(), GNENet::duplicateLane(), GNEEdge::editEndpoint(), GNEViewNet::MoveMultipleElementValues::finishMoveSelection(), GNEApplicationWindow::handleEvent_NetworkLoaded(), GNESelectorFrame::handleIDs(), GNEViewNet::hotkeyDel(), GNEViewNet::hotkeyEnter(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEDialog_FixAdditionalPositions::onCmdAccept(), GNEViewNet::onCmdAddReversedEdge(), GNEViewNet::onCmdClearConnections(), GNEConnectorFrame::ConnectionOperations::onCmdClearSelectedConnections(), GNEViewNet::onCmdDuplicateLane(), GNEFrame::GenericParametersEditor::onCmdEditGenericParameter(), GNESelectorFrame::SelectionOperation::onCmdInvert(), GNESelectorFrame::SelectionOperation::onCmdLoad(), GNETLSEditorFrame::onCmdOK(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEInspectorFrame::AttributesEditor::AttributeInput::onCmdOpenAttributeDialog(), GNEApplicationWindow::onCmdOpenShapes(), GNEApplicationWindow::onCmdOpenTLSPrograms(), GNEViewNet::onCmdResetConnections(), GNEViewNet::onCmdResetJunctionShape(), GNEViewNet::onCmdResetLaneCustomShape(), GNEConnectorFrame::ConnectionOperations::onCmdResetSelectedConnections(), GNEViewNet::onCmdReverseEdge(), GNETAZFrame::TAZSaveChanges::onCmdSaveChanges(), GNEConnectorFrame::ConnectionModifications::onCmdSaveModifications(), GNEInspectorFrame::AttributesEditor::AttributeInput::onCmdSetAttribute(), GNEFrame::GenericParametersEditor::onCmdSetGenericParameter(), GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(), GNEViewNet::onCmdSmoothEdges(), GNEViewNet::onCmdSmoothEdgesElevation(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onCmdStraightenEdgesElevation(), GNEViewNet::onCmdTransformPOI(), GNEViewNet::onLeftBtnPress(), GNEPoly::openPolygon(), GNEViewNet::SelectingArea::processBoundarySelection(), GNEAdditionalFrame::removeAdditional(), GNEViewNet::removeRestrictedLane(), GNEDeleteFrame::removeSelectedAttributeCarriers(), GNENet::removeSolitaryJunctions(), GNENet::replaceIncomingEdge(), GNENet::replaceJunctionByGeometry(), GNENet::resetJunctionConnections(), GNEViewNet::restrictLane(), GNEConnection::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), GNEEdge::setNumLanes(), GNEPoly::simplifyShape(), GNENet::splitEdgesBidi(), and GNENet::splitJunction().
long GNEUndoList::p_onUpdRedo | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
event after Redo
Definition at line 171 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
long GNEUndoList::p_onUpdUndo | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
Definition at line 153 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
void GNEUndoList::redo | ( | ) |
redo the last command group
Definition at line 123 of file GNEUndoList.cpp.
References myParent, GNEApplicationWindow::updateControls(), and WRITE_DEBUG.
void GNEUndoList::undo | ( | ) |
undo the last command group
Definition at line 114 of file GNEUndoList.cpp.
References myParent, GNEApplicationWindow::updateControls(), and WRITE_DEBUG.
|
private |
Definition at line 126 of file GNEUndoList.h.
Referenced by currentCommandGroupSize(), hasCommandGroup(), p_abort(), p_abortLastCommandGroup(), p_begin(), p_end(), p_onUpdRedo(), and p_onUpdUndo().
|
private |
Definition at line 129 of file GNEUndoList.h.