![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GNEMoveElement.h>
Public Member Functions | |
| virtual GNEMoveOperation * | getMoveOperation ()=0 |
| get move operation | |
| GNEMoveElement (GNEAttributeCarrier *movedElement) | |
| constructor | |
| virtual void | removeGeometryPoint (const Position clickedPosition, GNEUndoList *undoList)=0 |
| remove geometry point in the clicked position | |
| virtual | ~GNEMoveElement () |
functions related with moving attributes | |
| virtual std::string | getMovingAttribute (SumoXMLAttr key) const =0 |
| get moving attribute | |
| virtual double | getMovingAttributeDouble (SumoXMLAttr key) const =0 |
| get moving attribute double | |
| virtual Position | getMovingAttributePosition (SumoXMLAttr key) const =0 |
| get moving attribute position | |
| virtual PositionVector | getMovingAttributePositionVector (SumoXMLAttr key) const =0 |
| get moving attribute positionVector | |
| virtual void | setMovingAttribute (SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0 |
| set moving attribute (using undo-list) | |
| virtual bool | isMovingAttributeValid (SumoXMLAttr key, const std::string &value) const =0 |
| check if the given moving attribute is valid | |
| virtual void | setMovingAttribute (SumoXMLAttr key, const std::string &value)=0 |
| set moving attribute | |
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) | |
Data Fields | |
| double | myMovingLateralOffset = 0 |
| move element lateral offset | |
Protected Member Functions | |
| GNEMoveOperation * | getEditShapeOperation (const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed) |
| calculate move shape operation | |
Protected Attributes | |
| GNEAttributeCarrier * | myMovedElement = nullptr |
| pointer to element | |
Private Member Functions | |
| virtual void | commitMoveShape (const GNEMoveResult &moveResult, GNEUndoList *undoList)=0 |
| commit move shape | |
| GNEMoveElement ()=delete | |
| invalidate default constructor | |
| 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) |
| calculate lane offset (used in calculateLanePosition) | |
| static void | calculateLanePosition (double &starPos, const GNEViewNet *viewNet, const GNELane *lane, const double posOverLane, const GNEMoveOffset &offset) |
| calculate lane position over one lane with only one position (accesss, E1, star/end positions, etc.) | |
| static void | calculateLanePositions (double &starPos, double &endPos, const GNEViewNet *viewNet, const GNELane *firstLane, const double firstPosOverLane, const GNELane *lastLane, const double lastPosOverLane, const bool firstLaneClicked, const GNEMoveOffset &offset) |
| calculate lane position over two lane with two positions (E2 Multilanes) | |
| static void | calculateLanePositions (double &starPos, double &endPos, const GNEViewNet *viewNet, const GNELane *lane, const double firstPosOverLane, const double lastPosOverLane, const GNEMoveOffset &offset) |
| calculate lane position over one lane with two positions (stoppingPlaces, E2 single lanes) | |
| static void | calculateNewLaneChange (const GNEViewNet *viewNet, const GNELane *originalLane, const GNELane *&newLane, double &laneOffset) |
| calculate new lane change | |
Definition at line 42 of file GNEMoveElement.h.
| GNEMoveElement::GNEMoveElement | ( | GNEAttributeCarrier * | movedElement | ) |
constructor
Definition at line 32 of file GNEMoveElement.cpp.
|
virtual |
Definition at line 37 of file GNEMoveElement.cpp.
|
privatedelete |
invalidate default constructor
|
privatedelete |
Invalidated copy constructor.
|
staticprivate |
calculate width/height shape
Definition at line 420 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 (used in calculateLanePosition)
Definition at line 280 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 calculateLanePosition(), and calculateLanePositions().
|
staticprivate |
calculate lane position over one lane with only one position (accesss, E1, star/end positions, etc.)
Definition at line 323 of file GNEMoveElement.cpp.
References calculateLaneOffset(), and GNELane::getLengthGeometryFactor().
Referenced by calculateLanePositions(), commitMove(), and moveElement().
|
staticprivate |
calculate lane position over two lane with two positions (E2 Multilanes)
Definition at line 344 of file GNEMoveElement.cpp.
References calculateLanePosition(), GNELane::getLaneShape(), and PositionVector::length2D().
|
staticprivate |
calculate lane position over one lane with two positions (stoppingPlaces, E2 single lanes)
Definition at line 333 of file GNEMoveElement.cpp.
References calculateLaneOffset(), and GNELane::getLengthGeometryFactor().
Referenced by commitMove(), and moveElement().
|
staticprivate |
calculate new lane change
Definition at line 388 of file GNEMoveElement.cpp.
References Position::distanceSquaredTo2D(), Position::distanceTo2D(), GNEHierarchicalElement::getChildLanes(), GNELane::getIndex(), 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 181 of file GNEMoveElement.cpp.
References PositionVector::add(), GNEMoveOperation::allowChangeLane, calculateExtrapolatedVector(), calculateLanePosition(), calculateLanePositions(), calculateNewLaneChange(), GNEMoveOperation::clickedFirstLane, commitMoveShape(), GNEMoveOperation::firstLane, GNEMoveResult::firstLaneOffset, GNEMoveOperation::firstPosition, GNEMoveOperation::geometryPointsToMove, GNEMoveResult::geometryPointsToMove, GNEMoveFrame::getCommonMoveOptions(), GNEMoveFrame::CommonMoveOptions::getMergeGeometryPoints(), GNEViewParent::getMoveFrame(), GNEViewNet::getViewParent(), GNEMoveOperation::HEIGHT, Position::INVALID, INVALID_DOUBLE, GNEMoveOperation::lastLane, GNEMoveOperation::lastPosition, GNEMoveOperation::LENGTH, GNEMoveOperation::moveElement, GNEMoveResult::newFirstLane, GNEMoveResult::newFirstPos, GNEMoveResult::newLastLane, GNEMoveResult::newLastPos, GNEMoveOperation::operationType, GNEMoveOperation::originalGeometryPoints, GNEMoveOperation::originalShape, PositionVector::removeDoublePoints(), setMoveShape(), GNEMoveOperation::shapeToMove, GNEMoveResult::shapeToUpdate, 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 GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, GNEMoveElementView, and GNEMoveElementViewResizable.
Referenced by commitMove().
|
protected |
calculate move shape operation
Definition at line 71 of file GNEMoveElement.cpp.
References GUIViewObjectsHandler::getSelectedGeometryPoints(), GUIViewObjectsHandler::getSelectedPositionOverShape(), gViewObjectsHandler, PositionVector::indexOfClosest(), PositionVector::insertAtClosest(), and Position::INVALID.
Referenced by GNEMoveElementConnection::getMoveOperation(), GNEMoveElementCrossing::getMoveOperation(), GNEMoveElementEdge::getMoveOperation(), GNEMoveElementJunction::getMoveOperation(), GNEMoveElementLane::getMoveOperation(), and GNEMoveElementShape::getMoveOperation().
|
pure virtual |
get move operation
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, GNEMoveElementView, and GNEMoveElementViewResizable.
|
pure virtual |
get moving attribute
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Definition at line 41 of file GNEMoveElement.cpp.
References GNEAttributeCarrier::getTagStr(), myMovedElement, and toString().
Referenced by GNEDetector::getDetectorAttribute().
|
pure virtual |
get moving attribute double
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Definition at line 47 of file GNEMoveElement.cpp.
References GNEAttributeCarrier::getTagStr(), myMovedElement, and toString().
Referenced by GNEDetector::getDetectorAttributeDouble().
|
pure virtual |
get moving attribute position
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Referenced by GNEDetector::getDetectorAttributePosition().
|
pure virtual |
get moving attribute positionVector
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
|
pure virtual |
check if the given moving attribute is valid
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Definition at line 59 of file GNEMoveElement.cpp.
References GNEAttributeCarrier::getTagStr(), myMovedElement, and toString().
Referenced by GNEDetector::isDetectorValid().
|
static |
move element the for given offset (note: offset can be X-Y-0, 0-0-Z or X-Y-Z)
Definition at line 100 of file GNEMoveElement.cpp.
References PositionVector::add(), GNEMoveOperation::allowChangeLane, calculateExtrapolatedVector(), calculateLanePosition(), calculateLanePositions(), calculateNewLaneChange(), GNEMoveOperation::clickedFirstLane, GNEMoveOperation::firstLane, GNEMoveResult::firstLaneOffset, GNEMoveOperation::firstPosition, GNEMoveOperation::geometryPointsToMove, GNEMoveResult::geometryPointsToMove, GNEMoveOperation::HEIGHT, Position::INVALID, INVALID_DOUBLE, GNEMoveOperation::lastLane, GNEMoveOperation::lastPosition, GNEMoveOperation::LENGTH, GNEMoveOperation::moveElement, GNEMoveResult::newFirstLane, GNEMoveResult::newFirstPos, GNEMoveResult::newLastPos, GNEMoveOperation::operationType, setMoveShape(), GNEMoveOperation::shapeToMove, GNEMoveResult::shapeToUpdate, 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 GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Referenced by GNEViewNet::processLeftButtonPressNetwork(), and GNEDeleteFrame::removeGeometryPoint().
|
privatepure virtual |
set move shape
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, GNEMoveElementView, and GNEMoveElementViewResizable.
Referenced by commitMove(), and moveElement().
|
pure virtual |
set moving attribute
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Definition at line 65 of file GNEMoveElement.cpp.
References GNEAttributeCarrier::getTagStr(), myMovedElement, and toString().
|
pure virtual |
set moving attribute (using undo-list)
Implemented in GNEMoveElementConnection, GNEMoveElementCrossing, GNEMoveElementEdge, GNEMoveElementJunction, GNEMoveElementLane, GNEMoveElementLaneDouble, GNEMoveElementLaneSingle, GNEMoveElementPlan, GNEMoveElementPlanParent, GNEMoveElementShape, GNEMoveElementVehicle, and GNEMoveElementView.
Definition at line 53 of file GNEMoveElement.cpp.
References GNEAttributeCarrier::getTagStr(), myMovedElement, and toString().
Referenced by GNEDetector::setDetectorAttribute(), and GNEDetector::setDetectorAttribute().
|
protected |
pointer to element
Definition at line 96 of file GNEMoveElement.h.
Referenced by GNEMoveElementLaneDouble::commitMoveShape(), GNEMoveElementLaneSingle::commitMoveShape(), GNEMoveElementShape::commitMoveShape(), GNEMoveElementView::commitMoveShape(), GNEMoveElementViewResizable::commitMoveShape(), GNEMoveElementLaneDouble::fixMovingProblem(), GNEMoveElementLaneSingle::fixMovingProblem(), GNEMoveElementLaneSingle::getFixedPositionOverLane(), GNEMoveElementLaneDouble::getMoveOperation(), GNEMoveElementLaneSingle::getMoveOperation(), GNEMoveElementShape::getMoveOperation(), GNEMoveElementViewResizable::getMoveOperation(), getMovingAttribute(), GNEMoveElementConnection::getMovingAttribute(), GNEMoveElementCrossing::getMovingAttribute(), GNEMoveElementEdge::getMovingAttribute(), GNEMoveElementJunction::getMovingAttribute(), GNEMoveElementLane::getMovingAttribute(), GNEMoveElementLaneDouble::getMovingAttribute(), GNEMoveElementLaneSingle::getMovingAttribute(), GNEMoveElementPlan::getMovingAttribute(), GNEMoveElementPlanParent::getMovingAttribute(), GNEMoveElementShape::getMovingAttribute(), GNEMoveElementVehicle::getMovingAttribute(), GNEMoveElementView::getMovingAttribute(), getMovingAttributeDouble(), GNEMoveElementConnection::getMovingAttributeDouble(), GNEMoveElementCrossing::getMovingAttributeDouble(), GNEMoveElementEdge::getMovingAttributeDouble(), GNEMoveElementJunction::getMovingAttributeDouble(), GNEMoveElementLane::getMovingAttributeDouble(), GNEMoveElementLaneDouble::getMovingAttributeDouble(), GNEMoveElementLaneSingle::getMovingAttributeDouble(), GNEMoveElementPlan::getMovingAttributeDouble(), GNEMoveElementPlanParent::getMovingAttributeDouble(), GNEMoveElementShape::getMovingAttributeDouble(), GNEMoveElementVehicle::getMovingAttributeDouble(), GNEMoveElementView::getMovingAttributeDouble(), GNEMoveElementConnection::getMovingAttributePosition(), GNEMoveElementCrossing::getMovingAttributePosition(), GNEMoveElementEdge::getMovingAttributePosition(), GNEMoveElementJunction::getMovingAttributePosition(), GNEMoveElementLane::getMovingAttributePosition(), GNEMoveElementLaneDouble::getMovingAttributePosition(), GNEMoveElementLaneSingle::getMovingAttributePosition(), GNEMoveElementPlan::getMovingAttributePosition(), GNEMoveElementPlanParent::getMovingAttributePosition(), GNEMoveElementShape::getMovingAttributePosition(), GNEMoveElementVehicle::getMovingAttributePosition(), GNEMoveElementView::getMovingAttributePosition(), GNEMoveElementConnection::getMovingAttributePositionVector(), GNEMoveElementCrossing::getMovingAttributePositionVector(), GNEMoveElementEdge::getMovingAttributePositionVector(), GNEMoveElementJunction::getMovingAttributePositionVector(), GNEMoveElementLane::getMovingAttributePositionVector(), GNEMoveElementLaneDouble::getMovingAttributePositionVector(), GNEMoveElementLaneSingle::getMovingAttributePositionVector(), GNEMoveElementPlan::getMovingAttributePositionVector(), GNEMoveElementPlanParent::getMovingAttributePositionVector(), GNEMoveElementShape::getMovingAttributePositionVector(), GNEMoveElementVehicle::getMovingAttributePositionVector(), GNEMoveElementView::getMovingAttributePositionVector(), GNEMoveElementLaneDouble::getMovingProblem(), GNEMoveElementLaneSingle::getMovingProblem(), GNEMoveElementLaneDouble::isMoveElementValid(), GNEMoveElementLaneSingle::isMoveElementValid(), isMovingAttributeValid(), GNEMoveElementConnection::isMovingAttributeValid(), GNEMoveElementCrossing::isMovingAttributeValid(), GNEMoveElementEdge::isMovingAttributeValid(), GNEMoveElementJunction::isMovingAttributeValid(), GNEMoveElementLane::isMovingAttributeValid(), GNEMoveElementLaneDouble::isMovingAttributeValid(), GNEMoveElementLaneSingle::isMovingAttributeValid(), GNEMoveElementPlan::isMovingAttributeValid(), GNEMoveElementPlanParent::isMovingAttributeValid(), GNEMoveElementShape::isMovingAttributeValid(), GNEMoveElementVehicle::isMovingAttributeValid(), GNEMoveElementView::isMovingAttributeValid(), GNEMoveElementShape::removeGeometryPoint(), GNEMoveElementLaneDouble::setMoveShape(), GNEMoveElementLaneSingle::setMoveShape(), GNEMoveElementShape::setMoveShape(), GNEMoveElementView::setMoveShape(), GNEMoveElementConnection::setMovingAttribute(), GNEMoveElementCrossing::setMovingAttribute(), GNEMoveElementEdge::setMovingAttribute(), GNEMoveElementJunction::setMovingAttribute(), GNEMoveElementLane::setMovingAttribute(), GNEMoveElementLaneDouble::setMovingAttribute(), GNEMoveElementLaneSingle::setMovingAttribute(), GNEMoveElementPlan::setMovingAttribute(), GNEMoveElementPlanParent::setMovingAttribute(), GNEMoveElementShape::setMovingAttribute(), GNEMoveElementVehicle::setMovingAttribute(), GNEMoveElementView::setMovingAttribute(), setMovingAttribute(), GNEMoveElementConnection::setMovingAttribute(), GNEMoveElementCrossing::setMovingAttribute(), GNEMoveElementEdge::setMovingAttribute(), GNEMoveElementJunction::setMovingAttribute(), GNEMoveElementLane::setMovingAttribute(), GNEMoveElementLaneDouble::setMovingAttribute(), GNEMoveElementLaneSingle::setMovingAttribute(), GNEMoveElementPlan::setMovingAttribute(), GNEMoveElementPlanParent::setMovingAttribute(), GNEMoveElementShape::setMovingAttribute(), GNEMoveElementVehicle::setMovingAttribute(), GNEMoveElementView::setMovingAttribute(), setMovingAttribute(), GNEMoveElementLaneDouble::setSize(), GNEMoveElementLaneSingle::writeMoveAttributes(), GNEMoveElementView::writeMoveAttributes(), and GNEMoveElementLaneDouble::writeMoveAttributes().
| double GNEMoveElement::myMovingLateralOffset = 0 |
move element lateral offset
Definition at line 92 of file GNEMoveElement.h.
Referenced by GNEMoveElementLaneSingle::commitMoveShape(), GNEMoveElementVehicle::commitMoveShape(), GNEMoveElementLaneDouble::setMoveShape(), GNEMoveElementLaneSingle::setMoveShape(), GNEMoveElementVehicle::setMoveShape(), GNEStoppingPlace::setStoppingPlaceGeometry(), GNEAccess::updateGeometry(), GNEEntryExitDetector::updateGeometry(), GNEInductionLoopDetector::updateGeometry(), GNEInstantInductionLoopDetector::updateGeometry(), GNELaneAreaDetector::updateGeometry(), and GNEStop::updateGeometry().