Eclipse SUMO - Simulation of Urban MObility
GNEDetectorE1Instant.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 "GNEDetectorE1Instant.h"
27 #include "GNEAdditionalHandler.h"
28 
29 
30 // ===========================================================================
31 // member method definitions
32 // ===========================================================================
33 
36  // reset default values
37  resetDefaultValues();
38 }
39 
40 
41 GNEDetectorE1Instant::GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNENet* net, const double pos, const std::string& filename, const std::vector<std::string>& vehicleTypes,
42  const std::string& name, const bool friendlyPos, const Parameterised::Map& parameters) :
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 (myFilename.size() > 0) {
66  }
67  if (myVehicleTypes.size() > 0) {
69  }
70  if (myFriendlyPosition) {
71  device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true);
72  }
73  // write parameters (Always after children to avoid problems with additionals.xsd)
74  writeParams(device);
75  device.closeTag();
76 }
77 
78 
79 bool
81  // with friendly position enabled position are "always fixed"
82  if (myFriendlyPosition) {
83  return true;
84  } else {
85  return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
86  }
87 }
88 
89 
90 std::string
92  // obtain final length
93  const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
94  // check if detector has a problem
96  return "";
97  } else {
98  // declare variable for error position
99  std::string errorPosition;
100  // check positions over lane
101  if (myPositionOverLane < 0) {
102  errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0");
103  }
104  if (myPositionOverLane > len) {
105  errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length");
106  }
107  return errorPosition;
108  }
109 }
110 
111 
112 void
114  // declare new position
115  double newPositionOverLane = myPositionOverLane;
116  // fix pos and length checkAndFixDetectorPosition
117  double length = 0;
118  GNEAdditionalHandler::fixLanePosition(newPositionOverLane, length, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
119  // set new position
120  setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList());
121 }
122 
123 
124 void
126  // update geometry
128  // update centering boundary without updating grid
130 }
131 
132 
133 void
135  // Obtain exaggeration of the draw
136  const double E1InstantExaggeration = getExaggeration(s);
137  // first check if additional has to be drawn
139  // check exaggeration
140  if (s.drawAdditionals(E1InstantExaggeration)) {
141  // obtain scaledSize
142  const double scaledWidth = s.detectorSettings.E1InstantWidth * 0.5 * s.scale;
143  // declare colors
144  RGBColor mainColor, secondColor, textColor;
145  // set color
146  if (drawUsingSelectColor()) {
148  secondColor = mainColor.changedBrightness(-32);
149  textColor = mainColor.changedBrightness(32);
150  } else {
151  mainColor = s.detectorSettings.E1InstantColor;
152  secondColor = RGBColor::WHITE;
153  textColor = RGBColor::BLACK;
154  }
155  // draw parent and child lines
157  // start drawing
159  // push layer matrix
161  // translate to front
163  // draw E1Instant shape
164  drawE1Shape(s, E1InstantExaggeration, scaledWidth, mainColor, secondColor);
165  // Check if the distance is enought to draw details
166  if (s.drawDetail(s.detailSettings.detectorDetails, E1InstantExaggeration)) {
167  // draw E1 Logo
168  drawDetectorLogo(s, E1InstantExaggeration, "E1", textColor);
169  }
170  // pop layer matrix
172  // Pop name
174  // draw lock icon
176  // check if dotted contours has to be drawn
179  }
180  if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
182  }
183  }
184  // Draw additional ID
185  drawAdditionalID(s);
186  // draw additional name
188  }
189 }
190 
191 
192 std::string
194  switch (key) {
195  case SUMO_ATTR_ID:
196  return getMicrosimID();
197  case SUMO_ATTR_LANE:
198  return getParentLanes().front()->getID();
199  case SUMO_ATTR_POSITION:
201  case SUMO_ATTR_NAME:
202  return myAdditionalName;
203  case SUMO_ATTR_FILE:
204  return myFilename;
205  case SUMO_ATTR_VTYPES:
206  return toString(myVehicleTypes);
209  case GNE_ATTR_SELECTED:
211  case GNE_ATTR_PARAMETERS:
212  return getParametersStr();
214  return "";
215  default:
216  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
217  }
218 }
219 
220 
221 double
223  switch (key) {
224  case SUMO_ATTR_POSITION:
225  return myPositionOverLane;
226  default:
227  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
228  }
229 }
230 
231 
232 void
233 GNEDetectorE1Instant::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
234  switch (key) {
235  case SUMO_ATTR_ID:
236  case SUMO_ATTR_LANE:
237  case SUMO_ATTR_POSITION:
238  case SUMO_ATTR_NAME:
239  case SUMO_ATTR_FILE:
240  case SUMO_ATTR_VTYPES:
242  case GNE_ATTR_SELECTED:
243  case GNE_ATTR_PARAMETERS:
245  undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
246  break;
247  default:
248  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
249  }
250 
251 }
252 
253 
254 bool
255 GNEDetectorE1Instant::isValid(SumoXMLAttr key, const std::string& value) {
256  switch (key) {
257  case SUMO_ATTR_ID:
258  return isValidDetectorID(value);
259  case SUMO_ATTR_LANE:
260  if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) {
261  return true;
262  } else {
263  return false;
264  }
265  case SUMO_ATTR_POSITION:
266  return canParse<double>(value) && fabs(parse<double>(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
267  case SUMO_ATTR_NAME:
269  case SUMO_ATTR_FILE:
271  case SUMO_ATTR_VTYPES:
272  if (value.empty()) {
273  return true;
274  } else {
276  }
278  return canParse<bool>(value);
279  case GNE_ATTR_SELECTED:
280  return canParse<bool>(value);
281  case GNE_ATTR_PARAMETERS:
282  return areParametersValid(value);
283  default:
284  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
285  }
286 }
287 
288 // ===========================================================================
289 // private
290 // ===========================================================================
291 
292 void
293 GNEDetectorE1Instant::setAttribute(SumoXMLAttr key, const std::string& value) {
294  switch (key) {
295  case SUMO_ATTR_ID:
296  // update microsimID
297  setMicrosimID(value);
298  break;
299  case SUMO_ATTR_LANE:
301  break;
302  case SUMO_ATTR_POSITION:
303  myPositionOverLane = parse<double>(value);
304  break;
305  case SUMO_ATTR_NAME:
306  myAdditionalName = value;
307  break;
308  case SUMO_ATTR_FILE:
309  myFilename = value;
310  break;
311  case SUMO_ATTR_VTYPES:
312  myVehicleTypes = parse<std::vector<std::string> >(value);
313  break;
315  myFriendlyPosition = parse<bool>(value);
316  break;
317  case GNE_ATTR_SELECTED:
318  if (parse<bool>(value)) {
320  } else {
322  }
323  break;
324  case GNE_ATTR_PARAMETERS:
325  setParametersStr(value);
326  break;
328  shiftLaneIndex();
329  break;
330  default:
331  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
332  }
333 }
334 
335 
336 void
338  // change position
339  myPositionOverLane = moveResult.newFirstPos;
340  // set lateral offset
342  // update geometry
343  updateGeometry();
344 }
345 
346 
347 void
349  // reset lateral offset
351  // begin change attribute
352  undoList->begin(myTagProperty.getGUIIcon(), "position of " + getTagStr());
353  // set startPosition
354  setAttribute(SUMO_ATTR_POSITION, toString(moveResult.newFirstPos), undoList);
355  // check if lane has to be changed
356  if (moveResult.newFirstLane) {
357  // set new lane
358  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
359  }
360  // end change attribute
361  undoList->end();
362 }
363 
364 /****************************************************************************/
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
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
GNEDetectorE1Instant::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorE1Instant.cpp:113
GNEDetectorE1Instant::getAttributeDouble
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEDetectorE1Instant.cpp:222
GNEDetectorE1Instant::commitMoveShape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNEDetectorE1Instant.cpp:348
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
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
GNEMoveResult
move result
Definition: GNEMoveElement.h:179
GNEDetectorE1Instant::writeAdditional
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition: GNEDetectorE1Instant.cpp:56
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
GNEDetectorE1Instant::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorE1Instant.cpp:193
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
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
GNEDetectorE1Instant::~GNEDetectorE1Instant
~GNEDetectorE1Instant()
Destructor.
Definition: GNEDetectorE1Instant.cpp:51
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
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
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:151
GNEDetectorE1Instant::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML
Definition: GNEDetectorE1Instant.cpp:80
GNEMoveResult::newFirstPos
double newFirstPos
new first position
Definition: GNEMoveElement.h:207
GLO_E1DETECTOR_INSTANT
@ GLO_E1DETECTOR_INSTANT
a E1 detector
Definition: GUIGlObjectTypes.h:88
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
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
GNE_ATTR_PARAMETERS
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:1331
GNEDetectorE1Instant.h
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
GNEDetectorE1Instant::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorE1Instant.cpp:125
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
GNEDetectorE1Instant::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEDetectorE1Instant.cpp:233
GNEDetector
Definition: GNEDetector.h:31
GNEDetectorE1Instant::setMoveShape
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNEDetectorE1Instant.cpp:337
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
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
SUMO_ATTR_POSITION
@ SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:526
GUIVisualizationDetectorSettings::E1InstantWidth
static const double E1InstantWidth
E1 Instant detector widths.
Definition: GUIVisualizationSettings.h:406
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1935
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:997
GNEDetectorE1Instant::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorE1Instant.cpp:134
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
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
GNEDetectorE1Instant::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorE1Instant.cpp:91
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
PositionVector::getCentroid
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
Definition: PositionVector.cpp:418
GNEDetectorE1Instant::GNEDetectorE1Instant
GNEDetectorE1Instant(GNENet *net)
default Constructor
Definition: GNEDetectorE1Instant.cpp:34
GLHelper::popMatrix
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
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
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
GNEDetectorE1Instant::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition: GNEDetectorE1Instant.cpp:255
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
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
GUIVisualizationDetectorSettings::E1InstantColor
static const RGBColor E1InstantColor
color for E1 Instant detectors
Definition: GUIVisualizationSettings.h:403
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
SUMO_TAG_INSTANT_INDUCTION_LOOP
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
Definition: SUMOXMLDefinitions.h:103
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:192
GNEUndoList.h