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-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 "GNEDetectorEntryExit.h"
32 #include "GNEAdditionalHandler.h"
33 
34 
35 // ===========================================================================
36 // member method definitions
37 // ===========================================================================
38 
39 GNEDetectorEntryExit::GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet* viewNet, GNEAdditional* parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) :
40  GNEDetector(parent, viewNet, GLO_DET_ENTRY, entryExitTag, pos, 0, "", "", friendlyPos, blockMovement, {
41  lane
42 }) {
43  //check that this is a TAZ Source OR a TAZ Sink
44  if ((entryExitTag != SUMO_TAG_DET_ENTRY) && (entryExitTag != SUMO_TAG_DET_EXIT)) {
45  throw InvalidArgument("Invalid E3 Child Tag");
46  }
47 }
48 
49 
51 
52 
53 bool
55  // with friendly position enabled position are "always fixed"
56  if (myFriendlyPosition) {
57  return true;
58  } else {
59  return fabs(myPositionOverLane) <= getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
60  }
61 }
62 
63 
64 std::string
66  // declare variable for error position
67  std::string errorPosition;
68  const double len = getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
69  // check positions over lane
70  if (myPositionOverLane < -len) {
71  errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0");
72  }
73  if (myPositionOverLane > len) {
74  errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length");
75  }
76  return errorPosition;
77 }
78 
79 
80 void
82  // declare new position
83  double newPositionOverLane = myPositionOverLane;
84  // fix pos and lenght checkAndFixDetectorPosition
85  GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength(), true);
86  // set new position
88 }
89 
90 
91 void
93  // Calculate new position using old position
94  Position newPosition = myMove.originalViewPosition;
95  newPosition.add(offset);
96  // filtern position using snap to active grid
97  newPosition = myViewNet->snapToActiveGrid(newPosition);
98  const bool storeNegative = myPositionOverLane < 0;
99  myPositionOverLane = getLaneParents().front()->getGeometry().shape.nearest_offset_to_point2D(newPosition, false);
100  if (storeNegative) {
101  myPositionOverLane -= getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
102  }
103  // Update geometry
104  updateGeometry();
105 }
106 
107 
108 void
110  // commit new position allowing undo/redo
111  undoList->p_begin("position of " + getTagStr());
113  undoList->p_end();
114 }
115 
116 
117 void
119  // Clear all containers
121 
122  // obtain position over lane
123  myGeometry.shape.push_back(getPositionInView());
124 
125  // Obtain first position
126  Position f = myGeometry.shape[0] - Position(1, 0);
127 
128  // Obtain next position
129  Position s = myGeometry.shape[0] + Position(1, 0);
130 
131  // Save rotation (angle) of the vector constructed by points f and s
132  myGeometry.shapeRotations.push_back(getLaneParents().front()->getGeometry().shape.rotationDegreeAtOffset(getGeometryPositionOverLane()) * -1);
133 
134  // Set block icon position
136 
137  // Set offset of the block icon
138  myBlockIcon.offset = Position(-1, 0);
139 
140  // Set block icon rotation, and using their rotation for logo
142 
143  // update E3 parent children
144  getAdditionalParents().at(0)->updateChildConnections();
145 }
146 
147 
148 void
150  // Set initial values
151  const double exaggeration = s.addSize.getExaggeration(s, this);
152  // Start drawing adding gl identificator
153  glPushName(getGlID());
154  // Push detector matrix
155  glPushMatrix();
156  glTranslated(0, 0, getType());
157  // Set color
158  if (drawUsingSelectColor()) {
160  } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) {
162  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
164  }
165  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
166  // Push polygon matrix
167  glPushMatrix();
168  glScaled(exaggeration, exaggeration, 1);
169  glTranslated(myGeometry.shape[0].x(), myGeometry.shape[0].y(), 0);
170  glRotated(myGeometry.shapeRotations[0], 0, 0, 1);
171  // draw details if isn't being drawn for selecting
172  if (!s.drawForSelecting) {
173  // Draw polygon
174  glBegin(GL_LINES);
175  glVertex2d(1.7, 0);
176  glVertex2d(-1.7, 0);
177  glEnd();
178  glBegin(GL_QUADS);
179  glVertex2d(-1.7, .5);
180  glVertex2d(-1.7, -.5);
181  glVertex2d(1.7, -.5);
182  glVertex2d(1.7, .5);
183  glEnd();
184  // first Arrow
185  glTranslated(1.5, 0, 0);
186  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
187  GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25);
188  // second Arrow
189  glTranslated(-3, 0, 0);
190  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
191  GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25);
192  } else {
193  // Draw square in drawy for selecting mode
194  glBegin(GL_QUADS);
195  glVertex2d(-1.7, 4.3);
196  glVertex2d(-1.7, -.5);
197  glVertex2d(1.7, -.5);
198  glVertex2d(1.7, 4.3);
199  glEnd();
200  }
201  // Pop polygon matrix
202  glPopMatrix();
203  // Pop detector matrix
204  glPopMatrix();
205  // Check if the distance is enought to draw details
206  if (!s.drawForSelecting && s.drawDetail(s.detailSettings.detectorDetails, exaggeration)) {
207  // Push matrix
208  glPushMatrix();
209  // Traslate to center of detector
210  glTranslated(myGeometry.shape.getLineCenter().x(), myGeometry.shape.getLineCenter().y(), getType() + 0.1);
211  // Rotate depending of myBlockIcon.rotation
212  glRotated(myBlockIcon.rotation, 0, 0, -1);
213  //move to logo position
214  glTranslated(1.9, 0, 0);
215  // draw Entry or Exit logo if isn't being drawn for selecting
216  if (s.drawForSelecting) {
218  GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1);
219  } else if (drawUsingSelectColor()) {
221  } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) {
222  GLHelper::drawText("E3", Position(), .1, 2.8, s.colorSettings.E3Entry);
223  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
224  GLHelper::drawText("E3", Position(), .1, 2.8, s.colorSettings.E3Exit);
225  }
226  //move to logo position
227  glTranslated(1.7, 0, 0);
228  // Rotate depending of myBlockIcon.rotation
229  glRotated(90, 0, 0, 1);
230  // draw Entry or Exit text if isn't being drawn for selecting
231  if (s.drawForSelecting) {
233  GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1);
234  } else if (drawUsingSelectColor()) {
237  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
239  }
240  } else {
242  GLHelper::drawText("Entry", Position(), .1, 1, s.colorSettings.E3Entry);
243  } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) {
244  GLHelper::drawText("Exit", Position(), .1, 1, s.colorSettings.E3Exit);
245  }
246  }
247  // pop matrix
248  glPopMatrix();
249  // draw lock icon
250  myBlockIcon.drawIcon(s, exaggeration, 0.4);
251  }
252  // Draw name if isn't being drawn for selecting
253  if (!s.drawForSelecting) {
255  }
256  // check if dotted contour has to be drawn
257  if (myViewNet->getDottedAC() == this) {
259  }
260  // pop gl identificator
261  glPopName();
262 }
263 
264 
265 std::string
267  switch (key) {
268  case SUMO_ATTR_ID:
269  return getAdditionalID();
270  case SUMO_ATTR_LANE:
271  return getLaneParents().front()->getID();
272  case SUMO_ATTR_POSITION:
277  return toString(myBlockMovement);
278  case GNE_ATTR_PARENT:
279  return getAdditionalParents().at(0)->getID();
280  case GNE_ATTR_SELECTED:
282  case GNE_ATTR_GENERIC:
283  return getGenericParametersStr();
284  default:
285  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
286  }
287 }
288 
289 
290 void
291 GNEDetectorEntryExit::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
292  if (value == getAttribute(key)) {
293  return; //avoid needless changes, later logic relies on the fact that attributes have changed
294  }
295  switch (key) {
296  case SUMO_ATTR_ID:
297  case SUMO_ATTR_LANE:
298  case SUMO_ATTR_POSITION:
301  case GNE_ATTR_PARENT:
302  case GNE_ATTR_SELECTED:
303  case GNE_ATTR_GENERIC:
304  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
305  break;
306  default:
307  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
308  }
309 }
310 
311 
312 bool
313 GNEDetectorEntryExit::isValid(SumoXMLAttr key, const std::string& value) {
314  switch (key) {
315  case SUMO_ATTR_ID:
316  return isValidAdditionalID(value);
317  case SUMO_ATTR_LANE:
318  return (myViewNet->getNet()->retrieveLane(value, false) != nullptr);
319  case SUMO_ATTR_POSITION:
320  return canParse<double>(value) && fabs(parse<double>(value)) < getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
322  return canParse<bool>(value);
324  return canParse<bool>(value);
325  case GNE_ATTR_PARENT:
326  return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_E3DETECTOR, value, false) != nullptr);
327  case GNE_ATTR_SELECTED:
328  return canParse<bool>(value);
329  case GNE_ATTR_GENERIC:
330  return isGenericParametersValid(value);
331  default:
332  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
333  }
334 }
335 
336 void
337 GNEDetectorEntryExit::setAttribute(SumoXMLAttr key, const std::string& value) {
338  switch (key) {
339  case SUMO_ATTR_ID:
340  changeAdditionalID(value);
341  break;
342  case SUMO_ATTR_LANE:
343  changeLaneParents(this, value);
344  break;
345  case SUMO_ATTR_POSITION:
346  myPositionOverLane = parse<double>(value);
347  break;
349  myFriendlyPosition = parse<bool>(value);
350  break;
352  myBlockMovement = parse<bool>(value);
353  break;
354  case GNE_ATTR_PARENT:
355  changeAdditionalParent(this, value, 0);
356  break;
357  case GNE_ATTR_SELECTED:
358  if (parse<bool>(value)) {
360  } else {
362  }
363  break;
364  case GNE_ATTR_GENERIC:
366  break;
367  default:
368  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
369  }
370 }
371 
372 /****************************************************************************/
GLO_DET_ENTRY
a DetEntry detector
Definition: GUIGlObjectTypes.h:82
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:181
GNEAdditional::BlockIcon::position
Position position
position of the block icon
Definition: GNEAdditional.h:351
GNENet::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
GNEDetectorEntryExit.h
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
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
GNEAdditional::AdditionalGeometry::shape
PositionVector shape
The shape of the additional element.
Definition: GNEAdditional.h:68
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
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
GNEHierarchicalElementParents::changeAdditionalParent
void changeAdditionalParent(GNEShape *shapeTobeChanged, const std::string &newAdditionalParentID, int additionalParentIndex)
change additional parent of a shape
Definition: GNEHierarchicalElementParents.cpp:480
GNEDetector::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEDetector.cpp:74
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
GNEViewNet
Definition: GNEViewNet.h:43
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:379
SUMO_TAG_DET_ENTRY
an e3 entry point
Definition: SUMOXMLDefinitions.h:82
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
GNEDetectorEntryExit::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEDetectorEntryExit.cpp:92
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
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:42
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
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:521
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
GNEDetectorEntryExit::GNEDetectorEntryExit
GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet *viewNet, GNEAdditional *parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Constructor.
Definition: GNEDetectorEntryExit.cpp:39
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
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
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:655
GUIVisualizationColorSettings::selectedAdditionalColor
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
Definition: GUIVisualizationSettings.h:148
GNEDetectorEntryExit::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
Definition: GNEDetectorEntryExit.cpp:54
GNEDetectorEntryExit::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorEntryExit.cpp:81
GNEAdditional::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
Definition: GNEAdditional.cpp:619
GNEViewNet.h
GUIVisualizationColorSettings::E3Entry
static const RGBColor E3Entry
color for Entrys
Definition: GUIVisualizationSettings.h:217
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
GNEDetectorEntryExit::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorEntryExit.cpp:65
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
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
GNEAttributeCarrier::myTagProperty
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
Definition: GNEAttributeCarrier.h:792
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
GNEDetectorEntryExit::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorEntryExit.cpp:266
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
GNEDetectorEntryExit::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorEntryExit.cpp:149
SUMO_ATTR_FRIENDLY_POS
Definition: SUMOXMLDefinitions.h:762
GNELane.h
SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:658
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:649
GLIncludes.h
GUIVisualizationColorSettings::E3Exit
static const RGBColor E3Exit
color for Exits
Definition: GUIVisualizationSettings.h:220
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
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
GNEDetectorEntryExit::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorEntryExit.cpp:118
GNEHierarchicalElementParents::getAdditionalParents
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementParents.cpp:86
InvalidArgument
Definition: UtilExceptions.h:57
GLHelper::drawBoxLine
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:136
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
GNEDetectorEntryExit::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEDetectorEntryExit.cpp:313
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
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:291
GNEAdditional::myGeometry
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
Definition: GNEAdditional.h:368
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
SUMO_TAG_E3DETECTOR
an e3 detector
Definition: SUMOXMLDefinitions.h:74
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
GNEDetectorEntryExit::~GNEDetectorEntryExit
~GNEDetectorEntryExit()
destructor
Definition: GNEDetectorEntryExit.cpp:50
GNEDetectorEntryExit::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEDetectorEntryExit.cpp:109
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
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
GNEAdditional::isValidAdditionalID
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
Definition: GNEAdditional.cpp:584
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
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
SUMO_TAG_DET_EXIT
an e3 exit point
Definition: SUMOXMLDefinitions.h:84
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
GNEUndoList.h
GNE_ATTR_PARENT
parent of an additional element
Definition: SUMOXMLDefinitions.h:984
GUIVisualizationSettings::drawForSelecting
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
Definition: GUIVisualizationSettings.h:635
GLHelper::drawTriangleAtEnd
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:440