Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMoveElement Class Referenceabstract

move element More...

#include <GNEMoveElement.h>

Inheritance diagram for GNEMoveElement:
[legend]

Public Member Functions

virtual GNEMoveOperationgetMoveOperation ()=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

GNEMoveOperationcalculateMoveShapeOperation (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.
 
GNEMoveElementoperator= (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
 

Detailed Description

move element

Definition at line 226 of file GNEMoveElement.h.

Constructor & Destructor Documentation

◆ GNEMoveElement() [1/2]

GNEMoveElement::GNEMoveElement ( )

constructor

Definition at line 186 of file GNEMoveElement.cpp.

◆ ~GNEMoveElement()

virtual GNEMoveElement::~GNEMoveElement ( )
inlinevirtual

Definition at line 233 of file GNEMoveElement.h.

◆ GNEMoveElement() [2/2]

GNEMoveElement::GNEMoveElement ( const GNEMoveElement )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ calculateExtrapolatedVector()

PositionVector GNEMoveElement::calculateExtrapolatedVector ( const GNEMoveOperation moveOperation,
const GNEMoveResult moveResult 
)
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().

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,
const double  extremFrom,
const double  extremTo 
)
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().

Here is the caller graph for this function:

◆ calculateMoveResult() [1/3]

void GNEMoveElement::calculateMoveResult ( GNEMoveResult moveResult,
const GNEViewNet viewNet,
const GNELane firstLane,
const double  firstPos,
const GNELane lastLane,
const double  lastPos,
const GNEMoveOffset offset 
)
staticprivate

◆ calculateMoveResult() [2/3]

void GNEMoveElement::calculateMoveResult ( GNEMoveResult moveResult,
const GNEViewNet viewNet,
const GNELane lane,
const double  firstPos,
const double  lastPos,
const GNEMoveOffset offset 
)
staticprivate

◆ calculateMoveResult() [3/3]

void GNEMoveElement::calculateMoveResult ( GNEMoveResult moveResult,
const GNEViewNet viewNet,
const GNELane lane,
const double  pos,
const GNEMoveOffset offset,
const double  extremFrom,
const double  extremTo 
)
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().

Here is the caller graph for this function:

◆ calculateMoveShapeOperation()

GNEMoveOperation * GNEMoveElement::calculateMoveShapeOperation ( const GUIGlObject obj,
const PositionVector  originalShape,
const bool  maintainShapeClosed 
)
protected

◆ calculateNewLaneChange()

void GNEMoveElement::calculateNewLaneChange ( const GNEViewNet viewNet,
const GNELane originalLane,
const GNELane *&  newLane,
double &  laneOffset 
)
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().

Here is the caller graph for this function:

◆ commitMove()

void GNEMoveElement::commitMove ( const GNEViewNet viewNet,
GNEMoveOperation moveOperation,
const GNEMoveOffset offset,
GNEUndoList undoList 
)
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().

Here is the caller graph for this function:

◆ commitMoveShape()

◆ getMoveOperation()

◆ moveElement()

void GNEMoveElement::moveElement ( const GNEViewNet viewNet,
GNEMoveOperation moveOperation,
const GNEMoveOffset offset 
)
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().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ removeGeometryPoint()

virtual void GNEMoveElement::removeGeometryPoint ( const Position  clickedPosition,
GNEUndoList undoList 
)
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().

Here is the caller graph for this function:

◆ setMoveShape()

Field Documentation

◆ myMoveElementLateralOffset


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