Eclipse SUMO - Simulation of Urban MObility
GNEMoveElement Class Referenceabstract

move element More...

#include <GNEMoveElement.h>

Inheritance diagram for GNEMoveElement:
[legend]

Public Member Functions

virtual GNEMoveOperationgetMoveOperation ()=0
 get move operation More...
 
 GNEMoveElement ()
 constructor More...
 
virtual void removeGeometryPoint (const Position clickedPosition, GNEUndoList *undoList)=0
 remove geometry point in the clicked position More...
 
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 More...
 
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) More...
 

Protected Member Functions

GNEMoveOperationcalculateMoveShapeOperation (const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed)
 calculate move shape operation More...
 

Protected Attributes

double myMoveElementLateralOffset
 move element lateral offset (used by elements placed over lanes More...
 

Private Member Functions

virtual void commitMoveShape (const GNEMoveResult &moveResult, GNEUndoList *undoList)=0
 commit move shape More...
 
 GNEMoveElement (const GNEMoveElement &)=delete
 Invalidated copy constructor. More...
 
GNEMoveElementoperator= (const GNEMoveElement &)=delete
 Invalidated assignment operator. More...
 
virtual void setMoveShape (const GNEMoveResult &moveResult)=0
 set move shape More...
 

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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
static void calculateNewLane (const GNEViewNet *viewNet, const GNELane *originalLane, const GNELane *&newLane, double &laneOffset)
 calculate new lane More...
 

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

◆ adjustBothPositions()

void GNEMoveElement::adjustBothPositions ( const GNEViewNet viewNet,
const GNEMoveOperation moveOperation,
GNEMoveResult moveResult,
const GNEMoveOffset offset 
)
staticprivate

◆ calculateExtrapolatedVector()

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

calculate width/height shape

Definition at line 582 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  secondPosition,
const GNEMoveOffset offset,
const double  extremFrom,
const double  extremTo 
)
staticprivate

calculate lane offset

Definition at line 436 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().

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 secondLane,
const double  secondPos,
const GNEMoveOffset offset 
)
staticprivate

◆ calculateMoveResult() [2/3]

void GNEMoveElement::calculateMoveResult ( GNEMoveResult moveResult,
const GNEViewNet viewNet,
const GNELane lane,
const double  firstPos,
const double  secondPos,
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 477 of file GNEMoveElement.cpp.

References calculateLaneOffset(), GNELane::getLengthGeometryFactor(), GNEMoveResult::newFirstPos, and GNEMoveResult::newSecondPos.

Referenced by adjustBothPositions(), 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

◆ calculateNewLane()

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

calculate new lane

Definition at line 510 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 310 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::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

◆ 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 GNEPoly, GNEPOI, GNEWalkingArea, GNELaneType, GNELane, GNEJunction, GNEInternalLane, GNEEdgeType, GNEEdge, GNECrossing, GNEConnection, GNEDemandElement, GNETAZ, and GNEAdditional.

Referenced by 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: