Eclipse SUMO - Simulation of Urban MObility
GNEUndoList Class Reference

#include <GNEUndoList.h>

Inheritance diagram for GNEUndoList:
Collaboration diagram for GNEUndoList:

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 myGNEApplicationWindowParent
 

Detailed Description

Definition at line 48 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 65 of file GNEUndoList.cpp.

Member Function Documentation

◆ currentCommandGroupSize()

int GNEUndoList::currentCommandGroupSize ( ) const

◆ hasCommandGroup()

bool GNEUndoList::hasCommandGroup ( ) const

Check if undoList has command group.

Definition at line 231 of file GNEUndoList.cpp.

References myCommandGroups.

Referenced by GNEJunction::invalidateTLS(), p_abort(), p_onUpdRedo(), p_onUpdUndo(), GNECreateEdgeFrame::processClick(), and GNEJunction::setLogicValid().

◆ p_abort()

void GNEUndoList::p_abort ( )

◆ p_abortLastCommandGroup()

◆ p_add()

void GNEUndoList::p_add ( GNEChange_Attribute cmd)

special method, avoid empty changes, always execute

Definition at line 131 of file GNEUndoList.cpp.

References GNEChange_Attribute::trueChange().

Referenced by GNEPOI::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNEAccess::commitGeometryMoving(), GNEDetectorE1::commitGeometryMoving(), GNEDetectorE1Instant::commitGeometryMoving(), GNEDetectorE2::commitGeometryMoving(), GNEDetectorE3::commitGeometryMoving(), GNEDetectorEntryExit::commitGeometryMoving(), GNEParkingSpace::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNETAZ::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNEPersonTrip::commitGeometryMoving(), GNERide::commitGeometryMoving(), GNEStop::commitGeometryMoving(), GNEWalk::commitGeometryMoving(), GNEPoly::commitShapeChange(), GNETAZ::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::commitShapeEndChange(), GNEEdge::commitShapeStartChange(), GNEStop::enableAttribute(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNERoute::GNERoutePopupMenu::onCmdApplyDistance(), GNENet::replaceIncomingEdge(), GNEAccess::setAttribute(), GNEBusStop::setAttribute(), GNECalibrator::setAttribute(), GNECalibratorFlow::setAttribute(), GNEChargingStation::setAttribute(), GNEClosingLaneReroute::setAttribute(), GNEClosingReroute::setAttribute(), GNEContainerStop::setAttribute(), GNEDestProbReroute::setAttribute(), GNEDetectorE1::setAttribute(), GNEDetectorE1Instant::setAttribute(), GNEDetectorE2::setAttribute(), GNEDetectorE3::setAttribute(), GNEDetectorEntryExit::setAttribute(), GNEParkingArea::setAttribute(), GNEParkingAreaReroute::setAttribute(), GNEParkingSpace::setAttribute(), GNEPOI::setAttribute(), GNEPoly::setAttribute(), GNERerouter::setAttribute(), GNERerouterInterval::setAttribute(), GNERouteProbe::setAttribute(), GNERouteProbReroute::setAttribute(), GNETAZ::setAttribute(), GNETAZSourceSink::setAttribute(), GNEVaporizer::setAttribute(), GNEVariableSpeedSign::setAttribute(), GNEVariableSpeedSignStep::setAttribute(), GNEPerson::setAttribute(), GNEPersonTrip::setAttribute(), GNERide::setAttribute(), GNERoute::setAttribute(), GNEStop::setAttribute(), GNEVehicle::setAttribute(), GNEVehicleType::setAttribute(), GNEWalk::setAttribute(), GNEConnection::setAttribute(), GNEEdge::setAttribute(), GNELane::setAttribute(), GNENet::splitEdge(), GNENet::splitJunction(), GNERouteHandler::transformToFlow(), GNERouteHandler::transformToRouteFlow(), GNERouteHandler::transformToTrip(), and GNERouteHandler::transformToVehicle().

◆ 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 72 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::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNEConnectorFrame::buildConnection(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::builDestProbReroute(), GNERouteHandler::buildFlow(), GNERouteHandler::buildFlowOverRoute(), GNERouteHandler::buildFlowWithEmbeddedRoute(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingSpace(), GNEPersonFrame::buildPerson(), GNERouteHandler::buildPerson(), GNERouteHandler::buildPersonFlow(), GNERouteHandler::buildPersonTripBusStop(), GNERouteHandler::buildPersonTripFromTo(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNERouteHandler::buildRideBusStop(), GNERouteHandler::buildRideFromTo(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNERouteHandler::buildStop(), GNEAdditionalHandler::buildTAZ(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNERouteHandler::buildTrip(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSign(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNERouteHandler::buildVehicleOverRoute(), GNERouteHandler::buildVehicleWithEmbeddedRoute(), GNERouteHandler::buildWalkBusStop(), GNERouteHandler::buildWalkEdges(), GNERouteHandler::buildWalkFromTo(), GNERouteHandler::buildWalkRoute(), GNEAdditionalHandler::builParkingAreaReroute(), GNEPoly::changeFirstGeometryPoint(), GNEConnection::changeTLIndex(), GNENet::cleanInvalidCrossings(), GNENet::cleanInvalidDemandElements(), GNENet::cleanUnusedRoutes(), GNESelectorFrame::clearCurrentSelection(), GNENet::clearJunctionConnections(), GNERouteHandler::closePerson(), GNEPoly::closePolygon(), GNERouteHandler::closeRoute(), GNERouteHandler::closeVType(), GNEPOI::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNEAccess::commitGeometryMoving(), GNEDetectorE1::commitGeometryMoving(), GNEDetectorE1Instant::commitGeometryMoving(), GNEDetectorE2::commitGeometryMoving(), GNEDetectorE3::commitGeometryMoving(), GNEDetectorEntryExit::commitGeometryMoving(), GNEParkingSpace::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNETAZ::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNEPersonTrip::commitGeometryMoving(), GNERide::commitGeometryMoving(), GNEStop::commitGeometryMoving(), GNEWalk::commitGeometryMoving(), GNEPoly::commitShapeChange(), GNETAZ::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::commitShapeEndChange(), GNEEdge::commitShapeStartChange(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteAdditional(), GNENet::deleteConnection(), GNENet::deleteCrossing(), GNENet::deleteDemandElement(), GNENet::deleteEdge(), GNEPoly::deleteGeometryPoint(), GNETAZ::deleteGeometryPoint(), GNEEdge::deleteGeometryPoint(), GNENet::deleteJunction(), GNENet::deleteLane(), GNEViewNet::deleteSelectedAdditionals(), GNEViewNet::deleteSelectedConnections(), GNEViewNet::deleteSelectedCrossings(), GNEViewNet::deleteSelectedDemandElements(), GNEViewNet::deleteSelectedEdges(), GNEViewNet::deleteSelectedJunctions(), GNEViewNet::deleteSelectedLanes(), GNEViewNet::deleteSelectedShapes(), GNENet::deleteShape(), GNENet::duplicateLane(), GNEEdge::editEndpoint(), GNETLSEditorFrame::editJunction(), GNEApplicationWindow::handleEvent_NetworkLoaded(), GNESelectorFrame::handleIDs(), GNEViewNet::hotkeyDel(), GNEAdditionalDialog::initChanges(), GNEDemandElementDialog::initChanges(), GNENet::joinRoutes(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEFixAdditionalElements::onCmdAccept(), GNEFixDemandElements::onCmdAccept(), GNEViewNet::onCmdAddReversedEdge(), GNERoute::GNERoutePopupMenu::onCmdApplyDistance(), GNEViewNet::onCmdClearConnections(), GNEViewNet::onCmdDuplicateLane(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEApplicationWindow::onCmdOpenDemandElements(), GNEApplicationWindow::onCmdOpenTLSPrograms(), GNEViewNet::onCmdResetConnections(), GNEViewNet::onCmdResetJunctionShape(), GNEViewNet::onCmdResetLaneCustomShape(), GNEViewNet::onCmdResetLength(), GNEViewNet::onCmdReverseEdge(), GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSelectFlowRadioButton(), GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSetFlowAttribute(), GNEViewNet::onCmdSmoothEdges(), GNEViewNet::onCmdSmoothEdgesElevation(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onCmdStraightenEdgesElevation(), GNEViewNet::onCmdTransformPOI(), GNEPoly::openPolygon(), GNEVehicleType::overwriteVType(), GNECreateEdgeFrame::processClick(), GNEViewNet::removeRestrictedLane(), GNEDeleteFrame::removeSelectedAttributeCarriers(), GNENet::removeSolitaryJunctions(), GNENet::replaceIncomingEdge(), GNENet::replaceJunctionByGeometry(), GNEAdditionalDialog::resetChanges(), GNEDemandElementDialog::resetChanges(), GNENet::resetJunctionConnections(), GNEViewNet::restrictLane(), GNENet::reverseEdge(), GNEEdge::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setNumLanes(), GNEPoly::simplifyShape(), GNENet::splitEdge(), GNENet::splitEdgesBidi(), GNENet::splitJunction(), GNERouteHandler::transformToFlow(), GNERouteHandler::transformToRouteFlow(), GNERouteHandler::transformToTrip(), and GNERouteHandler::transformToVehicle().

◆ p_clear()

void GNEUndoList::p_clear ( )

clears the undo list (implies abort)

Definition at line 86 of file GNEUndoList.cpp.

References p_abort().

Referenced by GNENet::computeAndUpdate(), 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 79 of file GNEUndoList.cpp.

References myCommandGroups.

Referenced by GNEAdditionalDialog::acceptChanges(), GNEDemandElementDialog::acceptChanges(), GNEPolygonFrame::addPOI(), GNENet::addPOI(), GNEPolygonFrame::addPOILane(), GNEPolygonFrame::addPolygon(), GNENet::addPolygon(), GNEViewNet::addRestrictedLane(), GNENet::addReversedEdge(), GNEAdditionalHandler::buildAccess(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildCalibratorFlow(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1(), GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::builDestProbReroute(), GNERouteHandler::buildFlow(), GNERouteHandler::buildFlowOverRoute(), GNERouteHandler::buildFlowWithEmbeddedRoute(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingSpace(), GNERouteHandler::buildPerson(), GNERouteHandler::buildPersonFlow(), GNEPersonFrame::buildPersonOverRoute(), GNEPersonFrame::buildPersonOverStop(), GNERouteHandler::buildPersonTripBusStop(), GNERouteHandler::buildPersonTripFromTo(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNERouteHandler::buildRideBusStop(), GNERouteHandler::buildRideFromTo(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNERouteHandler::buildStop(), GNEAdditionalHandler::buildTAZ(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNERouteHandler::buildTrip(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSign(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNERouteHandler::buildVehicleOverRoute(), GNERouteHandler::buildVehicleWithEmbeddedRoute(), GNERouteHandler::buildWalkBusStop(), GNERouteHandler::buildWalkEdges(), GNERouteHandler::buildWalkFromTo(), GNERouteHandler::buildWalkRoute(), GNEAdditionalHandler::builParkingAreaReroute(), GNEPoly::changeFirstGeometryPoint(), GNEConnection::changeTLIndex(), GNENet::cleanInvalidCrossings(), GNENet::cleanInvalidDemandElements(), GNENet::cleanUnusedRoutes(), GNESelectorFrame::clearCurrentSelection(), GNENet::clearJunctionConnections(), GNERouteHandler::closePerson(), GNEPoly::closePolygon(), GNERouteHandler::closeRoute(), GNERouteHandler::closeVehicle(), GNERouteHandler::closeVType(), GNEPOI::commitGeometryMoving(), GNEJunction::commitGeometryMoving(), GNEAccess::commitGeometryMoving(), GNEDetectorE1::commitGeometryMoving(), GNEDetectorE1Instant::commitGeometryMoving(), GNEDetectorE2::commitGeometryMoving(), GNEDetectorE3::commitGeometryMoving(), GNEDetectorEntryExit::commitGeometryMoving(), GNEParkingSpace::commitGeometryMoving(), GNERerouter::commitGeometryMoving(), GNEStoppingPlace::commitGeometryMoving(), GNETAZ::commitGeometryMoving(), GNEVariableSpeedSign::commitGeometryMoving(), GNEPersonTrip::commitGeometryMoving(), GNERide::commitGeometryMoving(), GNEStop::commitGeometryMoving(), GNEWalk::commitGeometryMoving(), GNEPoly::commitShapeChange(), GNETAZ::commitShapeChange(), GNEEdge::commitShapeChange(), GNEEdge::commitShapeEndChange(), GNEEdge::commitShapeStartChange(), GNEEdge::copyTemplate(), GNENet::createEdge(), GNENet::deleteAdditional(), GNENet::deleteConnection(), GNENet::deleteCrossing(), GNENet::deleteDemandElement(), GNENet::deleteEdge(), GNEPoly::deleteGeometryPoint(), GNETAZ::deleteGeometryPoint(), GNEEdge::deleteGeometryPoint(), GNENet::deleteJunction(), GNENet::deleteLane(), GNEViewNet::deleteSelectedAdditionals(), GNEViewNet::deleteSelectedConnections(), GNEViewNet::deleteSelectedCrossings(), GNEViewNet::deleteSelectedDemandElements(), GNEViewNet::deleteSelectedEdges(), GNEViewNet::deleteSelectedJunctions(), GNEViewNet::deleteSelectedLanes(), GNEViewNet::deleteSelectedShapes(), GNENet::deleteShape(), GNENet::duplicateLane(), GNEPersonFrame::edgePathCreated(), GNEEdge::editEndpoint(), GNEApplicationWindow::handleEvent_NetworkLoaded(), GNESelectorFrame::handleIDs(), GNEViewNet::hotkeyDel(), GNENet::joinRoutes(), GNENet::joinSelectedJunctions(), GNENet::mergeJunctions(), GNEFixAdditionalElements::onCmdAccept(), GNEFixDemandElements::onCmdAccept(), GNEViewNet::onCmdAddReversedEdge(), GNERoute::GNERoutePopupMenu::onCmdApplyDistance(), GNEViewNet::onCmdClearConnections(), GNEViewNet::onCmdDuplicateLane(), GNETLSEditorFrame::onCmdOK(), GNEApplicationWindow::onCmdOpenAdditionals(), GNEFrameAttributesModuls::AttributesEditorRow::onCmdOpenAttributeDialog(), GNEApplicationWindow::onCmdOpenDemandElements(), GNEApplicationWindow::onCmdOpenTLSPrograms(), GNEViewNet::onCmdResetConnections(), GNEViewNet::onCmdResetJunctionShape(), GNEViewNet::onCmdResetLaneCustomShape(), GNEViewNet::onCmdResetLength(), GNEViewNet::onCmdReverseEdge(), GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSelectFlowRadioButton(), GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSetFlowAttribute(), GNEViewNet::onCmdSmoothEdges(), GNEViewNet::onCmdSmoothEdgesElevation(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onCmdStraightenEdgesElevation(), GNEViewNet::onCmdTransformPOI(), GNEPoly::openPolygon(), GNEVehicleType::overwriteVType(), GNECreateEdgeFrame::processClick(), GNEViewNet::removeRestrictedLane(), GNEDeleteFrame::removeSelectedAttributeCarriers(), GNENet::removeSolitaryJunctions(), GNENet::replaceIncomingEdge(), GNENet::replaceJunctionByGeometry(), GNENet::resetJunctionConnections(), GNEViewNet::restrictLane(), GNENet::reverseEdge(), GNEEdge::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setNumLanes(), GNEPoly::simplifyShape(), GNENet::splitEdge(), GNENet::splitEdgesBidi(), GNENet::splitJunction(), GNERouteHandler::transformToFlow(), GNERouteHandler::transformToRouteFlow(), GNERouteHandler::transformToTrip(), and GNERouteHandler::transformToVehicle().

◆ p_onUpdRedo()

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

◆ p_onUpdUndo()

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

◆ redo()

void GNEUndoList::redo ( )

redo the last command group

Definition at line 122 of file GNEUndoList.cpp.

References myGNEApplicationWindowParent, GNEApplicationWindow::updateControls(), and WRITE_DEBUG.

Referenced by GNEApplicationWindow::onCmdRedo().

◆ undo()

void GNEUndoList::undo ( )

undo the last command group

Definition at line 113 of file GNEUndoList.cpp.

References myGNEApplicationWindowParent, GNEApplicationWindow::updateControls(), and WRITE_DEBUG.

Referenced by GNEApplicationWindow::onCmdUndo().

Field Documentation

◆ myCommandGroups

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

◆ myGNEApplicationWindowParent

GNEApplicationWindow* const GNEUndoList::myGNEApplicationWindowParent
private

Definition at line 129 of file GNEUndoList.h.

Referenced by p_onUpdRedo(), p_onUpdUndo(), redo(), and undo().


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