Eclipse SUMO - Simulation of Urban MObility
GNEStoppingPlace.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-2024 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 // A abstract class to define common parameters of lane area in which vehicles can halt (GNE version)
19 /****************************************************************************/
20 #include <config.h>
21 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNEViewNet.h>
26 #include <netedit/GNEViewParent.h>
28 #include <utils/gui/div/GLHelper.h>
31 
32 #include "GNEStoppingPlace.h"
33 #include "GNEAdditionalHandler.h"
34 
35 // ===========================================================================
36 // static members
37 // ===========================================================================
38 
39 const double GNEStoppingPlace::myCircleWidth = 1.1;
40 const double GNEStoppingPlace::myCircleWidthSquared = 1.21;
41 const double GNEStoppingPlace::myCircleInWidth = 0.9;
42 const double GNEStoppingPlace::myCircleInText = 1.6;
43 
44 // ===========================================================================
45 // member method definitions
46 // ===========================================================================
47 
48 GNEStoppingPlace::GNEStoppingPlace(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, FXIcon* icon,
49  GNELane* lane, const double startPos, const double endPos, const std::string& name, bool friendlyPosition,
50  const Parameterised::Map& parameters) :
51  GNEAdditional(id, net, type, tag, icon, name, {}, {}, {lane}, {}, {}, {}),
52  Parameterised(parameters),
53  myStartPosition(startPos),
54  myEndPosition(endPos),
55 myFriendlyPosition(friendlyPosition) {
56 }
57 
58 
60 
61 
64  // get allow change lane
65  const bool allowChangeLane = myNet->getViewNet()->getViewParent()->getMoveFrame()->getCommonModeOptions()->getAllowChangeLane();
66  // fist check if we're moving only extremes
67  if (drawMovingGeometryPoints(false)) {
68  // get geometry points under cursor
69  const auto geometryPoints = gViewObjectsHandler.getGeometryPoints(this);
70  // continue depending of moved element
71  if (geometryPoints.empty()) {
72  return nullptr;
73  } else if (geometryPoints.front() == 0) {
74  // move start position
75  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, getParentLanes().front()->getLaneShape().length2D() - POSITION_EPS,
77  } else {
78  // move end position
79  return new GNEMoveOperation(this, getParentLanes().front(), 0, myEndPosition,
81  }
83  // move both start and end positions
84  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, myEndPosition,
86  } else if (myStartPosition != INVALID_DOUBLE) {
87  // move only start position
88  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, getParentLanes().front()->getLaneShape().length2D() - POSITION_EPS,
90  } else if (myEndPosition != INVALID_DOUBLE) {
91  // move only end position
92  return new GNEMoveOperation(this, getParentLanes().front(), 0, myEndPosition,
94  } else {
95  // start and end positions undefined, then nothing to move
96  return nullptr;
97  }
98 }
99 
100 
101 bool
104  getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), myFriendlyPosition);
105 }
106 
107 
108 std::string
110  // obtain lane length
111  double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor();
112  // calculate start and end positions
113  double startPos = getAttributeDouble(SUMO_ATTR_STARTPOS);
114  double endPos = getAttributeDouble(SUMO_ATTR_ENDPOS);
115  // check if position has to be fixed
116  if (startPos < 0) {
117  startPos += laneLength;
118  }
119  if (endPos < 0) {
120  endPos += laneLength;
121  }
122  // declare variables
123  std::string errorStart, separator, errorEnd;
124  // check positions over lane
125  if (startPos < 0) {
126  errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0");
127  } else if (startPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
128  errorStart = (toString(SUMO_ATTR_STARTPOS) + TL(" > lanes's length"));
129  }
130  if (endPos < 0) {
131  errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0");
132  } else if (endPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
133  errorEnd = (toString(SUMO_ATTR_ENDPOS) + TL(" > lanes's length"));
134  }
135  // check separator
136  if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
137  separator = TL(" and ");
138  }
139  return errorStart + separator + errorEnd;
140 }
141 
142 
143 void
145  // calculate start and end positions
146  double startPos = getAttributeDouble(SUMO_ATTR_STARTPOS);
147  double endPos = getAttributeDouble(SUMO_ATTR_ENDPOS);
148  // fix start and end positions using fixLaneDoublePosition
149  GNEAdditionalHandler::fixLaneDoublePosition(startPos, endPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
150  // set new start and end positions
153 }
154 
155 
156 bool
158  // get edit modes
159  const auto& editModes = myNet->getViewNet()->getEditModes();
160  // check if we're in move mode
161  if (!myNet->getViewNet()->isMovingElement() && editModes.isCurrentSupermodeNetwork() &&
162  (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
163  // only move the first element
165  } else {
166  return false;
167  }
168 }
169 
170 
171 Position
174 }
175 
176 
177 void
178 GNEStoppingPlace::updateCenteringBoundary(const bool /*updateGrid*/) {
179  // nothing to do
180 }
181 
182 
183 void
184 GNEStoppingPlace::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) {
185  // first check tat both network elements are lanes and originalElement correspond to stoppingPlace lane
186  if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
187  (newElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
188  (getParentLanes().front() == originalElement)) {
189  // check if we have to change additional lane depending of split position
191  // calculate middle position
192  const double middlePosition = ((myEndPosition - myStartPosition) / 2.0) + myStartPosition;
193  // four cases:
194  if (splitPosition < myStartPosition) {
195  // change lane
196  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
197  // now adjust start and end position
198  setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList);
199  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
200  } else if ((splitPosition > myStartPosition) && (splitPosition < middlePosition)) {
201  // change lane
202  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
203  // now adjust start and end position
204  setAttribute(SUMO_ATTR_STARTPOS, "0", undoList);
205  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
206  } else if ((splitPosition > middlePosition) && (splitPosition < myEndPosition)) {
207  // only adjust end position
208  setAttribute(SUMO_ATTR_ENDPOS, toString(splitPosition), undoList);
209  } else if ((splitPosition > myEndPosition)) {
210  // nothing to do
211  }
212  } else if ((myStartPosition != INVALID_DOUBLE) && (splitPosition < myStartPosition)) {
213  // change lane
214  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
215  // now adjust start position
216  setAttribute(SUMO_ATTR_STARTPOS, toString(myEndPosition - splitPosition), undoList);
217  } else if ((myEndPosition != INVALID_DOUBLE) && (splitPosition < myEndPosition)) {
218  // change lane
219  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
220  // now adjust end position
221  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
222  }
223  }
224 }
225 
226 
227 std::string
229  return getParentLanes().front()->getID();
230 }
231 
232 
233 void
235  if (getParentLanes().empty() || getParentLanes().front() == nullptr) {
236  // may happen during initialization
237  return;
238  }
239  // Get value of option "lefthand"
240  const bool lefthandAttr = hasAttribute(SUMO_ATTR_LEFTHAND) && parse<bool>(getAttribute(SUMO_ATTR_LEFTHAND));
241  const double offsetSign = OptionsCont::getOptions().getBool("lefthand") != lefthandAttr ? -1 : 1;
242 
243  // obtain laneShape
244  PositionVector laneShape = getParentLanes().front()->getLaneShape();
245 
246  // Move shape to side
247  laneShape.move2side(movingToSide * offsetSign);
248 
249  // Cut shape using as delimitators fixed start position and fixed end position
251 }
252 
253 
254 double
256  switch (key) {
257  case SUMO_ATTR_STARTPOS:
259  return myStartPosition;
260  } else {
261  return 0;
262  }
263  case SUMO_ATTR_ENDPOS:
264  if (myEndPosition != INVALID_DOUBLE) {
265  return myEndPosition;
266  } else {
267  return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
268  }
269  case SUMO_ATTR_CENTER:
271  default:
272  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
273  }
274 }
275 
276 
277 const Parameterised::Map&
279  return getParametersMap();
280 }
281 
282 
283 std::string
285  return getTagStr() + ": " + getID();
286 }
287 
288 
289 std::string
291  return getTagStr();
292 }
293 
294 
295 void
296 GNEStoppingPlace::drawLines(const GUIVisualizationSettings::Detail d, const std::vector<std::string>& lines, const RGBColor& color) const {
297  // only draw in level 1
299  // calculate middle point
300  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
301  // calculate rotation
302  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
303  // Iterate over every line
304  for (int i = 0; i < (int)lines.size(); ++i) {
305  // push a new matrix for every line
307  // translate
308  glTranslated(mySignPos.x(), mySignPos.y(), 0);
309  // rotate over lane
311  // draw line with a color depending of the selection status
312  if (drawUsingSelectColor()) {
313  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
314  } else {
315  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
316  }
317  // pop matrix for every line
319  }
320  }
321 }
322 
323 
324 void
325 GNEStoppingPlace::drawSign(const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor& baseColor,
326  const RGBColor& signColor, const std::string& word) const {
327  // only draw in level 2
329  // calculate middle point
330  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
331  // calculate rotation
332  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
333  // push matrix
335  // Start drawing sign traslating matrix to signal position
336  glTranslated(mySignPos.x(), mySignPos.y(), 0);
337  // rotate over lane
339  // scale matrix depending of the exaggeration
340  glScaled(exaggeration, exaggeration, 1);
341  // set color
342  GLHelper::setColor(baseColor);
343  // Draw circle
345  // continue depending of rectangle selection
347  // Traslate to front
348  glTranslated(0, 0, .1);
349  // set color
350  GLHelper::setColor(signColor);
351  // draw another circle in the same position, but a little bit more small
353  // draw H depending of detailSettings
354  GLHelper::drawText(word, Position(), .1, myCircleInText, baseColor);
355  }
356  // pop draw matrix
358  }
359 }
360 
361 
362 void
364  const double width, const bool movingGeometryPoints) const {
365  // check if we're calculating the contour or the moving geometry points
366  if (movingGeometryPoints) {
370  }
371  if (movingGeometryPoints && (myEndPosition != INVALID_DOUBLE)) {
374  }
375  } else {
376  // don't exaggerate contour
377  myAdditionalContour.calculateContourExtrudedShape(s, d, this, myAdditionalGeometry.getShape(), width, 1, true, true, 0);
378  }
379 }
380 
381 
382 double
385  // get lane final and shape length
386  const double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
387  // get startPosition
388  double fixedPos = myStartPosition;
389  // adjust fixedPos
390  if (fixedPos < 0) {
391  fixedPos += laneLength;
392  }
393  fixedPos *= getParentLanes().front()->getLengthGeometryFactor();
394  // return depending of fixedPos
395  if (fixedPos < 0) {
396  return 0;
397  } else if (fixedPos > (getParentLanes().front()->getLaneShapeLength() - POSITION_EPS)) {
398  return (getParentLanes().front()->getLaneShapeLength() - POSITION_EPS);
399  } else {
400  return fixedPos;
401  }
402  } else {
403  return 0;
404  }
405 }
406 
407 
408 double
410  if (myEndPosition != INVALID_DOUBLE) {
411  // get lane final and shape length
412  const double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
413  // get endPosition
414  double fixedPos = myEndPosition;
415  // adjust fixedPos
416  if (fixedPos < 0) {
417  fixedPos += laneLength;
418  }
419  fixedPos *= getParentLanes().front()->getLengthGeometryFactor();
420  // return depending of fixedPos
421  if (fixedPos < POSITION_EPS) {
422  return POSITION_EPS;
423  } else if (fixedPos > getParentLanes().front()->getLaneShapeLength()) {
424  return getParentLanes().front()->getLaneShapeLength();
425  } else {
426  return fixedPos;
427  }
428  } else {
429  return getParentLanes().front()->getLaneShapeLength();
430  }
431 }
432 
433 
434 void
437  // change only start position
438  myStartPosition = moveResult.newFirstPos;
439  // adjust startPos
440  if (myStartPosition > (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS)) {
442  }
444  // change only end position
445  myEndPosition = moveResult.newFirstPos;
446  // adjust endPos
447  if (myEndPosition < (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS)) {
449  }
450  } else {
451  // change both position
452  myStartPosition = moveResult.newFirstPos;
453  myEndPosition = moveResult.newSecondPos;
454  // set lateral offset
456  }
457  // update geometry
458  updateGeometry();
459 }
460 
461 
462 void
464  // begin change attribute
465  undoList->begin(this, "position of " + getTagStr());
466  // set attributes depending of operation type
468  // set only start position
469  setAttribute(SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos), undoList);
471  // set only end position
472  setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos), undoList);
473  } else {
474  // set both
475  setAttribute(SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos), undoList);
476  setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newSecondPos), undoList);
477  // check if lane has to be changed
478  if (moveResult.newFirstLane) {
479  // set new lane
480  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
481  }
482  }
483  // end change attribute
484  undoList->end();
485 }
486 
487 /****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
GUIGlObjectType
GUIViewObjectsHandler gViewObjectsHandler
#define TL(string)
Definition: MsgHandler.h:315
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_LANE
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_LEFTHAND
@ SUMO_ATTR_CENTER
const double INVALID_DOUBLE
invalid double
Definition: StdDefs.h:64
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:654
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition: GLHelper.cpp:539
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
Definition: GLHelper.cpp:756
static void fixLaneDoublePosition(double &from, double &to, const double laneLengt)
fix the given positions over lane
static bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
GNEContour myAdditionalContour
variable used for draw additional contours
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool drawMovingGeometryPoints(const bool ignoreShift) const
check if draw additional extrem geometry points
const std::string getID() const
get ID (all Attribute Carriers have one)
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool hasAttribute(SumoXMLAttr key) const
GNENet * myNet
pointer to net
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset) const
calculate contour extruded (used in elements formed by a central shape)
Definition: GNEContour.cpp:88
void calculateContourLastGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for last geometry point
Definition: GNEContour.cpp:164
void calculateContourFirstGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for first geometry point
Definition: GNEContour.cpp:152
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
move operation
move result
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
const GNEMoveOperation::OperationType operationType
move operation
double firstLaneOffset
lane offset
double newSecondPos
new second position
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2055
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
virtual double getAttributeDouble(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation()
get move operation
Position getPositionInView() const
Returns position of additional in view.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool checkDrawMoveContour() const
check if draw move contour (red)
void drawSign(const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
~GNEStoppingPlace()
Destructor.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
const Parameterised::Map & getACParametersMap() const
get parameters map
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
static const double myCircleWidth
circle width resolution for all stopping places
virtual void updateGeometry()=0
update pre-computed geometry information
bool myFriendlyPosition
Flag for friendly position.
static const double myCircleInText
text inner circle width resolution for all stopping places
void drawLines(const GUIVisualizationSettings::Detail d, const std::vector< std::string > &lines, const RGBColor &color) const
draw lines
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
static const double myCircleInWidth
inner circle width resolution for all stopping places
GNEStoppingPlace(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, FXIcon *icon, GNELane *lane, const double startPos, const double endPos, const std::string &name, bool friendlyPosition, const Parameterised::Map &parameters)
Constructor.
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
void calculateStoppingPlaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const bool movingGeometryPoints) const
check object in view
double myEndPosition
The position this stopping place is located at (-1 means empty)
Position mySignPos
The position of the sign.
std::string getParentName() const
Returns the name of the parent object (if any)
virtual std::string getAttribute(SumoXMLAttr key) const =0
double myStartPosition
The relative start position this stopping place is located at (-1 means empty)
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
const GUIGlObject * getGUIGlObjectFront() const
get front attribute carrier or a pointer to nullptr
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:703
bool isMovingElement() const
check if an element is being moved
GNEViewParent * getViewParent() const
get the net object
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
Definition: GNEViewNet.cpp:468
GNEMoveFrame * getMoveFrame() const
get frame for move elements
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:59
const std::vector< int > & getGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
Stores the information about how to visualize structures.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:60
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double x() const
Returns the x-position.
Definition: Position.h:55
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
double length2D() const
Returns the length.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
@ FONS_ALIGN_LEFT
Definition: fontstash.h:42
static const double additionalGeometryPointRadius
moving additional geometry point radius