![]() |
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 54 of file GNEUndoList.h.
GNEUndoList::GNEUndoList | ( | GNEApplicationWindow * | parent | ) |
FOX declaration.
constructor
Definition at line 77 of file GNEUndoList.cpp.
int GNEUndoList::currentCommandGroupSize | ( | ) | const |
get size of current CommandGroup
Definition at line 158 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEAdditionalDialog::initChanges().
bool GNEUndoList::hasCommandGroup | ( | ) | const |
Check if undoList has command group.
Definition at line 204 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 105 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
Referenced by GNEViewNet::abortOperation(), GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPOILane(), GNEPolygonFrame::addPolygon(), GNEConnectorFrame::onCmdCancel(), GNETLSEditorFrame::onCmdCancel(), and p_clear().
void GNEUndoList::p_abortLastCommandGroup | ( | ) |
reverts last command group
Definition at line 115 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 148 of file GNEUndoList.cpp.
References GNEChange_Attribute::trueChange().
Referenced by GNEDetectorE3::commitGeometryMoving(), GNEPOI::commitGeometryMoving(), GNEDetector::commitGeometryMoving(), GNEPOILane::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNEPoly::commitShapeChange(), GNEEdge::commitShapeChange(), GNENet::replaceIncomingEdge(), GNERouteProbReroute::setAttribute(), GNEDestProbReroute::setAttribute(), GNEClosingLaneReroute::setAttribute(), GNEClosingReroute::setAttribute(), GNEVariableSpeedSignStep::setAttribute(), GNECalibratorRoute::setAttribute(), GNECalibratorVehicleType::setAttribute(), GNERerouterInterval::setAttribute(), GNEDetectorE1::setAttribute(), GNEDetectorEntry::setAttribute(), GNEDetectorExit::setAttribute(), GNEContainerStop::setAttribute(), GNEBusStop::setAttribute(), GNEDetectorE2::setAttribute(), GNECalibratorFlow::setAttribute(), GNEVaporizer::setAttribute(), GNEDetectorE3::setAttribute(), GNERouteProbe::setAttribute(), GNEChargingStation::setAttribute(), GNEConnection::setAttribute(), GNEVariableSpeedSign::setAttribute(), GNERerouter::setAttribute(), GNEPOI::setAttribute(), GNEPOILane::setAttribute(), GNEPoly::setAttribute(), GNECalibrator::setAttribute(), GNELane::setAttribute(), and GNEEdge::setAttribute().
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 84 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNENet::addPOI(), GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPOILane(), GNENet::addPolygon(), GNEPolygonFrame::addPolygon(), GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildCalibratorFlow(), GNEAdditionalHandler::buildCalibratorRoute(), GNEAdditionalHandler::buildCalibratorVehicleType(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE2(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::builDestProbReroute(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSign(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNEPoly::changeFirstGeometryPoint(), GNENet::cleanInvalidCrossings(), GNENet::clearJunctionConnections(), GNEPoly::closePolygon(), GNEDetectorE3::commitGeometryMoving(), GNEPOI::commitGeometryMoving(), GNEDetector::commitGeometryMoving(), GNEPOILane::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNEPoly::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteConnection(), GNENet::deleteCrossing(), GNENet::deleteEdge(), 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(), GNETLSEditorFrame::editJunction(), GNEViewNet::finishMoveSelection(), GNEApplicationWindow::handleEvent_NetworkLoaded(), GNESelectorFrame::handleIDs(), GNEConnectorFrame::handleLaneClick(), GNEViewNet::hotkeyDel(), GNEViewNet::hotkeyEnter(), GNEAdditionalDialog::initChanges(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEDialog_FixAdditionalPositions::onCmdAccept(), GNESelectorFrame::onCmdClear(), GNEViewNet::onCmdClearConnections(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEViewNet::onCmdDuplicateLane(), GNESelectorFrame::onCmdInvert(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEApplicationWindow::onCmdOpenShapes(), GNEViewNet::onCmdResetConnections(), GNEConnectorFrame::onCmdResetSelectedConnections(), GNEInspectorFrame::AttributeInput::onCmdSetAttribute(), GNEViewNet::onCmdSmoothEdges(), GNEViewNet::onCmdSmoothEdgesElevation(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onCmdStraightenEdgesElevation(), GNEViewNet::onCmdTransformPOI(), GNEViewNet::onLeftBtnPress(), GNEPoly::openPolygon(), GNEAdditionalFrame::removeAdditional(), GNEViewNet::removeRestrictedLane(), GNENet::removeSolitaryJunctions(), GNENet::replaceIncomingEdge(), GNENet::replaceJunctionByGeometry(), GNEAdditionalDialog::resetChanges(), GNENet::resetJunctionConnections(), GNEViewNet::restrictLane(), GNENet::reverseEdge(), GNEConnection::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), GNEEdge::setEndpoint(), GNEEdge::setNumLanes(), GNEPoly::simplifyShape(), GNENet::splitEdge(), and GNENet::splitEdgesBidi().
void GNEUndoList::p_clear | ( | ) |
clears the undo list (implies abort)
Definition at line 98 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 91 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEAdditionalDialog::acceptChanges(), GNENet::addPOI(), GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPOILane(), GNENet::addPolygon(), GNEPolygonFrame::addPolygon(), GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildCalibratorFlow(), GNEAdditionalHandler::buildCalibratorRoute(), GNEAdditionalHandler::buildCalibratorVehicleType(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE2(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::builDestProbReroute(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSign(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNEPoly::changeFirstGeometryPoint(), GNENet::cleanInvalidCrossings(), GNENet::clearJunctionConnections(), GNEPoly::closePolygon(), GNEDetectorE3::commitGeometryMoving(), GNEPOI::commitGeometryMoving(), GNEDetector::commitGeometryMoving(), GNEPOILane::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNEPoly::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteConnection(), GNENet::deleteCrossing(), GNENet::deleteEdge(), 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(), GNEViewNet::finishMoveSelection(), GNEApplicationWindow::handleEvent_NetworkLoaded(), GNESelectorFrame::handleIDs(), GNEViewNet::hotkeyDel(), GNEViewNet::hotkeyEnter(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEDialog_FixAdditionalPositions::onCmdAccept(), GNESelectorFrame::onCmdClear(), GNEViewNet::onCmdClearConnections(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEViewNet::onCmdDuplicateLane(), GNESelectorFrame::onCmdInvert(), GNEConnectorFrame::onCmdOK(), GNETLSEditorFrame::onCmdOK(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEApplicationWindow::onCmdOpenShapes(), GNEViewNet::onCmdResetConnections(), GNEConnectorFrame::onCmdResetSelectedConnections(), GNEInspectorFrame::AttributeInput::onCmdSetAttribute(), GNEViewNet::onCmdSmoothEdges(), GNEViewNet::onCmdSmoothEdgesElevation(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onCmdStraightenEdgesElevation(), GNEViewNet::onCmdTransformPOI(), GNEViewNet::onLeftBtnPress(), GNEPoly::openPolygon(), GNEAdditionalFrame::removeAdditional(), GNEViewNet::removeRestrictedLane(), GNENet::removeSolitaryJunctions(), GNENet::replaceIncomingEdge(), GNENet::replaceJunctionByGeometry(), GNENet::resetJunctionConnections(), GNEViewNet::restrictLane(), GNEConnection::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), GNEEdge::setEndpoint(), GNEEdge::setNumLanes(), GNEPoly::simplifyShape(), and GNENet::splitEdgesBidi().
long GNEUndoList::p_onUpdRedo | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
event after Redo
Definition at line 186 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
long GNEUndoList::p_onUpdUndo | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
Definition at line 168 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
void GNEUndoList::redo | ( | ) |
redo the last command group
Definition at line 136 of file GNEUndoList.cpp.
References OptionsCont::getOptions(), myParent, GNEApplicationWindow::updateControls(), and WRITE_WARNING.
void GNEUndoList::undo | ( | ) |
undo the last command group
Definition at line 125 of file GNEUndoList.cpp.
References OptionsCont::getOptions(), myParent, GNEApplicationWindow::updateControls(), and WRITE_WARNING.
|
private |
Definition at line 132 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 135 of file GNEUndoList.h.