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 /****************************************************************************/
14 // A lane area vehicles can halt at (GNE version)
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
31 #include <utils/gui/div/GLHelper.h>
32 #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 double startPos, const double endPos, const int parametersSet,
42  const std::string& name, const std::vector<std::string>& lines, int personCapacity, bool friendlyPosition, bool blockMovement) :
43  GNEStoppingPlace(id, viewNet, GLO_BUS_STOP, SUMO_TAG_BUS_STOP, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement),
44  myLines(lines),
45  myPersonCapacity(personCapacity) {
46 }
47 
48 
50 
51 
52 void
54  // Get value of option "lefthand"
55  double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
56 
57  // Update common geometry of stopping place
58  setStoppingPlaceGeometry(getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) / 2);
59 
60  // Obtain a copy of the shape
62 
63  // Move shape to side
64  tmpShape.move2side(1.5 * offsetSign);
65 
66  // Get position of the sign
67  mySignPos = tmpShape.getLineCenter();
68 
69  // Set block icon position
71 
72  // Set block icon rotation, and using their rotation for sign
74 
75  // obtain parent edge
76  const GNEEdge* edge = getParentLanes().front()->getParentEdge();
77 
78  // update child demand elements geometry
79  for (const auto& i : getChildDemandElements()) {
80  // special case for person trips
81  if (i->getTagProperty().isPersonTrip()) {
82  // update previous and next person plan
83  GNEDemandElement* previousDemandElement = i->getParentDemandElements().front()->getPreviousChildDemandElement(i);
84  if (previousDemandElement) {
85  previousDemandElement->updatePartialGeometry(edge);
86  }
87  GNEDemandElement* nextDemandElement = i->getParentDemandElements().front()->getNextChildDemandElement(i);
88  if (nextDemandElement) {
89  nextDemandElement->updatePartialGeometry(edge);
90  }
91  }
92  i->updatePartialGeometry(edge);
93  }
94 }
95 
96 
100 }
101 
102 
103 void
105  // Obtain exaggeration of the draw
106  const double exaggeration = s.addSize.getExaggeration(s, this);
107  // first check if additional has to be drawn
108  if (s.drawAdditionals(exaggeration)) {
109  // Start drawing adding an gl identificator
110  glPushName(getGlID());
111  // Add a draw matrix
112  glPushMatrix();
113  // Start with the drawing of the area traslating matrix to origin
114  glTranslated(0, 0, getType());
115  // Set color of the base
116  if (mySpecialColor) {
118  } else if (drawUsingSelectColor()) {
120  } else {
122  }
123  // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
125  // Check if the distance is enought to draw details and if is being drawn for selecting
127  // only draw circle depending of distance between sign and mouse cursor
129  // Add a draw matrix for details
130  glPushMatrix();
131  // Start drawing sign traslating matrix to signal position
132  glTranslated(mySignPos.x(), mySignPos.y(), 0);
133  // scale matrix depending of the exaggeration
134  glScaled(exaggeration, exaggeration, 1);
135  // set color
137  // Draw circle
139  // pop draw matrix
140  glPopMatrix();
141  }
142  } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, exaggeration)) {
143  // draw lines between BusStops and Acces
144  for (auto i : getChildAdditionals()) {
145  GLHelper::drawBoxLine(i->getAdditionalGeometry().getPosition(),
146  RAD2DEG(mySignPos.angleTo2D(i->getAdditionalGeometry().getPosition())) - 90, mySignPos.distanceTo2D(i->getAdditionalGeometry().getPosition()), .05);
147  }
148  // Add a draw matrix for details
149  glPushMatrix();
150  // draw lines depending of detailSettings
151  if (s.drawDetail(s.detailSettings.stoppingPlaceText, exaggeration)) {
152  // Iterate over every line
153  for (int i = 0; i < (int)myLines.size(); ++i) {
154  // push a new matrix for every line
155  glPushMatrix();
156  // Rotate and traslaste
157  glTranslated(mySignPos.x(), mySignPos.y(), 0);
158  glRotated(-1 * myBlockIcon.rotation, 0, 0, 1);
159  // draw line with a color depending of the selection status
160  if (drawUsingSelectColor()) {
161  GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.selectionColor, 0, FONS_ALIGN_LEFT);
162  } else {
163  GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.busStop, 0, FONS_ALIGN_LEFT);
164  }
165  // pop matrix for every line
166  glPopMatrix();
167  }
168  }
169  // Start drawing sign traslating matrix to signal position
170  glTranslated(mySignPos.x(), mySignPos.y(), 0);
171  // scale matrix depending of the exaggeration
172  glScaled(exaggeration, exaggeration, 1);
173  // Set color of the externe circle
174  if (drawUsingSelectColor()) {
176  } else {
178  }
179  // Draw circle
181  // Traslate to front
182  glTranslated(0, 0, .1);
183  // Set color of the interne circle
184  if (drawUsingSelectColor()) {
186  } else {
188  }
189  // draw another circle in the same position, but a little bit more small
191  // draw H depending of detailSettings
192  if (s.drawDetail(s.detailSettings.stoppingPlaceText, exaggeration)) {
193  if (drawUsingSelectColor()) {
195  } else {
197  }
198  }
199  // pop draw matrix
200  glPopMatrix();
201  // Show Lock icon depending of the Edit mode
202  myBlockIcon.drawIcon(s, exaggeration);
203  }
204  // pop draw matrix
205  glPopMatrix();
206  // Draw name if isn't being drawn for selecting
210  }
211  // check if dotted contour has to be drawn
212  if (myViewNet->getDottedAC() == this) {
214  }
215  // Pop name
216  glPopName();
217  // draw child demand elements
218  for (const auto& i : getChildDemandElements()) {
219  if (!i->getTagProperty().isPlacedInRTree()) {
220  i->drawGL(s);
221  }
222  }
223  }
224 }
225 
226 
227 std::string
229  switch (key) {
230  case SUMO_ATTR_ID:
231  return getAdditionalID();
232  case SUMO_ATTR_LANE:
233  return getParentLanes().front()->getID();
234  case SUMO_ATTR_STARTPOS:
236  return toString(myStartPosition);
237  } else {
238  return "";
239  }
240  case SUMO_ATTR_ENDPOS:
242  return toString(myEndPosition);
243  } else {
244  return "";
245  }
246  case SUMO_ATTR_NAME:
247  return myAdditionalName;
250  case SUMO_ATTR_LINES:
251  return joinToString(myLines, " ");
253  return toString(myPersonCapacity);
255  return toString(myBlockMovement);
256  case GNE_ATTR_SELECTED:
258  case GNE_ATTR_PARAMETERS:
259  return getParametersStr();
260  default:
261  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
262  }
263 }
264 
265 
266 void
267 GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
268  if (value == getAttribute(key)) {
269  return; //avoid needless changes, later logic relies on the fact that attributes have changed
270  }
271  switch (key) {
272  case SUMO_ATTR_ID: {
273  // change ID of BusStop
274  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
275  // Change Ids of all Acces children
276  for (auto i : getChildAdditionals()) {
277  i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_ACCESS), undoList);
278  }
279  break;
280  }
281  case SUMO_ATTR_LANE:
282  case SUMO_ATTR_STARTPOS:
283  case SUMO_ATTR_ENDPOS:
284  case SUMO_ATTR_NAME:
286  case SUMO_ATTR_LINES:
289  case GNE_ATTR_SELECTED:
290  case GNE_ATTR_PARAMETERS:
291  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
292  break;
293  default:
294  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
295  }
296 }
297 
298 
299 bool
300 GNEBusStop::isValid(SumoXMLAttr key, const std::string& value) {
301  switch (key) {
302  case SUMO_ATTR_ID:
303  return isValidAdditionalID(value);
304  case SUMO_ATTR_LANE:
305  if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) {
306  return true;
307  } else {
308  return false;
309  }
310  case SUMO_ATTR_STARTPOS:
311  if (value.empty()) {
312  return true;
313  } else if (canParse<double>(value)) {
314  return SUMORouteHandler::isStopPosValid(parse<double>(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
315  } else {
316  return false;
317  }
318  case SUMO_ATTR_ENDPOS:
319  if (value.empty()) {
320  return true;
321  } else if (canParse<double>(value)) {
322  return SUMORouteHandler::isStopPosValid(myStartPosition, parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
323  } else {
324  return false;
325  }
326  case SUMO_ATTR_NAME:
329  return canParse<bool>(value);
330  case SUMO_ATTR_LINES:
331  return canParse<std::vector<std::string> >(value);
333  return canParse<int>(value) && (parse<int>(value) > 0 || parse<int>(value) == -1);
335  return canParse<bool>(value);
336  case GNE_ATTR_SELECTED:
337  return canParse<bool>(value);
338  case GNE_ATTR_PARAMETERS:
339  return Parameterised::areParametersValid(value);
340  default:
341  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
342  }
343 }
344 
345 // ===========================================================================
346 // private
347 // ===========================================================================
348 
349 void
350 GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value) {
351  switch (key) {
352  case SUMO_ATTR_ID:
353  changeAdditionalID(value);
354  break;
355  case SUMO_ATTR_LANE:
356  replaceParentLanes(this, value);
357  break;
358  case SUMO_ATTR_STARTPOS:
359  if (!value.empty()) {
360  myStartPosition = parse<double>(value);
362  } else {
364  }
365  break;
366  case SUMO_ATTR_ENDPOS:
367  if (!value.empty()) {
368  myEndPosition = parse<double>(value);
370  } else {
372  }
373  break;
374  case SUMO_ATTR_NAME:
375  myAdditionalName = value;
376  break;
378  myFriendlyPosition = parse<bool>(value);
379  break;
380  case SUMO_ATTR_LINES:
381  myLines = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
382  break;
384  myPersonCapacity = GNEAttributeCarrier::parse<int>(value);
385  break;
387  myBlockMovement = parse<bool>(value);
388  break;
389  case GNE_ATTR_SELECTED:
390  if (parse<bool>(value)) {
392  } else {
394  }
395  break;
396  case GNE_ATTR_PARAMETERS:
397  setParametersStr(value);
398  break;
399  default:
400  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
401  }
402 }
403 
404 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
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:995
GNEAdditional::BlockIcon::position
Position position
position of the block icon
Definition: GNEAdditional.h:318
GNEStoppingPlace::myStartPosition
double myStartPosition
The relative start position this stopping place is located at (optional, if empty takes 0)
Definition: GNEStoppingPlace.h:159
GLO_MAX
@ GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:165
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GUIVisualizationColorSettings::busStop
static const RGBColor busStop
color for busStops
Definition: GUIVisualizationSettings.h:174
Parameterised::getParametersStr
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
Definition: Parameterised.cpp:112
GNEAdditional::getAdditionalID
const std::string & getAdditionalID() const
Definition: GNEAdditional.cpp:476
GNEBusStop::GNEBusStop
GNEBusStop(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const double startPos, const double endPos, const int parametersSet, const std::string &name, const std::vector< std::string > &lines, int personCapacity, bool friendlyPosition, bool blockMovement)
Constructor.
Definition: GNEBusStop.cpp:41
GUIVisualizationDetailSettings::stoppingPlaceDetails
static const double stoppingPlaceDetails
details for stopping places
Definition: GUIVisualizationSettings.h:298
GNEHierarchicalChildElements::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalChildElements.cpp:296
GNEAdditional::BlockIcon::setRotation
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
Definition: GNEAdditional.cpp:400
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:354
GUIVisualizationSettings::drawForRectangleSelection
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Definition: GUIVisualizationSettings.h:647
OptionsCont.h
GNEAdditional::generateChildID
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNEAdditional.cpp:96
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:74
GNEStoppingPlace::mySignPos
Position mySignPos
The position of the sign.
Definition: GNEStoppingPlace.h:171
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:267
SUMO_ATTR_LINES
@ SUMO_ATTR_LINES
Definition: SUMOXMLDefinitions.h:776
FONS_ALIGN_LEFT
@ 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:222
GNEHierarchicalParentElements::getParentLanes
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Definition: GNEHierarchicalParentElements.cpp:235
STOPPINGPLACE_STARTPOS_SET
const int STOPPINGPLACE_STARTPOS_SET
Definition: GNEStoppingPlace.h:29
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
GNEViewNet
Definition: GNEViewNet.h:42
RAD2DEG
#define RAD2DEG(x)
Definition: GeomHelper.h:38
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
GLHelper.h
SUMO_ATTR_LANE
@ SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:637
SUMO_ATTR_ENDPOS
@ SUMO_ATTR_ENDPOS
Definition: SUMOXMLDefinitions.h:798
STOPPINGPLACE_ENDPOS_SET
const int STOPPINGPLACE_ENDPOS_SET
Definition: GNEStoppingPlace.h:30
GNEAdditional::changeAdditionalID
void changeAdditionalID(const std::string &newID)
change ID of additional
Definition: GNEAdditional.cpp:502
PositionVector
A list of positions.
Definition: PositionVector.h:45
GNEAdditional::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNEAdditional.cpp:532
GNEAdditional::myBlockIcon
BlockIcon myBlockIcon
variable BlockIcon
Definition: GNEAdditional.h:353
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
PositionVector::getBoxBoundary
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Definition: PositionVector.cpp:390
GNEStoppingPlace::myCircleInWidth
static const double myCircleInWidth
inner circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:180
GUIVisualizationTextSettings::scaledSize
double scaledSize(double scale, double constFactor=0.1) const
get scale size
Definition: GUIVisualizationSettings.cpp:195
GNEDemandElement::updatePartialGeometry
virtual void updatePartialGeometry(const GNEEdge *edge)=0
partial update pre-computed geometry information
GNEAdditional::mySpecialColor
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
Definition: GNEAdditional.h:356
GNEAdditional::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
Definition: GNEAdditional.h:335
GNEStoppingPlace::myParametersSet
int myParametersSet
Variable used for set/unset start/endPositions.
Definition: GNEStoppingPlace.h:165
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
GNEBusStop::~GNEBusStop
~GNEBusStop()
Destructor.
Definition: GNEBusStop.cpp:49
GNEUndoList::p_add
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Definition: GNEUndoList.cpp:131
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
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:548
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:673
GNEStoppingPlace::myFriendlyPosition
bool myFriendlyPosition
Flag for friendly position.
Definition: GNEStoppingPlace.h:168
GUIVisualizationSettings::addName
GUIVisualizationTextSettings addName
Definition: GUIVisualizationSettings.h:591
GNEStoppingPlace::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEStoppingPlace.cpp:140
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:683
GNEHierarchicalParentElements::getParentDemandElements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
Definition: GNEHierarchicalParentElements.cpp:114
SUMO_ATTR_STARTPOS
@ SUMO_ATTR_STARTPOS
Definition: SUMOXMLDefinitions.h:797
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:147
GNEGeometry::Geometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GNEGeometry.cpp:147
GNEStoppingPlace
Definition: GNEStoppingPlace.h:39
GNEStoppingPlace::myCircleWidthSquared
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:177
GNEDemandElement.h
GNEAdditional::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
Definition: GNEAdditional.cpp:517
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:300
GNEStoppingPlace::setStoppingPlaceGeometry
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
Definition: GNEStoppingPlace.cpp:286
GNEViewNet.h
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:1026
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEBusStop::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEBusStop.cpp:104
GNEHierarchicalParentElements::replaceParentLanes
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
Definition: GNEHierarchicalParentElements.cpp:469
GNE_ATTR_PARAMETERS
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
GNEBusStop::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEBusStop.cpp:98
GNEGeometry::drawGeometry
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
Definition: GNEGeometry.cpp:795
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_PERSON_CAPACITY
Definition: SUMOXMLDefinitions.h:649
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
GNEEdge.h
GNEAdditional::myAdditionalGeometry
GNEGeometry::Geometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Definition: GNEAdditional.h:338
GNEAdditional::myAdditionalName
std::string myAdditionalName
name of additional
Definition: GNEAdditional.h:347
GUIVisualizationSettings::addFullName
GUIVisualizationTextSettings addFullName
Definition: GUIVisualizationSettings.h:593
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:68
GNEAdditional::myBlockMovement
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Definition: GNEAdditional.h:350
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:190
GNEAdditional::BlockIcon::rotation
double rotation
The rotation of the block icon.
Definition: GNEAdditional.h:324
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
@ SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:765
GNELane.h
GLO_BUS_STOP
@ GLO_BUS_STOP
a busStop
Definition: GUIGlObjectTypes.h:61
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:248
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:677
GNEBusStop::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEBusStop.cpp:53
GUIVisualizationColorSettings::selectionColor
RGBColor selectionColor
basic selection color
Definition: GUIVisualizationSettings.h:129
GUIVisualizationSettings::getCircleResolution
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
Definition: GUIVisualizationSettings.cpp:1679
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:253
Position::distanceTo2D
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:243
Parameterised::setParametersStr
void setParametersStr(const std::string &paramsString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
Definition: Parameterised.cpp:139
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNEAdditional::BlockIcon::drawIcon
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
Definition: GNEAdditional.cpp:416
SUMO_TAG_BUS_STOP
@ SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:97
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:166
InvalidArgument
Definition: UtilExceptions.h:56
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
GNE_ATTR_BLOCK_MOVEMENT
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:981
GUIVisualizationColorSettings::busStop_sign
static const RGBColor busStop_sign
color for busStops signs
Definition: GUIVisualizationSettings.h:177
SUMORouteHandler.h
GUIVisualizationSettings::drawAdditionals
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
Definition: GUIVisualizationSettings.cpp:1663
GNEAdditional::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEAdditional.cpp:554
GNEBusStop.h
GUIVisualizationDetailSettings::stoppingPlaceText
static const double stoppingPlaceText
details for stopping place texts
Definition: GUIVisualizationSettings.h:301
GNEBusStop::myLines
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition: GNEBusStop.h:98
joinToString
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:246
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1228
GUIVisualizationSettings::addSize
GUIVisualizationSizeSettings addSize
Definition: GUIVisualizationSettings.h:589
GeomHelper.h
GNEStoppingPlace::myEndPosition
double myEndPosition
The position this stopping place is located at (optional, if empty takes the lane length)
Definition: GNEStoppingPlace.h:162
GNE_ATTR_SELECTED
@ GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:971
GNEBusStop::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEBusStop.cpp:228
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
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:1669
GNEStoppingPlace::myCircleInText
static const double myCircleInText
text inner circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:183
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1267
SUMO_ATTR_NAME
@ SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:380
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SUMO_TAG_ACCESS
@ SUMO_TAG_ACCESS
An access point for a train stop.
Definition: SUMOXMLDefinitions.h:103
PositionVector::getLineCenter
Position getLineCenter() const
get line center
Definition: PositionVector.cpp:474
GNEAdditional::isValidAdditionalID
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
Definition: GNEAdditional.cpp:482
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
POSITION_EPS
#define POSITION_EPS
Definition: config.h:172
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEStoppingPlace::myCircleWidth
static const double myCircleWidth
circle width resolution for all stopping places
Definition: GNEStoppingPlace.h:174
GNEHierarchicalChildElements::getChildAdditionals
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
Definition: GNEHierarchicalChildElements.cpp:131
SUMORouteHandler::isStopPosValid
static bool isStopPosValid(const double startPos, const double endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if start and end position of a stop is valid
Definition: SUMORouteHandler.cpp:320
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:1103
GNEBusStop::myPersonCapacity
int myPersonCapacity
maximum number of persons that can wait at this stop
Definition: GNEBusStop.h:101
GNEUndoList.h
fontstash.h