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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 //
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
28 #include <utils/gui/div/GLHelper.h>
30 
31 #include "GNEDetectorE1.h"
32 #include "GNEAdditionalHandler.h"
33 
34 
35 // ===========================================================================
36 // member method definitions
37 // ===========================================================================
38 
39 GNEDetectorE1::GNEDetectorE1(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) :
40  GNEDetector(id, viewNet, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, {
41  lane
42 }) {
43 }
44 
45 
47 }
48 
49 
50 bool
52  // with friendly position enabled position are "always fixed"
53  if (myFriendlyPosition) {
54  return true;
55  } else {
56  return fabs(myPositionOverLane) <= getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
57  }
58 }
59 
60 
61 std::string
63  // declare variable for error position
64  std::string errorPosition;
65  const double len = getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
66  // check positions over lane
67  if (myPositionOverLane < -len) {
68  errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0");
69  }
70  if (myPositionOverLane > len) {
71  errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length");
72  }
73  return errorPosition;
74 }
75 
76 
77 void
79  // declare new position
80  double newPositionOverLane = myPositionOverLane;
81  // fix pos and lenght checkAndFixDetectorPosition
82  GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength(), true);
83  // set new position
85 }
86 
87 
88 void
90  // Calculate new position using old position
91  Position newPosition = myMove.originalViewPosition;
92  newPosition.add(offset);
93  // filtern position using snap to active grid
94  newPosition = myViewNet->snapToActiveGrid(newPosition);
95  const bool storeNegative = myPositionOverLane < 0;
96  myPositionOverLane = getLaneParents().front()->getGeometry().shape.nearest_offset_to_point2D(newPosition, false);
97  if (storeNegative) {
98  myPositionOverLane -= getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
99  }
100  // Update geometry
101  updateGeometry();
102 }
103 
104 
105 void
107  // commit new position allowing undo/redo
108  undoList->p_begin("position of " + getTagStr());
110  undoList->p_end();
111 }
112 
113 
114 void
116  // Clear all containers
118 
119  // obtain position over lane
120  myGeometry.shape.push_back(getPositionInView());
121 
122  // Obtain first position
123  Position f = myGeometry.shape[0] - Position(1, 0);
124 
125  // Obtain next position
126  Position s = myGeometry.shape[0] + Position(1, 0);
127 
128  // Save rotation (angle) of the vector constructed by points f and s
129  myGeometry.shapeRotations.push_back(getLaneParents().front()->getGeometry().shape.rotationDegreeAtOffset(getGeometryPositionOverLane()) * -1);
130 
131  // Set block icon position
133 
134  // Set offset of the block icon
135  myBlockIcon.offset = Position(-1, 0);
136 
137  // Set block icon rotation, and using their rotation for logo
139 }
140 
141 
142 void
144  // get values
145  const double width = (double) 2.0 * s.scale;
146  const double exaggeration = s.addSize.getExaggeration(s, this);
147  // start drawing
148  glPushName(getGlID());
149  glLineWidth(1.0);
150  // set color
151  if (drawUsingSelectColor()) {
153  } else {
155  }
156  // draw shape
157  glPushMatrix();
158  glTranslated(0, 0, getType());
159  glTranslated(myGeometry.shape[0].x(), myGeometry.shape[0].y(), 0);
160  glRotated(myGeometry.shapeRotations[0], 0, 0, 1);
161  glScaled(exaggeration, exaggeration, 1);
162  glBegin(GL_QUADS);
163  glVertex2d(-1.0, 2);
164  glVertex2d(-1.0, -2);
165  glVertex2d(1.0, -2);
166  glVertex2d(1.0, 2);
167  glEnd();
168  glTranslated(0, 0, .01);
169  glBegin(GL_LINES);
170  glVertex2d(0, 2 - .1);
171  glVertex2d(0, -2 + .1);
172  glEnd();
173  // outline if isn't being drawn for selecting
174  if ((width * exaggeration > 1) && !s.drawForSelecting) {
175  // set color
176  if (drawUsingSelectColor()) {
178  } else {
180  }
181  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
182  glBegin(GL_QUADS);
183  glVertex2f(-1.0, 2);
184  glVertex2f(-1.0, -2);
185  glVertex2f(1.0, -2);
186  glVertex2f(1.0, 2);
187  glEnd();
188  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
189  }
190  // position indicator if isn't being drawn for selecting
191  if ((width * exaggeration > 1) && !s.drawForSelecting) {
192  // set color
193  if (drawUsingSelectColor()) {
195  } else {
197  }
198  glRotated(90, 0, 0, -1);
199  glBegin(GL_LINES);
200  glVertex2d(0, 1.7);
201  glVertex2d(0, -1.7);
202  glEnd();
203  }
204  // Pop shape matrix
205  glPopMatrix();
206  // Check if the distance is enought to draw details and isn't being drawn for selecting
207  if ((s.drawDetail(s.detailSettings.detectorDetails, exaggeration)) && !s.drawForSelecting) {
208  // Push matrix
209  glPushMatrix();
210  // Traslate to center of detector
211  glTranslated(myGeometry.shape.getLineCenter().x(), myGeometry.shape.getLineCenter().y(), getType() + 0.1);
212  // Rotate depending of myBlockIcon.rotation
213  glRotated(myBlockIcon.rotation, 0, 0, -1);
214  //move to logo position
215  glTranslated(-1, 0, 0);
216  // draw E1 logo
217  if (drawUsingSelectColor()) {
219  } else {
220  GLHelper::drawText("E1", Position(), .1, 1.5, RGBColor::BLACK);
221  }
222  // pop matrix
223  glPopMatrix();
224  // Show Lock icon depending of the Edit mode
225  myBlockIcon.drawIcon(s, exaggeration);
226  }
227  // Finish draw if isn't being drawn for selecting
228  if (!s.drawForSelecting) {
230  }
231  // check if dotted contour has to be drawn
232  if (myViewNet->getDottedAC() == this) {
234  }
235  // pop name
236  glPopName();
237 }
238 
239 
240 std::string
242  switch (key) {
243  case SUMO_ATTR_ID:
244  return getAdditionalID();
245  case SUMO_ATTR_LANE:
246  return getLaneParents().front()->getID();
247  case SUMO_ATTR_POSITION:
249  case SUMO_ATTR_FREQUENCY:
250  return time2string(myFreq);
251  case SUMO_ATTR_NAME:
252  return myAdditionalName;
253  case SUMO_ATTR_FILE:
254  return myFilename;
255  case SUMO_ATTR_VTYPES:
256  return myVehicleTypes;
260  return toString(myBlockMovement);
261  case GNE_ATTR_SELECTED:
263  case GNE_ATTR_GENERIC:
264  return getGenericParametersStr();
265  default:
266  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
267  }
268 }
269 
270 
271 void
272 GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
273  if (value == getAttribute(key)) {
274  return; //avoid needless changes, later logic relies on the fact that attributes have changed
275  }
276  switch (key) {
277  case SUMO_ATTR_ID:
278  case SUMO_ATTR_LANE:
279  case SUMO_ATTR_POSITION:
280  case SUMO_ATTR_FREQUENCY:
281  case SUMO_ATTR_NAME:
282  case SUMO_ATTR_FILE:
283  case SUMO_ATTR_VTYPES:
286  case GNE_ATTR_SELECTED:
287  case GNE_ATTR_GENERIC:
288  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
289  break;
290  default:
291  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
292  }
293 
294 }
295 
296 
297 bool
298 GNEDetectorE1::isValid(SumoXMLAttr key, const std::string& value) {
299  switch (key) {
300  case SUMO_ATTR_ID:
301  return isValidDetectorID(value);
302  case SUMO_ATTR_LANE:
303  if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) {
304  return true;
305  } else {
306  return false;
307  }
308  case SUMO_ATTR_POSITION:
309  return canParse<double>(value) && fabs(parse<double>(value)) < getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
310  case SUMO_ATTR_FREQUENCY:
311  return (canParse<double>(value) && (parse<double>(value) >= 0));
312  case SUMO_ATTR_NAME:
314  case SUMO_ATTR_FILE:
316  case SUMO_ATTR_VTYPES:
317  if (value.empty()) {
318  return true;
319  } else {
321  }
323  return canParse<bool>(value);
325  return canParse<bool>(value);
326  case GNE_ATTR_SELECTED:
327  return canParse<bool>(value);
328  case GNE_ATTR_GENERIC:
329  return isGenericParametersValid(value);
330  default:
331  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
332  }
333 }
334 
335 // ===========================================================================
336 // private
337 // ===========================================================================
338 
339 void
340 GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value) {
341  switch (key) {
342  case SUMO_ATTR_ID:
343  changeAdditionalID(value);
344  break;
345  case SUMO_ATTR_LANE:
346  changeLaneParents(this, value);
347  break;
348  case SUMO_ATTR_POSITION:
349  myPositionOverLane = parse<double>(value);
350  break;
351  case SUMO_ATTR_FREQUENCY:
352  myFreq = parse<SUMOTime>(value);
353  break;
354  case SUMO_ATTR_FILE:
355  myFilename = value;
356  break;
357  case SUMO_ATTR_NAME:
358  myAdditionalName = value;
359  break;
360  case SUMO_ATTR_VTYPES:
361  myVehicleTypes = value;
362  break;
364  myFriendlyPosition = parse<bool>(value);
365  break;
367  myBlockMovement = parse<bool>(value);
368  break;
369  case GNE_ATTR_SELECTED:
370  if (parse<bool>(value)) {
372  } else {
374  }
375  break;
376  case GNE_ATTR_GENERIC:
378  break;
379  default:
380  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
381  }
382 }
383 
384 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:181
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:988
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:272
GNEAdditional::BlockIcon::position
Position position
position of the block icon
Definition: GNEAdditional.h:351
GNEAdditional::setGenericParametersStr
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Definition: GNEAdditional.cpp:704
GNEAdditional::getAdditionalID
const std::string & getAdditionalID() const
Definition: GNEAdditional.cpp:578
GNEDetectorE1::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorE1.cpp:62
GNEAdditional::AdditionalGeometry::shape
PositionVector shape
The shape of the additional element.
Definition: GNEAdditional.h:68
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:994
GNEAdditional::BlockIcon::setRotation
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
Definition: GNEAdditional.cpp:502
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:355
RGBColor::BLACK
static const RGBColor BLACK
Definition: RGBColor.h:198
GNEUndoList::p_end
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:80
GNEDetector::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEDetector.cpp:74
GNEDetectorE1::GNEDetectorE1
GNEDetectorE1(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, SUMOTime freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Constructor.
Definition: GNEDetectorE1.cpp:39
GNEAdditional::AdditionalGeometry::shapeRotations
std::vector< double > shapeRotations
The rotations of the single shape parts.
Definition: GNEAdditional.h:74
GNEAttributeCarrier::isGenericParametersValid
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
Definition: GNEAttributeCarrier.cpp:1354
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
GNEViewNet
Definition: GNEViewNet.h:43
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
GLHelper.h
SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:635
GNEAdditional::changeAdditionalID
void changeAdditionalID(const std::string &newID)
change ID of additional
Definition: GNEAdditional.cpp:604
GNEDetector::myPositionOverLane
double myPositionOverLane
position of detector over Lane
Definition: GNEDetector.h:161
GNEAdditional::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNEAdditional.cpp:634
GNEAdditional::myBlockIcon
BlockIcon myBlockIcon
variable BlockIcon
Definition: GNEAdditional.h:380
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
GNEDetector::myFriendlyPosition
bool myFriendlyPosition
Flag for friendly position.
Definition: GNEDetector.h:173
SUMO_ATTR_FILE
Definition: SUMOXMLDefinitions.h:662
GUISUMOAbstractView::snapToActiveGrid
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
Definition: GUISUMOAbstractView.cpp:194
GUIVisualizationDetailSettings::detectorDetails
static const double detectorDetails
details for detectors
Definition: GUIVisualizationSettings.h:305
GNEAdditional::myMove
AdditionalMove myMove
variable AdditionalMove
Definition: GNEAdditional.h:371
GNEAdditional::myViewNet
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
Definition: GNEAdditional.h:365
GNEDetector::getGeometryPositionOverLane
double getGeometryPositionOverLane() const
get position over lane that is applicable to the shape
Definition: GNEDetector.cpp:90
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
GNEHierarchicalElementParents::getLaneParents
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
Definition: GNEHierarchicalElementParents.cpp:182
GNEUndoList::p_add
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Definition: GNEUndoList.cpp:132
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
GNEAdditional::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEAdditional.cpp:650
GNEDetectorE1::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEDetectorE1.cpp:106
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, int align=0, double width=-1)
Definition: GLHelper.cpp:668
GUIVisualizationSettings::addName
GUIVisualizationTextSettings addName
Definition: GUIVisualizationSettings.h:582
GNEAdditional::isValidDetectorID
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
Definition: GNEAdditional.cpp:594
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:655
GNEDetector::myVehicleTypes
std::string myVehicleTypes
attribute vehicle types
Definition: GNEDetector.h:170
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:148
GNEDetectorE1::~GNEDetectorE1
~GNEDetectorE1()
Destructor.
Definition: GNEDetectorE1.cpp:46
GNEDetectorE1.h
GNEAdditional::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
Definition: GNEAdditional.cpp:619
GNEDetectorE1::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
Definition: GNEDetectorE1.cpp:51
GNEViewNet.h
GNEAdditionalHandler.h
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:150
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:939
GNEDetectorE1::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorE1.cpp:78
GLHelper::drawShapeDottedContourRectangle
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position &center, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
Definition: GLHelper.cpp:555
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:623
GNEAdditional::AdditionalGeometry::clearGeometry
void clearGeometry()
reset geometry
Definition: GNEAdditional.cpp:53
GNEDetector
Definition: GNEDetector.h:34
GLO_E1DETECTOR
a E1 detector
Definition: GUIGlObjectTypes.h:72
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
Position::x
double x() const
Returns the x-position.
Definition: Position.h:57
GNEEdge.h
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
GNEDetectorE1::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorE1.cpp:241
GNEAdditional::myAdditionalName
std::string myAdditionalName
name of additional
Definition: GNEAdditional.h:374
GNEDetectorE1::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEDetectorE1.cpp:89
GNEAdditional::myBlockMovement
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
Definition: GNEAdditional.h:377
GNEAdditional::BlockIcon::rotation
double rotation
The rotation of the block icon.
Definition: GNEAdditional.h:357
SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:762
GNELane.h
SUMO_ATTR_FREQUENCY
Definition: SUMOXMLDefinitions.h:660
SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:658
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:649
GUIVisualizationColorSettings::selectionColor
RGBColor selectionColor
basic selection color
Definition: GUIVisualizationSettings.h:130
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GNE_ATTR_GENERIC
generic attribute
Definition: SUMOXMLDefinitions.h:986
GNEAdditional::BlockIcon::drawIcon
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
Definition: GNEAdditional.cpp:518
GNEDetectorE1::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorE1.cpp:143
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
SUMO_ATTR_VTYPES
Definition: SUMOXMLDefinitions.h:630
InvalidArgument
Definition: UtilExceptions.h:57
GNEAdditional::getGenericParametersStr
std::string getGenericParametersStr() const
return generic parameters in string format
Definition: GNEAdditional.cpp:678
GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:978
GNEDetector::myFilename
std::string myFilename
The path to the output file.
Definition: GNEDetector.h:167
GNEAdditional::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEAdditional.cpp:656
GNEHierarchicalElementParents::changeLaneParents
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
Definition: GNEHierarchicalElementParents.cpp:460
GNEAdditional::myGeometry
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
Definition: GNEAdditional.h:368
GNEDetector::myFreq
SUMOTime myFreq
The aggregation period the values the detector collects shall be summed up.
Definition: GNEDetector.h:164
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
GNEDetectorE1::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEDetectorE1.cpp:298
GUIVisualizationColorSettings::E1
static const RGBColor E1
color for E1 detectors
Definition: GUIVisualizationSettings.h:208
GUIVisualizationSettings::addSize
GUIVisualizationSizeSettings addSize
Definition: GUIVisualizationSettings.h:580
Position::add
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:127
GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:968
GNEDetectorE1::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorE1.cpp:115
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:1621
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1165
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:1017
SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:381
GNEUndoList
Definition: GNEUndoList.h:49
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
PositionVector::getLineCenter
Position getLineCenter() const
get line center
Definition: PositionVector.cpp:466
GNEUndoList::p_begin
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:73
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
SUMO_TAG_E1DETECTOR
an e1 detector
Definition: SUMOXMLDefinitions.h:64
GNEAdditional::AdditionalMove::originalViewPosition
Position originalViewPosition
value for saving first original position over lane before moving
Definition: GNEAdditional.h:329
GNEAdditional::AdditionalMove::firstOriginalLanePosition
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
Definition: GNEAdditional.h:332
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEAdditionalHandler::checkAndFixDetectorPosition
static bool checkAndFixDetectorPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
Definition: GNEAdditionalHandler.cpp:977
GNEChange_Attribute.h
GNENet.h
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
GNEAdditional::BlockIcon::offset
Position offset
The offSet of the block icon.
Definition: GNEAdditional.h:354
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:197
GNEUndoList.h
GUIVisualizationSettings::drawForSelecting
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
Definition: GUIVisualizationSettings.h:635