Eclipse SUMO - Simulation of Urban MObility
GNEBusStop.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A lane area vehicles can halt at (GNE version)
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNEViewNet.h>
32 #include <utils/gui/div/GLHelper.h>
33 #include <utils/geom/GeomHelper.h>
34 
35 #include "GNEBusStop.h"
36 
37 // ===========================================================================
38 // method definitions
39 // ===========================================================================
40 
41 GNEBusStop::GNEBusStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const std::string& startPos, const std::string& endPos, const std::string& name, const std::vector<std::string>& lines, int personCapacity, bool friendlyPosition, bool blockMovement) :
42  GNEStoppingPlace(id, viewNet, GLO_BUS_STOP, SUMO_TAG_BUS_STOP, lane, startPos, endPos, name, friendlyPosition, blockMovement),
43  myLines(lines),
44  myPersonCapacity(personCapacity) {
45 }
46 
47 
49 
50 
51 void
53  // Get value of option "lefthand"
54  double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
55 
56  // Update common geometry of stopping place
57  setStoppingPlaceGeometry(getLaneParents().front()->getParentEdge().getNBEdge()->getLaneWidth(getLaneParents().front()->getIndex()) / 2);
58 
59  // Obtain a copy of the shape
60  PositionVector tmpShape = myGeometry.shape;
61 
62  // Move shape to side
63  tmpShape.move2side(1.5 * offsetSign);
64 
65  // Get position of the sign
66  mySignPos = tmpShape.getLineCenter();
67 
68  // Set block icon position
70 
71  // Set block icon rotation, and using their rotation for sign
73 
74  // update demand element children (GNEStops)
75  for (const auto& i : getDemandElementChildren()) {
76  i->updateGeometry();
77  }
78 }
79 
80 
83  return myGeometry.shape.getBoxBoundary().grow(10);
84 }
85 
86 
87 void
89  // Obtain exaggeration of the draw
90  const double exaggeration = s.addSize.getExaggeration(s, this);
91  // Start drawing adding an gl identificator
92  glPushName(getGlID());
93  // Add a draw matrix
94  glPushMatrix();
95  // Start with the drawing of the area traslating matrix to origin
96  glTranslated(0, 0, getType());
97  // Set color of the base
98  if (mySpecialColor) {
100  } else if (drawUsingSelectColor()) {
102  } else {
104  }
105  // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
107  // Check if the distance is enought to draw details and if is being drawn for selecting
108  if (s.drawForSelecting) {
109  // only draw circle depending of distance between sign and mouse cursor
111  // Add a draw matrix for details
112  glPushMatrix();
113  // Start drawing sign traslating matrix to signal position
114  glTranslated(mySignPos.x(), mySignPos.y(), 0);
115  // scale matrix depending of the exaggeration
116  glScaled(exaggeration, exaggeration, 1);
117  // set color
119  // Draw circle
121  // pop draw matrix
122  glPopMatrix();
123  }
124  } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, exaggeration)) {
125  // draw lines between BusStops and Acces
126  for (auto i : getAdditionalChildren()) {
127  GLHelper::drawBoxLine(i->getShape()[0], RAD2DEG(mySignPos.angleTo2D(i->getShape()[0])) - 90, mySignPos.distanceTo2D(i->getShape()[0]), .05);
128  }
129  // Add a draw matrix for details
130  glPushMatrix();
131  // draw lines depending of detailSettings
132  if (s.drawDetail(s.detailSettings.stoppingPlaceText, exaggeration)) {
133  // Iterate over every line
134  for (int i = 0; i < (int)myLines.size(); ++i) {
135  // push a new matrix for every line
136  glPushMatrix();
137  // Rotate and traslaste
138  glTranslated(mySignPos.x(), mySignPos.y(), 0);
139  glRotated(-1 * myBlockIcon.rotation, 0, 0, 1);
140  // draw line with a color depending of the selection status
141  if (drawUsingSelectColor()) {
142  GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.selectionColor, 0, FONS_ALIGN_LEFT);
143  } else {
144  GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.busStop, 0, FONS_ALIGN_LEFT);
145  }
146  // pop matrix for every line
147  glPopMatrix();
148  }
149  }
150  // Start drawing sign traslating matrix to signal position
151  glTranslated(mySignPos.x(), mySignPos.y(), 0);
152  // scale matrix depending of the exaggeration
153  glScaled(exaggeration, exaggeration, 1);
154  // Set color of the externe circle
155  if (drawUsingSelectColor()) {
157  } else {
159  }
160  // Draw circle
162  // Traslate to front
163  glTranslated(0, 0, .1);
164  // Set color of the interne circle
165  if (drawUsingSelectColor()) {
167  } else {
169  }
170  // draw another circle in the same position, but a little bit more small
172  // draw H depending of detailSettings
173  if (s.drawDetail(s.detailSettings.stoppingPlaceText, exaggeration)) {
174  if (drawUsingSelectColor()) {
176  } else {
178  }
179  }
180  // pop draw matrix
181  glPopMatrix();
182  // Show Lock icon depending of the Edit mode
183  myBlockIcon.drawIcon(s, exaggeration);
184  }
185  // pop draw matrix
186  glPopMatrix();
187  // Draw name if isn't being drawn for selecting
189  if (s.addFullName.show && (myAdditionalName != "") && !s.drawForSelecting) {
191  }
192  // check if dotted contour has to be drawn
193  if (myViewNet->getDottedAC() == this) {
195  }
196  // Pop name
197  glPopName();
198  // draw demand element children
199  for (const auto& i : getDemandElementChildren()) {
200  if (!i->getTagProperty().isPlacedInRTree()) {
201  i->drawGL(s);
202  }
203  }
204 }
205 
206 
207 std::string
209  switch (key) {
210  case SUMO_ATTR_ID:
211  return getAdditionalID();
212  case SUMO_ATTR_LANE:
213  return getLaneParents().front()->getID();
214  case SUMO_ATTR_STARTPOS:
215  return toString(myStartPosition);
216  case SUMO_ATTR_ENDPOS:
217  return myEndPosition;
218  case SUMO_ATTR_NAME:
219  return myAdditionalName;
222  case SUMO_ATTR_LINES:
223  return joinToString(myLines, " ");
225  return toString(myPersonCapacity);
227  return toString(myBlockMovement);
228  case GNE_ATTR_SELECTED:
230  case GNE_ATTR_GENERIC:
231  return getGenericParametersStr();
232  default:
233  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
234  }
235 }
236 
237 
238 void
239 GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
240  if (value == getAttribute(key)) {
241  return; //avoid needless changes, later logic relies on the fact that attributes have changed
242  }
243  switch (key) {
244  case SUMO_ATTR_ID: {
245  // change ID of BusStop
246  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
247  // Change Ids of all Acces children
248  for (auto i : getAdditionalChildren()) {
249  i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_ACCESS), undoList);
250  }
251  break;
252  }
253  case SUMO_ATTR_LANE:
254  case SUMO_ATTR_STARTPOS:
255  case SUMO_ATTR_ENDPOS:
256  case SUMO_ATTR_NAME:
258  case SUMO_ATTR_LINES:
261  case GNE_ATTR_SELECTED:
262  case GNE_ATTR_GENERIC:
263  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
264  break;
265  default:
266  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
267  }
268 }
269 
270 
271 bool
272 GNEBusStop::isValid(SumoXMLAttr key, const std::string& value) {
273  switch (key) {
274  case SUMO_ATTR_ID:
275  return isValidAdditionalID(value);
276  case SUMO_ATTR_LANE:
277  if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) {
278  return true;
279  } else {
280  return false;
281  }
282  case SUMO_ATTR_STARTPOS:
283  if (value.empty()) {
284  return true;
285  } else if (canParse<double>(value)) {
286  return checkStoppinPlacePosition(value, myEndPosition, getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength(), myFriendlyPosition);
287  } else {
288  return false;
289  }
290  case SUMO_ATTR_ENDPOS:
291  if (value.empty()) {
292  return true;
293  } else if (canParse<double>(value)) {
294  return checkStoppinPlacePosition(myStartPosition, value, getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength(), myFriendlyPosition);
295  } else {
296  return false;
297  }
298  case SUMO_ATTR_NAME:
301  return canParse<bool>(value);
302  case SUMO_ATTR_LINES:
303  return canParse<std::vector<std::string> >(value);
305  return canParse<int>(value) && (parse<int>(value) > 0 || parse<int>(value) == -1);
307  return canParse<bool>(value);
308  case GNE_ATTR_SELECTED:
309  return canParse<bool>(value);
310  case GNE_ATTR_GENERIC:
311  return isGenericParametersValid(value);
312  default:
313  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
314  }
315 }
316 
317 // ===========================================================================
318 // private
319 // ===========================================================================
320 
321 void
322 GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value) {
323  switch (key) {
324  case SUMO_ATTR_ID:
325  changeAdditionalID(value);
326  break;
327  case SUMO_ATTR_LANE:
328  changeLaneParents(this, value);
329  break;
330  case SUMO_ATTR_STARTPOS:
331  myStartPosition = value;
332  break;
333  case SUMO_ATTR_ENDPOS:
334  myEndPosition = value;
335  break;
336  case SUMO_ATTR_NAME:
337  myAdditionalName = value;
338  break;
340  myFriendlyPosition = parse<bool>(value);
341  break;
342  case SUMO_ATTR_LINES:
343  myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
344  break;
346  myPersonCapacity = GNEAttributeCarrier::parse<int>(value);
347  break;
349  myBlockMovement = parse<bool>(value);
350  break;
351  case GNE_ATTR_SELECTED:
352  if (parse<bool>(value)) {
354  } else {
356  }
357  break;
358  case GNE_ATTR_GENERIC:
360  break;
361  default:
362  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
363  }
364 }
365 
366 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:181
SUMOXMLDefinitions::isValidAttribute
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
Definition: SUMOXMLDefinitions.cpp:988
GNEAdditional::BlockIcon::position
Position position
position of the block icon
Definition: GNEAdditional.h:351
GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:166
GUIVisualizationColorSettings::busStop
static const RGBColor busStop
color for busStops
Definition: GUIVisualizationSettings.h:175
GNEAdditional::setGenericParametersStr
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Definition: GNEAdditional.cpp:704
GNEAdditional::getAdditionalID
const std::string & getAdditionalID() const
Definition: GNEAdditional.cpp:578
GUIVisualizationDetailSettings::stoppingPlaceDetails
static const double stoppingPlaceDetails
details for stopping places
Definition: GUIVisualizationSettings.h:299
GNEAdditional::AdditionalGeometry::shape
PositionVector shape
The shape of the additional element.
Definition: GNEAdditional.h:68
GNEAdditional::BlockIcon::setRotation
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
Definition: GNEAdditional.cpp:502
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:355
OptionsCont.h
GLHelper::drawBoxLines
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:182
GNEAdditional::generateChildID
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNEAdditional.cpp:183
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:75
GNEStoppingPlace::mySignPos
Position mySignPos
The position of the sign.
Definition: GNEStoppingPlace.h:167
GNEBusStop::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEBusStop.cpp:239
GNEAdditional::AdditionalGeometry::shapeRotations
std::vector< double > shapeRotations
The rotations of the single shape parts.
Definition: GNEAdditional.h:74
GNEAttributeCarrier::isGenericParametersValid
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
Definition: GNEAttributeCarrier.cpp:1354
SUMO_ATTR_LINES
Definition: SUMOXMLDefinitions.h:773
FONS_ALIGN_LEFT
Definition: fontstash.h:42
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:223
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
GNEViewNet
Definition: GNEViewNet.h:43
RAD2DEG
#define RAD2DEG(x)
Definition: GeomHelper.h:39
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
GLHelper.h
SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:635
SUMO_ATTR_ENDPOS
Definition: SUMOXMLDefinitions.h:795
GNEAdditional::changeAdditionalID
void changeAdditionalID(const std::string &newID)
change ID of additional
Definition: GNEAdditional.cpp:604
PositionVector
A list of positions.
Definition: PositionVector.h:46
GNEAdditional::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNEAdditional.cpp:634
GNEAdditional::myBlockIcon
BlockIcon myBlockIcon
variable BlockIcon
Definition: GNEAdditional.h:380
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
PositionVector::getBoxBoundary
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Definition: PositionVector.cpp:382
GNEStoppingPlace::myCircleInWidth
static const double myCircleInWidth
inner circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:176
GUIVisualizationTextSettings::scaledSize
double scaledSize(double scale, double constFactor=0.1) const
get scale size
Definition: GUIVisualizationSettings.cpp:195
GNEAdditional::mySpecialColor
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
Definition: GNEAdditional.h:383
GNEAdditional::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
Definition: GNEAdditional.h:365
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
GNEBusStop::~GNEBusStop
~GNEBusStop()
Destructor.
Definition: GNEBusStop.cpp:48
GNEHierarchicalElementParents::getLaneParents
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
Definition: GNEHierarchicalElementParents.cpp:182
GNEUndoList::p_add
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Definition: GNEUndoList.cpp:132
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
GLHelper::drawFilledCircle
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:348
GNEAdditional::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEAdditional.cpp:650
GLHelper::drawText
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, int align=0, double width=-1)
Definition: GLHelper.cpp:668
GNEStoppingPlace::myFriendlyPosition
bool myFriendlyPosition
Flag for friendly position.
Definition: GNEStoppingPlace.h:164
GUIVisualizationSettings::addName
GUIVisualizationTextSettings addName
Definition: GUIVisualizationSettings.h:582
GNEStoppingPlace::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEStoppingPlace.cpp:212
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:655
SUMO_ATTR_STARTPOS
Definition: SUMOXMLDefinitions.h:794
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:148
GNEStoppingPlace
Definition: GNEStoppingPlace.h:35
GNEStoppingPlace::myCircleWidthSquared
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:173
GNEDemandElement.h
GNEAdditional::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
Definition: GNEAdditional.cpp:619
GNEBusStop::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEBusStop.cpp:272
GNEStoppingPlace::setStoppingPlaceGeometry
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
Definition: GNEStoppingPlace.cpp:336
GNEViewNet.h
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:150
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:939
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GNEBusStop::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEBusStop.cpp:88
GNEBusStop::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEBusStop.cpp:82
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:623
SUMO_ATTR_PERSON_CAPACITY
Definition: SUMOXMLDefinitions.h:647
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
Position::x
double x() const
Returns the x-position.
Definition: Position.h:57
GNEEdge.h
GNEAdditional::myAdditionalName
std::string myAdditionalName
name of additional
Definition: GNEAdditional.h:374
GUIVisualizationSettings::addFullName
GUIVisualizationTextSettings addFullName
Definition: GUIVisualizationSettings.h:584
GNEStoppingPlace::myStartPosition
std::string myStartPosition
The relative start position this stopping place is located at (optional, if empty takes 0)
Definition: GNEStoppingPlace.h:158
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:69
GNEAdditional::myBlockMovement
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Definition: GNEAdditional.h:377
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:188
GNEAdditional::BlockIcon::rotation
double rotation
The rotation of the block icon.
Definition: GNEAdditional.h:357
GLHelper::drawShapeDottedContourAroundShape
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
Definition: GLHelper.cpp:461
SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:762
GNELane.h
GLO_BUS_STOP
a busStop
Definition: GUIGlObjectTypes.h:62
Position::distanceSquaredTo2D
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:249
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:649
GNEBusStop::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEBusStop.cpp:52
GUIVisualizationColorSettings::selectionColor
RGBColor selectionColor
basic selection color
Definition: GUIVisualizationSettings.h:130
GUIVisualizationSettings::getCircleResolution
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
Definition: GUIVisualizationSettings.cpp:1631
Position::angleTo2D
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
Definition: Position.h:254
Position::distanceTo2D
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:244
GNEBusStop::GNEBusStop
GNEBusStop(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, int personCapacity, bool friendlyPosition, bool blockMovement)
Constructor.
Definition: GNEBusStop.cpp:41
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GNE_ATTR_GENERIC
generic attribute
Definition: SUMOXMLDefinitions.h:986
GNEAdditional::BlockIcon::drawIcon
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
Definition: GNEAdditional.cpp:518
SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:98
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
InvalidArgument
Definition: UtilExceptions.h:57
GLHelper::drawBoxLine
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:136
GNEAdditional::getGenericParametersStr
std::string getGenericParametersStr() const
return generic parameters in string format
Definition: GNEAdditional.cpp:678
GNEHierarchicalElementChildren::getAdditionalChildren
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:132
GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:978
GUIVisualizationColorSettings::busStop_sign
static const RGBColor busStop_sign
color for busStops signs
Definition: GUIVisualizationSettings.h:178
GNEAdditional::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEAdditional.cpp:656
GNEBusStop.h
GUIVisualizationDetailSettings::stoppingPlaceText
static const double stoppingPlaceText
details for stopping place texts
Definition: GUIVisualizationSettings.h:302
GNEBusStop::myLines
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition: GNEBusStop.h:97
joinToString
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:247
GNEHierarchicalElementParents::changeLaneParents
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
Definition: GNEHierarchicalElementParents.cpp:460
GNEAdditional::myGeometry
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
Definition: GNEAdditional.h:368
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
GUIVisualizationSettings::addSize
GUIVisualizationSizeSettings addSize
Definition: GUIVisualizationSettings.h:580
GeomHelper.h
GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:968
GNEBusStop::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEBusStop.cpp:208
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
GUIVisualizationSettings::drawDetail
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
Definition: GUIVisualizationSettings.cpp:1621
GNEStoppingPlace::myCircleInText
static const double myCircleInText
text inner circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:179
GNEAdditional::AdditionalGeometry::shapeLengths
std::vector< double > shapeLengths
The lengths of the single shape parts.
Definition: GNEAdditional.h:77
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1165
SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:381
GNEUndoList
Definition: GNEUndoList.h:49
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
SUMO_TAG_ACCESS
An access point for a train stop.
Definition: SUMOXMLDefinitions.h:104
PositionVector::getLineCenter
Position getLineCenter() const
get line center
Definition: PositionVector.cpp:466
GNEAdditional::isValidAdditionalID
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
Definition: GNEAdditional.cpp:584
GNEHierarchicalElementChildren::getDemandElementChildren
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementChildren.cpp:297
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEStoppingPlace::myCircleWidth
static const double myCircleWidth
circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:170
GNEStoppingPlace::checkStoppinPlacePosition
static bool checkStoppinPlacePosition(const std::string &startPosStr, const std::string &endPosStr, const double laneLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid (without modifications)
Definition: GNEStoppingPlace.cpp:139
GNEChange_Attribute.h
GNENet.h
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
PositionVector::move2side
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Definition: PositionVector.cpp:1086
GNEBusStop::myPersonCapacity
int myPersonCapacity
maximum number of persons that can wait at this stop
Definition: GNEBusStop.h:100
GNEUndoList.h
GUIVisualizationSettings::drawForSelecting
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
Definition: GUIVisualizationSettings.h:635
GNEStoppingPlace::myEndPosition
std::string myEndPosition
The position this stopping place is located at (optional, if empty takes the lane lenght)
Definition: GNEStoppingPlace.h:161
fontstash.h