Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEParkingArea.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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 myLefthand(false) {
46 // reset default values
48}
49
50
51GNEParkingArea::GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos,
52 const std::string& departPos, const std::string& name, const std::vector<std::string>& badges,
53 const bool friendlyPosition, const int roadSideCapacity, const bool onRoad, const double width,
54 const double length, const double angle, const bool lefthand, const Parameterised::Map& parameters) :
56 lane, startPos, endPos, name, friendlyPosition, parameters),
57 myDepartPos(departPos),
58 myRoadSideCapacity(roadSideCapacity),
59 myOnRoad(onRoad),
60 myWidth(width),
61 myLength(length),
62 myAngle(angle),
63 myLefthand(lefthand),
64 myAcceptedBadges(badges) {
65 // update centering boundary without updating grid
67}
68
69
71
72
73void
75 device.openTag(getTagProperty().getTag());
76 device.writeAttr(SUMO_ATTR_ID, getID());
77 if (!myAdditionalName.empty()) {
79 }
80 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
83 }
86 }
88 device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true");
89 }
92 }
95 }
98 }
101 }
104 }
107 }
110 }
113 }
114 // write all parking spaces
115 for (const auto& space : getChildAdditionals()) {
116 if (space->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
117 space->writeAdditional(device);
118 }
119 }
120 // write parameters (Always after children to avoid problems with additionals.xsd)
121 writeParams(device);
122 device.closeTag();
123}
124
125
126void
128 // Get value of option "lefthand"
129 const double offsetSign = OptionsCont::getOptions().getBool("lefthand") != myLefthand ? -1 : 1;
130 // calculate spaceDim
131 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
132 // calculate length
133 const double length = (myLength > 0) ? myLength : spaceDim;
134 // Update common geometry of stopping place
136 // Obtain a copy of the shape
138 // Move shape to side
139 tmpShape.move2side(1.5 * offsetSign + myWidth);
140 // Get position of the sign
141 mySymbolPosition = tmpShape.getLineCenter();
142 // clear LotSpaceDefinitions
143 myLotSpaceDefinitions.clear();
144 // iterate over
145 for (int i = 0; i < myRoadSideCapacity; ++i) {
146 // calculate pos
148 // calculate angle
149 const double angle = GeomHelper::calculateLotSpaceAngle(myAdditionalGeometry.getShape(), i, spaceDim, myAngle);
150 // add GNElotEntry
151 myLotSpaceDefinitions.push_back(GNELotSpaceDefinition(pos.x(), pos.y(), pos.z(), angle, myWidth, length));
152 }
153}
154
155
156void
158 // first check if additional has to be drawn
160 // Obtain exaggeration of the draw
161 const double parkingAreaExaggeration = getExaggeration(s);
162 // check if draw moving geometry points
163 const bool movingGeometryPoints = drawMovingGeometryPoints(false);
164 // get detail level
165 const auto d = s.getDetailLevel(parkingAreaExaggeration);
166 // draw geometry only if we'rent in drawForObjectUnderCursor mode
168 // declare colors
169 RGBColor baseColor, signColor;
170 // set colors
171 if (mySpecialColor) {
172 baseColor = *mySpecialColor;
173 signColor = baseColor.changedBrightness(-32);
174 } else if (drawUsingSelectColor()) {
176 signColor = baseColor.changedBrightness(-32);
177 } else {
178 baseColor = s.colorSettings.parkingAreaColor;
180 }
181 // draw parent and child lines
183 // Add a layer matrix
185 // translate to front
187 // set base color
188 GLHelper::setColor(baseColor);
189 // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
190 GUIGeometry::drawGeometry(d, myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
191 // draw sign
192 drawSign(s, d, parkingAreaExaggeration, baseColor, signColor, "P");
193 // Traslate to front
194 glTranslated(0, 0, 0.1);
195 // draw lotSpaceDefinitions
197 for (const auto& lsd : myLotSpaceDefinitions) {
198 GLHelper::drawSpaceOccupancies(parkingAreaExaggeration, lsd.position, lsd.rotation, lsd.width, lsd.length, true);
199 }
200 }
201 // draw geometry points
202 if (movingGeometryPoints && (myStartPosition != INVALID_DOUBLE)) {
204 }
205 if (movingGeometryPoints && (myEndPosition != INVALID_DOUBLE)) {
207 }
208 // pop layer matrix
210 // draw lock icon
211 GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), getPositionInView(), parkingAreaExaggeration);
212 // Draw additional ID
214 // draw additional name
216 // draw dotted contours
217 if (movingGeometryPoints) {
220 } else {
223 }
224 }
225 // draw demand element children
227 // calculate contours
228 calculateStoppingPlaceContour(s, d, myWidth * 0.5, parkingAreaExaggeration, movingGeometryPoints);
229 }
230}
231
232
233std::string
235 switch (key) {
236 case SUMO_ATTR_ID:
237 return getMicrosimID();
238 case SUMO_ATTR_LANE:
239 return getParentLanes().front()->getID();
243 } else {
244 return "";
245 }
246 case SUMO_ATTR_ENDPOS:
248 return toString(myEndPosition);
249 } else {
250 return "";
251 }
253 return myDepartPos;
254 case SUMO_ATTR_NAME:
255 return myAdditionalName;
257 return joinToString(myAcceptedBadges, " ");
262 case SUMO_ATTR_ONROAD:
263 return toString(myOnRoad);
264 case SUMO_ATTR_WIDTH:
265 return toString(myWidth);
266 case SUMO_ATTR_LENGTH:
267 return toString(myLength);
268 case SUMO_ATTR_ANGLE:
269 return toString(myAngle);
271 return toString(myLefthand);
275 return getParametersStr();
277 return "";
278 default:
279 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
280 }
281}
282
283
284double
286 switch (key) {
289 return myStartPosition;
290 } else {
291 return 0;
292 }
293 case SUMO_ATTR_ENDPOS:
295 return myEndPosition;
296 } else {
297 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
298 }
299 case SUMO_ATTR_CENTER:
301 case SUMO_ATTR_WIDTH:
302 return myWidth;
303 case SUMO_ATTR_LENGTH: {
304 // calculate spaceDim
305 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
306 return (myLength > 0) ? myLength : spaceDim;
307 }
308 case SUMO_ATTR_ANGLE:
309 return myAngle;
310 default:
311 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
312 }
313}
314
315
316void
317GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
318 switch (key) {
319 case SUMO_ATTR_ID:
320 case SUMO_ATTR_LANE:
322 case SUMO_ATTR_ENDPOS:
324 case SUMO_ATTR_NAME:
328 case SUMO_ATTR_ONROAD:
329 case SUMO_ATTR_WIDTH:
330 case SUMO_ATTR_LENGTH:
331 case SUMO_ATTR_ANGLE:
336 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
337 break;
338 default:
339 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
340 }
341}
342
343
344bool
345GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) {
346 switch (key) {
347 case SUMO_ATTR_ID:
348 return isValidAdditionalID(value);
349 case SUMO_ATTR_LANE:
350 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
351 return true;
352 } else {
353 return false;
354 }
356 if (value.empty()) {
357 return true;
358 } else if (canParse<double>(value)) {
359 return SUMORouteHandler::isStopPosValid(parse<double>(value), getAttributeDouble(SUMO_ATTR_ENDPOS), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
360 } else {
361 return false;
362 }
363 case SUMO_ATTR_ENDPOS:
364 if (value.empty()) {
365 return true;
366 } else if (canParse<double>(value)) {
367 return SUMORouteHandler::isStopPosValid(getAttributeDouble(SUMO_ATTR_STARTPOS), parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
368 } else {
369 return false;
370 }
372 if (value.empty()) {
373 return true;
374 } else if (canParse<double>(value)) {
375 // parse value
376 const double departPos = parse<double>(value);
377 if (departPos >= 0) {
378 if (isTemplate()) {
379 return true;
380 } else {
381 return (departPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
382 }
383 } else {
384 return false;
385 }
386 } else {
387 return false;
388 }
389 case SUMO_ATTR_NAME:
392 return canParse<std::vector<std::string> >(value);
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 canParse<bool>(value);
414 return areParametersValid(value);
415 default:
416 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
417 }
418}
419
420// ===========================================================================
421// protected
422// ===========================================================================
423
425 rotation(0),
426 width(0),
427 length(0) {
428}
429
430
431GNEParkingArea::GNELotSpaceDefinition::GNELotSpaceDefinition(double x, double y, double z, double rotation_, double width_, double length_) :
432 position(Position(x, y, z)),
433 rotation(rotation_),
434 width(width_),
435 length(length_) {
436}
437
438// ===========================================================================
439// private
440// ===========================================================================
441
442void
443GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) {
444 switch (key) {
445 case SUMO_ATTR_ID:
446 // update microsimID
447 setAdditionalID(value);
448 break;
449 case SUMO_ATTR_LANE:
451 break;
453 if (value == "") {
455 } else {
456 myStartPosition = parse<double>(value);
457 }
459 break;
460 case SUMO_ATTR_ENDPOS:
461 if (value == "") {
463 } else {
464 myEndPosition = parse<double>(value);
465 }
467 break;
469 myDepartPos = value;
470 break;
471 case SUMO_ATTR_NAME:
472 myAdditionalName = value;
473 break;
475 myAcceptedBadges = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
476 break;
478 myFriendlyPosition = parse<bool>(value);
479 break;
481 myRoadSideCapacity = parse<int>(value);
483 break;
484 case SUMO_ATTR_ONROAD:
485 myOnRoad = parse<bool>(value);
486 break;
487 case SUMO_ATTR_WIDTH:
488 myWidth = parse<double>(value);
489 // update geometry of all spaces
490 for (const auto& space : getChildAdditionals()) {
491 space->updateGeometry();
492 }
494 if (!isTemplate()) {
495 getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true);
496 }
497 break;
498 case SUMO_ATTR_LENGTH:
499 if (value.empty()) {
500 myLength = 0;
501 } else {
502 myLength = parse<double>(value);
503 }
504 // update geometry of all spaces
505 for (const auto& space : getChildAdditionals()) {
506 space->updateGeometry();
507 }
508 break;
509 case SUMO_ATTR_ANGLE:
510 myAngle = parse<double>(value);
511 break;
513 myLefthand = parse<bool>(value);
514 if (!isTemplate()) {
516 }
517 break;
519 if (parse<bool>(value)) {
521 } else {
523 }
524 break;
526 setParametersStr(value);
527 break;
530 break;
531 default:
532 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
533 }
534}
535
536
537/****************************************************************************/
@ 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_ACCEPTED_BADGES
@ SUMO_ATTR_ENDPOS
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_DEPARTPOS
@ SUMO_ATTR_LEFTHAND
@ 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
invalid double
Definition StdDefs.h:64
T MIN2(T a, T b)
Definition StdDefs.h:76
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition ToString.h:283
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:654
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
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:684
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void drawRightGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw right geometry point
void setAdditionalID(const std::string &newID)
set additional ID
GNEContour myAdditionalContour
variable used for draw additional contours
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
void drawDemandElementChildren(const GUIVisualizationSettings &s) const
draw demand element children
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
bool drawMovingGeometryPoints(const bool ignoreShift) const
check if draw additional extrem geometry points
void drawLeftGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw left geometry point
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
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
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void drawDottedContourGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const PositionVector &shape, const double radius, const double scale, const double lineWidth) const
draw dotted contour for geometry points
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
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:127
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2155
double myLength
Length of Parking Area (by default (endPos - startPos) / roadsideCapacity.
bool myLefthand
lefthand
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.
std::vector< std::string > myAcceptedBadges
The list of badges that allow accessing the parkingArea.
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.
void drawSign(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
void calculateStoppingPlaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration, const bool movingGeometryPoints) const
check object in view
bool myFriendlyPosition
Flag for friendly position.
Position mySymbolPosition
The position of the sign.
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
double myEndPosition
The position this stopping place is located at (-1 means empty)
GNEContour mySymbolContour
circle contour
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
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometry(const GUIVisualizationSettings::Detail d, 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.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Stores the information about how to visualize structures.
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size 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
static double calculateLotSpaceAngle(const PositionVector &shape, const int index, const double spaceDim, const double angle)
calculate lotSpace angle
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.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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.
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
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 amount
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 GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, 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 segmentWidthSmall
width of small dotted contour segments
static const double segmentWidth
width of dotted contour segments
static const double additionalGeometryPointRadius
moving additional geometry point radius