SUMO - Simulation of Urban MObility
|
#include <GNEUndoList.h>
Data Structures | |
class | CommandGroup |
class CommandGroup More... | |
Public Member Functions | |
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_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 55 of file GNEUndoList.h.
GNEUndoList::GNEUndoList | ( | GNEApplicationWindow * | parent | ) |
FOX declaration.
constructor
Definition at line 79 of file GNEUndoList.cpp.
bool GNEUndoList::hasCommandGroup | ( | ) | const |
Check if undoList has command group.
Definition at line 178 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 107 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
Referenced by GNEViewNet::abortOperation(), GNEConnectorFrame::onCmdCancel(), GNETLSEditorFrame::onCmdCancel(), and p_clear().
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 GNEVariableSpeedSignal::commmitAdditionalGeometryMoved(), GNEDetector::commmitAdditionalGeometryMoved(), GNEStoppingPlace::commmitAdditionalGeometryMoved(), GNEDetectorE3::commmitAdditionalGeometryMoved(), GNERerouter::commmitAdditionalGeometryMoved(), GNEDetectorEntry::setAttribute(), GNEDetectorExit::setAttribute(), GNEDetectorE1::setAttribute(), GNEDetectorE2::setAttribute(), GNEContainerStop::setAttribute(), GNEBusStop::setAttribute(), GNEDetectorE3::setAttribute(), GNEVaporizer::setAttribute(), GNEVariableSpeedSignal::setAttribute(), GNERouteProbe::setAttribute(), GNEChargingStation::setAttribute(), GNEConnection::setAttribute(), GNECalibrator::setAttribute(), GNEEdge::setAttribute(), GNELane::setAttribute(), and GNERerouter::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 86 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE2(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSignal(), GNEVariableSpeedSignal::commmitAdditionalGeometryMoved(), GNEDetector::commmitAdditionalGeometryMoved(), GNEDetectorE3::commmitAdditionalGeometryMoved(), GNEStoppingPlace::commmitAdditionalGeometryMoved(), GNERerouter::commmitAdditionalGeometryMoved(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteConnection(), GNENet::deleteEdge(), GNENet::deleteJunction(), GNENet::deleteLane(), GNEViewNet::deleteSelectedEdges(), GNEViewNet::deleteSelectedJunctions(), GNENet::duplicateLane(), GNETLSEditorFrame::editJunction(), GNENet::finishMoveSelection(), GNESelectorFrame::handleIDs(), GNEConnectorFrame::handleLaneClick(), GNEViewNet::hotkeyDel(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEViewNet::onCmdDuplicateLane(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEConnectorFrame::onCmdResetSelectedConnections(), GNEViewNet::onCmdRevertRestriction(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onLeftBtnPress(), GNEAdditionalFrame::removeAdditional(), GNEViewNet::removeRestrictedLane(), GNENet::removeSolitaryJunctions(), GNENet::replaceJunctionByGeometry(), GNEViewNet::restrictLane(), GNENet::reverseEdge(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), GNEEdge::setEndpoint(), GNEEdge::setNumLanes(), GNENet::splitEdge(), and GNENet::splitEdgesBidi().
void GNEUndoList::p_clear | ( | ) |
clears the undo list (implies abort)
Definition at line 100 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 93 of file GNEUndoList.cpp.
References myCommandGroups.
Referenced by GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE2(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSignal(), GNEVariableSpeedSignal::commmitAdditionalGeometryMoved(), GNEDetector::commmitAdditionalGeometryMoved(), GNEDetectorE3::commmitAdditionalGeometryMoved(), GNEStoppingPlace::commmitAdditionalGeometryMoved(), GNERerouter::commmitAdditionalGeometryMoved(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteConnection(), GNENet::deleteEdge(), GNENet::deleteJunction(), GNENet::deleteLane(), GNEViewNet::deleteSelectedEdges(), GNEViewNet::deleteSelectedJunctions(), GNENet::duplicateLane(), GNENet::finishMoveSelection(), GNESelectorFrame::handleIDs(), GNEViewNet::hotkeyDel(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEViewNet::onCmdDuplicateLane(), GNEConnectorFrame::onCmdOK(), GNETLSEditorFrame::onCmdOK(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEConnectorFrame::onCmdResetSelectedConnections(), GNEViewNet::onCmdRevertRestriction(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onLeftBtnPress(), GNEAdditionalFrame::removeAdditional(), GNEViewNet::removeRestrictedLane(), GNENet::removeSolitaryJunctions(), GNENet::replaceJunctionByGeometry(), GNEViewNet::restrictLane(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), GNEEdge::setEndpoint(), GNEEdge::setNumLanes(), and GNENet::splitEdgesBidi().
long GNEUndoList::p_onUpdRedo | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
event after Redo
Definition at line 160 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
long GNEUndoList::p_onUpdUndo | ( | FXObject * | sender, |
FXSelector | , | ||
void * | |||
) |
Definition at line 142 of file GNEUndoList.cpp.
References hasCommandGroup(), and myCommandGroups.
void GNEUndoList::redo | ( | ) |
redo the last command group
Definition at line 125 of file GNEUndoList.cpp.
References myParent, and GNEApplicationWindow::updateControls().
void GNEUndoList::undo | ( | ) |
undo the last command group
Definition at line 117 of file GNEUndoList.cpp.
References myParent, and GNEApplicationWindow::updateControls().
|
private |
Definition at line 127 of file GNEUndoList.h.
Referenced by hasCommandGroup(), p_abort(), p_begin(), p_end(), p_onUpdRedo(), and p_onUpdUndo().
|
private |
Definition at line 130 of file GNEUndoList.h.