Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMoveElementLaneSingle Class Reference

#include <GNEMoveElementLaneSingle.h>

Inheritance diagram for GNEMoveElementLaneSingle:
[legend]
Collaboration diagram for GNEMoveElementLaneSingle:
[legend]

Data Structures

struct  PositionType
 

Public Member Functions

void fixMovingProblem ()
 fix moving problem
 
double getFixedPositionOverLane (const bool adjustGeometryFactor) const
 get fixed offset position over lane
 
GNEMoveOperationgetMoveOperation ()
 get move operation
 
std::string getMovingProblem () const
 return a string with the current moving problem
 
 GNEMoveElementLaneSingle (GNEAttributeCarrier *element, SumoXMLAttr posAttr, double &position, bool &friendlyPos, const std::string &defaultBehavior)
 constructor
 
bool isMoveElementValid () const
 check if current moving element is valid to be written into XML
 
void removeGeometryPoint (const Position clickedPosition, GNEUndoList *undoList) override
 remove geometry point in the clicked position
 
void writeMoveAttributes (OutputDevice &device) const
 write move attributes
 
 ~GNEMoveElementLaneSingle ()
 
functions related with moving attributes
std::string getMovingAttribute (SumoXMLAttr key) const override
 get moving attribute
 
double getMovingAttributeDouble (SumoXMLAttr key) const override
 get moving attribute double
 
Position getMovingAttributePosition (SumoXMLAttr key) const override
 get moving attribute position
 
PositionVector getMovingAttributePositionVector (SumoXMLAttr key) const override
 get moving attribute positionVector
 
void setMovingAttribute (SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
 set moving attribute (using undo-list)
 
bool isMovingAttributeValid (SumoXMLAttr key, const std::string &value) const override
 check if the given moving attribute is valid
 
void setMovingAttribute (SumoXMLAttr key, const std::string &value) override
 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

GNEMoveOperationgetEditShapeOperation (const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed)
 calculate move shape operation
 

Protected Attributes

GNEAttributeCarriermyMovedElement = nullptr
 pointer to element
 

Private Member Functions

void commitMoveShape (const GNEMoveResult &moveResult, GNEUndoList *undoList) override
 commit move shape
 
 GNEMoveElementLaneSingle (const GNEMoveElementLaneSingle &)=delete
 Invalidated copy constructor.
 
GNEMoveElementLaneSingleoperator= (const GNEMoveElementLaneSingle &)=delete
 Invalidated assignment operator.
 
void setMoveShape (const GNEMoveResult &moveResult) override
 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
 

Private Attributes

bool & myFriendlyPos
 friendly position
 
SumoXMLAttr myPosAttr
 pos attribute
 
const std::string myPositionType
 default behavior
 
double & myPosOverLane
 position over lane
 

Friends

class GNEMoveElementLaneDouble
 move element lane double need access to set and commit shape
 

Detailed Description

Definition at line 31 of file GNEMoveElementLaneSingle.h.

Constructor & Destructor Documentation

◆ GNEMoveElementLaneSingle() [1/2]

GNEMoveElementLaneSingle::GNEMoveElementLaneSingle ( GNEAttributeCarrier element,
SumoXMLAttr  posAttr,
double &  position,
bool &  friendlyPos,
const std::string &  defaultBehavior 
)

constructor

Definition at line 41 of file GNEMoveElementLaneSingle.cpp.

◆ ~GNEMoveElementLaneSingle()

GNEMoveElementLaneSingle::~GNEMoveElementLaneSingle ( )

Definition at line 51 of file GNEMoveElementLaneSingle.cpp.

◆ GNEMoveElementLaneSingle() [2/2]

GNEMoveElementLaneSingle::GNEMoveElementLaneSingle ( const GNEMoveElementLaneSingle )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ calculateExtrapolatedVector()

PositionVector GNEMoveElement::calculateExtrapolatedVector ( const GNEMoveOperation moveOperation,
const GNEMoveResult moveResult 
)
staticprivateinherited

calculate width/height shape

Definition at line 419 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 GNEMoveElement::commitMove(), and GNEMoveElement::moveElement().

Here is the caller graph for this function:

◆ calculateLaneOffset()

double GNEMoveElement::calculateLaneOffset ( const GNEViewNet viewNet,
const GNELane lane,
const double  firstPosition,
const double  lastPosition,
const GNEMoveOffset offset 
)
staticprivateinherited

calculate lane offset (used in calculateLanePosition)

Definition at line 279 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 GNEMoveElement::calculateLanePosition(), and GNEMoveElement::calculateLanePositions().

Here is the caller graph for this function:

◆ calculateLanePosition()

void GNEMoveElement::calculateLanePosition ( double &  starPos,
const GNEViewNet viewNet,
const GNELane lane,
const double  posOverLane,
const GNEMoveOffset offset 
)
staticprivateinherited

calculate lane position over one lane with only one position (accesss, E1, star/end positions, etc.)

Definition at line 322 of file GNEMoveElement.cpp.

References GNEMoveElement::calculateLaneOffset(), and GNELane::getLengthGeometryFactor().

Referenced by GNEMoveElement::calculateLanePositions(), GNEMoveElement::commitMove(), and GNEMoveElement::moveElement().

Here is the caller graph for this function:

◆ calculateLanePositions() [1/2]

void GNEMoveElement::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 
)
staticprivateinherited

