예제 #1
0
void
InsertLaneCommand::redo()
{

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

    laneSection_->addLane(newLane_);


    setRedone();
}
예제 #2
0
/*! \brief .
*
*/
void
MoveRoadSectionCommand::redo()
{
    roadSection_->getParentRoad()->moveRoadSection(roadSection_, newS_, sectionType_);

    setRedone();
}
예제 #3
0
void
RemoveLaneCommand::redo()
{

    laneSection_->removeLane(oldLane_);

    Lane *lane;
    if (id_ < 0)
    {
        int i = id_;
        while ((lane = laneSection_->getNextLower(i)) != NULL)
        {
            int index = lane->getId();
            lane->setId(i);
            i = index;
        }
    }
    else
    {
        int i = id_;
        while ((lane = laneSection_->getNextUpper(i)) != NULL)
        {
            int index = lane->getId();
            lane->setId(i);
            i = index;
        }
    }

    setRedone();
}
예제 #4
0
void
SetLaneRoadMarkSOffsetCommand::redo()
{
    mark_->setSOffset(newSOffset_);

    setRedone();
}
예제 #5
0
/*! \brief Adds the TypeSection to the RSystemElementRoad.
*
* This also notifies the RSystemElementRoad.
*/
void
AddTypeSectionCommand::redo()
{
    // Set //
    //
    road_->addTypeSection(newTypeSection_);

    setRedone();
}
예제 #6
0
/*! \brief Sets the Road Type of a TypeSection.
*/
void
SetTypeTypeSectionCommand::redo()
{
    // Set //
    //
    typeSection_->setRoadType(newRoadType_);

    setRedone();
}
예제 #7
0
/*! \brief Sets the Road Type of a TypeSection.
*/
void
SetSpeedTypeSectionCommand::redo()
{
    // Set //
    //
    typeSection_->setSpeedRecord(newSpeedRecord);

    setRedone();
}
예제 #8
0
/*! \brief Removes the TypeSection from the RSystemElementRoad.
*
* This also notifies the RSystemElementRoad.
*/
void
DeleteTypeSectionCommand::redo()
{
    if (!isValid())
        return;

    // Set //
    //
    road_->delTypeSection(deletedTypeSection_);

    setRedone();
}
예제 #9
0
void
InsertLaneWidthCommand::redo()
{
    lane_->addWidthEntry(newLaneWidth_);
    setRedone();
}