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-2023 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 bool friendlyPosition, const int roadSideCapacity,
53 const bool onRoad, const double width, const double length, const double angle, const bool lefthand,
54 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 // update centering boundary without updating grid
66}
67
68
70
71
72void
74 device.openTag(getTagProperty().getTag());
75 device.writeAttr(SUMO_ATTR_ID, getID());
76 if (!myAdditionalName.empty()) {
78 }
79 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
82 }
85 }
87 device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true");
88 }
91 }
94 }
97 }
100 }
103 }
106 }
109 }
110 // write all parking spaces
111 for (const auto& space : getChildAdditionals()) {
112 if (space->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) {
113 space->writeAdditional(device);
114 }
115 }
116 // write parameters (Always after children to avoid problems with additionals.xsd)
117 writeParams(device);
118 device.closeTag();
119}
120
121
122void
124 // Get value of option "lefthand"
125 const double offsetSign = OptionsCont::getOptions().getBool("lefthand") != myLefthand ? -1 : 1;
126 // calculate spaceDim
127 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
128 // calculate length
129 const double length = (myLength > 0) ? myLength : spaceDim;
130 // Update common geometry of stopping place
132 // Obtain a copy of the shape
134 // Move shape to side
135 tmpShape.move2side(1.5 * offsetSign + myWidth);
136 // Get position of the sign
137 mySignPos = tmpShape.getLineCenter();
138 // clear LotSpaceDefinitions
139 myLotSpaceDefinitions.clear();
140 // iterate over
141 for (int i = 0; i < myRoadSideCapacity; ++i) {
142 // calculate pos
144 // calculate angle
145 const double angle = GeomHelper::calculateLotSpaceAngle(myAdditionalGeometry.getShape(), i, spaceDim, myAngle);
146 // add GNElotEntry
147 myLotSpaceDefinitions.push_back(GNELotSpaceDefinition(pos.x(), pos.y(), pos.z(), angle, myWidth, length));
148 }
149}
150
151
152void
154 // Obtain exaggeration of the draw
155 const double parkingAreaExaggeration = getExaggeration(s);
156 // first check if additional has to be drawn
158 // check exaggeration
159 if (s.drawAdditionals(parkingAreaExaggeration)) {
160 // declare colors
161 RGBColor baseColor, signColor;
162 // set colors
163 if (mySpecialColor) {
164 baseColor = *mySpecialColor;
165 signColor = baseColor.changedBrightness(-32);
166 } else if (drawUsingSelectColor()) {
168 signColor = baseColor.changedBrightness(-32);
169 } else {
170 baseColor = s.colorSettings.parkingAreaColor;
172 }
173 // avoid draw invisible elements
174 if (baseColor.alpha() != 0) {
175 // draw parent and child lines
177 // Start drawing adding an gl identificator
179 // Add a layer matrix
181 // translate to front
183 // set base color
184 GLHelper::setColor(baseColor);
185 // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
186 GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
187 // draw detail
188 if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, parkingAreaExaggeration)) {
189 // draw sign
190 drawSign(s, parkingAreaExaggeration, baseColor, signColor, "P");
191 // Traslate to front
192 glTranslated(0, 0, 0.1);
193 // draw lotSpaceDefinitions
194 for (const auto& lsd : myLotSpaceDefinitions) {
195 GLHelper::drawSpaceOccupancies(parkingAreaExaggeration, lsd.position, lsd.rotation, lsd.width, lsd.length, true);
196 }
197 }
198 // draw geometry points
201 }
204 }
205 // pop layer matrix
207 // Pop name
209 // draw lock icon
210 GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), parkingAreaExaggeration);
211 }
212 // check if mouse is over element
213 mouseWithinGeometry(myAdditionalGeometry.getShape(), myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
215 // inspect contour
218 parkingAreaExaggeration, true, true);
219 }
220 // front element contour
221 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
223 parkingAreaExaggeration, true, true);
224 }
225 // delete contour
226 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
228 parkingAreaExaggeration, true, true);
229 }
230 // select contour
231 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
233 parkingAreaExaggeration, true, true);
234 }
235 // draw child demand elements
236 for (const auto& demandElement : getChildDemandElements()) {
237 if (!demandElement->getTagProperty().isPlacedInRTree()) {
238 demandElement->drawGL(s);
239 }
240 }
241 }
242 // Draw additional ID
244 // draw additional name
246 }
247}
248
249
250std::string
252 switch (key) {
253 case SUMO_ATTR_ID:
254 return getMicrosimID();
255 case SUMO_ATTR_LANE:
256 return getParentLanes().front()->getID();
260 } else {
261 return "";
262 }
263 case SUMO_ATTR_ENDPOS:
265 return toString(myEndPosition);
266 } else {
267 return "";
268 }
270 return myDepartPos;
271 case SUMO_ATTR_NAME:
272 return myAdditionalName;
277 case SUMO_ATTR_ONROAD:
278 return toString(myOnRoad);
279 case SUMO_ATTR_WIDTH:
280 return toString(myWidth);
281 case SUMO_ATTR_LENGTH:
282 return toString(myLength);
283 case SUMO_ATTR_ANGLE:
284 return toString(myAngle);
286 return toString(myLefthand);
290 return getParametersStr();
292 return "";
293 default:
294 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
295 }
296}
297
298
299double
301 switch (key) {
304 return myStartPosition;
305 } else {
306 return 0;
307 }
308 case SUMO_ATTR_ENDPOS:
310 return myEndPosition;
311 } else {
312 return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
313 }
314 case SUMO_ATTR_CENTER:
316 case SUMO_ATTR_WIDTH:
317 return myWidth;
318 case SUMO_ATTR_LENGTH: {
319 // calculate spaceDim
320 const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
321 return (myLength > 0) ? myLength : spaceDim;
322 }
323 case SUMO_ATTR_ANGLE:
324 return myAngle;
325 default:
326 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
327 }
328}
329
330
331void
332GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
333 switch (key) {
334 case SUMO_ATTR_ID:
335 case SUMO_ATTR_LANE:
337 case SUMO_ATTR_ENDPOS:
339 case SUMO_ATTR_NAME:
342 case SUMO_ATTR_ONROAD:
343 case SUMO_ATTR_WIDTH:
344 case SUMO_ATTR_LENGTH:
345 case SUMO_ATTR_ANGLE:
350 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
351 break;
352 default:
353 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
354 }
355}
356
357
358bool
359GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) {
360 switch (key) {
361 case SUMO_ATTR_ID:
362 return isValidAdditionalID(value);
363 case SUMO_ATTR_LANE:
364 if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
365 return true;
366 } else {
367 return false;
368 }
370 if (value.empty()) {
371 return true;
372 } else if (canParse<double>(value)) {
373 return SUMORouteHandler::isStopPosValid(parse<double>(value), getAttributeDouble(SUMO_ATTR_ENDPOS), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
374 } else {
375 return false;
376 }
377 case SUMO_ATTR_ENDPOS:
378 if (value.empty()) {
379 return true;
380 } else if (canParse<double>(value)) {
381 return SUMORouteHandler::isStopPosValid(getAttributeDouble(SUMO_ATTR_STARTPOS), parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
382 } else {
383 return false;
384 }
386 if (value.empty()) {
387 return true;
388 } else if (canParse<double>(value)) {
389 // parse value
390 const double departPos = parse<double>(value);
391 if (departPos >= 0) {
392 if (isTemplate()) {
393 return true;
394 } else {
395 return (departPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
396 }
397 } else {
398 return false;
399 }
400 } else {
401 return false;
402 }
403 case SUMO_ATTR_NAME:
406 return canParse<bool>(value);
408 return canParse<int>(value) && (parse<int>(value) >= 0);
409 case SUMO_ATTR_ONROAD:
410 return canParse<bool>(value);
411 case SUMO_ATTR_WIDTH:
412 return canParse<double>(value) && (parse<double>(value) > 0);
413 case SUMO_ATTR_LENGTH:
414 if (value.empty()) {
415 return true;
416 } else {
417 return canParse<double>(value) && (parse<double>(value) > 0);
418 }
419 case SUMO_ATTR_ANGLE:
420 return canParse<double>(value);
422 return canParse<bool>(value);
424 return canParse<bool>(value);
426 return areParametersValid(value);
427 default:
428 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
429 }
430}
431
432// ===========================================================================
433// protected
434// ===========================================================================
435
437 rotation(0),
438 width(0),
439 length(0) {
440}
441
442
443GNEParkingArea::GNELotSpaceDefinition::GNELotSpaceDefinition(double x, double y, double z, double rotation_, double width_, double length_) :
444 position(Position(x, y, z)),
445 rotation(rotation_),
446 width(width_),
447 length(length_) {
448}
449
450// ===========================================================================
451// private
452// ===========================================================================
453
454void
455GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) {
456 switch (key) {
457 case SUMO_ATTR_ID:
458 // update microsimID
459 setMicrosimID(value);
460 // Change IDs of all parking Spaces
461 for (const auto& parkingSpace : getChildAdditionals()) {
462 parkingSpace->setMicrosimID(getID());
463 }
464 // enable save demand elements if there are stops
465 for (const auto& stop : getChildDemandElements()) {
466 if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) {
468 }
469 }
470 break;
471 case SUMO_ATTR_LANE:
473 break;
475 if (value == "") {
477 } else {
478 myStartPosition = parse<double>(value);
479 }
481 break;
482 case SUMO_ATTR_ENDPOS:
483 if (value == "") {
485 } else {
486 myEndPosition = parse<double>(value);
487 }
489 break;
491 myDepartPos = value;
492 break;
493 case SUMO_ATTR_NAME:
494 myAdditionalName = value;
495 break;
497 myFriendlyPosition = parse<bool>(value);
498 break;
500 myRoadSideCapacity = parse<int>(value);
502 break;
503 case SUMO_ATTR_ONROAD:
504 myOnRoad = parse<bool>(value);
505 break;
506 case SUMO_ATTR_WIDTH:
507 myWidth = parse<double>(value);
508 // update geometry of all spaces
509 for (const auto& space : getChildAdditionals()) {
510 space->updateGeometry();
511 }
513 if (!isTemplate()) {
514 getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true);
515 }
516 break;
517 case SUMO_ATTR_LENGTH:
518 if (value.empty()) {
519 myLength = 0;
520 } else {
521 myLength = parse<double>(value);
522 }
523 // update geometry of all spaces
524 for (const auto& space : getChildAdditionals()) {
525 space->updateGeometry();
526 }
527 break;
528 case SUMO_ATTR_ANGLE:
529 myAngle = parse<double>(value);
530 break;
532 myLefthand = parse<bool>(value);
534 break;
536 if (parse<bool>(value)) {
538 } else {
540 }
541 break;
543 setParametersStr(value);
544 break;
547 break;
548 default:
549 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
550 }
551}
552
553
554/****************************************************************************/
@ 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_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 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
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
the function-object for an editing operation (abstract base)
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
void requireSaveDemandElements()
inform that demand elements has to be saved
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
Definition GNENet.cpp:126
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
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.
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
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.
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.
bool mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
GUIGlID getGlID() const
Returns the numerical id of the object.
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
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 ammount
Position getLineCenter() const
get line center
unsigned char alpha() const
Returns the alpha-amount of the color.
Definition RGBColor.cpp:92
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