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);
273 return getParametersStr();
275 return "";
276 default:
277 return getCommonAttribute(key);
278 }
279}
280
281
282double
284 switch (key) {
287 return myStartPosition;
288 } else {
289 return 0;
290 }
291 case SUMO_ATTR_ENDPOS:
293 return myEndPosition;
294 } else {
295 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
296 }
297 case SUMO_ATTR_CENTER:
299 case SUMO_ATTR_WIDTH:
300 return myWidth;
301 case SUMO_ATTR_LENGTH: {
302 // calculate spaceDim
303 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
304 return (myLength > 0) ? myLength : spaceDim;
305 }
306 case SUMO_ATTR_ANGLE:
307 return myAngle;
308 default:
309 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
310 }
311}
312
313
314void
315GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
316 switch (key) {
317 case SUMO_ATTR_ID:
318 case SUMO_ATTR_LANE:
320 case SUMO_ATTR_ENDPOS:
322 case SUMO_ATTR_NAME:
326 case SUMO_ATTR_ONROAD:
327 case SUMO_ATTR_WIDTH:
328 case SUMO_ATTR_LENGTH:
329 case SUMO_ATTR_ANGLE:
333 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
334 break;
335 default:
336 setCommonAttribute(key, value, undoList);
337 break;
338 }
339}
340
341
342bool
343GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) {
344 switch (key) {
345 case SUMO_ATTR_ID:
346 return isValidAdditionalID(value);
347 case SUMO_ATTR_LANE:
348 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
349 return true;
350 } else {
351 return false;
352 }
354 if (value.empty()) {
355 return true;
356 } else if (canParse<double>(value)) {
357 return SUMORouteHandler::isStopPosValid(parse<double>(value), getAttributeDouble(SUMO_ATTR_ENDPOS), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
358 } else {
359 return false;
360 }
361 case SUMO_ATTR_ENDPOS:
362 if (value.empty()) {
363 return true;
364 } else if (canParse<double>(value)) {
365 return SUMORouteHandler::isStopPosValid(getAttributeDouble(SUMO_ATTR_STARTPOS), parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
366 } else {
367 return false;
368 }
370 if (value.empty()) {
371 return true;
372 } else if (canParse<double>(value)) {
373 // parse value
374 const double departPos = parse<double>(value);
375 if (departPos >= 0) {
376 if (isTemplate()) {
377 return true;
378 } else {
379 return (departPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
380 }
381 } else {
382 return false;
383 }
384 } else {
385 return false;
386 }
387 case SUMO_ATTR_NAME:
390 return canParse<std::vector<std::string> >(value);
392 return canParse<bool>(value);
394 return canParse<int>(value) && (parse<int>(value) >= 0);
395 case SUMO_ATTR_ONROAD:
396 return canParse<bool>(value);
397 case SUMO_ATTR_WIDTH:
398 return canParse<double>(value) && (parse<double>(value) > 0);
399 case SUMO_ATTR_LENGTH:
400 if (value.empty()) {
401 return true;
402 } else {
403 return canParse<double>(value) && (parse<double>(value) > 0);
404 }
405 case SUMO_ATTR_ANGLE:
406 return canParse<double>(value);
408 return canParse<bool>(value);
410 return areParametersValid(value);
411 default:
412 return isCommonValid(key, value);
413 }
414}
415
416// ===========================================================================
417// protected
418// ===========================================================================
419
421 rotation(0),
422 width(0),
423 length(0) {
424}
425
426
427GNEParkingArea::GNELotSpaceDefinition::GNELotSpaceDefinition(double x, double y, double z, double rotation_, double width_, double length_) :
428 position(Position(x, y, z)),
429 rotation(rotation_),
430 width(width_),
431 length(length_) {
432}
433
434// ===========================================================================
435// private
436// ===========================================================================
437
438void
439GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) {
440 switch (key) {
441 case SUMO_ATTR_ID:
442 // update microsimID
443 setAdditionalID(value);
444 break;
445 case SUMO_ATTR_LANE:
447 break;
449 if (value == "") {
451 } else {
452 myStartPosition = parse<double>(value);
453 }
455 break;
456 case SUMO_ATTR_ENDPOS:
457 if (value == "") {
459 } else {
460 myEndPosition = parse<double>(value);
461 }
463 break;
465 myDepartPos = value;
466 break;
467 case SUMO_ATTR_NAME:
468 myAdditionalName = value;
469 break;
471 myAcceptedBadges = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
472 break;
474 myFriendlyPosition = parse<bool>(value);
475 break;
477 myRoadSideCapacity = parse<int>(value);
479 break;
480 case SUMO_ATTR_ONROAD:
481 myOnRoad = parse<bool>(value);
482 break;
483 case SUMO_ATTR_WIDTH:
484 myWidth = parse<double>(value);
485 // update geometry of all spaces
486 for (const auto& space : getChildAdditionals()) {
487 space->updateGeometry();
488 }
490 if (!isTemplate()) {
491 getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true);
492 }
493 break;
494 case SUMO_ATTR_LENGTH:
495 if (value.empty()) {
496 myLength = 0;
497 } else {
498 myLength = parse<double>(value);
499 }
500 // update geometry of all spaces
501 for (const auto& space : getChildAdditionals()) {
502 space->updateGeometry();
503 }
504 break;
505 case SUMO_ATTR_ANGLE:
506 myAngle = parse<double>(value);
507 break;
509 myLefthand = parse<bool>(value);
510 if (!isTemplate()) {
512 }
513 break;
515 setParametersStr(value);
516 break;
519 break;
520 default:
521 setCommonAttribute(key, value);
522 break;
523 }
524}
525
526
527/****************************************************************************/
@ 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_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:649
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
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:679
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
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool isCommonValid(SumoXMLAttr key, const std::string &value)
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
void resetDefaultValues()
reset attribute carrier to their default values
GNENet * myNet
pointer to net
std::string getCommonAttribute(SumoXMLAttr key) const
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
bool 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:2163
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
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