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-2020 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 <netedit/GNENet.h>
21 #include <netedit/GNEUndoList.h>
22 #include <netedit/GNEViewNet.h>
25 #include <utils/gui/div/GLHelper.h>
29 
30 #include "GNEStoppingPlace.h"
31 
32 // ===========================================================================
33 // static members
34 // ===========================================================================
35 
36 const double GNEStoppingPlace::myCircleWidth = 1.1;
37 const double GNEStoppingPlace::myCircleWidthSquared = 1.21;
38 const double GNEStoppingPlace::myCircleInWidth = 0.9;
39 const double GNEStoppingPlace::myCircleInText = 1.6;
40 
41 // ===========================================================================
42 // member method definitions
43 // ===========================================================================
44 
46  GNELane* lane, double startPos, double endPos, int parametersSet, const std::string& name,
47  bool friendlyPosition, bool blockMovement) :
48  GNEAdditional(id, net, type, tag, name, blockMovement,
49 {}, {}, {lane}, {}, {}, {}, {}, {}),
50 myStartPosition(startPos),
51 myEndPosition(endPos),
52 myParametersSet(parametersSet),
53 myFriendlyPosition(friendlyPosition) {
54 }
55 
56 
58 
59 
61 GNEStoppingPlace::getMoveOperation(const double /*shapeOffset*/) {
62  // check conditions
63  if (myParametersSet == 0) {
64  // start and end positions undefined, then nothing to move
65  return nullptr;
66  } else if (myBlockMovement) {
67  // element blocked, then nothing to move
68  return nullptr;
69  } else {
70  // return move operation for additional placed over shape
71  return new GNEMoveOperation(this, getParentLanes().front(), {myStartPosition, myEndPosition});
72  }
73 }
74 
75 
76 bool
78  // with friendly position enabled position are "always fixed"
79  if (myFriendlyPosition) {
80  return true;
81  } else {
82  // obtain lane length
83  double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor();
84  // calculate start and end positions
86  double endPos = (myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : laneLength;
87  // check if position has to be fixed
88  if (startPos < 0) {
89  startPos += laneLength;
90  }
91  if (endPos < 0) {
92  endPos += laneLength;
93  }
94  // check values
95  if (myParametersSet == 0) {
96  return true;
97  } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) == 0) {
98  return (endPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
99  } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) == 0) {
100  return (startPos >= 0);
101  } else {
102  return ((startPos >= 0) && (endPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPos - startPos) >= POSITION_EPS));
103  }
104  }
105 }
106 
107 
108 std::string
110  // calculate start and end positions
111  double startPos = (myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0;
112  double endPos = (myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
113  // obtain lane length
114  double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
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) + " > 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) + " > lanes's length");
134  }
135  // check separator
136  if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
137  separator = " and ";
138  }
139  return errorStart + separator + errorEnd;
140 }
141 
142 
143 void
145  // declare new start and end position
146  double newStartPos = myStartPosition;
147  double newEndPos = myEndPosition;
148  // fix start and end positions using fixStoppingPlacePosition
149  SUMORouteHandler::checkStopPos(newStartPos, newEndPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, true);
150  // set new start and end positions
153 }
154 
155 
156 
157 void
159  // remove additional from grid
160  if (updateGrid && myTagProperty.isPlacedInRTree()) {
162  }
163  // update geometry
164  updateGeometry();
165  // add shape boundary
167  // grow with "width"
169  // we cannot use "getAttributeDouble(...)"
171  }
172  // grow
173  myBoundary.grow(10);
174  // add parking spaces
175  for (const auto& parkingSpace : getChildAdditionals()) {
176  if (parkingSpace->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
177  myBoundary.add(parkingSpace->getCenteringBoundary());
178  }
179  }
180  // add additional into RTREE again
181  if (updateGrid && myTagProperty.isPlacedInRTree()) {
182  myNet->addGLObjectIntoGrid(this);
183  }
184 }
185 
186 
187 void
188 GNEStoppingPlace::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) {
189  // first check tat both network elements are lanes and originalElement correspond to stoppingPlace lane
190  if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
191  (originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
192  (getParentLanes().front() == originalElement)) {
193  // check if we have to change additional lane depending of split position
195  // calculate middle position
196  const double middlePosition = ((myEndPosition - myStartPosition) / 2.0) + myStartPosition;
197  // four cases:
198  if (splitPosition < myStartPosition) {
199  // change lane
200  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
201  // now adjust start and end position
202  setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList);
203  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
204  } else if ((splitPosition > myStartPosition) && (splitPosition < middlePosition)) {
205  // change lane
206  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
207  // now adjust start and end position
208  setAttribute(SUMO_ATTR_STARTPOS, "0", undoList);
209  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
210  } else if ((splitPosition > middlePosition) && (splitPosition < myEndPosition)) {
211  // only adjust end position
212  setAttribute(SUMO_ATTR_ENDPOS, toString(splitPosition), undoList);
213  } else if ((splitPosition > myEndPosition)) {
214  // nothing to do
215  }
216  } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (splitPosition < myStartPosition)) {
217  // change lane
218  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
219  // now adjust start position
220  setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList);
221  } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) && (splitPosition < myEndPosition)) {
222  // change lane
223  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
224  // now adjust end position
225  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
226  }
227  }
228 }
229 
230 /*
231 
232 void
233 GNEStoppingPlace::move Geometry(const Position& offset) {
234  // only move if at leats start or end positions is defined
235  if (myParametersSet > 0) {
236  // Calculate new position using old position
237  Position newPosition = myMove.originalViewPosition;
238  newPosition.add(offset);
239  // filtern position using snap to active grid
240  newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition);
241  double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myMove.originalViewPosition, false);
242  // check if both position has to be moved
243  if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (myParametersSet & STOPPINGPLACE_ENDPOS_SET)) {
244  // calculate stoppingPlace length and lane length (After apply geometry factor)
245  double stoppingPlaceLength = fabs(parse<double>(myMove.secondOriginalPosition) - parse<double>(myMove.firstOriginalLanePosition));
246  double laneLengt = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor();
247  // avoid changing stopping place's length
248  if ((parse<double>(myMove.firstOriginalLanePosition) + offsetLane) < 0) {
249  myStartPosition = 0;
250  myEndPosition = stoppingPlaceLength;
251  } else if ((parse<double>(myMove.secondOriginalPosition) + offsetLane) > laneLengt) {
252  myStartPosition = laneLengt - stoppingPlaceLength;
253  myEndPosition = laneLengt;
254  } else {
255  myStartPosition = parse<double>(myMove.firstOriginalLanePosition) + offsetLane;
256  myEndPosition = parse<double>(myMove.secondOriginalPosition) + offsetLane;
257  }
258  } else {
259  // check if start position must be moved
260  if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) {
261  myStartPosition = parse<double>(myMove.firstOriginalLanePosition) + offsetLane;
262  }
263  // check if start position must be moved
264  if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) {
265  myEndPosition = parse<double>(myMove.secondOriginalPosition) + offsetLane;
266  }
267  }
268  // Update geometry
269  updateGeometry();
270  }
271 }
272 */
273 /*
274 void
275 GNEStoppingPlace::commitGeometryMoving(GNEUndoList* undoList) {
276  // only commit geometry moving if at leats start or end positions is defined
277  if (myParametersSet > 0) {
278  undoList->p_begin("position of " + getTagStr());
279  if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) {
280  undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(myStartPosition), myMove.firstOriginalLanePosition));
281  }
282  if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) {
283  undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(myEndPosition), myMove.secondOriginalPosition));
284  }
285  undoList->p_end();
286  }
287 }
288 */
289 
290 double
293  return myStartPosition;
294  } else {
295  return 0;
296  }
297 }
298 
299 
300 double
303  return myEndPosition;
304  } else {
305  return getParentLanes().front()->getLaneShapeLength();
306  }
307 }
308 
309 
310 std::string
312  return getParentLanes().front()->getID();
313 }
314 
315 
316 void
318  // Get value of option "lefthand"
319  const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
320 
321  // obtain laneShape
322  PositionVector laneShape = getParentLanes().front()->getLaneShape();
323 
324  // Move shape to side
325  laneShape.move2side(movingToSide * offsetSign);
326 
327  // Cut shape using as delimitators fixed start position and fixed end position
329 }
330 
331 
332 double
335  double fixedPos = myStartPosition;
336  const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
337  if (fixedPos < 0) {
338  fixedPos += len;
339  }
340  return fixedPos * getParentLanes().front()->getLengthGeometryFactor();
341  } else {
342  return 0;
343  }
344 }
345 
346 
347 double
350  double fixedPos = myEndPosition;
351  const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
352  if (fixedPos < 0) {
353  fixedPos += len;
354  }
355  return fixedPos * getParentLanes().front()->getLengthGeometryFactor();
356  } else {
357  return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
358  }
359 }
360 
361 
362 double
364  switch (key) {
365  case SUMO_ATTR_STARTPOS:
367  return myStartPosition;
368  } else {
369  return -1;
370  }
371  case SUMO_ATTR_ENDPOS:
373  return myEndPosition;
374  } else {
375  return -1;
376  }
377  default:
378  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
379  }
380 }
381 
382 
383 bool
385  // all stopping place attributes are always enabled
386  return true;
387 }
388 
389 
390 std::string
392  return getTagStr() + ": " + getID();
393 }
394 
395 
396 std::string
398  return getTagStr();
399 }
400 
401 
402 void
403 GNEStoppingPlace::drawLines(const GUIVisualizationSettings& s, const std::vector<std::string>& lines, const RGBColor& color) const {
404  if (!s.drawForPositionSelection) {
405  // calculate middle point
406  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
407  // calculate rotation
408  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
409  // Iterate over every line
410  for (int i = 0; i < (int)lines.size(); ++i) {
411  // push a new matrix for every line
412  glPushMatrix();
413  // translate
414  glTranslated(mySignPos.x(), mySignPos.y(), 0);
415  // rotate over lane
417  // draw line with a color depending of the selection status
418  if (drawUsingSelectColor()) {
419  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
420  } else {
421  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
422  }
423  // pop matrix for every line
424  glPopMatrix();
425  }
426  }
427 }
428 
429 
430 void
431 GNEStoppingPlace::drawSign(const GUIVisualizationSettings& s, const double exaggeration,
432  const RGBColor& baseColor, const RGBColor& signColor, const std::string& word) const {
433  // calculate middle point
434  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
435  // calculate rotation
436  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
437  if (s.drawForPositionSelection) {
438  // only draw circle depending of distance between sign and mouse cursor
440  // push matrix
441  glPushMatrix();
442  // Start drawing sign traslating matrix to signal position
443  glTranslated(mySignPos.x(), mySignPos.y(), 0);
444  // rotate over lane
446  // scale matrix depending of the exaggeration
447  glScaled(exaggeration, exaggeration, 1);
448  // set color
449  GLHelper::setColor(baseColor);
450  // Draw circle
452  // pop draw matrix
453  glPopMatrix();
454  }
455  } else {
456  // push matrix
457  glPushMatrix();
458  // Start drawing sign traslating matrix to signal position
459  glTranslated(mySignPos.x(), mySignPos.y(), 0);
460  // rotate over lane
462  // scale matrix depending of the exaggeration
463  glScaled(exaggeration, exaggeration, 1);
464  // set color
465  GLHelper::setColor(baseColor);
466  // Draw circle
468  // continue depending of rectangle selection
469  if (!s.drawForRectangleSelection) {
470  // Traslate to front
471  glTranslated(0, 0, .1);
472  // set color
473  GLHelper::setColor(signColor);
474  // draw another circle in the same position, but a little bit more small
476  // draw H depending of detailSettings
477  GLHelper::drawText(word, Position(), .1, myCircleInText, baseColor);
478  }
479  // pop draw matrix
480  glPopMatrix();
481  }
482 }
483 
484 
485 void
487  // change both position
488  myStartPosition = moveResult.shapeToUpdate.front().x();
489  myEndPosition = moveResult.shapeToUpdate.back().x();
490  // update geometry
491  updateGeometry();
492 }
493 
494 
495 void
497  // only commit geometry moving if at leats start or end positions is defined
498  if (myParametersSet > 0) {
499  undoList->p_begin("position of " + getTagStr());
501  undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(moveResult.shapeToUpdate.front().x())));
502  }
504  undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(moveResult.shapeToUpdate.back().x())));
505  }
506  undoList->p_end();
507  }
508 }
509 
510 /****************************************************************************/
const int STOPPINGPLACE_STARTPOS_SET
const int STOPPINGPLACE_ENDPOS_SET
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_WIDTH
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
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
void growWidth(double by)
Increases the width of the boundary (x-axis)
Definition: Boundary.cpp:308
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:446
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:347
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:498
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
const std::string & getID() const
get ID
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Boundary myBoundary
Additional Boundary.
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
Definition: GNEGeometry.cpp:81
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:45
move operation
move result
PositionVector shapeToUpdate
shape to update (edited in moveElement)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1411
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1423
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2245
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, double startPos, double endPos, int parametersSet, const std::string &name, bool friendlyPosition, bool blockMovement)
Constructor.
double getAttributeDouble(SumoXMLAttr key) const
double getEndPosition() const
get end Position
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
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.
double getStartPosition() const
get start Position
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 (optional, if empty takes the lane length)
void drawSign(const GUIVisualizationSettings &s, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
int myParametersSet
Variable used for set/unset start/endPositions.
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 (optional, if empty takes 0)
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
bool isPlacedInRTree() const
return true if Tag correspond to an element that has has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:71
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:78
GNEUndoList * getUndoList() const
get the undoList object
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
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:36
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:246
double x() const
Returns the x-position.
Definition: Position.h:54
double y() const
Returns the y-position.
Definition: Position.h:59
A list of positions.
double length2D() const
Returns the length.
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.
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
@ FONS_ALIGN_LEFT
Definition: fontstash.h:42
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)