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

 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
 

Detailed Description

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

Member Function Documentation

§ hasCommandGroup()

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

§ p_abort()

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

§ p_add()

§ 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 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(), GNEInspectorFrame::AttrInput::onCmdSetAttribute(), 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().

§ p_clear()

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

§ 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 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(), GNEInspectorFrame::AttrInput::onCmdSetAttribute(), 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().

§ p_onUpdRedo()

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

event after Redo

Definition at line 160 of file GNEUndoList.cpp.

References hasCommandGroup(), and myCommandGroups.

§ p_onUpdUndo()

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

Definition at line 142 of file GNEUndoList.cpp.

References hasCommandGroup(), and myCommandGroups.

§ redo()

void GNEUndoList::redo ( )

redo the last command group

Definition at line 125 of file GNEUndoList.cpp.

References myParent, and GNEApplicationWindow::updateControls().

§ undo()

void GNEUndoList::undo ( )

undo the last command group

Definition at line 117 of file GNEUndoList.cpp.

References myParent, and GNEApplicationWindow::updateControls().

Field Documentation

§ myCommandGroups

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

Definition at line 127 of file GNEUndoList.h.

Referenced by hasCommandGroup(), p_abort(), p_begin(), p_end(), p_onUpdRedo(), and p_onUpdUndo().

§ myParent

GNEApplicationWindow* const GNEUndoList::myParent
private

Definition at line 130 of file GNEUndoList.h.

Referenced by redo(), and undo().


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