![]() |
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 PositionVector originalShape, const Position mousePosition, const double snapRadius, const bool onlyContour) |
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 void | adjustBothPositions (const GNEViewNet *viewNet, const GNEMoveOperation *moveOperation, GNEMoveResult &moveResult, const GNEMoveOffset &offset) |
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 secondPosition, 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 *secondLane, const double secondPos, 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 secondPos, 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 | calculateNewLane (const GNEViewNet *viewNet, const GNELane *originalLane, const GNELane *&newLane, double &laneOffset) |
calculate new lane | |
move element
Definition at line 225 of file GNEMoveElement.h.
GNEMoveElement::GNEMoveElement | ( | ) |
constructor
Definition at line 186 of file GNEMoveElement.cpp.
|
inlinevirtual |
Definition at line 232 of file GNEMoveElement.h.
|
privatedelete |
Invalidated copy constructor.
|
staticprivate |
Definition at line 548 of file GNEMoveElement.cpp.
References calculateMoveResult(), GNEMoveOperation::firstLane, GNEMoveOperation::firstPosition, GNELane::getLaneShapeLength(), GNEMoveResult::newFirstPos, GNEMoveResult::newSecondPos, GNEMoveOperation::operationType, GNEMoveOperation::secondLane, GNEMoveOperation::secondPosition, GNEMoveOperation::TWO_LANES_MOVEBOTH_FIRST, and GNEMoveOperation::TWO_LANES_MOVEBOTH_SECOND.
Referenced by commitMove(), and moveElement().
|
staticprivate |
calculate width/height shape
Definition at line 588 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 442 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 505 of file GNEMoveElement.cpp.
References calculateLaneOffset(), GNELane::getLaneShape(), GNELane::getLengthGeometryFactor(), PositionVector::length2D(), GNEMoveResult::newFirstPos, and GNEMoveResult::newSecondPos.
|
staticprivate |
calculate double movement over one lane
Definition at line 494 of file GNEMoveElement.cpp.
References calculateLaneOffset(), GNELane::getLaneShape(), GNELane::getLengthGeometryFactor(), PositionVector::length2D(), GNEMoveResult::newFirstPos, and GNEMoveResult::newSecondPos.
|
staticprivate |
calculate single movement over one lane
Definition at line 483 of file GNEMoveElement.cpp.
References calculateLaneOffset(), GNELane::getLengthGeometryFactor(), GNEMoveResult::newFirstPos, and GNEMoveResult::newSecondPos.
Referenced by adjustBothPositions(), commitMove(), and moveElement().
|
protected |
calculate move shape operation
Definition at line 192 of file GNEMoveElement.cpp.
References Position::distanceSquaredTo2D(), PositionVector::indexOfClosest(), PositionVector::insertAtClosest(), Position::INVALID, PositionVector::nearest_offset_to_point2D(), and PositionVector::positionAtOffset2D().
Referenced by GNETAZ::getMoveOperation(), GNEConnection::getMoveOperation(), GNECrossing::getMoveOperation(), GNEEdge::getMoveOperation(), GNEJunction::getMoveOperation(), GNELane::getMoveOperation(), GNEWalkingArea::getMoveOperation(), and GNEPoly::getMoveOperation().
|
staticprivate |
calculate new lane
Definition at line 516 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 316 of file GNEMoveElement.cpp.
References PositionVector::add(), adjustBothPositions(), GNEMoveOperation::allowChangeLane, calculateExtrapolatedVector(), calculateMoveResult(), calculateNewLane(), 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::LENGTH, GNEMoveOperation::moveElement, GNEMoveResult::newFirstLane, GNEMoveResult::newFirstPos, GNEMoveResult::newSecondLane, GNEMoveResult::newSecondPos, GNEMoveOperation::ONE_LANE, GNEMoveOperation::ONE_LANE_MOVEFIRST, GNEMoveOperation::ONE_LANE_MOVESECOND, GNEMoveOperation::operationType, GNEMoveOperation::originalGeometryPoints, GNEMoveOperation::originalShape, PositionVector::removeDoublePoints(), GNEMoveOperation::secondLane, GNEMoveResult::secondLaneOffset, GNEMoveOperation::secondPosition, setMoveShape(), GNEMoveOperation::shapeToMove, GNEMoveResult::shapeToUpdate, GUISUMOAbstractView::snapToActiveGrid(), GNEMoveOperation::TWO_LANES_MOVEFIRST, GNEMoveOperation::TWO_LANES_MOVESECOND, GNEMoveOperation::WIDTH, GNEMoveOffset::x, GNEMoveOffset::y, and GNEMoveOffset::z.
Referenced by GNEViewNetHelper::MoveMultipleElementValues::finishMoveSelection(), GNEViewNetHelper::MoveSingleElementValues::finishMoveSingleElement(), GNEViewNetHelper::MoveMultipleElementValues::moveSelection(), and GNEViewNetHelper::MoveSingleElementValues::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, GNEPerson, GNEPersonTrip, GNERide, GNERoute, GNEStop, GNETranship, GNETransport, GNEVehicle, GNEVType, GNEVTypeDistribution, 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, GNEPerson, GNEPersonTrip, GNERide, GNERoute, GNEStop, GNETranship, GNETransport, GNEVehicle, GNEVType, GNEVTypeDistribution, 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 227 of file GNEMoveElement.cpp.
References PositionVector::add(), adjustBothPositions(), GNEMoveOperation::allowChangeLane, calculateExtrapolatedVector(), calculateMoveResult(), calculateNewLane(), GNEMoveResult::clearLanes(), GNEMoveOperation::firstLane, GNEMoveResult::firstLaneOffset, GNEMoveOperation::firstPosition, GNEMoveOperation::geometryPointsToMove, GNEMoveResult::geometryPointsToMove, GNELane::getLaneShapeLength(), GNEMoveOperation::HEIGHT, Position::INVALID, GNEMoveOperation::LENGTH, GNEMoveOperation::moveElement, GNEMoveResult::newFirstLane, GNEMoveOperation::ONE_LANE, GNEMoveOperation::ONE_LANE_MOVEFIRST, GNEMoveOperation::ONE_LANE_MOVESECOND, GNEMoveOperation::operationType, GNEMoveOperation::secondLane, GNEMoveOperation::secondPosition, setMoveShape(), GNEMoveOperation::shapeToMove, GNEMoveResult::shapeToUpdate, GUISUMOAbstractView::snapToActiveGrid(), GNEMoveOperation::TWO_LANES_MOVEFIRST, GNEMoveOperation::TWO_LANES_MOVESECOND, GNEMoveOperation::WIDTH, GNEMoveOffset::x, GNEMoveOffset::y, and GNEMoveOffset::z.
Referenced by GNEViewNetHelper::MoveMultipleElementValues::moveSelection(), and GNEViewNetHelper::MoveSingleElementValues::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 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, GNEPerson, GNEPersonTrip, GNERide, GNERoute, GNEStop, GNETranship, GNETransport, GNEVehicle, GNEVType, GNEVTypeDistribution, 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 250 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().