calculate lane position over two lane with two positions (E2 Multilanes)

Definition at line 343 of file GNEMoveElement.cpp.

References GNEMoveElement::calculateLanePosition(), GNELane::getLaneShape(), and PositionVector::length2D().

◆ calculateLanePositions() [2/2]

void GNEMoveElement::calculateLanePositions ( double &  starPos,
double &  endPos,
const GNEViewNet viewNet,
const GNELane lane,
const double  firstPosOverLane,
const double  lastPosOverLane,
const GNEMoveOffset offset 
)
staticprivateinherited

calculate lane position over one lane with two positions (stoppingPlaces, E2 single lanes)

Definition at line 332 of file GNEMoveElement.cpp.

References GNEMoveElement::calculateLaneOffset(), and GNELane::getLengthGeometryFactor().

Referenced by GNEMoveElement::commitMove(), and GNEMoveElement::moveElement().

Here is the caller graph for this function:

◆ calculateNewLaneChange()

void GNEMoveElement::calculateNewLaneChange ( const GNEViewNet viewNet,
const GNELane originalLane,
const GNELane *&  newLane,
double &  laneOffset 
)
staticprivateinherited

calculate new lane change

Definition at line 387 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 GNEMoveElement::commitMove(), and GNEMoveElement::moveElement().

Here is the caller graph for this function:

◆ commitMove()

void GNEMoveElement::commitMove ( const GNEViewNet viewNet,
GNEMoveOperation moveOperation,
const GNEMoveOffset offset,
GNEUndoList undoList 
)
staticinherited

commit move element for the given offset

Definition at line 180 of file GNEMoveElement.cpp.

References PositionVector::add(), GNEMoveOperation::allowChangeLane, GNEMoveElement::calculateExtrapolatedVector(), GNEMoveElement::calculateLanePosition(), GNEMoveElement::calculateLanePositions(), GNEMoveElement::calculateNewLaneChange(), GNEMoveOperation::clickedFirstLane, GNEMoveElement::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(), GNEMoveElement::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().

Here is the caller graph for this function:

◆ commitMoveShape()

◆ fixMovingProblem()

◆ getEditShapeOperation()

GNEMoveOperation * GNEMoveElement::getEditShapeOperation ( const GUIGlObject obj,
const PositionVector  originalShape,
const bool  maintainShapeClosed 
)
protectedinherited

◆ getFixedPositionOverLane()

◆ getMoveOperation()

GNEMoveOperation * GNEMoveElementLaneSingle::getMoveOperation ( )
virtual

◆ getMovingAttribute()

std::string GNEMoveElementLaneSingle::getMovingAttribute ( SumoXMLAttr  key) const
overridevirtual

◆ getMovingAttributeDouble()

