Eclipse SUMO - Simulation of Urban MObility
GNEDetectorEntryExit.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 //
19 /****************************************************************************/
20 #include <netedit/GNENet.h>
21 #include <netedit/GNEUndoList.h>
22 #include <netedit/GNEViewNet.h>
24 #include <utils/gui/div/GLHelper.h>
26 
27 #include "GNEDetectorEntryExit.h"
28 #include "GNEAdditionalHandler.h"
29 
30 
31 // ===========================================================================
32 // member method definitions
33 // ===========================================================================
34 
36  GNEDetector("", net, GLO_DET_ENTRY, entryExitTag, 0, 0, {}, "", {}, "", false, Parameterised::Map()) {
37  // reset default values
38  resetDefaultValues();
39 }
40 
41 
42 GNEDetectorEntryExit::GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet* net, GNEAdditional* parent, GNELane* lane, const double pos,
43  const bool friendlyPos, const Parameterised::Map& parameters) :
44  GNEDetector(parent, net, GLO_DET_ENTRY, entryExitTag, pos, 0, {
45  lane
46 }, "", "", friendlyPos, parameters) {
47  // update centering boundary without updating grid
48  updateCenteringBoundary(false);
49 }
50 
51 
53 
54 
55 void
57  device.openTag(getTagProperty().getTag());
58  device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
60  if (myFriendlyPosition) {
61  device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true);
62  }
63  device.closeTag();
64 }
65 
66 
67 bool
69  // with friendly position enabled position are "always fixed"
70  if (myFriendlyPosition) {
71  return true;
72  } else {
73  return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
74  }
75 }
76 
77 
78 std::string
80  // obtain final length
81  const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
82  // check if detector has a problem
84  return "";
85  } else {
86  // declare variable for error position
87  std::string errorPosition;
88  // check positions over lane
89  if (myPositionOverLane < 0) {
90  errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0");
91  }
92  if (myPositionOverLane > len) {
93  errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length");
94  }
95  return errorPosition;
96  }
97 }
98 
99 
100 void
102  // declare new position
103  double newPositionOverLane = myPositionOverLane;
104  // fix pos and length checkAndFixDetectorPosition
105  double length = 0;
106  GNEAdditionalHandler::fixLanePosition(newPositionOverLane, length, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
107  // set new position
108  setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList());
109 }
110 
111 
112 void
114  // update geometry
116  // update centering boundary without updating grid
118 }
119 
120 
121 void
123  // Set initial values
124  const double entryExitExaggeration = getExaggeration(s);
125  // first check if additional has to be drawn
126  if (s.drawAdditionals(entryExitExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) {
127  // draw parent and child lines
129  // Start drawing adding gl identificator
131  // Push layer matrix
133  // translate to front
135  // Set color
136  if (drawUsingSelectColor()) {
138  } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) {
140  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
142  }
143  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
144  // Push polygon matrix
146  glTranslated(myAdditionalGeometry.getShape().front().x(), myAdditionalGeometry.getShape().front().y(), 0);
147  // rotate over lane
149  // scale
150  glScaled(entryExitExaggeration, entryExitExaggeration, 1);
151  // draw details if isn't being drawn for selecting
152  if (!s.drawForRectangleSelection) {
153  // Draw polygon
154  glBegin(GL_LINES);
155  glVertex2d(1.7, 0);
156  glVertex2d(-1.7, 0);
157  glEnd();
158  glBegin(GL_QUADS);
159  glVertex2d(-1.7, .5);
160  glVertex2d(-1.7, -.5);
161  glVertex2d(1.7, -.5);
162  glVertex2d(1.7, .5);
163  glEnd();
164  // first Arrow
165  glTranslated(1.5, 0, 0);
166  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
167  GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25);
168  // second Arrow
169  glTranslated(-3, 0, 0);
170  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
171  GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25);
172  } else {
173  // Draw square in drawy for selecting mode
174  glBegin(GL_QUADS);
175  glVertex2d(-1.7, 4.3);
176  glVertex2d(-1.7, -.5);
177  glVertex2d(1.7, -.5);
178  glVertex2d(1.7, 4.3);
179  glEnd();
180  }
181  // Pop polygon matrix
183  // Check if the distance is enought to draw details
184  if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.detectorDetails, entryExitExaggeration)) {
185  // Push matrix
187  // Traslate to center of detector
188  glTranslated(myAdditionalGeometry.getShape().front().x(), myAdditionalGeometry.getShape().front().y(), getType() + 0.1);
189  // rotate over lane
191  //move to logo position
192  glTranslated(1.9, 0, 0);
193  // scale
194  glScaled(entryExitExaggeration, entryExitExaggeration, 1);
195  // draw Entry or Exit logo if isn't being drawn for selecting
198  GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1);
199  } else if (drawUsingSelectColor()) {
201  } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) {
202  GLHelper::drawText("E3", Position(), .1, 2.8, s.detectorSettings.E3EntryColor, 180);
203  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
204  GLHelper::drawText("E3", Position(), .1, 2.8, s.detectorSettings.E3ExitColor, 180);
205  }
206  //move to logo position
207  glTranslated(1.7, 0, 0);
208  // rotate 90 degrees lane
209  glRotated(90, 0, 0, 1);
210  // draw Entry or Exit text if isn't being drawn for selecting
213  GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1);
214  } else if (drawUsingSelectColor()) {
217  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
219  }
220  } else {
222  GLHelper::drawText("Entry", Position(), .1, 1, s.detectorSettings.E3EntryColor, 180);
223  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
224  GLHelper::drawText("Exit", Position(), .1, 1, s.detectorSettings.E3ExitColor, 180);
225  }
226  }
227  // pop matrix
229  }
230  // Pop layer matrix
232  // draw lock icon
234  // check if dotted contour has to be drawn
237  myAdditionalGeometry.getShape().front(), 2.7, 1.6, 2, 0,
238  myAdditionalGeometry.getShapeRotations().front(), entryExitExaggeration);
239  }
240  if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
242  myAdditionalGeometry.getShape().front(), 2.7, 1.6, 2, 0,
243  myAdditionalGeometry.getShapeRotations().front(), entryExitExaggeration);
244  }
245  // pop gl identificator
247  // draw additional name
249  }
250 }
251 
252 
253 std::string
255  switch (key) {
256  case SUMO_ATTR_ID:
257  return getParentAdditionals().front()->getID();
258  case SUMO_ATTR_LANE:
259  return getParentLanes().front()->getID();
260  case SUMO_ATTR_POSITION:
264  case GNE_ATTR_PARENT:
265  return getParentAdditionals().at(0)->getID();
266  case GNE_ATTR_SELECTED:
268  case GNE_ATTR_PARAMETERS:
269  return getParametersStr();
271  return "";
272  default:
273  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
274  }
275 }
276 
277 
278 double
280  switch (key) {
281  case SUMO_ATTR_POSITION:
282  return myPositionOverLane;
283  default:
284  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
285  }
286 }
287 
288 
289 void
290 GNEDetectorEntryExit::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
291  switch (key) {
292  case SUMO_ATTR_LANE:
293  case SUMO_ATTR_POSITION:
295  case GNE_ATTR_PARENT:
296  case GNE_ATTR_SELECTED:
297  case GNE_ATTR_PARAMETERS:
299  undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
300  break;
301  default:
302  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
303  }
304 }
305 
306 
307 bool
308 GNEDetectorEntryExit::isValid(SumoXMLAttr key, const std::string& value) {
309  switch (key) {
310  case SUMO_ATTR_LANE:
311  return (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr);
312  case SUMO_ATTR_POSITION:
313  return canParse<double>(value) && fabs(parse<double>(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
315  return canParse<bool>(value);
316  case GNE_ATTR_PARENT:
317  return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_E3DETECTOR, value, false) != nullptr);
318  case GNE_ATTR_SELECTED:
319  return canParse<bool>(value);
320  case GNE_ATTR_PARAMETERS:
321  return areParametersValid(value);
322  default:
323  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
324  }
325 }
326 
327 
328 void
329 GNEDetectorEntryExit::setAttribute(SumoXMLAttr key, const std::string& value) {
330  switch (key) {
331  case SUMO_ATTR_LANE:
333  break;
334  case SUMO_ATTR_POSITION:
335  myPositionOverLane = parse<double>(value);
336  break;
338  myFriendlyPosition = parse<bool>(value);
339  break;
340  case GNE_ATTR_PARENT:
342  break;
343  case GNE_ATTR_SELECTED:
344  if (parse<bool>(value)) {
346  } else {
348  }
349  break;
350  case GNE_ATTR_PARAMETERS:
351  setParametersStr(value);
352  break;
354  shiftLaneIndex();
355  break;
356  default:
357  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
358  }
359 }
360 
361 
362 void
364  // change position
365  myPositionOverLane = moveResult.newFirstPos;
366  // set lateral offset
368  // update geometry
369  updateGeometry();
370 }
371 
372 
373 void
375  // reset lateral offset
377  // begin change attribute
378  undoList->begin(myTagProperty.getGUIIcon(), "position of " + getTagStr());
379  // set startPosition
380  setAttribute(SUMO_ATTR_POSITION, toString(moveResult.newFirstPos), undoList);
381  // check if lane has to be changed
382  if (moveResult.newFirstLane) {
383  // set new lane
384  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
385  }
386  // end change attribute
387  undoList->end();
388 }
389 
390 /****************************************************************************/
GLO_DET_ENTRY
@ GLO_DET_ENTRY
a DetEntry detector
Definition: GUIGlObjectTypes.h:94
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:146
GNEDetectorEntryExit::setMoveShape
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNEDetectorEntryExit.cpp:363
Parameterised::getParametersStr
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".
Definition: Parameterised.cpp:132
GUIVisualizationSettings::drawForPositionSelection
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
Definition: GUIVisualizationSettings.h:958
GNEDetectorEntryExit.h
GNEHierarchicalElement::getParentAdditionals
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
Definition: GNEHierarchicalElement.cpp:129
GNEAdditional
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:48
GNEAttributeCarrier::getID
const std::string getID() const
get ID (all Attribute Carriers have one)
Definition: GNEAttributeCarrier.cpp:62
GNE_ATTR_SHIFTLANEINDEX
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
Definition: SUMOXMLDefinitions.h:1361
GNEViewNet::getDataViewOptions
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:562
GNEAttributeCarrier::getTagProperty
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
Definition: GNEAttributeCarrier.cpp:596
GNEViewNetHelper::DataViewOptions::showAdditionals
bool showAdditionals() const
check if additionals has to be drawn
Definition: GNEViewNetHelper.cpp:2661
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
GNEMoveElement::myMoveElementLateralOffset
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
Definition: GNEMoveElement.h:250
GNEViewNet::drawTranslateFrontAttributeCarrier
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
Definition: GNEViewNet.cpp:1489
GUIVisualizationSettings::drawForRectangleSelection
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Definition: GUIVisualizationSettings.h:961
GNEAttributeCarrier::myTagProperty
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
Definition: GNEAttributeCarrier.h:289
GNEAdditional::myAdditionalGeometry
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Definition: GNEAdditional.h:305
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNEAdditional::shiftLaneIndex
void shiftLaneIndex()
shift lane index
Definition: GNEAdditional.cpp:340
GUIDottedGeometry::DottedContourType::INSPECT
@ INSPECT
GUIGeometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GUIGeometry.cpp:202
GNEMoveResult
move result
Definition: GNEMoveElement.h:179
Parameterised::areParametersValid
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|....
Definition: Parameterised.cpp:197
GNEHierarchicalElement::getParentLanes
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Definition: GNEHierarchicalElement.cpp:123
Parameterised::Map
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
GUIVisualizationAdditionalSettings::connectionColor
static const RGBColor connectionColor
connection color
Definition: GUIVisualizationSettings.h:362
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:544
SUMO_TAG_DET_ENTRY
@ SUMO_TAG_DET_ENTRY
an e3 entry point
Definition: SUMOXMLDefinitions.h:97
GLHelper.h
SUMO_ATTR_LANE
@ SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:528
GNEViewNet::isAttributeCarrierInspected
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
Definition: GNEViewNet.cpp:1448
GNENet::getAttributeCarriers
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
GNEDetector::myPositionOverLane
double myPositionOverLane
position of detector over Lane
Definition: GNEDetector.h:172
GLHelper::pushName
static void pushName(unsigned int name)
push Name
Definition: GLHelper.cpp:139
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:583
GNEDetector::myFriendlyPosition
bool myFriendlyPosition
Flag for friendly position.
Definition: GNEDetector.h:184
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:39
GUIVisualizationDetailSettings::detectorDetails
static const double detectorDetails
details for detectors
Definition: GUIVisualizationSettings.h:542
GNEAttributeCarrier::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEAttributeCarrier.cpp:102
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:271
GNEDetector::getGeometryPositionOverLane
double getGeometryPositionOverLane() const
get position over lane that is applicable to the shape
Definition: GNEDetector.cpp:130
GLHelper::pushMatrix
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
GNEAttributeCarrier::myNet
GNENet * myNet
pointer to net
Definition: GNEAttributeCarrier.h:292
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:51
GUIGeometry::getShapeRotations
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
Definition: GUIGeometry.cpp:208
GNEAdditional::replaceAdditionalParent
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
Definition: GNEAdditional.cpp:314
GUIDottedGeometry::DottedContourType::FRONT
@ FRONT
GNEDetectorEntryExit::GNEDetectorEntryExit
GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet *net)
default Constructor
Definition: GNEDetectorEntryExit.cpp:35
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
GNEViewNet::getFrontAttributeCarrier
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
Definition: GNEViewNet.cpp:1475
GUIGeometry::updateGeometry
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:58
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:1024
GUIVisualizationSettings::detectorSettings
GUIVisualizationDetectorSettings detectorSettings
Detector settings.
Definition: GUIVisualizationSettings.h:1012
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:151
GNEDetectorEntryExit::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML
Definition: GNEDetectorEntryExit.cpp:68
GNEDetectorEntryExit::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorEntryExit.cpp:101
GNEMoveResult::newFirstPos
double newFirstPos
new first position
Definition: GNEMoveElement.h:207
GNEViewNet.h
GLHelper::drawText
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
Definition: GLHelper.cpp:685
GNEDetectorEntryExit::commitMoveShape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNEDetectorEntryExit.cpp:374
GNEAdditionalHandler.h
GNEUndoList::changeAttribute
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
Definition: GNEUndoList.cpp:367
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:97
GNEAdditional::drawAdditionalName
void drawAdditionalName(const GUIVisualizationSettings &s) const
draw additional name
Definition: GNEAdditional.cpp:271
GNEDetectorEntryExit::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorEntryExit.cpp:79
GUIVisualizationDetectorSettings::E3EntryColor
static const RGBColor E3EntryColor
color for Entrys
Definition: GUIVisualizationSettings.h:421
GNE_ATTR_PARAMETERS
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:1331
GUIVisualizationSettings::additionalSettings
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
Definition: GUIVisualizationSettings.h:1009
Parameterised::setParametersStr
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"
Definition: Parameterised.cpp:170
GNEDetector
Definition: GNEDetector.h:31
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
GNEAdditionalHandler::fixLanePosition
static void fixLanePosition(double &pos, double &length, const double laneLength)
fix given position over lane
Definition: GNEAdditionalHandler.cpp:1798
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1418
GNEAdditional::drawParentChildLines
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
Definition: GNEAdditional.cpp:627
GNEViewNetHelper::LockIcon::drawLockIcon
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
Definition: GNEViewNetHelper.cpp:3545
GNEDetectorEntryExit::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorEntryExit.cpp:254
GNEAdditional::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
Definition: GNEAdditional.cpp:121
GNEAdditional::replaceAdditionalParentLanes
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
Definition: GNEAdditional.cpp:296
GNEAdditionalHandler::checkLanePosition
static bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
Definition: GNEAdditionalHandler.cpp:1776
GNEDetectorEntryExit::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorEntryExit.cpp:122
SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:1091
GNETagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNETagProperties.cpp:67
SUMO_ATTR_POSITION
@ SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:526
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1935
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:997
GNEUndoList::end
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:235
GLIncludes.h
GUIGeometry::rotateOverLane
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
Definition: GUIGeometry.cpp:602
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:257
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
GNEDetector::updateCenteringBoundary
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition: GNEDetector.cpp:101
GNEDetectorEntryExit::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorEntryExit.cpp:113
GNEAttributeCarrier::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEAttributeCarrier.cpp:96
InvalidArgument
Definition: UtilExceptions.h:54
GLHelper::drawBoxLine
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:277
GUIDottedGeometry::drawDottedSquaredShape
static void drawDottedSquaredShape(const DottedContourType type, const GUIVisualizationSettings &s, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double exaggeration)
draw dotted squared contour (used by additionals and demand elements)
Definition: GUIDottedGeometry.cpp:380
GNEDetectorEntryExit::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition: GNEDetectorEntryExit.cpp:308
GNEAttributeCarrier::selectAttributeCarrier
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
Definition: GNEAttributeCarrier.cpp:74
GUIVisualizationSettings::drawAdditionals
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
Definition: GUIVisualizationSettings.cpp:2289
GUIVisualizationDetectorSettings::E3ExitColor
static const RGBColor E3ExitColor
color for Exits
Definition: GUIVisualizationSettings.h:424
PositionVector::getCentroid
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
Definition: PositionVector.cpp:418
GNEDetectorEntryExit::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEDetectorEntryExit.cpp:290
GLHelper::popMatrix
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
GNENetHelper::AttributeCarriers::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENetHelper.cpp:945
SUMO_TAG_E3DETECTOR
@ SUMO_TAG_E3DETECTOR
an e3 detector
Definition: SUMOXMLDefinitions.h:89
GNEMoveResult::newFirstLane
const GNELane * newFirstLane
new first Lane
Definition: GNEMoveElement.h:204
GNEUndoList::begin
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...
Definition: GNEUndoList.cpp:205
GNEMoveResult::firstLaneOffset
double firstLaneOffset
lane offset
Definition: GNEMoveElement.h:201
GNE_ATTR_SELECTED
@ GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:1315
GNEDetectorEntryExit::~GNEDetectorEntryExit
~GNEDetectorEntryExit()
destructor
Definition: GNEDetectorEntryExit.cpp:52
GUIVisualizationSettings::drawDetail
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
Definition: GUIVisualizationSettings.cpp:2295
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:569
GNEUndoList
Definition: GNEUndoList.h:42
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:583
GNEDetectorEntryExit::writeAdditional
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition: GNEDetectorEntryExit.cpp:56
GNENetHelper::AttributeCarriers::retrieveLane
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
Definition: GNENetHelper.cpp:766
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:466
GLHelper::popName
static void popName()
pop Name
Definition: GLHelper.cpp:148
GNEAttributeCarrier::unselectAttributeCarrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNEAttributeCarrier.cpp:85
GNETagProperties::getGUIIcon
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
Definition: GNETagProperties.cpp:233
SUMO_TAG_DET_EXIT
@ SUMO_TAG_DET_EXIT
an e3 exit point
Definition: SUMOXMLDefinitions.h:99
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEChange_Attribute.h
GNENet.h
GLHelper::drawTriangleAtEnd
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:558
GNEUndoList.h
GNE_ATTR_PARENT
@ GNE_ATTR_PARENT
parent of an additional element
Definition: SUMOXMLDefinitions.h:1327
GNEDetectorEntryExit::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEDetectorEntryExit.cpp:279