Eclipse SUMO - Simulation of Urban MObility
GNEParkingArea.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 lane area vehicles can park at (GNE version)
19 /****************************************************************************/
20 #include <netedit/GNENet.h>
21 #include <netedit/GNEUndoList.h>
22 #include <netedit/GNEViewNet.h>
24 #include <utils/gui/div/GLHelper.h>
28 
29 #include "GNEParkingArea.h"
30 
31 
32 // ===========================================================================
33 // method definitions
34 // ===========================================================================
35 
37  GNEStoppingPlace("", net, GLO_PARKING_AREA, SUMO_TAG_PARKING_AREA, nullptr, 0, 0, "", false, std::map<std::string, std::string>()),
38  myRoadSideCapacity(0),
39  myOnRoad(false),
40  myWidth(0),
41  myLength(0),
42  myAngle(0) {
43  // reset default values
45 }
46 
47 
48 GNEParkingArea::GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos,
49  const std::string& departPos, const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width,
50  const double length, double angle, const std::map<std::string, std::string>& parameters) :
51  GNEStoppingPlace(id, net, GLO_PARKING_AREA, SUMO_TAG_PARKING_AREA, lane, startPos, endPos, name, friendlyPosition, parameters),
52  myDepartPos(departPos),
53  myRoadSideCapacity(roadSideCapacity),
54  myOnRoad(onRoad),
55  myWidth(width),
56  myLength(length),
57  myAngle(angle) {
58  // update centering boundary without updating grid
60 }
61 
62 
64 
65 
66 void
68  device.openTag(getTagProperty().getTag());
69  device.writeAttr(SUMO_ATTR_ID, getID());
70  if (!myAdditionalName.empty()) {
72  }
73  device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
76  }
79  }
80  if (myFriendlyPosition) {
81  device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true");
82  }
85  }
88  }
91  }
94  }
95  // write all parking spaces
96  for (const auto& space : getChildAdditionals()) {
97  if (space->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
98  space->writeAdditional(device);
99  }
100  }
101  // write parameters (Always after children to avoid problems with additionals.xsd)
102  writeParams(device);
103  device.closeTag();
104 }
105 
106 
107 void
109  // Get value of option "lefthand"
110  const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
111  // calculate spaceDim
112  const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
113  // calculate lenght
114  const double length = (myLength > 0) ? myLength : spaceDim;
115  // Update common geometry of stopping place
117  // Obtain a copy of the shape
119  // Move shape to side
120  tmpShape.move2side(1.5 * offsetSign + myWidth);
121  // Get position of the sign
122  mySignPos = tmpShape.getLineCenter();
123  // clear LotSpaceDefinitions
124  myLotSpaceDefinitions.clear();
125  // iterate over
126  for (int i = 0; i < myRoadSideCapacity; ++i) {
127  // calculate pos
129  // calculate angle
130  const double angle = GeomHelper::calculateLotSpaceAngle(myAdditionalGeometry.getShape(), i, spaceDim, myAngle);
131  // add GNElotEntry
132  myLotSpaceDefinitions.push_back(GNELotSpaceDefinition(pos.x(), pos.y(), pos.z(), angle, myWidth, length));
133  }
134 }
135 
136 
137 void
139  // Obtain exaggeration of the draw
140  const double parkingAreaExaggeration = getExaggeration(s);
141  // first check if additional has to be drawn
143  // check exaggeration
144  if (s.drawAdditionals(parkingAreaExaggeration)) {
145  // declare colors
146  RGBColor baseColor, signColor;
147  // set colors
148  if (mySpecialColor) {
149  baseColor = *mySpecialColor;
150  signColor = baseColor.changedBrightness(-32);
151  } else if (drawUsingSelectColor()) {
153  signColor = baseColor.changedBrightness(-32);
154  } else {
155  baseColor = s.colorSettings.parkingAreaColor;
156  signColor = s.colorSettings.parkingAreaColorSign;
157  }
158  // draw parent and child lines
160  // Start drawing adding an gl identificator
162  // Add a layer matrix
164  // translate to front
166  // set base color
167  GLHelper::setColor(baseColor);
168  // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
169  GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
170  // draw detail
171  if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, parkingAreaExaggeration)) {
172  // draw sign
173  drawSign(s, parkingAreaExaggeration, baseColor, signColor, "P");
174  // Traslate to front
175  glTranslated(0, 0, 0.1);
176  // draw lotSpaceDefinitions
177  for (const auto& lsd : myLotSpaceDefinitions) {
178  GLHelper::drawSpaceOccupancies(parkingAreaExaggeration, lsd.position, lsd.rotation, lsd.width, lsd.length, true);
179  }
180  }
181  // draw geometry points
184  }
185  if (myEndPosition != INVALID_DOUBLE) {
187  }
188  // pop layer matrix
190  // Pop name
192  // draw lock icon
193  GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), parkingAreaExaggeration);
194  // check if dotted contours has to be drawn
197  parkingAreaExaggeration, true, true);
198  }
199  if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
201  parkingAreaExaggeration, true, true);
202  }
203  // draw child spaces
204  for (const auto& parkingSpace : getChildAdditionals()) {
205  if (parkingSpace->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
206  parkingSpace->drawGL(s);
207  }
208  }
209  // draw child demand elements
210  for (const auto& demandElement : getChildDemandElements()) {
211  if (!demandElement->getTagProperty().isPlacedInRTree()) {
212  demandElement->drawGL(s);
213  }
214  }
215  }
216  // Draw additional ID
217  drawAdditionalID(s);
218  // draw additional name
220  }
221 }
222 
223 
224 std::string
226  switch (key) {
227  case SUMO_ATTR_ID:
228  return getID();
229  case SUMO_ATTR_LANE:
230  return getParentLanes().front()->getID();
231  case SUMO_ATTR_STARTPOS:
233  return toString(myStartPosition);
234  } else {
235  return "";
236  }
237  case SUMO_ATTR_ENDPOS:
238  if (myEndPosition != INVALID_DOUBLE) {
239  return toString(myEndPosition);
240  } else {
241  return "";
242  }
243  case SUMO_ATTR_DEPARTPOS:
244  return myDepartPos;
245  case SUMO_ATTR_NAME:
246  return myAdditionalName;
251  case SUMO_ATTR_ONROAD:
252  return toString(myOnRoad);
253  case SUMO_ATTR_WIDTH:
254  return toString(myWidth);
255  case SUMO_ATTR_LENGTH:
256  return toString(myLength);
257  case SUMO_ATTR_ANGLE:
258  return toString(myAngle);
259  case GNE_ATTR_SELECTED:
261  case GNE_ATTR_PARAMETERS:
262  return getParametersStr();
264  return "";
265  default:
266  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
267  }
268 }
269 
270 
271 double
273  switch (key) {
274  case SUMO_ATTR_STARTPOS:
276  return myStartPosition;
277  } else {
278  return 0;
279  }
280  case SUMO_ATTR_ENDPOS:
281  if (myEndPosition != INVALID_DOUBLE) {
282  return myEndPosition;
283  } else {
284  return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
285  }
286  case SUMO_ATTR_CENTER:
288  case SUMO_ATTR_WIDTH:
289  return myWidth;
290  case SUMO_ATTR_LENGTH: {
291  // calculate spaceDim
292  const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
293  return (myLength > 0) ? myLength : spaceDim;
294  }
295  case SUMO_ATTR_ANGLE:
296  return myAngle;
297  default:
298  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
299  }
300 }
301 
302 
303 void
304 GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
305  switch (key) {
306  case SUMO_ATTR_ID:
307  case SUMO_ATTR_LANE:
308  case SUMO_ATTR_STARTPOS:
309  case SUMO_ATTR_ENDPOS:
310  case SUMO_ATTR_DEPARTPOS:
311  case SUMO_ATTR_NAME:
314  case SUMO_ATTR_ONROAD:
315  case SUMO_ATTR_WIDTH:
316  case SUMO_ATTR_LENGTH:
317  case SUMO_ATTR_ANGLE:
318  case GNE_ATTR_SELECTED:
319  case GNE_ATTR_PARAMETERS:
321  undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
322  break;
323  default:
324  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
325  }
326 }
327 
328 
329 bool
330 GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) {
331  switch (key) {
332  case SUMO_ATTR_ID:
333  return isValidAdditionalID(value);
334  case SUMO_ATTR_LANE:
335  if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
336  return true;
337  } else {
338  return false;
339  }
340  case SUMO_ATTR_STARTPOS:
341  if (value.empty()) {
342  return true;
343  } else if (canParse<double>(value)) {
344  return SUMORouteHandler::isStopPosValid(parse<double>(value), getAttributeDouble(SUMO_ATTR_ENDPOS), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
345  } else {
346  return false;
347  }
348  case SUMO_ATTR_ENDPOS:
349  if (value.empty()) {
350  return true;
351  } else if (canParse<double>(value)) {
352  return SUMORouteHandler::isStopPosValid(getAttributeDouble(SUMO_ATTR_STARTPOS), parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
353  } else {
354  return false;
355  }
356  case SUMO_ATTR_DEPARTPOS:
357  if (value.empty()) {
358  return true;
359  } else if (canParse<double>(value)) {
360  // parse value
361  const double departPos = parse<double>(value);
362  if ((departPos >= 0) && (departPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength())) {
363  return true;
364  } else {
365  return false;
366  }
367  } else {
368  return false;
369  }
370  case SUMO_ATTR_NAME:
373  return canParse<bool>(value);
375  return canParse<double>(value) && (parse<double>(value) >= 0);
376  case SUMO_ATTR_ONROAD:
377  return canParse<bool>(value);
378  case SUMO_ATTR_WIDTH:
379  return canParse<double>(value) && (parse<double>(value) > 0);
380  case SUMO_ATTR_LENGTH:
381  if (value.empty()) {
382  return true;
383  } else {
384  return canParse<double>(value) && (parse<double>(value) > 0);
385  }
386  case SUMO_ATTR_ANGLE:
387  return canParse<double>(value);
388  case GNE_ATTR_SELECTED:
389  return canParse<bool>(value);
390  case GNE_ATTR_PARAMETERS:
391  return Parameterised::areParametersValid(value);
392  default:
393  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
394  }
395 }
396 
397 // ===========================================================================
398 // protected
399 // ===========================================================================
400 
402  rotation(0),
403  width(0),
404  length(0) {
405 }
406 
407 
408 GNEParkingArea::GNELotSpaceDefinition::GNELotSpaceDefinition(double x, double y, double z, double rotation_, double width_, double length_) :
409  position(Position(x, y, z)),
410  rotation(rotation_),
411  width(width_),
412  length(length_) {
413 }
414 
415 // ===========================================================================
416 // private
417 // ===========================================================================
418 
419 void
420 GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) {
421  switch (key) {
422  case SUMO_ATTR_ID:
423  // update microsimID
424  setMicrosimID(value);
425  // Change IDs of all parking Spaces
426  for (const auto& parkingSpace : getChildAdditionals()) {
427  parkingSpace->setMicrosimID(getID());
428  }
429  // enable save demand elements if there are stops
430  for (const auto& stop : getChildDemandElements()) {
431  if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) {
433  }
434  }
435  break;
436  case SUMO_ATTR_LANE:
438  break;
439  case SUMO_ATTR_STARTPOS:
440  if (value == "") {
442  } else {
443  myStartPosition = parse<double>(value);
444  }
446  break;
447  case SUMO_ATTR_ENDPOS:
448  if (value == "") {
450  } else {
451  myEndPosition = parse<double>(value);
452  }
454  break;
455  case SUMO_ATTR_DEPARTPOS:
456  myDepartPos = value;
457  break;
458  case SUMO_ATTR_NAME:
459  myAdditionalName = value;
460  break;
462  myFriendlyPosition = parse<bool>(value);
463  break;
465  myRoadSideCapacity = parse<int>(value);
467  break;
468  case SUMO_ATTR_ONROAD:
469  myOnRoad = parse<bool>(value);
470  break;
471  case SUMO_ATTR_WIDTH:
472  myWidth = parse<double>(value);
473  // update geometry of all spaces
474  for (const auto& space : getChildAdditionals()) {
475  space->updateGeometry();
476  }
478  if (!isTemplate()) {
479  getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true);
480  }
481  break;
482  case SUMO_ATTR_LENGTH:
483  myLength = parse<double>(value);
484  // update geometry of all spaces
485  for (const auto& space : getChildAdditionals()) {
486  space->updateGeometry();
487  }
488  break;
489  case SUMO_ATTR_ANGLE:
490  myAngle = parse<double>(value);
491  break;
492  case GNE_ATTR_SELECTED:
493  if (parse<bool>(value)) {
495  } else {
497  }
498  break;
499  case GNE_ATTR_PARAMETERS:
500  setParametersStr(value);
501  break;
503  shiftLaneIndex();
504  break;
505  default:
506  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
507  }
508 }
509 
510 
511 /****************************************************************************/
@ GLO_PARKING_AREA
a ParkingArea
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_LANE
@ SUMO_ATTR_ENDPOS
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_DEPARTPOS
@ SUMO_ATTR_NAME
@ SUMO_ATTR_CENTER
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_ROADSIDE_CAPACITY
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_ONROAD
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ SUMO_ATTR_WIDTH
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
const double INVALID_DOUBLE
Definition: StdDefs.h:63
T MIN2(T a, T b)
Definition: StdDefs.h:74
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:507
static void pushName(unsigned int name)
push Name
Definition: GLHelper.cpp:132
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
static void popName()
pop Name
Definition: GLHelper.cpp:141
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:114
static void drawSpaceOccupancies(const double exaggeration, const Position &pos, const double rotation, const double width, const double length, const bool vehicle)
darw
Definition: GLHelper.cpp:537
static void drawRightGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor)
draw right geometry point
const std::string & getID() const
get ID
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
void shiftLaneIndex()
shift lane index
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
std::string myAdditionalName
name of additional
void drawAdditionalName(const GUIVisualizationSettings &s) const
draw additional name
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
static void drawLeftGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor)
draw left geometry point
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
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 tagProperty associated with this Attribute Carrier
bool isTemplate() const
check if this AC is template
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void resetDefaultValues()
reset attribute carrier to their default values
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
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
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
void requireSaveDemandElements(bool value)
inform that demand elements has to be saved
Definition: GNENet.cpp:2058
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1964
double myLength
Length of Parking Area (by default (endPos - startPos) / roadsideCapacity.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
std::string getAttribute(SumoXMLAttr key) const
~GNEParkingArea()
Destructor.
double myAngle
Angle of Parking Area.
double myWidth
width of Parking Area
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double getAttributeDouble(SumoXMLAttr key) const
std::string myDepartPos
departPos
bool myOnRoad
Whether vehicles stay on the road.
std::vector< GNELotSpaceDefinition > myLotSpaceDefinitions
vector with GNELotSpaceDefinition
GNEParkingArea(GNENet *net)
default constructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
void updateGeometry()
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
int myRoadSideCapacity
roadside capacity of Parking Area
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Position getPositionInView() const
Returns position of additional in view.
bool myFriendlyPosition
Flag for friendly position.
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
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.
double myStartPosition
The relative start position this stopping place is located at (-1 means empty)
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:537
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
static void drawDottedContourShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth=-1)
draw dotted contour for the given shape (used by additionals)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
GUIVisualizationDetailSettings detailSettings
detail settings
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
GUIVisualizationColorSettings colorSettings
color settings
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
static const Position calculateLotSpacePosition(const PositionVector &shape, const int index, const double spaceDim, const double angle, const double width, const double length)
calculate lotSpace position
Definition: GeomHelper.cpp:281
static double calculateLotSpaceAngle(const PositionVector &shape, const int index, const double spaceDim, const double angle)
calculate lotSpace angle
Definition: GeomHelper.cpp:320
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
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:248
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void setParametersStr(const std::string &paramsString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double x() const
Returns the x-position.
Definition: Position.h:55
double z() const
Returns the z-position.
Definition: Position.h:65
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Position getLineCenter() const
get line center
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:197
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
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
Representation of a single lot space in Netedit.
bool showAdditionals() const
check if additionals has to be drawn
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
static const RGBColor connectionColor
connection color
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
RGBColor parkingAreaColorSign
color for parkingArea sign
RGBColor parkingAreaColor
color for parkingAreas
static const double stoppingPlaceDetails
details for stopping places