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-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 "GNEDetectorE1Instant.h"
32 #include "GNEAdditionalHandler.h"
33 
34 
35 // ===========================================================================
36 // member method definitions
37 // ===========================================================================
38 
39 GNEDetectorE1Instant::GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) :
40  GNEDetector(id, viewNet, GLO_E1DETECTOR_INSTANT, SUMO_TAG_INSTANT_INDUCTION_LOOP, pos, 0, 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 
117  // Clear all containers
119 
120  // obtain position over lane
121  myGeometry.shape.push_back(getPositionInView());
122 
123  // Obtain first position
124  Position f = myGeometry.shape[0] - Position(1, 0);
125 
126  // Obtain next position
127  Position s = myGeometry.shape[0] + Position(1, 0);
128 
129  // Save rotation (angle) of the vector constructed by points f and s
130  myGeometry.shapeRotations.push_back(getLaneParents().front()->getGeometry().shape.rotationDegreeAtOffset(getGeometryPositionOverLane()) * -1);
131 
132  // Set block icon position
134 
135  // Set offset of the block icon
136  myBlockIcon.offset = Position(-1, 0);
137 
138  // Set block icon rotation, and using their rotation for logo
140 }
141 
142 
143 void
145  // get values
146  const double width = (double) 2.0 * s.scale;
147  const double exaggeration = s.addSize.getExaggeration(s, this);
148  // start drawing
149  glPushName(getGlID());
150  glLineWidth(1.0);
151  // set color
152  if (drawUsingSelectColor()) {
154  } else {
156  }
157  // draw shape
158  glPushMatrix();
159  glTranslated(0, 0, getType());
160  glTranslated(myGeometry.shape[0].x(), myGeometry.shape[0].y(), 0);
161  glRotated(myGeometry.shapeRotations[0], 0, 0, 1);
162  glScaled(exaggeration, exaggeration, 1);
163  glBegin(GL_QUADS);
164  glVertex2d(-1.0, 2);
165  glVertex2d(-1.0, -2);
166  glVertex2d(1.0, -2);
167  glVertex2d(1.0, 2);
168  glEnd();
169  glTranslated(0, 0, .01);
170  glBegin(GL_LINES);
171  glVertex2d(0, 2 - .1);
172  glVertex2d(0, -2 + .1);
173  glEnd();
174  // outline if isn't being drawn for selecting
175  if ((width * exaggeration > 1) && !s.drawForSelecting) {
176  // set color
177  if (drawUsingSelectColor()) {
179  } else {
181  }
182  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
183  glBegin(GL_QUADS);
184  glVertex2f(-1.0, 2);
185  glVertex2f(-1.0, -2);
186  glVertex2f(1.0, -2);
187  glVertex2f(1.0, 2);
188  glEnd();
189  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
190  }
191  // position indicator if isn't being drawn for selecting
192  if ((width * exaggeration > 1) && !s.drawForSelecting) {
193  // set color
194  if (drawUsingSelectColor()) {
196  } else {
198  }
199  glRotated(90, 0, 0, -1);
200  glBegin(GL_LINES);
201  glVertex2d(0, 1.7);
202  glVertex2d(0, -1.7);
203  glEnd();
204  }
205  // Pop shape matrix
206  glPopMatrix();
207  // Check if the distance is enought to draw details and isn't being drawn for selecting
208  if ((s.drawDetail(s.detailSettings.detectorDetails, exaggeration)) && !s.drawForSelecting) {
209  // Push matrix
210  glPushMatrix();
211  // Traslate to center of detector
212  glTranslated(myGeometry.shape.getLineCenter().x(), myGeometry.shape.getLineCenter().y(), getType() + 0.1);
213  // Rotate depending of myBlockIcon.rotation
214  glRotated(myBlockIcon.rotation, 0, 0, -1);
215  //move to logo position
216  glTranslated(-1, 0, 0);
217  // draw E1 logo
218  if (drawUsingSelectColor()) {
220  } else {
221  GLHelper::drawText("E1", Position(), .1, 1.5, RGBColor::BLACK);
222  }
223  // pop matrix
224  glPopMatrix();
225  // Show Lock icon depending of the Edit mode
226  myBlockIcon.drawIcon(s, exaggeration);
227  }
228  // Finish draw if isn't being drawn for selecting
229  if (!s.drawForSelecting) {
231  }
232  // check if dotted contour has to be drawn
233  if (myViewNet->getDottedAC() == this) {
235  }
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_NAME:
250  return myAdditionalName;
251  case SUMO_ATTR_FILE:
252  return myFilename;
253  case SUMO_ATTR_VTYPES:
254  return myVehicleTypes;
258  return toString(myBlockMovement);
259  case GNE_ATTR_SELECTED:
261  case GNE_ATTR_GENERIC:
262  return getGenericParametersStr();
263  default:
264  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
265  }
266 }
267 
268 
269 void
270 GNEDetectorE1Instant::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
271  if (value == getAttribute(key)) {
272  return; //avoid needless changes, later logic relies on the fact that attributes have changed
273  }
274  switch (key) {
275  case SUMO_ATTR_ID:
276  case SUMO_ATTR_LANE:
277  case SUMO_ATTR_POSITION:
278  case SUMO_ATTR_NAME:
279  case SUMO_ATTR_FILE:
280  case SUMO_ATTR_VTYPES:
283  case GNE_ATTR_SELECTED:
284  case GNE_ATTR_GENERIC:
285  undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value));
286  break;
287  default:
288  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
289  }
290 
291 }
292 
293 
294 bool
295 GNEDetectorE1Instant::isValid(SumoXMLAttr key, const std::string& value) {
296  switch (key) {
297  case SUMO_ATTR_ID:
298  return isValidDetectorID(value);
299  case SUMO_ATTR_LANE:
300  if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) {
301  return true;
302  } else {
303  return false;
304  }
305  case SUMO_ATTR_POSITION:
306  return canParse<double>(value) && fabs(parse<double>(value)) < getLaneParents().front()->getParentEdge().getNBEdge()->getFinalLength();
307  case SUMO_ATTR_NAME:
309  case SUMO_ATTR_FILE:
311  case SUMO_ATTR_VTYPES:
312  if (value.empty()) {
313  return true;
314  } else {
316  }
318  return canParse<bool>(value);
320  return canParse<bool>(value);
321  case GNE_ATTR_SELECTED:
322  return canParse<bool>(value);
323  case GNE_ATTR_GENERIC:
324  return isGenericParametersValid(value);
325  default:
326  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
327  }
328 }
329 
330 // ===========================================================================
331 // private
332 // ===========================================================================
333 
334 void
335 GNEDetectorE1Instant::setAttribute(SumoXMLAttr key, const std::string& value) {
336  switch (key) {
337  case SUMO_ATTR_ID:
338  changeAdditionalID(value);
339  break;
340  case SUMO_ATTR_LANE:
341  changeLaneParents(this, value);
342  break;
343  case SUMO_ATTR_POSITION:
344  myPositionOverLane = parse<double>(value);
345  break;
346  case SUMO_ATTR_NAME:
347  myAdditionalName = value;
348  break;
349  case SUMO_ATTR_FILE:
350  myFilename = value;
351  break;
352  case SUMO_ATTR_VTYPES:
353  myVehicleTypes = value;
354  break;
356  myFriendlyPosition = parse<bool>(value);
357  break;
359  myBlockMovement = parse<bool>(value);
360  break;
361  case GNE_ATTR_SELECTED:
362  if (parse<bool>(value)) {
364  } else {
366  }
367  break;
368  case GNE_ATTR_GENERIC:
370  break;
371  default:
372  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
373  }
374 }
375 
376 /****************************************************************************/
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
GNEAdditional::BlockIcon::position
Position position
position of the block icon
Definition: GNEAdditional.h:351
GNEDetectorE1Instant::fixAdditionalProblem
void fixAdditionalProblem()
fix additional problem
Definition: GNEDetectorE1Instant.cpp:78
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
GNEDetectorE1Instant::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEDetectorE1Instant.cpp:106
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
GNEDetectorE1Instant::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEDetectorE1Instant.cpp:89
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
GNEDetectorE1Instant::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorE1Instant.cpp:241
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
GNEDetectorE1Instant::~GNEDetectorE1Instant
~GNEDetectorE1Instant()
Destructor.
Definition: GNEDetectorE1Instant.cpp:46
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
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
GUIVisualizationColorSettings::E1Instant
static const RGBColor E1Instant
color for E1 Instant detectors
Definition: GUIVisualizationSettings.h:211
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
GNEDetectorE1Instant::isAdditionalValid
bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
Definition: GNEDetectorE1Instant.cpp:51
GNEAdditional::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
Definition: GNEAdditional.cpp:619
GLO_E1DETECTOR_INSTANT
a E1 detector
Definition: GUIGlObjectTypes.h:76
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
GNEDetectorE1Instant.h
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
GNEDetectorE1Instant::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorE1Instant.cpp:115
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:270
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
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
GNEAdditional::myAdditionalName
std::string myAdditionalName
name of additional
Definition: GNEAdditional.h:374
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_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
GNEDetectorE1Instant::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorE1Instant.cpp:144
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
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
SUMO_ATTR_VTYPES
Definition: SUMOXMLDefinitions.h:630
GNEDetectorE1Instant::GNEDetectorE1Instant
GNEDetectorE1Instant(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Constructor.
Definition: GNEDetectorE1Instant.cpp:39
GNEDetectorE1Instant::getAdditionalProblem
std::string getAdditionalProblem() const
return a string with the current additional problem
Definition: GNEDetectorE1Instant.cpp:62
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
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
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
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
GNEDetectorE1Instant::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEDetectorE1Instant.cpp:295
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
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
SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
Definition: SUMOXMLDefinitions.h:88
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