Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEParkingSpace.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-2025 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 halt at (GNE version)
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
24#include <netedit/GNEUndoList.h>
25#include <netedit/GNEViewNet.h>
30
31#include "GNEParkingSpace.h"
32
33// ===========================================================================
34// method definitions
35// ===========================================================================
36
38 GNEAdditional("", net, "", SUMO_TAG_PARKING_SPACE, ""),
39 mySlope(0) {
40}
41
42
44 const std::string& width, const std::string& length, const std::string& angle, double slope,
45 const std::string& name, const Parameterised::Map& parameters) :
46 GNEAdditional(parkingAreaParent, SUMO_TAG_PARKING_SPACE, name),
47 Parameterised(parameters),
48 myPosition(pos),
49 myWidth(width),
50 myLength(length),
51 myAngle(angle),
52 mySlope(slope) {
53 // set parents
54 setParent<GNEAdditional*>(parkingAreaParent);
55 // update centering boundary without updating grid
57}
58
59
61
62
68 // get snap radius
70 // get mouse position
71 const Position mousePosition = myNet->getViewNet()->getPositionInformation();
72 // check if we're editing width or height
73 if (myShapeLength.back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
74 // edit length
76 } else if (myShapeWidth.front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
77 // edit width
79 } else if (myShapeWidth.back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
80 // edit width
82 } else {
83 return nullptr;
84 }
85 } else {
86 // move entire space
87 return new GNEMoveOperation(this, myPosition);
88 }
89}
90
91
92void
94 device.openTag(getTagProperty()->getTag());
95 if (!myAdditionalName.empty()) {
97 }
100 if (myPosition.z() != 0) {
102 }
103 if (myWidth.size() > 0) {
105 }
106 if (myLength.size() > 0) {
108 }
109 if (myAngle.size() > 0) {
111 }
114 }
115 // write parameters (Always after children to avoid problems with additionals.xsd)
116 writeParams(device);
117 device.closeTag();
118}
119
120
122 return true;
123}
124
125
127 return "";
128}
129
130
132 // nothing to fix
133}
134
135
136bool
138 // get edit modes
139 const auto& editModes = myNet->getViewNet()->getEditModes();
140 // check if we're in move mode
141 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
143 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
144 // only move the first element
146 } else {
147 return false;
148 }
149}
150
151
152void
154 // get width an length
155 const double width = getAttributeDouble(SUMO_ATTR_WIDTH) <= 0 ? POSITION_EPS : getAttributeDouble(SUMO_ATTR_WIDTH);
156 const double length = getAttributeDouble(SUMO_ATTR_LENGTH) <= 0 ? POSITION_EPS : getAttributeDouble(SUMO_ATTR_LENGTH);
157 // calculate shape length
158 myShapeLength.clear();
159 myShapeLength.push_back(Position(0, 0));
160 myShapeLength.push_back(Position(0, length));
161 // rotate
163 // move
165 // calculate shape width
166 PositionVector leftShape = myShapeLength;
167 leftShape.move2side(width * -0.5);
168 PositionVector rightShape = myShapeLength;
169 rightShape.move2side(width * 0.5);
170 myShapeWidth = {leftShape.getCentroid(), rightShape.getCentroid()};
171 // update centering boundary
173}
174
175
180
181
182void
184 // remove additional from grid
185 if (updateGrid) {
187 }
188 // first reset boundary
190 // add position
192 // grow width and length
195 // grow
197 // add additional into RTREE again
198 if (updateGrid) {
200 }
201}
202
203
204void
205GNEParkingSpace::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
206 // geometry of this element cannot be splitted
207}
208
209
210std::string
212 return getParentAdditionals().at(0)->getID();
213}
214
215
216void
218 // first check if additional has to be drawn
220 // draw boundaries
222 // get exaggeration
223 const double spaceExaggeration = getExaggeration(s);
224 // get witdh
225 const double parkingSpaceWidth = myShapeWidth.length2D() * 0.5 + (spaceExaggeration * 0.1);
226 // get detail level
227 const auto d = s.getDetailLevel(spaceExaggeration);
228 // check if draw moving geometry points
229 const bool movingGeometryPoints = drawMovingGeometryPoints(false);
230 // draw geometry only if we'rent in drawForObjectUnderCursor mode
232 // draw space
233 drawSpace(s, d, parkingSpaceWidth, movingGeometryPoints);
234 // draw parent and child lines
236 // draw lock icon
238 // Draw additional ID
240 // draw additional name
242 // draw dotted contours
243 if (movingGeometryPoints) {
244 // get snap radius
246 const double snapRadiusSquared = snapRadius * snapRadius;
247 // get mouse position
248 const Position mousePosition = myNet->getViewNet()->getPositionInformation();
249 // check if we're editing width or height
250 if (myShapeLength.back().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) {
253 } else if ((myShapeWidth.front().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) ||
254 (myShapeWidth.back().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared)) {
257 }
258 } else {
260 }
261
262 }
263 // calculate contour
264 calculateSpaceContour(s, d, parkingSpaceWidth, spaceExaggeration, movingGeometryPoints);
265 }
266}
267
268
269std::string
271 switch (key) {
272 case SUMO_ATTR_ID:
273 return getMicrosimID();
275 return toString(myPosition);
276 case SUMO_ATTR_NAME:
277 return myAdditionalName;
278 case SUMO_ATTR_WIDTH:
279 return myWidth;
280 case SUMO_ATTR_LENGTH:
281 return myLength;
282 case SUMO_ATTR_ANGLE:
283 return myAngle;
284 case SUMO_ATTR_SLOPE:
285 return toString(mySlope);
286 case GNE_ATTR_PARENT:
287 if (isTemplate()) {
288 return "";
289 } else {
290 return getParentAdditionals().at(0)->getID();
291 }
292 default:
293 return getCommonAttribute(this, key);
294 }
295}
296
297
298double
300 switch (key) {
301 case SUMO_ATTR_WIDTH:
302 return myWidth.empty() ? getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_WIDTH) : parse<double>(myWidth);
303 case SUMO_ATTR_LENGTH:
304 return myLength.empty() ? getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_LENGTH) : parse<double>(myLength);
305 case SUMO_ATTR_ANGLE:
306 return myAngle.empty() ? getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_ANGLE) : parse<double>(myAngle);
307 default:
308 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
309 }
310}
311
312
317
318
319void
320GNEParkingSpace::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
321 if (value == getAttribute(key)) {
322 return; //avoid needless changes, later logic relies on the fact that attributes have changed
323 }
324 switch (key) {
326 case SUMO_ATTR_NAME:
327 case SUMO_ATTR_WIDTH:
328 case SUMO_ATTR_LENGTH:
329 case SUMO_ATTR_ANGLE:
330 case SUMO_ATTR_SLOPE:
331 case GNE_ATTR_PARENT:
332 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
333 break;
334 default:
335 setCommonAttribute(key, value, undoList);
336 break;
337 }
338}
339
340
341bool
342GNEParkingSpace::isValid(SumoXMLAttr key, const std::string& value) {
343 switch (key) {
345 return canParse<Position>(value);
346 case SUMO_ATTR_NAME:
348 case SUMO_ATTR_WIDTH:
349 return value.empty() || (canParse<double>(value) && (parse<double>(value) > 0));
350 case SUMO_ATTR_LENGTH:
351 return value.empty() || (canParse<double>(value) && (parse<double>(value) > 0));
352 case SUMO_ATTR_ANGLE:
353 return value.empty() || canParse<double>(value);
354 case SUMO_ATTR_SLOPE:
355 return canParse<double>(value);
356 case GNE_ATTR_PARENT:
357 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr);
358 default:
359 return isCommonValid(key, value);
360 }
361}
362
363
364std::string
366 return getTagStr();
367}
368
369
370std::string
374
375// ===========================================================================
376// private
377// ===========================================================================
378
379void
381 const double width, const bool movingGeometryPoints) const {
382 // get angle
383 const double angle = getAttributeDouble(SUMO_ATTR_ANGLE);
384 // get contour color
386 if (drawUsingSelectColor()) {
387 contourColor = s.colorSettings.selectedAdditionalColor;
390 }
391 // push later matrix
393 // translate to front
395 // set contour color
396 GLHelper::setColor(contourColor);
397 // draw extern
399 // make a copy of myShapeLength and scale
400 PositionVector shapeLengthInner = myShapeLength;
401 shapeLengthInner.scaleAbsolute(-0.1);
402 // draw intern
404 // Traslate to front
405 glTranslated(0, 0, 0.1);
406 // set base color
408 //draw intern
409 GLHelper::drawBoxLines(shapeLengthInner, width - 0.1);
410 }
411 // draw geometry points
412 if (movingGeometryPoints) {
413 if (myShapeLength.size() > 0) {
415 }
416 if (myShapeWidth.size() > 0) {
417 drawLeftGeometryPoint(s, d, myShapeWidth.back(), angle - 90, RGBColor::ORANGE);
418 drawRightGeometryPoint(s, d, myShapeWidth.front(), angle - 90, RGBColor::ORANGE);
419 }
420 }
421 // pop layer matrix
423}
424
425
426void
428 const double width, const double exaggeration, const bool movingGeometryPoints) const {
429 // check if we're calculating the contour or the moving geometry points
430 if (movingGeometryPoints) {
432 getType(), exaggeration, nullptr);
434 exaggeration, nullptr);
436 exaggeration, nullptr);
437 } else {
438 myAdditionalContour.calculateContourExtrudedShape(s, d, this, myShapeLength, getType(), width, exaggeration, true, true, 0, nullptr, nullptr);
439 }
440}
441
442
443void
444GNEParkingSpace::setAttribute(SumoXMLAttr key, const std::string& value) {
445 switch (key) {
447 myPosition = parse<Position>(value);
448 // update geometry
450 break;
451 case SUMO_ATTR_NAME:
452 myAdditionalName = value;
453 break;
454 case SUMO_ATTR_WIDTH:
455 myWidth = value;
456 // update geometry (except for template)
457 if (getParentAdditionals().size() > 0) {
459 }
460 break;
461 case SUMO_ATTR_LENGTH:
462 myLength = value;
463 // update geometry (except for template)
464 if (getParentAdditionals().size() > 0) {
466 }
467 break;
468 case SUMO_ATTR_ANGLE:
469 myAngle = value;
470 // update geometry (except for template)
471 if (getParentAdditionals().size() > 0) {
473 }
474 break;
475 case SUMO_ATTR_SLOPE:
476 mySlope = parse<double>(value);
477 break;
478 case GNE_ATTR_PARENT:
480 break;
481 default:
482 setCommonAttribute(this, key, value);
483 break;
484 }
485}
486
487
488void
490 // check what are being updated
492 myShapeLength[1] = moveResult.shapeToUpdate[1];
493 } else if (moveResult.operationType == GNEMoveOperation::OperationType::WIDTH) {
494 myShapeWidth = moveResult.shapeToUpdate;
495 } else {
496 myPosition = moveResult.shapeToUpdate.front();
497 // update geometry
499 }
500}
501
502
503void
505 // check what are being updated
507 undoList->begin(this, "length of " + getTagStr());
508 setAttribute(SUMO_ATTR_LENGTH, toString(myShapeLength[0].distanceTo2D(moveResult.shapeToUpdate[1])), undoList);
509 undoList->end();
510 } else if (moveResult.operationType == GNEMoveOperation::OperationType::WIDTH) {
511 undoList->begin(this, "width of " + getTagStr());
513 undoList->end();
514 } else {
515 undoList->begin(this, "position of " + getTagStr());
516 setAttribute(SUMO_ATTR_POSITION, toString(moveResult.shapeToUpdate.front()), undoList);
517 undoList->end();
518 }
519}
520
521/****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
@ GLO_PARKING_SPACE
a ParkingSpace
#define DEG2RAD(x)
Definition GeomHelper.h:35
@ 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_Y
@ SUMO_ATTR_Z
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_X
@ SUMO_ATTR_NAME
@ SUMO_ATTR_SLOPE
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ SUMO_ATTR_WIDTH
@ SUMO_ATTR_POSITION
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
void reset()
Resets the boundary.
Definition Boundary.cpp:63
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
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 drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition GLHelper.cpp:348
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
Definition GLHelper.cpp:952
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
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
GNEContour myAdditionalContour
variable used for draw additional contours
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
void drawUpGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw up geometry point
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
bool drawMovingGeometryPoints(const bool ignoreShift) const
check if draw additional extrem geometry points
Boundary myAdditionalBoundary
Additional Boundary (used only by additionals placed over grid)
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
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
std::string getCommonAttribute(const Parameterised *parameterised, SumoXMLAttr key) const
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isTemplate() const
check if this AC is template
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
bool isCommonValid(SumoXMLAttr key, const std::string &value) 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 calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset, const GNESegment *segment, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contour extruded (used in elements formed by a central shape)
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double layer, const double scale, const GUIGlObject *boundaryParent) const
calculate contour (circle elements)
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 GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
move operation
move result
const GNEMoveOperation::OperationType operationType
move operation
PositionVector shapeToUpdate
shape to update (edited in moveElement)
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1440
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1450
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:144
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2193
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void calculateSpaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration, const bool movingGeometryPoints) const
calculate space contour
GNEContour myMovingContourRight
variable used for moving contour right
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double getAttributeDouble(SumoXMLAttr key) const
void drawSpace(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const bool movingGeometryPoints) const
draw space
PositionVector myShapeWidth
shape width of Parking Space
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Position myPosition
position of Parking Space in view
GNEContour myMovingContourLeft
variable used for moving contour left
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNEContour myMovingContourDown
variable used for moving contour down
double mySlope
Slope of Parking Space.
~GNEParkingSpace()
Destructor.
std::string getParentName() const
Returns the name of the parent object.
std::string myAngle
Angle of Parking Space.
Position getPositionInView() const
Returns position of additional in view.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
GNEParkingSpace(GNENet *net)
Constructor.
std::string myLength
Length of Parking Space.
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
GNEMoveOperation * getMoveOperation()
get move operation
bool checkDrawMoveContour() const
check if draw move contour (red)
const Parameterised::Map & getACParametersMap() const
get parameters map
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string myWidth
width of Parking Space
PositionVector myShapeLength
shape length of Parking Space
void updateGeometry()
update pre-computed geometry information
GNEContour myMovingContourUp
variable used for moving contour up
double getDefaultDoubleValue(SumoXMLAttr attr) const
get default double value
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
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.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
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 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.
std::map< std::string, std::string > Map
parameters map
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
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:52
double z() const
Returns the z-position.
Definition Position.h:62
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
void scaleAbsolute(double offset)
enlarges/shrinks the polygon by an absolute offset based at the centroid
double length2D() const
Returns the length.
void rotate2D(double angle)
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
void add(double xoff, double yoff, double zoff)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
static const RGBColor ORANGE
Definition RGBColor.h:194
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.
bool showAdditionals() const
check if additionals has to be drawn
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
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
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
static const RGBColor connectionColor
connection color
RGBColor parkingSpaceColorContour
color for parkingSpace contour
RGBColor parkingSpaceColor
color for parkingSpace innen
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
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