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.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>
24 #include <utils/gui/div/GLHelper.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 
51 GNEParkingArea::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 
73 void
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  }
87  if (myFriendlyPosition) {
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 
126 void
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  mySignPos = 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 
156 void
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
167  if (!s.drawForViewObjectsHandler) {
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;
179  signColor = s.colorSettings.parkingAreaColorSign;
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(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
213  drawAdditionalID(s);
214  // draw additional name
216  // draw dotted contour
218  // draw dotted contours for geometry points
221  }
222  // draw demand element children
224  // calculate contour
225  calculateStoppingPlaceContour(s, d, myWidth * 0.5, movingGeometryPoints);
226  }
227 }
228 
229 
230 std::string
232  switch (key) {
233  case SUMO_ATTR_ID:
234  return getMicrosimID();
235  case SUMO_ATTR_LANE:
236  return getParentLanes().front()->getID();
237  case SUMO_ATTR_STARTPOS:
239  return toString(myStartPosition);
240  } else {
241  return "";
242  }
243  case SUMO_ATTR_ENDPOS:
244  if (myEndPosition != INVALID_DOUBLE) {
245  return toString(myEndPosition);
246  } else {
247  return "";
248  }
249  case SUMO_ATTR_DEPARTPOS:
250  return myDepartPos;
251  case SUMO_ATTR_NAME:
252  return myAdditionalName;
254  return joinToString(myAcceptedBadges, " ");
259  case SUMO_ATTR_ONROAD:
260  return toString(myOnRoad);
261  case SUMO_ATTR_WIDTH:
262  return toString(myWidth);
263  case SUMO_ATTR_LENGTH:
264  return toString(myLength);
265  case SUMO_ATTR_ANGLE:
266  return toString(myAngle);
267  case SUMO_ATTR_LEFTHAND:
268  return toString(myLefthand);
269  case GNE_ATTR_SELECTED:
271  case GNE_ATTR_PARAMETERS:
272  return getParametersStr();
274  return "";
275  default:
276  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
277  }
278 }
279 
280 
281 double
283  switch (key) {
284  case SUMO_ATTR_STARTPOS:
286  return myStartPosition;
287  } else {
288  return 0;
289  }
290  case SUMO_ATTR_ENDPOS:
291  if (myEndPosition != INVALID_DOUBLE) {
292  return myEndPosition;
293  } else {
294  return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
295  }
296  case SUMO_ATTR_CENTER:
298  case SUMO_ATTR_WIDTH:
299  return myWidth;
300  case SUMO_ATTR_LENGTH: {
301  // calculate spaceDim
302  const double spaceDim = myRoadSideCapacity > 0 ? (getAttributeDouble(SUMO_ATTR_ENDPOS) - getAttributeDouble(SUMO_ATTR_STARTPOS)) / myRoadSideCapacity * getParentLanes().front()->getLengthGeometryFactor() : 7.5;
303  return (myLength > 0) ? myLength : spaceDim;
304  }
305  case SUMO_ATTR_ANGLE:
306  return myAngle;
307  default:
308  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
309  }
310 }
311 
312 
313 void
314 GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
315  switch (key) {
316  case SUMO_ATTR_ID:
317  case SUMO_ATTR_LANE:
318  case SUMO_ATTR_STARTPOS:
319  case SUMO_ATTR_ENDPOS:
320  case SUMO_ATTR_DEPARTPOS:
321  case SUMO_ATTR_NAME:
325  case SUMO_ATTR_ONROAD:
326  case SUMO_ATTR_WIDTH:
327  case SUMO_ATTR_LENGTH:
328  case SUMO_ATTR_ANGLE:
329  case SUMO_ATTR_LEFTHAND:
330  case GNE_ATTR_SELECTED:
331  case GNE_ATTR_PARAMETERS:
333  GNEChange_Attribute::changeAttribute(this, key, value, undoList);
334  break;
335  default:
336  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
337  }
338 }
339 
340 
341 bool
342 GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) {
343  switch (key) {
344  case SUMO_ATTR_ID:
345  return isValidAdditionalID(value);
346  case SUMO_ATTR_LANE:
347  if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
348  return true;
349  } else {
350  return false;
351  }
352  case SUMO_ATTR_STARTPOS:
353  if (value.empty()) {
354  return true;
355  } else if (canParse<double>(value)) {
356  return SUMORouteHandler::isStopPosValid(parse<double>(value), getAttributeDouble(SUMO_ATTR_ENDPOS), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
357  } else {
358  return false;
359  }
360  case SUMO_ATTR_ENDPOS:
361  if (value.empty()) {
362  return true;
363  } else if (canParse<double>(value)) {
364  return SUMORouteHandler::isStopPosValid(getAttributeDouble(SUMO_ATTR_STARTPOS), parse<double>(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition);
365  } else {
366  return false;
367  }
368  case SUMO_ATTR_DEPARTPOS:
369  if (value.empty()) {
370  return true;
371  } else if (canParse<double>(value)) {
372  // parse value
373  const double departPos = parse<double>(value);
374  if (departPos >= 0) {
375  if (isTemplate()) {
376  return true;
377  } else {
378  return (departPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
379  }
380  } else {
381  return false;
382  }
383  } else {
384  return false;
385  }
386  case SUMO_ATTR_NAME:
389  return canParse<std::vector<std::string> >(value);
391  return canParse<bool>(value);
393  return canParse<int>(value) && (parse<int>(value) >= 0);
394  case SUMO_ATTR_ONROAD:
395  return canParse<bool>(value);
396  case SUMO_ATTR_WIDTH:
397  return canParse<double>(value) && (parse<double>(value) > 0);
398  case SUMO_ATTR_LENGTH:
399  if (value.empty()) {
400  return true;
401  } else {
402  return canParse<double>(value) && (parse<double>(value) > 0);
403  }
404  case SUMO_ATTR_ANGLE:
405  return canParse<double>(value);
406  case SUMO_ATTR_LEFTHAND:
407  return canParse<bool>(value);
408  case GNE_ATTR_SELECTED:
409  return canParse<bool>(value);
410  case GNE_ATTR_PARAMETERS:
411  return areParametersValid(value);
412  default:
413  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
414  }
415 }
416 
417 // ===========================================================================
418 // protected
419 // ===========================================================================
420 
422  rotation(0),
423  width(0),
424  length(0) {
425 }
426 
427 
428 GNEParkingArea::GNELotSpaceDefinition::GNELotSpaceDefinition(double x, double y, double z, double rotation_, double width_, double length_) :
429  position(Position(x, y, z)),
430  rotation(rotation_),
431  width(width_),
432  length(length_) {
433 }
434 
435 // ===========================================================================
436 // private
437 // ===========================================================================
438 
439 void
440 GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) {
441  switch (key) {
442  case SUMO_ATTR_ID:
443  // update microsimID
444  setAdditionalID(value);
445  break;
446  case SUMO_ATTR_LANE:
448  break;
449  case SUMO_ATTR_STARTPOS:
450  if (value == "") {
452  } else {
453  myStartPosition = parse<double>(value);
454  }
456  break;
457  case SUMO_ATTR_ENDPOS:
458  if (value == "") {
460  } else {
461  myEndPosition = parse<double>(value);
462  }
464  break;
465  case SUMO_ATTR_DEPARTPOS:
466  myDepartPos = value;
467  break;
468  case SUMO_ATTR_NAME:
469  myAdditionalName = value;
470  break;
472  myAcceptedBadges = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
473  break;
475  myFriendlyPosition = parse<bool>(value);
476  break;
478  myRoadSideCapacity = parse<int>(value);
480  break;
481  case SUMO_ATTR_ONROAD:
482  myOnRoad = parse<bool>(value);
483  break;
484  case SUMO_ATTR_WIDTH:
485  myWidth = parse<double>(value);
486  // update geometry of all spaces
487  for (const auto& space : getChildAdditionals()) {
488  space->updateGeometry();
489  }
491  if (!isTemplate()) {
492  getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true);
493  }
494  break;
495  case SUMO_ATTR_LENGTH:
496  if (value.empty()) {
497  myLength = 0;
498  } else {
499  myLength = parse<double>(value);
500  }
501  // update geometry of all spaces
502  for (const auto& space : getChildAdditionals()) {
503  space->updateGeometry();
504  }
505  break;
506  case SUMO_ATTR_ANGLE:
507  myAngle = parse<double>(value);
508  break;
509  case SUMO_ATTR_LEFTHAND:
510  myLefthand = parse<bool>(value);
511  if (!isTemplate()) {
512  updateGeometry();
513  }
514  break;
515  case GNE_ATTR_SELECTED:
516  if (parse<bool>(value)) {
518  } else {
520  }
521  break;
522  case GNE_ATTR_PARAMETERS:
523  setParametersStr(value);
524  break;
526  shiftLaneIndex();
527  break;
528  default:
529  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
530  }
531 }
532 
533 
534 /****************************************************************************/
@ 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
Definition: GNEContour.cpp:307
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
drawing contour functions
Definition: GNEContour.cpp:265
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:122
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2055
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::Detail d, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
bool myFriendlyPosition
Flag for friendly position.
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
void calculateStoppingPlaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const bool movingGeometryPoints) const
check object in view
double myEndPosition
The position this stopping place is located at (-1 means empty)
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
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:727
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.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:156
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.h:143
Stores the information about how to visualize structures.
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
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
Definition: GeomHelper.cpp:280
static double calculateLotSpaceAngle(const PositionVector &shape, const int index, const double spaceDim, const double angle)
calculate lotSpace angle
Definition: GeomHelper.cpp:319
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:60
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:254
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 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