Eclipse SUMO - Simulation of Urban MObility
GNEDetectorE1.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>
25 
26 #include "GNEDetectorE1.h"
27 #include "GNEAdditionalHandler.h"
28 
29 
30 // ===========================================================================
31 // member method definitions
32 // ===========================================================================
33 
35  GNEDetector("", net, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, 0, 0, {}, "", {}, "", false, Parameterised::Map()) {
36  // reset default values
37  resetDefaultValues();
38 }
39 
40 
41 GNEDetectorE1::GNEDetectorE1(const std::string& id, GNELane* lane, GNENet* net, const double pos, const SUMOTime freq, const std::string& filename, const std::vector<std::string>& vehicleTypes,
42  const std::string& name, bool friendlyPos, const Parameterised::Map& parameters) :
43  GNEDetector(id, net, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, pos, freq, {
44  lane
45 }, filename, vehicleTypes, name, friendlyPos, parameters) {
46  // update centering boundary without updating grid
47  updateCenteringBoundary(false);
48 }
49 
50 
52 }
53 
54 
55 void
57  device.openTag(getTagProperty().getTag());
58  device.writeAttr(SUMO_ATTR_ID, getID());
59  if (!myAdditionalName.empty()) {
61  }
62  device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
64  if (getAttribute(SUMO_ATTR_PERIOD).size() > 0) {
66  }
67  if (myFilename.size() > 0) {
69  }
70  if (myVehicleTypes.size() > 0) {
72  }
73  if (myFriendlyPosition) {
74  device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true);
75  }
76  // write parameters (Always after children to avoid problems with additionals.xsd)
77  writeParams(device);
78  device.closeTag();
79 }
80 
81 
82 bool
84  // with friendly position enabled position are "always fixed"
85  if (myFriendlyPosition) {
86  return true;
87  } else {
88  return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
89  }
90 }
91 
92 
93 std::string
95  // obtain final length
96  const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
97  // check if detector has a problem
99  return "";
100  } else {
101  // declare variable for error position
102  std::string errorPosition;
103  // check positions over lane
104  if (myPositionOverLane < 0) {
105  errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0");
106  }
107  if (myPositionOverLane > len) {
108  errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length");
109  }
110  return errorPosition;
111  }
112 }
113 
114 
115 void
117  // declare new position
118  double newPositionOverLane = myPositionOverLane;
119  // fix pos and length checkAndFixDetectorPosition
120  double length = 0;
121  GNEAdditionalHandler::fixLanePosition(newPositionOverLane, length, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
122  // set new position
123  setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList());
124 }
125 
126 
127 void
129  // update geometry
131  // update centering boundary without updating grid
133 }
134 
135 
136 void
138  // Obtain exaggeration of the draw
139  const double E1Exaggeration = getExaggeration(s);
140  // first check if additional has to be drawn
142  // check exaggeration
143  if (s.drawAdditionals(E1Exaggeration)) {
144  // obtain scaledSize
145  const double scaledWidth = s.detectorSettings.E1Width * 0.5 * s.scale;
146  // declare colors
147  RGBColor mainColor, secondColor, textColor;
148  // set color
149  if (drawUsingSelectColor()) {
151  secondColor = mainColor.changedBrightness(-32);
152  textColor = mainColor.changedBrightness(32);
153  } else {
154  mainColor = s.detectorSettings.E1Color;
155  secondColor = RGBColor::WHITE;
156  textColor = RGBColor::BLACK;
157  }
158  // draw parent and child lines
160  // start drawing
162  // push layer matrix
164  // translate to front
166  // draw E1 shape
167  drawE1Shape(s, E1Exaggeration, scaledWidth, mainColor, secondColor);
168  // Check if the distance is enought to draw details
169  if (s.drawDetail(s.detailSettings.detectorDetails, E1Exaggeration)) {
170  // draw E1 Logo
171  drawDetectorLogo(s, E1Exaggeration, "E1", textColor);
172  }
173  // pop layer matrix
175  // Pop name
177  // draw lock icon
179  // check if dotted contours has to be drawn
182  }
183  if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
185  }
186  }
187  // Draw additional ID
188  drawAdditionalID(s);
189  // draw additional name
191  }
192 }
193 
194 
195 std::string
197  switch (key) {
198  case SUMO_ATTR_ID:
199  return getMicrosimID();
200  case SUMO_ATTR_LANE:
201  return getParentLanes().front()->getID();
202  case SUMO_ATTR_POSITION:
204  case SUMO_ATTR_PERIOD:
205  if (myPeriod == SUMOTime_MAX_PERIOD) {
206  return "";
207  } else {
208  return time2string(myPeriod);
209  }
210  case SUMO_ATTR_NAME:
211  return myAdditionalName;
212  case SUMO_ATTR_FILE:
213  return myFilename;
214  case SUMO_ATTR_VTYPES:
215  return toString(myVehicleTypes);
218  case GNE_ATTR_SELECTED:
220  case GNE_ATTR_PARAMETERS:
221  return getParametersStr();
223  return "";
224  default:
225  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
226  }
227 }
228 
229 
230 double
232  switch (key) {
233  case SUMO_ATTR_POSITION:
234  return myPositionOverLane;
235  default:
236  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
237  }
238 }
239 
240 
241 void
242 GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
243  switch (key) {
244  case SUMO_ATTR_ID:
245  case SUMO_ATTR_LANE:
246  case SUMO_ATTR_POSITION:
247  case SUMO_ATTR_PERIOD:
248  case SUMO_ATTR_NAME:
249  case SUMO_ATTR_FILE:
250  case SUMO_ATTR_VTYPES:
252  case GNE_ATTR_SELECTED:
253  case GNE_ATTR_PARAMETERS:
255  undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
256  break;
257  default:
258  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
259  }
260 }
261 
262 
263 bool
264 GNEDetectorE1::isValid(SumoXMLAttr key, const std::string& value) {
265  switch (key) {
266  case SUMO_ATTR_ID:
267  return isValidDetectorID(value);
268  case SUMO_ATTR_LANE:
269  if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
270  return true;
271  } else {
272  return false;
273  }
274  case SUMO_ATTR_POSITION:
275  return canParse<double>(value) && fabs(parse<double>(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
276  case SUMO_ATTR_PERIOD:
277  if (value.empty()) {
278  return true;
279  } else {
280  return (canParse<double>(value) && (parse<double>(value) >= 0));
281  }
282  case SUMO_ATTR_NAME:
284  case SUMO_ATTR_FILE:
286  case SUMO_ATTR_VTYPES:
287  if (value.empty()) {
288  return true;
289  } else {
291  }
293  return canParse<bool>(value);
294  case GNE_ATTR_SELECTED:
295  return canParse<bool>(value);
296  case GNE_ATTR_PARAMETERS:
297  return areParametersValid(value);
298  default:
299  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
300  }
301 }
302 
303 // ===========================================================================
304 // private
305 // ===========================================================================
306 
307 void
308 GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value) {
309  switch (key) {
310  case SUMO_ATTR_ID:
311  // update microsimID
312  setMicrosimID(value);
313  break;
314  case SUMO_ATTR_LANE:
316  break;
317  case SUMO_ATTR_POSITION:
318  myPositionOverLane = parse<double>(value);
319  break;
320  case SUMO_ATTR_PERIOD:
321  if (value.empty()) {
323  } else {
324  myPeriod = string2time(value);
325  }
326  break;
327  case SUMO_ATTR_FILE:
328  myFilename = value;
329  break;
330  case SUMO_ATTR_NAME:
331  myAdditionalName = value;
332  break;
333  case SUMO_ATTR_VTYPES:
334  myVehicleTypes = parse<std::vector<std::string> >(value);
335  break;
337  myFriendlyPosition = parse<bool>(value);
338  break;
339  case GNE_ATTR_SELECTED:
340  if (parse<bool>(value)) {
342  } else {
344  }
345  break;
346  case GNE_ATTR_PARAMETERS:
347  setParametersStr(value);
348  break;
350  shiftLaneIndex();
351  break;
352  default:
353  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
354  }
355 }
356 
357 
358 void
360  // change position
361  myPositionOverLane = moveResult.newFirstPos;
362  // set lateral offset
364  // update geometry
365  updateGeometry();
366 }
367 
368 
369 void
371  // reset lateral offset
373  // begin change attribute
374  undoList->begin(myTagProperty.getGUIIcon(), "position of " + getTagStr());
375  // set startPosition
376  setAttribute(SUMO_ATTR_POSITION, toString(moveResult.newFirstPos), undoList);
377  // check if lane has to be changed
378  if (moveResult.newFirstLane) {
379  // set new lane
380  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
381  }
382  // end change attribute
383  undoList->end();
384 }
385 
386 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:146
SUMOXMLDefinitions::isValidAttribute
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
Definition: SUMOXMLDefinitions.cpp:1288
GNEDetectorE1::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEDetectorE1.cpp:242
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
GNEDetectorE1::commitMoveShape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNEDetectorE1.cpp:370
SUMOTime_MAX_PERIOD
#define SUMOTime_MAX_PERIOD
Definition: SUMOTime.h:35
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
SUMOTime
long long int SUMOTime
Definition: GUI.h:35
GNEDetectorE1::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorE1.cpp:94
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
SUMOXMLDefinitions::isValidFilename
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
Definition: SUMOXMLDefinitions.cpp:1294
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
RGBColor::BLACK
static const RGBColor BLACK
Definition: RGBColor.h:193
GNEViewNet::drawTranslateFrontAttributeCarrier
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
Definition: GNEViewNet.cpp:1489
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
SUMO_ATTR_PERIOD
@ SUMO_ATTR_PERIOD
Definition: SUMOXMLDefinitions.h:938
GNEMoveResult
move result
Definition: GNEMoveElement.h:179
GNEDetectorE1::setMoveShape
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNEDetectorE1.cpp:359
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
GLHelper.h
SUMO_ATTR_LANE
@ SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:528
GNEDetector::myPeriod
SUMOTime myPeriod
The aggregation period the values the detector collects shall be summed up.
Definition: GNEDetector.h:175
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
GNEDetector::myFriendlyPosition
bool myFriendlyPosition
Flag for friendly position.
Definition: GNEDetector.h:184
SUMO_ATTR_FILE
@ SUMO_ATTR_FILE
Definition: SUMOXMLDefinitions.h:958
GUIVisualizationDetailSettings::detectorDetails
static const double detectorDetails
details for detectors
Definition: GUIVisualizationSettings.h:542
Parameterised::writeParams
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
Definition: Parameterised.cpp:185
GNEDetector::myVehicleTypes
std::vector< std::string > myVehicleTypes
attribute vehicle types
Definition: GNEDetector.h:181
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
GUIDottedGeometry::DottedContourType::FRONT
@ FRONT
GNEDetectorE1::GNEDetectorE1
GNEDetectorE1(GNENet *net)
default constructor
Definition: GNEDetectorE1.cpp:34
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
RGBColor
Definition: RGBColor.h:38
GUIGlObject::setMicrosimID
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
Definition: GUIGlObject.cpp:198
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
GNEAdditional::isValidDetectorID
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
Definition: GNEAdditional.cpp:242
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:1024
GUIVisualizationSettings::detectorSettings
GUIVisualizationDetectorSettings detectorSettings
Detector settings.
Definition: GUIVisualizationSettings.h:1012
GNEDetectorE1::writeAdditional
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition: GNEDetectorE1.cpp:56
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:151
GNEDetectorE1::~GNEDetectorE1
~GNEDetectorE1()
Destructor.
Definition: GNEDetectorE1.cpp:51
GNEDetectorE1.h
GNEMoveResult::newFirstPos
double newFirstPos
new first position
Definition: GNEMoveElement.h:207
GNEDetector::drawDetectorLogo
void drawDetectorLogo(const GUIVisualizationSettings &s, const double exaggeration, const std::string &logo, const RGBColor &textColor) const
draw detector Logo
Definition: GNEDetector.cpp:230
GNEDetectorE1::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML
Definition: GNEDetectorE1.cpp:83
GNEViewNet.h
GNEAdditionalHandler.h
GNEUndoList::changeAttribute
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
Definition: GNEUndoList.cpp:367
StringUtils::escapeXML
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
Definition: StringUtils.cpp:240
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
GNEDetectorE1::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorE1.cpp:116
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
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:946
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
GLO_E1DETECTOR
@ GLO_E1DETECTOR
a E1 detector
Definition: GUIGlObjectTypes.h:84
time2string
std::string time2string(SUMOTime t)
convert SUMOTime to string
Definition: SUMOTime.cpp:68
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
GNEDetectorE1::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorE1.cpp:196
GNEAdditional::myAdditionalName
std::string myAdditionalName
name of additional
Definition: GNEAdditional.h:308
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
SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:1091
string2time
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition: SUMOTime.cpp:45
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
GUIVisualizationDetectorSettings::E1Color
static const RGBColor E1Color
color for E1 detectors
Definition: GUIVisualizationSettings.h:394
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
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
GNEDetectorE1::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorE1.cpp:137
GNEDetector::updateCenteringBoundary
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition: GNEDetector.cpp:101
GNEAdditional::drawAdditionalID
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
Definition: GNEAdditional.cpp:252
SUMO_ATTR_VTYPES
@ SUMO_ATTR_VTYPES
Definition: SUMOXMLDefinitions.h:923
GNEAttributeCarrier::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEAttributeCarrier.cpp:96
GNEDetectorE1::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEDetectorE1.cpp:231
InvalidArgument
Definition: UtilExceptions.h:54
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
GNEDetector::myFilename
std::string myFilename
The path to the output file.
Definition: GNEDetector.h:178
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
GUIGlObject::getMicrosimID
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.h:133
GUIVisualizationDetectorSettings::E1Width
static const double E1Width
E1 detector widths.
Definition: GUIVisualizationSettings.h:397
PositionVector::getCentroid
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
Definition: PositionVector.cpp:418
GLHelper::popMatrix
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
GNEDetectorE1::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition: GNEDetectorE1.cpp:264
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
GNEDetectorE1::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorE1.cpp:128
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
SUMOXMLDefinitions::isValidListOfTypeID
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
Definition: SUMOXMLDefinitions.cpp:1317
SUMO_ATTR_NAME
@ SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:546
GNEUndoList
Definition: GNEUndoList.h:42
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:583
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
RGBColor::changedBrightness
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:200
SUMO_TAG_E1DETECTOR
@ SUMO_TAG_E1DETECTOR
an e1 detector
Definition: SUMOXMLDefinitions.h:79
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
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEDetector::drawE1Shape
void drawE1Shape(const GUIVisualizationSettings &s, const double exaggeration, const double scaledWidth, const RGBColor &mainColor, const RGBColor &secondColor) const
draw E1 shape
Definition: GNEDetector.cpp:165
GNEChange_Attribute.h
GNENet.h
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:192
GNEUndoList.h