double GNEMoveElementLaneSingle::getMovingAttributeDouble ( SumoXMLAttr  key) const
overridevirtual

get moving attribute double

Implements GNEMoveElement.

Definition at line 91 of file GNEMoveElementLaneSingle.cpp.

References GNEAttributeCarrier::getCommonAttributeDouble(), GNEMoveElement::myMovedElement, myPosAttr, and myPosOverLane.

Referenced by GNEAccess::getAttributeDouble(), and GNEPOI::getAttributeDouble().

Here is the caller graph for this function:

◆ getMovingAttributePosition()

Position GNEMoveElementLaneSingle::getMovingAttributePosition ( SumoXMLAttr  key) const
overridevirtual

get moving attribute position

Implements GNEMoveElement.

Definition at line 101 of file GNEMoveElementLaneSingle.cpp.

References GNEAttributeCarrier::getCommonAttributePosition(), and GNEMoveElement::myMovedElement.

Referenced by GNEAccess::getAttributePosition(), and GNEPOI::getAttributePosition().

Here is the caller graph for this function:

◆ getMovingAttributePositionVector()

PositionVector GNEMoveElementLaneSingle::getMovingAttributePositionVector ( SumoXMLAttr  key) const
overridevirtual

get moving attribute positionVector

Implements GNEMoveElement.

Definition at line 107 of file GNEMoveElementLaneSingle.cpp.

References GNEAttributeCarrier::getCommonAttributePositionVector(), and GNEMoveElement::myMovedElement.

◆ getMovingProblem()

◆ isMoveElementValid()

◆ isMovingAttributeValid()

bool GNEMoveElementLaneSingle::isMovingAttributeValid ( SumoXMLAttr  key,
const std::string &  value 
) const
overridevirtual

check if the given moving attribute is valid

Implements GNEMoveElement.

Definition at line 131 of file GNEMoveElementLaneSingle.cpp.

References GNENet::getAttributeCarriers(), GNEAttributeCarrier::getNet(), GNEAttributeCarrier::isCommonAttributeValid(), GNEMoveElement::myMovedElement, myPosAttr, myPositionType, GNENetHelper::AttributeCarriers::retrieveLane(), GNEMoveElementLaneSingle::PositionType::SINGLE, SUMO_ATTR_FRIENDLY_POS, and SUMO_ATTR_LANE.

Referenced by GNEMoveElementLaneDouble::isMovingAttributeValid(), GNEAccess::isValid(), and GNEPOI::isValid().

Here is the caller graph for this function:

◆ moveElement()

void GNEMoveElement::moveElement ( const GNEViewNet viewNet,
GNEMoveOperation moveOperation,
const GNEMoveOffset offset 
)
staticinherited

◆ operator=()

GNEMoveElementLaneSingle & GNEMoveElementLaneSingle::operator= ( const GNEMoveElementLaneSingle )
privatedelete

Invalidated assignment operator.

◆ removeGeometryPoint()

void GNEMoveElementLaneSingle::removeGeometryPoint ( const Position  clickedPosition,
GNEUndoList undoList 
)
overridevirtual

remove geometry point in the clicked position

Implements GNEMoveElement.

Definition at line 181 of file GNEMoveElementLaneSingle.cpp.

◆ setMoveShape()

void GNEMoveElementLaneSingle::setMoveShape ( const GNEMoveResult moveResult)
overrideprivatevirtual

set move shape

Implements GNEMoveElement.

Definition at line 308 of file GNEMoveElementLaneSingle.cpp.

References GNEMoveElementLaneSingle::PositionType::ENDPOS, GNEMoveResult::firstLaneOffset, GNEMoveResult::lastLaneOffset, GNEMoveElement::myMovedElement, GNEMoveElement::myMovingLateralOffset, myPositionType, myPosOverLane, GNEMoveResult::newFirstPos, GNEMoveResult::newLastPos, and GNEAttributeCarrier::updateGeometry().

Referenced by GNEMoveElementLaneDouble::setMoveShape().

Here is the caller graph for this function:

