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.org/sumo
3 // Copyright (C) 2001-2022 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 /****************************************************************************/
21 #include <netedit/GNENet.h>
22 #include <netedit/GNEUndoList.h>
23 #include <netedit/GNEViewNet.h>
24 #include <netedit/GNEViewParent.h>
27 #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 
49  GNELane* lane, const double startPos, const double endPos, const std::string& name,
50  bool friendlyPosition, const std::map<std::string, std::string>& parameters) :
51  GNEAdditional(id, net, type, tag, name,
52 {}, {}, {lane}, {}, {}, {}, {}, {},
53 parameters),
54 myStartPosition(startPos),
55 myEndPosition(endPos),
56 myFriendlyPosition(friendlyPosition) {
57 }
58 
59 
61 
62 
65  // get allow change lane
66  const bool allowChangeLane = myNet->getViewNet()->getViewParent()->getMoveFrame()->getCommonModeOptions()->getAllowChangeLane();
67  // fist check if we're moving only extremes
71  // get snap radius
73  // get mouse position
74  const Position mousePosition = myNet->getViewNet()->getPositionInformation();
75  // check if we clicked over start or end position
76  if ((myStartPosition != INVALID_DOUBLE) && (myAdditionalGeometry.getShape().front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius))) {
77  // move only start position
78  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, getParentLanes().front()->getLaneShape().length2D() - POSITION_EPS,
80  } else if ((myEndPosition != INVALID_DOUBLE) && (myAdditionalGeometry.getShape().back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius))) {
81  // move only end position
82  return new GNEMoveOperation(this, getParentLanes().front(), 0, myEndPosition,
84  } else {
85  return nullptr;
86  }
88  // move both start and end positions
89  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, myEndPosition,
91  } else if (myStartPosition != INVALID_DOUBLE) {
92  // move only start position
93  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, getParentLanes().front()->getLaneShape().length2D() - POSITION_EPS,
95  } else if (myEndPosition != INVALID_DOUBLE) {
96  // move only end position
97  return new GNEMoveOperation(this, getParentLanes().front(), 0, myEndPosition,
99  } else {
100  // start and end positions undefined, then nothing to move
101  return nullptr;
102  }
103 }
104 
105 
106 bool
109  getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), myFriendlyPosition);
110 }
111 
112 
113 std::string
115  // obtain lane length
116  double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor();
117  // calculate start and end positions
118  double startPos = getAttributeDouble(SUMO_ATTR_STARTPOS);
119  double endPos = getAttributeDouble(SUMO_ATTR_ENDPOS);
120  // check if position has to be fixed
121  if (startPos < 0) {
122  startPos += laneLength;
123  }
124  if (endPos < 0) {
125  endPos += laneLength;
126  }
127  // declare variables
128  std::string errorStart, separator, errorEnd;
129  // check positions over lane
130  if (startPos < 0) {
131  errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0");
132  } else if (startPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
133  errorStart = (toString(SUMO_ATTR_STARTPOS) + " > lanes's length");
134  }
135  if (endPos < 0) {
136  errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0");
137  } else if (endPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
138  errorEnd = (toString(SUMO_ATTR_ENDPOS) + " > lanes's length");
139  }
140  // check separator
141  if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
142  separator = " and ";
143  }
144  return errorStart + separator + errorEnd;
145 }
146 
147 
148 void
150  // calculate start and end positions
151  double startPos = getAttributeDouble(SUMO_ATTR_STARTPOS);
152  double endPos = getAttributeDouble(SUMO_ATTR_ENDPOS);
153  // fix start and end positions using fixStoppingPlacePosition
154  GNEAdditionalHandler::fixDoublePositionOverLane(startPos, endPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
155  // set new start and end positions
158 }
159 
160 
161 Position
164 }
165 
166 
167 void
168 GNEStoppingPlace::updateCenteringBoundary(const bool /*updateGrid*/) {
169  if (isTemplate()) {
170  return;
171  }
172  // update geometry
173  updateGeometry();
174  // add shape boundary
176  // grow with "width"
178  // we cannot use "getAttributeDouble(...)"
180  }
181  // grow
183  // add parking spaces
184  for (const auto& parkingSpace : getChildAdditionals()) {
185  if (parkingSpace->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
186  myAdditionalBoundary.add(parkingSpace->getCenteringBoundary());
187  }
188  }
189 }
190 
191 
192 void
193 GNEStoppingPlace::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) {
194  // first check tat both network elements are lanes and originalElement correspond to stoppingPlace lane
195  if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
196  (newElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
197  (getParentLanes().front() == originalElement)) {
198  // check if we have to change additional lane depending of split position
200  // calculate middle position
201  const double middlePosition = ((myEndPosition - myStartPosition) / 2.0) + myStartPosition;
202  // four cases:
203  if (splitPosition < myStartPosition) {
204  // change lane
205  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
206  // now adjust start and end position
207  setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList);
208  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
209  } else if ((splitPosition > myStartPosition) && (splitPosition < middlePosition)) {
210  // change lane
211  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
212  // now adjust start and end position
213  setAttribute(SUMO_ATTR_STARTPOS, "0", undoList);
214  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
215  } else if ((splitPosition > middlePosition) && (splitPosition < myEndPosition)) {
216  // only adjust end position
217  setAttribute(SUMO_ATTR_ENDPOS, toString(splitPosition), undoList);
218  } else if ((splitPosition > myEndPosition)) {
219  // nothing to do
220  }
221  } else if ((myStartPosition != INVALID_DOUBLE) && (splitPosition < myStartPosition)) {
222  // change lane
223  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
224  // now adjust start position
225  setAttribute(SUMO_ATTR_STARTPOS, toString(myEndPosition - splitPosition), undoList);
226  } else if ((myEndPosition != INVALID_DOUBLE) && (splitPosition < myEndPosition)) {
227  // change lane
228  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
229  // now adjust end position
230  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
231  }
232  }
233 }
234 
235 
236 std::string
238  return getParentLanes().front()->getID();
239 }
240 
241 
242 void
244  // Get value of option "lefthand"
245  const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
246 
247  // obtain laneShape
248  PositionVector laneShape = getParentLanes().front()->getLaneShape();
249 
250  // Move shape to side
251  laneShape.move2side(movingToSide * offsetSign);
252 
253  // Cut shape using as delimitators fixed start position and fixed end position
255 }
256 
257 
258 double
260  switch (key) {
261  case SUMO_ATTR_STARTPOS:
263  return myStartPosition;
264  } else {
265  return 0;
266  }
267  case SUMO_ATTR_ENDPOS:
268  if (myEndPosition != INVALID_DOUBLE) {
269  return myEndPosition;
270  } else {
271  return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
272  }
273  case SUMO_ATTR_CENTER:
275  default:
276  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
277  }
278 }
279 
280 
281 bool
283  // all stopping place attributes are always enabled
284  return true;
285 }
286 
287 
288 std::string
290  return getTagStr() + ": " + getID();
291 }
292 
293 
294 std::string
296  return getTagStr();
297 }
298 
299 
300 void
301 GNEStoppingPlace::drawLines(const GUIVisualizationSettings& s, const std::vector<std::string>& lines, const RGBColor& color) const {
302  if (!s.drawForPositionSelection) {
303  // calculate middle point
304  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
305  // calculate rotation
306  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
307  // Iterate over every line
308  for (int i = 0; i < (int)lines.size(); ++i) {
309  // push a new matrix for every line
311  // translate
312  glTranslated(mySignPos.x(), mySignPos.y(), 0);
313  // rotate over lane
315  // draw line with a color depending of the selection status
316  if (drawUsingSelectColor()) {
317  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
318  } else {
319  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
320  }
321  // pop matrix for every line
323  }
324  }
325 }
326 
327 
328 void
329 GNEStoppingPlace::drawSign(const GUIVisualizationSettings& s, const double exaggeration,
330  const RGBColor& baseColor, const RGBColor& signColor, const std::string& word) const {
331  // calculate middle point
332  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
333  // calculate rotation
334  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
335  if (s.drawForPositionSelection) {
336  // only draw circle depending of distance between sign and mouse cursor
338  // push matrix
340  // Start drawing sign traslating matrix to signal position
341  glTranslated(mySignPos.x(), mySignPos.y(), 0);
342  // rotate over lane
344  // scale matrix depending of the exaggeration
345  glScaled(exaggeration, exaggeration, 1);
346  // set color
347  GLHelper::setColor(baseColor);
348  // Draw circle
350  // pop draw matrix
352  }
353  } else {
354  // push matrix
356  // Start drawing sign traslating matrix to signal position
357  glTranslated(mySignPos.x(), mySignPos.y(), 0);
358  // rotate over lane
360  // scale matrix depending of the exaggeration
361  glScaled(exaggeration, exaggeration, 1);
362  // set color
363  GLHelper::setColor(baseColor);
364  // Draw circle
366  // continue depending of rectangle selection
367  if (!s.drawForRectangleSelection) {
368  // Traslate to front
369  glTranslated(0, 0, .1);
370  // set color
371  GLHelper::setColor(signColor);
372  // draw another circle in the same position, but a little bit more small
374  // draw H depending of detailSettings
375  GLHelper::drawText(word, Position(), .1, myCircleInText, baseColor);
376  }
377  // pop draw matrix
379  }
380 }
381 
382 
383 double
386  // get lane final and shape length
387  const double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
388  // get startPosition
389  double fixedPos = myStartPosition;
390  // adjust fixedPos
391  if (fixedPos < 0) {
392  fixedPos += laneLength;
393  }
394  fixedPos *= getParentLanes().front()->getLengthGeometryFactor();
395  // return depending of fixedPos
396  if (fixedPos < 0) {
397  return 0;
398  } else if (fixedPos > (getParentLanes().front()->getLaneShapeLength() - POSITION_EPS)) {
399  return (getParentLanes().front()->getLaneShapeLength() - POSITION_EPS);
400  } else {
401  return fixedPos;
402  }
403  } else {
404  return 0;
405  }
406 }
407 
408 
409 double
411  if (myEndPosition != INVALID_DOUBLE) {
412  // get lane final and shape length
413  const double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
414  // get endPosition
415  double fixedPos = myEndPosition;
416  // adjust fixedPos
417  if (fixedPos < 0) {
418  fixedPos += laneLength;
419  }
420  fixedPos *= getParentLanes().front()->getLengthGeometryFactor();
421  // return depending of fixedPos
422  if (fixedPos < POSITION_EPS) {
423  return POSITION_EPS;
424  } else if (fixedPos > getParentLanes().front()->getLaneShapeLength()) {
425  return getParentLanes().front()->getLaneShapeLength();
426  } else {
427  return fixedPos;
428  }
429  } else {
430  return getParentLanes().front()->getLaneShapeLength();
431  }
432 }
433 
434 
435 void
438  // change only start position
439  myStartPosition = moveResult.newFirstPos;
440  // adjust startPos
441  if (myStartPosition > (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS)) {
443  }
445  // change only end position
446  myEndPosition = moveResult.newFirstPos;
447  // adjust endPos
448  if (myEndPosition < (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS)) {
450  }
451  } else {
452  // change both position
453  myStartPosition = moveResult.newFirstPos;
454  myEndPosition = moveResult.newSecondPos;
455  // set lateral offset
457  }
458  // update geometry
459  updateGeometry();
460 }
461 
462 
463 void
465  // begin change attribute
466  undoList->begin(myTagProperty.getGUIIcon(), "position of " + getTagStr());
467  // set attributes depending of operation type
469  // set only start position
470  setAttribute(SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos), undoList);
472  // set only end position
473  setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos), undoList);
474  } else {
475  // set both
476  setAttribute(SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos), undoList);
477  setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newSecondPos), undoList);
478  // check if lane has to be changed
479  if (moveResult.newFirstLane) {
480  // set new lane
481  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
482  }
483  }
484  // end change attribute
485  undoList->end();
486 }
487 
488 /****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
GUIGlObjectType
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
@ 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_CENTER
@ SUMO_ATTR_WIDTH
const double INVALID_DOUBLE
Definition: StdDefs.h:63
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:77
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:299
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:507
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:431
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:114
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:609
static void fixDoublePositionOverLane(double &from, double &to, const double laneLengt)
fix the given positions over lane
static bool checkDoublePositionOverLane(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 belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
const std::string & getID() const
get ID
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Boundary myAdditionalBoundary
Additional Boundary.
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 isTemplate() const
check if this AC is template
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
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:1964
const std::string & getID() const
get ID
void fixAdditionalProblem()
fix additional problem
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
GNEStoppingPlace(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, GNELane *lane, const double startPos, const double endPos, const std::string &name, bool friendlyPosition, const std::map< std::string, std::string > &parameters)
Constructor.
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)
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
~GNEStoppingPlace()
Destructor.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
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
std::string getAdditionalProblem() const
return a string with the current additional problem
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
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
void drawLines(const GUIVisualizationSettings &s, const std::vector< std::string > &lines, const RGBColor &color) const
draw lines
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
bool isAttributeEnabled(SumoXMLAttr key) const
double myEndPosition
The position this stopping place is located at (-1 means empty)
void drawSign(const GUIVisualizationSettings &s, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
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
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
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 GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:513
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
Definition: GNEViewNet.cpp:543
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
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:58
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
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:58
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:257
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 ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
@ FONS_ALIGN_LEFT
Definition: fontstash.h:42
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
static const double additionalGeometryPointRadius
moving additional geometry point radius