SUMO - Simulation of Urban MObility
GNEUndoList Class Reference

#include <GNEUndoList.h>

Inheritance diagram for GNEUndoList:
Inheritance graph
Collaboration diagram for GNEUndoList:
Collaboration graph

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
 

Detailed Description

Definition at line 54 of file GNEUndoList.h.

Constructor & Destructor Documentation

◆ GNEUndoList()

GNEUndoList::GNEUndoList ( GNEApplicationWindow parent)

FOX declaration.

constructor

Note
be aware that "parent" may be not fully initialized when stored here, so don't call any methods on it.

Definition at line 77 of file GNEUndoList.cpp.

Member Function Documentation

◆ currentCommandGroupSize()

int GNEUndoList::currentCommandGroupSize ( ) const

get size of current CommandGroup

Definition at line 158 of file GNEUndoList.cpp.

References myCommandGroups.

Referenced by GNEAdditionalDialog::initChanges().

◆ hasCommandGroup()

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().

◆ p_abort()

void GNEUndoList::p_abort ( )

◆ p_abortLastCommandGroup()

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().

◆ p_add()

void GNEUndoList::p_add ( GNEChange_Attribute cmd)

◆ p_begin()

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().

◆ p_clear()

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().

◆ p_end()

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().

◆ p_onUpdRedo()

long GNEUndoList::p_onUpdRedo ( FXObject *  sender,
FXSelector  ,
void *   
)

event after Redo

Definition at line 186 of file GNEUndoList.cpp.

References hasCommandGroup(), and myCommandGroups.

◆ p_onUpdUndo()

long GNEUndoList::p_onUpdUndo ( FXObject *  sender,
FXSelector  ,
void *   
)

Definition at line 168 of file GNEUndoList.cpp.

References hasCommandGroup(), and myCommandGroups.

◆ redo()

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.

◆ undo()

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.

Field Documentation

◆ myCommandGroups

std::stack<CommandGroup*> GNEUndoList::myCommandGroups
private

◆ myParent

GNEApplicationWindow* const GNEUndoList::myParent
private

Definition at line 135 of file GNEUndoList.h.

Referenced by redo(), and undo().


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