◆ setMovingAttribute() [1/2]

void GNEMoveElementLaneSingle::setMovingAttribute ( SumoXMLAttr  key,
const std::string &  value 
)
overridevirtual

◆ setMovingAttribute() [2/2]

void GNEMoveElementLaneSingle::setMovingAttribute ( SumoXMLAttr  key,
const std::string &  value,
GNEUndoList undoList 
)
overridevirtual

set moving attribute (using undo-list)

Implements GNEMoveElement.

Definition at line 113 of file GNEMoveElementLaneSingle.cpp.

References GNEChange_Attribute::changeAttribute(), GNEMoveElement::myMovedElement, myPosAttr, GNEAttributeCarrier::setCommonAttribute(), SUMO_ATTR_FRIENDLY_POS, and SUMO_ATTR_LANE.

Referenced by GNEAccess::setAttribute(), GNEPOI::setAttribute(), GNEAccess::setAttribute(), GNEPOI::setAttribute(), and GNEMoveElementLaneDouble::setMovingAttribute().

Here is the caller graph for this function:

◆ writeMoveAttributes()

void GNEMoveElementLaneSingle::writeMoveAttributes ( OutputDevice device) const

Friends And Related Symbol Documentation

◆ GNEMoveElementLaneDouble

move element lane double need access to set and commit shape

Definition at line 35 of file GNEMoveElementLaneSingle.h.

Field Documentation

◆ myFriendlyPos

bool& GNEMoveElementLaneSingle::myFriendlyPos
private

◆ myMovedElement

GNEAttributeCarrier* GNEMoveElement::myMovedElement = nullptr
protectedinherited

pointer to element

Definition at line 96 of file GNEMoveElement.h.

