Example #1
0
void
SetLaneRoadMarkSOffsetCommand::undo()
{
    mark_->setSOffset(oldSOffset_);

    setUndone();
}
Example #2
0
/*! \brief
*
*/
void
MoveRoadSectionCommand::undo()
{
    roadSection_->getParentRoad()->moveRoadSection(roadSection_, oldS_, sectionType_);

    setUndone();
}
Example #3
0
void
RemoveLaneCommand::undo()
{
    Lane *lane;
    if (id_ < 0)
    {
        lane = laneSection_->getFirst();
        int i;
        while (lane && ((i = lane->getId()) <= id_))
        {
            lane->setId(i - 1);
            lane = laneSection_->getNextUpper(i);
        }
    }
    else
    {
        lane = laneSection_->getLast();
        int i;
        while (lane && ((i = lane->getId()) >= id_))
        {
            lane->setId(i + 1);
            lane = laneSection_->getNextLower(i);
        }
    }
    laneSection_->addLane(oldLane_);

    setUndone();
}
Example #4
0
void
InsertLaneCommand::undo()
{

    laneSection_->removeLane(newLane_);

    if (id_ < 0)
    {
        for (int i = id_ - 1; i >= laneSection_->getRightmostLaneId(); i--)
        {
            Lane *lane = laneSection_->getLane(i);
            if (lane)
            {
                lane->setId(i+1);
            }
        }
    }
    else
    {
        for (int i = id_ + 1; i <= laneSection_->getLeftmostLaneId(); i++)
        {
            Lane *lane = laneSection_->getLane(i);
            if (lane)
            {
                lane->setId(i-1);
            }
        }

    }

    setUndone();
}
Example #5
0
void
InsertLaneWidthCommand::undo()
{

    lane_->delWidthEntry(newLaneWidth_);

    setUndone();
}
Example #6
0
/*! \brief Removes the TypeSection from the RSystemElementRoad.
*
* This also notifies the RSystemElementRoad.
*/
void
AddTypeSectionCommand::undo()
{
    // Reset //
    //
    road_->delTypeSection(newTypeSection_);

    setUndone();
}
Example #7
0
/*! \brief Resets the Road Type of a TypeSection.
*/
void
SetTypeTypeSectionCommand::undo()
{
    // Reset //
    //
    typeSection_->setRoadType(oldRoadType_);

    setUndone();
}
Example #8
0
/*! \brief Resets the Road Type of a TypeSection.
*/
void
SetSpeedTypeSectionCommand::undo()
{
    // Reset //
    //
    typeSection_->setSpeedRecord(oldSpeedRecord);

    setUndone();
}
Example #9
0
/*! \brief Adds the TypeSection to the RSystemElementRoad.
*
* This also notifies the RSystemElementRoad.
*/
void
DeleteTypeSectionCommand::undo()
{
    if (!isValid())
        return;

    // Reset //
    //
    road_->addTypeSection(deletedTypeSection_);

    setUndone();
}