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>
29
30#include "GNEParkingArea.h"
31
32
33// ===========================================================================
34// method definitions
35// ===========================================================================
36
39 nullptr, 0, 0, "", false, Parameterised::Map()),
40 myRoadSideCapacity(0),
41 myOnRoad(false),
42 myWidth(0),
43 myLength(0),
44 myAngle(0) {
45 // reset default values
47}
48
49
50GNEParkingArea::GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos,
51 const std::string& departPos, const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width,
52 const double length, double angle, const Parameterised::Map& parameters) :
54 lane, startPos, endPos, name, friendlyPosition, parameters),
55 myDepartPos(departPos),
56 myRoadSideCapacity(roadSideCapacity),
57 myOnRoad(onRoad),
58 myWidth(width),
59 myLength(length),
60 myAngle(angle) {
61 // update centering boundary without updating grid
63}
64
65
67
68
69void
71 device.openTag(getTagProperty().getTag());
72 device.writeAttr(SUMO_ATTR_ID, getID());
73 if (!myAdditionalName.empty()) {
75 }
76 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
79 }
82 }
84 device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true");
85 }
88 }
91 }
94 }
97 }
100 }
103 }
104 // write all parking spaces
105 for (const auto& space : getChildAdditionals()) {
106 if (space->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
107 space->writeAdditional(device);
108 }
109 }
110 // write parameters (Always after children to avoid problems with additionals.xsd)
111 writeParams(device);
112 device.closeTag();
113}
114
115
116void
118 // Get value of option "lefthand"
119 const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1;
120 // calculate spaceDim
121 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
122 // calculate length
123 const double length = (myLength > 0) ? myLength : spaceDim;
124 // Update common geometry of stopping place
126 // Obtain a copy of the shape
128 // Move shape to side
129 tmpShape.move2side(1.5 * offsetSign + myWidth);
130 // Get position of the sign
131 mySignPos = tmpShape.getLineCenter();
132 // clear LotSpaceDefinitions
133 myLotSpaceDefinitions.clear();
134 // iterate over
135 for (int i = 0; i < myRoadSideCapacity; ++i) {
136 // calculate pos
138 // calculate angle
139 const double angle = GeomHelper::calculateLotSpaceAngle(myAdditionalGeometry.getShape(), i, spaceDim, myAngle);
140 // add GNElotEntry
141 myLotSpaceDefinitions.push_back(GNELotSpaceDefinition(pos.x(), pos.y(), pos.z(), angle, myWidth, length));
142 }
143}
144
145
146void
148 // Obtain exaggeration of the draw
149 const double parkingAreaExaggeration = getExaggeration(s);
150 // first check if additional has to be drawn
152 // check exaggeration
153 if (s.drawAdditionals(parkingAreaExaggeration)) {
154 // declare colors
155 RGBColor baseColor, signColor;
156 // set colors
157 if (mySpecialColor) {
158 baseColor = *mySpecialColor;
159 signColor = baseColor.changedBrightness(-32);
160 } else if (drawUsingSelectColor()) {
162 signColor = baseColor.changedBrightness(-32);
163 } else {
164 baseColor = s.colorSettings.parkingAreaColor;
166 }
167 // draw parent and child lines
169 // Start drawing adding an gl identificator
171 // Add a layer matrix
173 // translate to front
175 // set base color
176 GLHelper::setColor(baseColor);
177 // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
178 GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
179 // draw detail
180 if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, parkingAreaExaggeration)) {
181 // draw sign
182 drawSign(s, parkingAreaExaggeration, baseColor, signColor, "P");
183 // Traslate to front
184 glTranslated(0, 0, 0.1);
185 // draw lotSpaceDefinitions
186 for (const auto& lsd : myLotSpaceDefinitions) {
187 GLHelper::drawSpaceOccupancies(parkingAreaExaggeration, lsd.position, lsd.rotation, lsd.width, lsd.length, true);
188 }
189 }
190 // draw geometry points
193 }
196 }
197 // pop layer matrix
199 // Pop name
201 // draw lock icon
202 GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), parkingAreaExaggeration);
203 // check if mouse is over element
204 mouseWithinGeometry(myAdditionalGeometry.getShape(), myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
206 // inspect contour
209 parkingAreaExaggeration, true, true);
210 }
211 // front element contour
212 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
214 parkingAreaExaggeration, true, true);
215 }
216 // delete contour
217 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
219 parkingAreaExaggeration, true, true);
220 }
221 // select contour
222 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
224 parkingAreaExaggeration, true, true);
225 }
226 // draw child demand elements
227 for (const auto& demandElement : getChildDemandElements()) {
228 if (!demandElement->getTagProperty().isPlacedInRTree()) {
229 demandElement->drawGL(s);
230 }
231 }
232 }
233 // Draw additional ID
235 // draw additional name
237 }
238}
239
240
241std::string
243 switch (key) {
244 case SUMO_ATTR_ID:
245 return getMicrosimID();
246 case SUMO_ATTR_LANE:
247 return getParentLanes().front()->getID();
251 } else {
252 return "";
253 }
254 case SUMO_ATTR_ENDPOS:
256 return toString(myEndPosition);
257 } else {
258 return "";
259 }
261 return myDepartPos;
262 case SUMO_ATTR_NAME:
263 return myAdditionalName;
268 case SUMO_ATTR_ONROAD:
269 return toString(myOnRoad);
270 case SUMO_ATTR_WIDTH:
271 return toString(myWidth);
272 case SUMO_ATTR_LENGTH:
273 return toString(myLength);
274 case SUMO_ATTR_ANGLE:
275 return toString(myAngle);
279 return getParametersStr();
281 return "";
282 default:
283 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
284 }
285}
286
287
288double
290 switch (key) {
293 return myStartPosition;
294 } else {
295 return 0;
296 }
297 case SUMO_ATTR_ENDPOS:
299 return myEndPosition;
300 } else {
301 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
302 }
303 case SUMO_ATTR_CENTER:
305 case SUMO_ATTR_WIDTH:
306 return myWidth;
307 case SUMO_ATTR_LENGTH: {
308 // calculate spaceDim
309 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
310 return (myLength > 0) ? myLength : spaceDim;
311 }
312 case SUMO_ATTR_ANGLE:
313 return myAngle;
314 default:
315 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
316 }
317}
318
319
320void
321GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
322 switch (key) {
323 case SUMO_ATTR_ID:
324 case SUMO_ATTR_LANE:
326 case SUMO_ATTR_ENDPOS:
328 case SUMO_ATTR_NAME:
331 case SUMO_ATTR_ONROAD:
332 case SUMO_ATTR_WIDTH:
333 case SUMO_ATTR_LENGTH:
334 case SUMO_ATTR_ANGLE:
338 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
339 break;
340 default:
341 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
342 }
343}
344
345
346bool
347GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) {
348 switch (key) {
349 case SUMO_ATTR_ID:
350 return isValidAdditionalID(value);
351 case SUMO_ATTR_LANE:
352 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
353 return true;
354 } else {
355 return false;
356 }
358 if (value.empty()) {
359 return true;
360 } else if (canParse<double>(value)) {
361 return SUMORouteHandler::isStopPosValid(parse<double>(value), getAttributeDouble(SUMO_ATTR_ENDPOS), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
362 } else {
363 return false;
364 }
365 case SUMO_ATTR_ENDPOS:
366 if (value.empty()) {
367 return true;
368 } else if (canParse<double>(value)) {
369 return SUMORouteHandler::isStopPosValid(getAttributeDouble(SUMO_ATTR_STARTPOS), parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
370 } else {
371 return false;
372 }
374 if (value.empty()) {
375 return true;
376 } else if (canParse<double>(value)) {
377 // parse value
378 const double departPos = parse<double>(value);
379 if (departPos >= 0) {
380 if (isTemplate()) {
381 return true;
382 } else {
383 return (departPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
384 }
385 } else {
386 return false;
387 }
388 } else {
389 return false;
390 }
391 case SUMO_ATTR_NAME:
394 return canParse<bool>(value);
396 return canParse<int>(value) && (parse<int>(value) >= 0);
397 case SUMO_ATTR_ONROAD:
398 return canParse<bool>(value);
399 case SUMO_ATTR_WIDTH:
400 return canParse<double>(value) && (parse<double>(value) > 0);
401 case SUMO_ATTR_LENGTH:
402 if (value.empty()) {
403 return true;
404 } else {
405 return canParse<double>(value) && (parse<double>(value) > 0);
406 }
407 case SUMO_ATTR_ANGLE:
408 return canParse<double>(value);
410 return canParse<bool>(value);
412 return areParametersValid(value);
413 default:
414 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
415 }
416}
417
418// ===========================================================================
419// protected
420// ===========================================================================
421
423 rotation(0),
424 width(0),
425 length(0) {
426}
427
428
429GNEParkingArea::GNELotSpaceDefinition::GNELotSpaceDefinition(double x, double y, double z, double rotation_, double width_, double length_) :
430 position(Position(x, y, z)),
431 rotation(rotation_),
432 width(width_),
433 length(length_) {
434}
435
436// ===========================================================================
437// private
438// ===========================================================================
439
440void
441GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) {
442 switch (key) {
443 case SUMO_ATTR_ID:
444 // update microsimID
445 setMicrosimID(value);
446 // Change IDs of all parking Spaces
447 for (const auto& parkingSpace : getChildAdditionals()) {
448 parkingSpace->setMicrosimID(getID());
449 }
450 // enable save demand elements if there are stops
451 for (const auto& stop : getChildDemandElements()) {
452 if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) {
454 }
455 }
456 break;
457 case SUMO_ATTR_LANE:
459 break;
461 if (value == "") {
463 } else {
464 myStartPosition = parse<double>(value);
465 }
467 break;
468 case SUMO_ATTR_ENDPOS:
469 if (value == "") {
471 } else {
472 myEndPosition = parse<double>(value);
473 }
475 break;
477 myDepartPos = value;
478 break;
479 case SUMO_ATTR_NAME:
480 myAdditionalName = value;
481 break;
483 myFriendlyPosition = parse<bool>(value);
484 break;
486 myRoadSideCapacity = parse<int>(value);
488 break;
489 case SUMO_ATTR_ONROAD:
490 myOnRoad = parse<bool>(value);
491 break;
492 case SUMO_ATTR_WIDTH:
493 myWidth = parse<double>(value);
494 // update geometry of all spaces
495 for (const auto& space : getChildAdditionals()) {
496 space->updateGeometry();
497 }
499 if (!isTemplate()) {
500 getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true);
501 }
502 break;
503 case SUMO_ATTR_LENGTH:
504 if (value.empty()) {
505 myLength = 0;
506 } else {
507 myLength = parse<double>(value);
508 }
509 // update geometry of all spaces
510 for (const auto& space : getChildAdditionals()) {
511 space->updateGeometry();
512 }
513 break;
514 case SUMO_ATTR_ANGLE:
515 myAngle = parse<double>(value);
516 break;
518 if (parse<bool>(value)) {
520 } else {
522 }
523 break;
525 setParametersStr(value);
526 break;
529 break;
530 default:
531 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
532 }
533}
534
535
536/****************************************************************************/
@ GLO_PARKING_AREA
a ParkingArea
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
@ 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:60
T MIN2(T a, T b)
Definition: StdDefs.h:71
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:583
static void pushName(unsigned int name)
push Name
Definition: GLHelper.cpp:139
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void popName()
pop Name
Definition: GLHelper.cpp:148
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
static void drawSpaceOccupancies(const double exaggeration, const Position &pos, const double rotation, const double width, const double length, const bool vehicle)
draw
Definition: GLHelper.cpp:613
static void drawRightGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false)
draw right geometry point
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 associated 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...
static void drawLeftGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false)
draw left geometry point
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
const std::string getID() const
get ID (all Attribute Carriers have one)
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:132
void requireSaveDemandElements(bool value)
inform that demand elements has to be saved
Definition: GNENet.cpp:2083
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1987
double myLength
Length of Parking Area (by default (endPos - startPos) / roadsideCapacity.
void writeAdditional(OutputDevice &device) const
write 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 correspondent 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.
static const double myCircleWidth
circle width resolution for all stopping places
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:656
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
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 GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem)
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.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.h:141
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:154
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:102
virtual 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:59
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
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|....
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
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:200
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