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(); }
/*! \brief . * */ void MoveRoadSectionCommand::redo() { roadSection_->getParentRoad()->moveRoadSection(roadSection_, newS_, sectionType_); setRedone(); }
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(); }
void SetLaneRoadMarkSOffsetCommand::redo() { mark_->setSOffset(newSOffset_); setRedone(); }
/*! \brief Adds the TypeSection to the RSystemElementRoad. * * This also notifies the RSystemElementRoad. */ void AddTypeSectionCommand::redo() { // Set // // road_->addTypeSection(newTypeSection_); setRedone(); }
/*! \brief Sets the Road Type of a TypeSection. */ void SetTypeTypeSectionCommand::redo() { // Set // // typeSection_->setRoadType(newRoadType_); setRedone(); }
/*! \brief Sets the Road Type of a TypeSection. */ void SetSpeedTypeSectionCommand::redo() { // Set // // typeSection_->setSpeedRecord(newSpeedRecord); setRedone(); }
/*! \brief Removes the TypeSection from the RSystemElementRoad. * * This also notifies the RSystemElementRoad. */ void DeleteTypeSectionCommand::redo() { if (!isValid()) return; // Set // // road_->delTypeSection(deletedTypeSection_); setRedone(); }
void InsertLaneWidthCommand::redo() { lane_->addWidthEntry(newLaneWidth_); setRedone(); }