Eclipse SUMO - Simulation of Urban MObility
|
move element More...
#include <GNEMoveElement.h>
Public Member Functions | |
virtual GNEMoveOperation * | getMoveOperation ()=0 |
get move operation | |
GNEMoveElement () | |
constructor | |
virtual void | removeGeometryPoint (const Position clickedPosition, GNEUndoList *undoList)=0 |
remove geometry point in the clicked position | |
virtual | ~GNEMoveElement () |
Static Public Member Functions | |
static void | commitMove (const GNEViewNet *viewNet, GNEMoveOperation *moveOperation, const GNEMoveOffset &offset, GNEUndoList *undoList) |
commit move element for the given offset | |
static void | moveElement (const GNEViewNet *viewNet, GNEMoveOperation *moveOperation, const GNEMoveOffset &offset) |
move element the for given offset (note: offset can be X-Y-0, 0-0-Z or X-Y-Z) | |
Protected Member Functions | |
GNEMoveOperation * | calculateMoveShapeOperation (const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed) |
calculate move shape operation | |
Protected Attributes | |
double | myMoveElementLateralOffset |
move element lateral offset (used by elements placed over lanes | |
Private Member Functions | |
virtual void | commitMoveShape (const GNEMoveResult &moveResult, GNEUndoList *undoList)=0 |
commit move shape | |
GNEMoveElement (const GNEMoveElement &)=delete | |
Invalidated copy constructor. | |
GNEMoveElement & | operator= (const GNEMoveElement &)=delete |
Invalidated assignment operator. | |
virtual void | setMoveShape (const GNEMoveResult &moveResult)=0 |
set move shape | |
Static Private Member Functions | |
static PositionVector | calculateExtrapolatedVector (const GNEMoveOperation *moveOperation, const GNEMoveResult &moveResult) |
calculate width/height shape | |
static double | calculateLaneOffset (const GNEViewNet *viewNet, const GNELane *lane, const double firstPosition, const double lastPosition, const GNEMoveOffset &offset, const double extremFrom, const double extremTo) |
calculate lane offset | |
static void | calculateMoveResult (GNEMoveResult &moveResult, const GNEViewNet *viewNet, const GNELane *firstLane, const double firstPos, const GNELane *lastLane, const double lastPos, const GNEMoveOffset &offset) |
calculate double movement over two lanes | |
static void | calculateMoveResult (GNEMoveResult &moveResult, const GNEViewNet *viewNet, const GNELane *lane, const double firstPos, const double lastPos, const GNEMoveOffset &offset) |
calculate double movement over one lane | |
static void | calculateMoveResult (GNEMoveResult &moveResult, const GNEViewNet *viewNet, const GNELane *lane, const double pos, const GNEMoveOffset &offset, const double extremFrom, const double extremTo) |
calculate single movement over one lane | |
static void | calculateNewLaneChange (const GNEViewNet *viewNet, const GNELane *originalLane, const GNELane *&newLane, double &laneOffset) |
calculate new lane change | |
move element
Definition at line 226 of file GNEMoveElement.h.
GNEMoveElement::GNEMoveElement | ( | ) |
constructor
Definition at line 186 of file GNEMoveElement.cpp.
|
inlinevirtual |
Definition at line 233 of file GNEMoveElement.h.
|
privatedelete |
Invalidated copy constructor.
|
staticprivate |
calculate width/height shape
Definition at line 527 of file GNEMoveElement.cpp.
References PositionVector::extrapolate2D(), GNEMoveOperation::firstGeometryPoint, PositionVector::length2D(), PositionVector::nearest_offset_to_point2D(), GNEMoveOperation::originalShape, PositionVector::reverse(), GNEMoveOperation::shapeToMove, and GNEMoveResult::shapeToUpdate.
Referenced by commitMove(), and moveElement().
|
staticprivate |
calculate lane offset
Definition at line 421 of file GNEMoveElement.cpp.
References Position::add(), GNELane::getLaneShape(), PositionVector::length2D(), PositionVector::nearest_offset_to_point2D(), PositionVector::positionAtOffset2D(), GUISUMOAbstractView::snapToActiveGrid(), GNEMoveOffset::x, GNEMoveOffset::y, and GNEMoveOffset::z.
Referenced by calculateMoveResult(), calculateMoveResult(), and calculateMoveResult().
|
staticprivate |
calculate double movement over two lanes
Definition at line 484 of file GNEMoveElement.cpp.
References calculateLaneOffset(), GNELane::getLaneShape(), GNELane::getLengthGeometryFactor(), PositionVector::length2D(), GNEMoveResult::newFirstPos, and GNEMoveResult::newLastPos.
|
staticprivate |
calculate double movement over one lane
Definition at line 473 of file GNEMoveElement.cpp.
References calculateLaneOffset(), GNELane::getLaneShape(), GNELane::getLengthGeometryFactor(), PositionVector::length2D(), GNEMoveResult::newFirstPos, and GNEMoveResult::newLastPos.
|
staticprivate |
calculate single movement over one lane
Definition at line 462 of file GNEMoveElement.cpp.
References calculateLaneOffset(), GNELane::getLengthGeometryFactor(), GNEMoveResult::newFirstPos, and GNEMoveResult::newLastPos.
Referenced by commitMove(), and moveElement().
|
protected |
calculate move shape operation
Definition at line 192 of file GNEMoveElement.cpp.
References GUIViewObjectsHandler::getSelectedGeometryPoints(), GUIViewObjectsHandler::getSelectedPositionOverShape(), gViewObjectsHandler, PositionVector::indexOfClosest(), PositionVector::insertAtClosest(), and Position::INVALID.
Referenced by GNETAZ::getMoveOperation(), GNEConnection::getMoveOperation(), GNECrossing::getMoveOperation(), GNEEdge::getMoveOperation(), GNEJunction::getMoveOperation(), GNELane::getMoveOperation(), GNEWalkingArea::getMoveOperation(), and GNEPoly::getMoveOperation().
|
staticprivate |
calculate new lane change
Definition at line 495 of file GNEMoveElement.cpp.
References Position::distanceSquaredTo2D(), Position::distanceTo2D(), GNELane::getIndex(), GNEEdge::getLanes(), GNELane::getLaneShape(), GNELane::getParentEdge(), GUISUMOAbstractView::getPositionInformation(), PositionVector::nearest_offset_to_point2D(), and PositionVector::positionAtOffset2D().
Referenced by commitMove(), and moveElement().
|
static |
commit move element for the given offset
Definition at line 309 of file GNEMoveElement.cpp.
References PositionVector::add(), GNEMoveOperation::allowChangeLane, calculateExtrapolatedVector(), calculateMoveResult(), calculateNewLaneChange(), GNEMoveResult::clearLanes(), commitMoveShape(), GNEMoveOperation::firstLane, GNEMoveResult::firstLaneOffset, GNEMoveOperation::firstPosition, GNEMoveOperation::geometryPointsToMove, GNEMoveResult::geometryPointsToMove, GNEMoveFrame::getCommonModeOptions(), GNELane::getLaneShapeLength(), GNEMoveFrame::CommonModeOptions::getMergeGeometryPoints(), GNEViewParent::getMoveFrame(), GNEViewNet::getViewParent(), GNEMoveOperation::HEIGHT, Position::INVALID, GNEMoveOperation::lastLane, GNEMoveResult::lastLaneOffset, GNEMoveOperation::lastPosition, GNEMoveOperation::LENGTH, GNEMoveOperation::moveElement, GNEMoveOperation::MULTIPLE_LANES_MOVE_BOTH_FIRST, GNEMoveOperation::MULTIPLE_LANES_MOVE_BOTH_LAST, GNEMoveOperation::MULTIPLE_LANES_MOVE_FIRST, GNEMoveOperation::MULTIPLE_LANES_MOVE_LAST, GNEMoveResult::newFirstLane, GNEMoveResult::newFirstPos, GNEMoveResult::newLastLane, GNEMoveResult::newLastPos, GNEMoveOperation::operationType, GNEMoveOperation::originalGeometryPoints, GNEMoveOperation::originalShape, PositionVector::removeDoublePoints(), setMoveShape(), GNEMoveOperation::shapeToMove, GNEMoveResult::shapeToUpdate, GNEMoveOperation::SINGLE_LANE, GNEMoveOperation::SINGLE_LANE_MOVE_FIRST, GNEMoveOperation::SINGLE_LANE_MOVE_LAST, GUISUMOAbstractView::snapToActiveGrid(), GNEMoveOperation::WIDTH, GNEMoveOffset::x, GNEMoveOffset::y, and GNEMoveOffset::z.
Referenced by GNEViewNetHelper::MoveMultipleElementModul::finishMoveSelection(), GNEViewNetHelper::MoveSingleElementModul::finishMoveSingleElement(), GNEViewNetHelper::MoveMultipleElementModul::moveSelection(), and GNEViewNetHelper::MoveSingleElementModul::moveSingleElement().
|
privatepure virtual |
commit move shape
Implemented in GNEAccess, GNECalibrator, GNECalibratorFlow, GNEClosingLaneReroute, GNEClosingReroute, GNEDestProbReroute, GNEEntryExitDetector, GNEInductionLoopDetector, GNEInstantInductionLoopDetector, GNELaneAreaDetector, GNEMultiEntryExitDetector, GNEOverheadWire, GNEParkingAreaReroute, GNEParkingSpace, GNERerouter, GNERerouterInterval, GNERerouterSymbol, GNERouteProbe, GNERouteProbReroute, GNEStoppingPlace, GNETAZ, GNETAZSourceSink, GNETractionSubstation, GNEVaporizer, GNEVariableSpeedSign, GNEVariableSpeedSignStep, GNEVariableSpeedSignSymbol, GNEContainer, GNEDistribution, GNEPerson, GNEPersonTrip, GNERide, GNERoute, GNEStop, GNEStopPlan, GNETranship, GNETransport, GNEVehicle, GNEVType, GNEWalk, GNEConnection, GNECrossing, GNEEdge, GNEEdgeType, GNEInternalLane, GNEJunction, GNELane, GNELaneType, GNEWalkingArea, GNEPOI, GNEPoly, GNEAdditional, GNEDetector, and GNEDemandElement.
Referenced by commitMove().
|
pure virtual |
get move operation
Implemented in GNEAccess, GNECalibrator, GNECalibratorFlow, GNEClosingLaneReroute, GNEClosingReroute, GNEDestProbReroute, GNEDetector, GNEMultiEntryExitDetector, GNEOverheadWire, GNEParkingAreaReroute, GNEParkingSpace, GNERerouter, GNERerouterInterval, GNERerouterSymbol, GNERouteProbe, GNERouteProbReroute, GNEStoppingPlace, GNETAZ, GNETAZSourceSink, GNETractionSubstation, GNEVaporizer, GNEVariableSpeedSign, GNEVariableSpeedSignStep, GNEVariableSpeedSignSymbol, GNEContainer, GNEDistribution, GNEPerson, GNEPersonTrip, GNERide, GNERoute, GNEStop, GNEStopPlan, GNETranship, GNETransport, GNEVehicle, GNEVType, GNEWalk, GNEConnection, GNECrossing, GNEEdge, GNEEdgeType, GNEInternalLane, GNEJunction, GNELane, GNELaneType, GNEWalkingArea, GNEPOI, GNEPoly, GNEAdditional, GNEDemandElement, and GNENetworkElement.
|
static |
move element the for given offset (note: offset can be X-Y-0, 0-0-Z or X-Y-Z)
Definition at line 221 of file GNEMoveElement.cpp.
References PositionVector::add(), GNEMoveOperation::allowChangeLane, calculateExtrapolatedVector(), calculateMoveResult(), calculateNewLaneChange(), GNEMoveResult::clearLanes(), GNEMoveOperation::firstLane, GNEMoveResult::firstLaneOffset, GNEMoveOperation::firstPosition, GNEMoveOperation::geometryPointsToMove, GNEMoveResult::geometryPointsToMove, GNELane::getLaneShapeLength(), GNEMoveOperation::HEIGHT, Position::INVALID, GNEMoveOperation::lastLane, GNEMoveOperation::lastPosition, GNEMoveOperation::LENGTH, GNEMoveOperation::moveElement, GNEMoveOperation::MULTIPLE_LANES_MOVE_BOTH_FIRST, GNEMoveOperation::MULTIPLE_LANES_MOVE_BOTH_LAST, GNEMoveOperation::MULTIPLE_LANES_MOVE_FIRST, GNEMoveOperation::MULTIPLE_LANES_MOVE_LAST, GNEMoveResult::newFirstLane, GNEMoveOperation::operationType, setMoveShape(), GNEMoveOperation::shapeToMove, GNEMoveResult::shapeToUpdate, GNEMoveOperation::SINGLE_LANE, GNEMoveOperation::SINGLE_LANE_MOVE_FIRST, GNEMoveOperation::SINGLE_LANE_MOVE_LAST, GUISUMOAbstractView::snapToActiveGrid(), GNEMoveOperation::WIDTH, GNEMoveOffset::x, GNEMoveOffset::y, and GNEMoveOffset::z.
Referenced by GNEViewNetHelper::MoveSingleElementModul::getMovedElement(), GNEViewNetHelper::MoveMultipleElementModul::moveSelection(), and GNEViewNetHelper::MoveSingleElementModul::moveSingleElement().
|
privatedelete |
Invalidated assignment operator.
|
pure virtual |
remove geometry point in the clicked position
Implemented in GNEAdditional, GNETAZ, GNEDemandElement, GNEConnection, GNECrossing, GNEEdge, GNEEdgeType, GNEInternalLane, GNEJunction, GNELane, GNELaneType, GNEWalkingArea, GNEPOI, and GNEPoly.
Referenced by GNENetworkElement::getShapeEditedPopUpMenu(), and GNEViewNet::processLeftButtonPressNetwork().
|
privatepure virtual |
set move shape
Implemented in GNEAccess, GNECalibrator, GNECalibratorFlow, GNEClosingLaneReroute, GNEClosingReroute, GNEDestProbReroute, GNEEntryExitDetector, GNEInductionLoopDetector, GNEInstantInductionLoopDetector, GNELaneAreaDetector, GNEMultiEntryExitDetector, GNEOverheadWire, GNEParkingAreaReroute, GNEParkingSpace, GNERerouter, GNERerouterInterval, GNERerouterSymbol, GNERouteProbe, GNERouteProbReroute, GNEStoppingPlace, GNETAZ, GNETAZSourceSink, GNETractionSubstation, GNEVaporizer, GNEVariableSpeedSign, GNEVariableSpeedSignStep, GNEVariableSpeedSignSymbol, GNEContainer, GNEDistribution, GNEPerson, GNEPersonTrip, GNERide, GNERoute, GNEStop, GNEStopPlan, GNETranship, GNETransport, GNEVehicle, GNEVType, GNEWalk, GNEConnection, GNECrossing, GNEEdge, GNEEdgeType, GNEInternalLane, GNEJunction, GNELane, GNELaneType, GNEWalkingArea, GNEPOI, GNEPoly, GNEAdditional, GNEDetector, and GNEDemandElement.
Referenced by commitMove(), and moveElement().
|
protected |
move element lateral offset (used by elements placed over lanes
Definition at line 251 of file GNEMoveElement.h.
Referenced by GNEAccess::commitMoveShape(), GNEEntryExitDetector::commitMoveShape(), GNEInductionLoopDetector::commitMoveShape(), GNEInstantInductionLoopDetector::commitMoveShape(), GNEVehicle::commitMoveShape(), GNEAccess::setMoveShape(), GNEEntryExitDetector::setMoveShape(), GNEInductionLoopDetector::setMoveShape(), GNEInstantInductionLoopDetector::setMoveShape(), GNEStoppingPlace::setMoveShape(), GNEStop::setMoveShape(), GNEVehicle::setMoveShape(), GNEStoppingPlace::setStoppingPlaceGeometry(), GNEDemandElement::updateDemandElementGeometry(), GNEDemandElement::updateDemandElementSpreadGeometry(), GNEAccess::updateGeometry(), GNEEntryExitDetector::updateGeometry(), GNEInductionLoopDetector::updateGeometry(), GNEInstantInductionLoopDetector::updateGeometry(), GNELaneAreaDetector::updateGeometry(), GNEStop::updateGeometry(), and GNEVehicle::updateGeometry().