Referenced by GNEMoveElementLaneDouble::commitMoveShape(), commitMoveShape(), GNEMoveElementShape::commitMoveShape(), GNEMoveElementView::commitMoveShape(), GNEMoveElementViewResizable::commitMoveShape(), GNEMoveElementLaneDouble::fixMovingProblem(), fixMovingProblem(), getFixedPositionOverLane(), GNEMoveElementLaneDouble::getMoveOperation(), getMoveOperation(), GNEMoveElementShape::getMoveOperation(), GNEMoveElementViewResizable::getMoveOperation(), GNEMoveElement::getMovingAttribute(), GNEMoveElementConnection::getMovingAttribute(), GNEMoveElementCrossing::getMovingAttribute(), GNEMoveElementEdge::getMovingAttribute(), GNEMoveElementJunction::getMovingAttribute(), GNEMoveElementLane::getMovingAttribute(), GNEMoveElementLaneDouble::getMovingAttribute(), getMovingAttribute(), GNEMoveElementPlan::getMovingAttribute(), GNEMoveElementPlanParent::getMovingAttribute(), GNEMoveElementShape::getMovingAttribute(), GNEMoveElementVehicle::getMovingAttribute(), GNEMoveElementView::getMovingAttribute(), GNEMoveElement::getMovingAttributeDouble(), GNEMoveElementConnection::getMovingAttributeDouble(), GNEMoveElementCrossing::getMovingAttributeDouble(), GNEMoveElementEdge::getMovingAttributeDouble(), GNEMoveElementJunction::getMovingAttributeDouble(), GNEMoveElementLane::getMovingAttributeDouble(), GNEMoveElementLaneDouble::getMovingAttributeDouble(), getMovingAttributeDouble(), GNEMoveElementPlan::getMovingAttributeDouble(), GNEMoveElementPlanParent::getMovingAttributeDouble(), GNEMoveElementShape::getMovingAttributeDouble(), GNEMoveElementVehicle::getMovingAttributeDouble(), GNEMoveElementView::getMovingAttributeDouble(), GNEMoveElementConnection::getMovingAttributePosition(), GNEMoveElementCrossing::getMovingAttributePosition(), GNEMoveElementEdge::getMovingAttributePosition(), GNEMoveElementJunction::getMovingAttributePosition(), GNEMoveElementLane::getMovingAttributePosition(), GNEMoveElementLaneDouble::getMovingAttributePosition(), getMovingAttributePosition(), GNEMoveElementPlan::getMovingAttributePosition(), GNEMoveElementPlanParent::getMovingAttributePosition(), GNEMoveElementShape::getMovingAttributePosition(), GNEMoveElementVehicle::getMovingAttributePosition(), GNEMoveElementView::getMovingAttributePosition(), GNEMoveElementConnection::getMovingAttributePositionVector(), GNEMoveElementCrossing::getMovingAttributePositionVector(), GNEMoveElementEdge::getMovingAttributePositionVector(), GNEMoveElementJunction::getMovingAttributePositionVector(), GNEMoveElementLane::getMovingAttributePositionVector(), GNEMoveElementLaneDouble::getMovingAttributePositionVector(), getMovingAttributePositionVector(), GNEMoveElementPlan::getMovingAttributePositionVector(), GNEMoveElementPlanParent::getMovingAttributePositionVector(), GNEMoveElementShape::getMovingAttributePositionVector(), GNEMoveElementVehicle::getMovingAttributePositionVector(), GNEMoveElementView::getMovingAttributePositionVector(), GNEMoveElementLaneDouble::getMovingProblem(), getMovingProblem(), GNEMoveElementLaneDouble::isMoveElementValid(), isMoveElementValid(), GNEMoveElement::isMovingAttributeValid(), GNEMoveElementConnection::isMovingAttributeValid(), GNEMoveElementCrossing::isMovingAttributeValid(), GNEMoveElementEdge::isMovingAttributeValid(), GNEMoveElementJunction::isMovingAttributeValid(), GNEMoveElementLane::isMovingAttributeValid(), GNEMoveElementLaneDouble::isMovingAttributeValid(), isMovingAttributeValid(), GNEMoveElementPlan::isMovingAttributeValid(), GNEMoveElementPlanParent::isMovingAttributeValid(), GNEMoveElementShape::isMovingAttributeValid(), GNEMoveElementVehicle::isMovingAttributeValid(), GNEMoveElementView::isMovingAttributeValid(), GNEMoveElementShape::removeGeometryPoint(), GNEMoveElementLaneDouble::setMoveShape(), setMoveShape(), GNEMoveElementShape::setMoveShape(), GNEMoveElementView::setMoveShape(), GNEMoveElementConnection::setMovingAttribute(), GNEMoveElementCrossing::setMovingAttribute(), GNEMoveElementEdge::setMovingAttribute(), GNEMoveElementJunction::setMovingAttribute(), GNEMoveElementLane::setMovingAttribute(), GNEMoveElementLaneDouble::setMovingAttribute(), setMovingAttribute(), GNEMoveElementPlan::setMovingAttribute(), GNEMoveElementPlanParent::setMovingAttribute(), GNEMoveElementShape::setMovingAttribute(), GNEMoveElementVehicle::setMovingAttribute(), GNEMoveElementView::setMovingAttribute(), GNEMoveElement::setMovingAttribute(), GNEMoveElementConnection::setMovingAttribute(), GNEMoveElementCrossing::setMovingAttribute(), GNEMoveElementEdge::setMovingAttribute(), GNEMoveElementJunction::setMovingAttribute(), GNEMoveElementLane::setMovingAttribute(), GNEMoveElementLaneDouble::setMovingAttribute(), setMovingAttribute(), GNEMoveElementPlan::setMovingAttribute(), GNEMoveElementPlanParent::setMovingAttribute(), GNEMoveElementShape::setMovingAttribute(), GNEMoveElementVehicle::setMovingAttribute(), GNEMoveElementView::setMovingAttribute(), GNEMoveElement::setMovingAttribute(), GNEMoveElementLaneDouble::setSize(), writeMoveAttributes(), GNEMoveElementView::writeMoveAttributes(), and GNEMoveElementLaneDouble::writeMoveAttributes().

◆ myMovingLateralOffset

◆ myPosAttr

◆ myPositionType

◆ myPosOverLane


The documentation for this class was generated from the following files: