Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMoveOperation.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Class used for define move operation
19/****************************************************************************/
20
22
23#include "GNEMoveOperation.h"
24
25// ===========================================================================
26// Method definitions
27// ===========================================================================
28
30 const Position _originalPosition) :
31 moveElement(_moveElement),
32 originalShape({_originalPosition}),
33 shapeToMove({_originalPosition}),
34operationType(OperationType::POSITION) {
35}
36
37
39 const PositionVector _originalShape) :
40 moveElement(_moveElement),
41 originalShape(_originalShape),
42 shapeToMove(_originalShape),
43 operationType(OperationType::ENTIRE_SHAPE) {
44}
45
46
48 const PositionVector _originalShape,
49 const bool _firstGeometryPoint,
50 const OperationType _operationType) :
51 moveElement(_moveElement),
52 originalShape(_originalShape),
53 shapeToMove(_originalShape),
54 firstGeometryPoint(_firstGeometryPoint),
55 operationType(_operationType) {
56}
57
58
60 const PositionVector _originalShape,
61 const std::vector<int> _originalgeometryPoints,
62 const PositionVector _shapeToMove,
63 const std::vector<int> _geometryPointsToMove) :
64 moveElement(_moveElement),
65 originalShape(_originalShape),
66 originalGeometryPoints(_originalgeometryPoints),
67 shapeToMove(_shapeToMove),
68 geometryPointsToMove(_geometryPointsToMove),
69 operationType(OperationType::GEOMETRY_POINTS) {
70}
71
72
74 const GNELane* _lane,
75 const double _firstPosition,
76 const bool _allowChangeLane) :
77 moveElement(_moveElement),
78 firstLane(_lane),
79 firstPosition(_firstPosition * _lane->getLengthGeometryFactor()),
80 allowChangeLane(_allowChangeLane),
81 operationType(OperationType::LANE) {
82}
83
84
86 const GNELane* _lane,
87 const double _firstPosition,
88 const double _lastPosition,
89 const bool _allowChangeLane) :
90 moveElement(_moveElement),
91 firstLane(_lane),
92 firstPosition((_firstPosition == INVALID_DOUBLE) ? INVALID_DOUBLE : _firstPosition * _lane->getLengthGeometryFactor()),
93 lastPosition((_lastPosition == INVALID_DOUBLE) ? INVALID_DOUBLE : _lastPosition * _lane->getLengthGeometryFactor()),
94 allowChangeLane(_allowChangeLane),
95 operationType(OperationType::LANE) {
96}
97
98
100 const GNELane* _firstLane,
101 const double _firstStartPos,
102 const GNELane* _lastLane,
103 const double _lastStartPos,
104 const double _clickedFirstLane,
105 const bool _allowChangeLane) :
106 moveElement(_moveElement),
107 firstLane(_firstLane),
108 firstPosition((_firstStartPos != INVALID_DOUBLE) ? _firstStartPos * _firstLane->getLengthGeometryFactor() : INVALID_DOUBLE),
109 lastLane(_lastLane),
110 lastPosition((_lastStartPos != INVALID_DOUBLE) ? _lastStartPos * _lastLane->getLengthGeometryFactor() : INVALID_DOUBLE),
111 clickedFirstLane(_clickedFirstLane),
112 allowChangeLane(_allowChangeLane),
113 operationType(OperationType::LANE) {
114}
115
116
118
119/****************************************************************************/
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
GNEMoveOperation(GNEMoveElement *moveElement, const Position originalPosition)
constructor for values with a single position (junctions, E3, ParkingSpaces...)
~GNEMoveOperation()
destructor
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.