Eclipse SUMO - Simulation of Urban MObility
GNEStoppingPlace.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 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 // A abstract class to define common parameters of lane area in which vehicles can halt (GNE version)
19 /****************************************************************************/
20 #include <config.h>
21 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNEViewNet.h>
26 #include <netedit/GNEViewParent.h>
28 #include <utils/gui/div/GLHelper.h>
31 
32 #include "GNEStoppingPlace.h"
33 #include "GNEAdditionalHandler.h"
34 
35 // ===========================================================================
36 // member method definitions
37 // ===========================================================================
38 
39 GNEStoppingPlace::GNEStoppingPlace(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, FXIcon* icon,
40  GNELane* lane, const double startPos, const double endPos, const std::string& name, bool friendlyPosition,
41  const Parameterised::Map& parameters) :
42  GNEAdditional(id, net, type, tag, icon, name, {}, {}, {lane}, {}, {}, {}),
43  Parameterised(parameters),
44  myStartPosition(startPos),
45  myEndPosition(endPos),
46 myFriendlyPosition(friendlyPosition) {
47 }
48 
49 
51 
52 
55  // get allow change lane
56  const bool allowChangeLane = myNet->getViewNet()->getViewParent()->getMoveFrame()->getCommonModeOptions()->getAllowChangeLane();
57  // fist check if we're moving only extremes
58  if (drawMovingGeometryPoints(false)) {
59  // get geometry points under cursor
60  const auto geometryPoints = gViewObjectsHandler.getGeometryPoints(this);
61  // continue depending of moved element
62  if (geometryPoints.empty()) {
63  return nullptr;
64  } else if (geometryPoints.front() == 0) {
65  // move start position
66  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, getParentLanes().front()->getLaneShape().length2D() - POSITION_EPS,
68  } else {
69  // move end position
70  return new GNEMoveOperation(this, getParentLanes().front(), 0, myEndPosition,
72  }
74  // move both start and end positions
75  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, myEndPosition,
77  } else if (myStartPosition != INVALID_DOUBLE) {
78  // move only start position
79  return new GNEMoveOperation(this, getParentLanes().front(), myStartPosition, getParentLanes().front()->getLaneShape().length2D() - POSITION_EPS,
81  } else if (myEndPosition != INVALID_DOUBLE) {
82  // move only end position
83  return new GNEMoveOperation(this, getParentLanes().front(), 0, myEndPosition,
85  } else {
86  // start and end positions undefined, then nothing to move
87  return nullptr;
88  }
89 }
90 
91 
92 bool
95  getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), myFriendlyPosition);
96 }
97 
98 
99 std::string
101  // obtain lane length
102  double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor();
103  // calculate start and end positions
104  double startPos = getAttributeDouble(SUMO_ATTR_STARTPOS);
105  double endPos = getAttributeDouble(SUMO_ATTR_ENDPOS);
106  // check if position has to be fixed
107  if (startPos < 0) {
108  startPos += laneLength;
109  }
110  if (endPos < 0) {
111  endPos += laneLength;
112  }
113  // declare variables
114  std::string errorStart, separator, errorEnd;
115  // check positions over lane
116  if (startPos < 0) {
117  errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0");
118  } else if (startPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
119  errorStart = (toString(SUMO_ATTR_STARTPOS) + TL(" > lanes's length"));
120  }
121  if (endPos < 0) {
122  errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0");
123  } else if (endPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
124  errorEnd = (toString(SUMO_ATTR_ENDPOS) + TL(" > lanes's length"));
125  }
126  // check separator
127  if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
128  separator = TL(" and ");
129  }
130  return errorStart + separator + errorEnd;
131 }
132 
133 
134 void
136  // calculate start and end positions
137  double startPos = getAttributeDouble(SUMO_ATTR_STARTPOS);
138  double endPos = getAttributeDouble(SUMO_ATTR_ENDPOS);
139  // fix start and end positions using fixLaneDoublePosition
140  GNEAdditionalHandler::fixLaneDoublePosition(startPos, endPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
141  // set new start and end positions
144 }
145 
146 
147 bool
149  // get edit modes
150  const auto& editModes = myNet->getViewNet()->getEditModes();
151  // check if we're in move mode
152  if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
154  (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
155  // only move the first element
157  } else {
158  return false;
159  }
160 }
161 
162 
163 Position
166 }
167 
168 
169 void
170 GNEStoppingPlace::updateCenteringBoundary(const bool /*updateGrid*/) {
171  // nothing to do
172 }
173 
174 
175 void
176 GNEStoppingPlace::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) {
177  // first check tat both network elements are lanes and originalElement correspond to stoppingPlace lane
178  if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
179  (newElement->getTagProperty().getTag() == SUMO_TAG_LANE) &&
180  (getParentLanes().front() == originalElement)) {
181  // check if we have to change additional lane depending of split position
183  // calculate middle position
184  const double middlePosition = ((myEndPosition - myStartPosition) / 2.0) + myStartPosition;
185  // four cases:
186  if (splitPosition < myStartPosition) {
187  // change lane
188  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
189  // now adjust start and end position
190  setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList);
191  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
192  } else if ((splitPosition > myStartPosition) && (splitPosition < middlePosition)) {
193  // change lane
194  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
195  // now adjust start and end position
196  setAttribute(SUMO_ATTR_STARTPOS, "0", undoList);
197  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
198  } else if ((splitPosition > middlePosition) && (splitPosition < myEndPosition)) {
199  // only adjust end position
200  setAttribute(SUMO_ATTR_ENDPOS, toString(splitPosition), undoList);
201  } else if ((splitPosition > myEndPosition)) {
202  // nothing to do
203  }
204  } else if ((myStartPosition != INVALID_DOUBLE) && (splitPosition < myStartPosition)) {
205  // change lane
206  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
207  // now adjust start position
208  setAttribute(SUMO_ATTR_STARTPOS, toString(myEndPosition - splitPosition), undoList);
209  } else if ((myEndPosition != INVALID_DOUBLE) && (splitPosition < myEndPosition)) {
210  // change lane
211  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
212  // now adjust end position
213  setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList);
214  }
215  }
216 }
217 
218 
219 std::string
221  return getParentLanes().front()->getID();
222 }
223 
224 
225 void
227  if (getParentLanes().empty() || getParentLanes().front() == nullptr) {
228  // may happen during initialization
229  return;
230  }
231  // Get value of option "lefthand"
232  const bool lefthandAttr = hasAttribute(SUMO_ATTR_LEFTHAND) && parse<bool>(getAttribute(SUMO_ATTR_LEFTHAND));
233  const double offsetSign = OptionsCont::getOptions().getBool("lefthand") != lefthandAttr ? -1 : 1;
234 
235  // obtain laneShape
236  PositionVector laneShape = getParentLanes().front()->getLaneShape();
237 
238  // Move shape to side
239  laneShape.move2side(movingToSide * offsetSign);
240 
241  // Cut shape using as delimitators fixed start position and fixed end position
243 }
244 
245 
246 double
248  switch (key) {
249  case SUMO_ATTR_STARTPOS:
251  return myStartPosition;
252  } else {
253  return 0;
254  }
255  case SUMO_ATTR_ENDPOS:
256  if (myEndPosition != INVALID_DOUBLE) {
257  return myEndPosition;
258  } else {
259  return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
260  }
261  case SUMO_ATTR_CENTER:
263  default:
264  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
265  }
266 }
267 
268 
269 const Parameterised::Map&
271  return getParametersMap();
272 }
273 
274 
275 std::string
277  return getTagStr() + ": " + getID();
278 }
279 
280 
281 std::string
283  return getTagStr();
284 }
285 
286 
287 void
288 GNEStoppingPlace::drawLines(const GUIVisualizationSettings::Detail d, const std::vector<std::string>& lines, const RGBColor& color) const {
289  // only draw in level 1
291  // calculate middle point
292  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
293  // calculate rotation
294  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
295  // Iterate over every line
296  for (int i = 0; i < (int)lines.size(); ++i) {
297  // push a new matrix for every line
299  // translate
300  glTranslated(mySymbolPosition.x(), mySymbolPosition.y(), 0);
301  // rotate over lane
303  // draw line with a color depending of the selection status
304  if (drawUsingSelectColor()) {
305  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
306  } else {
307  GLHelper::drawText(lines[i].c_str(), Position(1.2, (double)i), .1, 1.f, color, 0, FONS_ALIGN_LEFT);
308  }
309  // pop matrix for every line
311  }
312  }
313 }
314 
315 
316 void
318  const RGBColor& baseColor, const RGBColor& signColor, const std::string& word) const {
319  // only draw in level 2
321  // calculate middle point
322  const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5);
323  // calculate rotation
324  const double rot = (myAdditionalGeometry.getShape().size() <= 1) ? 0 : myAdditionalGeometry.getShape().rotationDegreeAtOffset(middlePoint);
325  // push matrix
327  // Start drawing sign traslating matrix to signal position
328  glTranslated(mySymbolPosition.x(), mySymbolPosition.y(), 0);
329  // rotate over lane
331  // scale matrix depending of the exaggeration
332  glScaled(exaggeration, exaggeration, 1);
333  // set color
334  GLHelper::setColor(baseColor);
335  // Draw circle
337  // continue depending of rectangle selection
339  // Traslate to front
340  glTranslated(0, 0, .1);
341  // set color
342  GLHelper::setColor(signColor);
343  // draw another circle in the same position, but a little bit more small
345  // draw H depending of detailSettings
347  }
348  // pop draw matrix
350  }
351 }
352 
353 
354 void
356  const double width, const double exaggeration, const bool movingGeometryPoints) const {
357  // check if we're calculating the contour or the moving geometry points
358  if (movingGeometryPoints) {
362  }
363  if (movingGeometryPoints && (myEndPosition != INVALID_DOUBLE)) {
366  }
367  } else {
368  // don't exaggerate contour
369  myAdditionalContour.calculateContourExtrudedShape(s, d, this, myAdditionalGeometry.getShape(), width, 1, true, true, 0);
371  }
372 }
373 
374 
375 double
378  // get lane final and shape length
379  const double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
380  // get startPosition
381  double fixedPos = myStartPosition;
382  // adjust fixedPos
383  if (fixedPos < 0) {
384  fixedPos += laneLength;
385  }
386  fixedPos *= getParentLanes().front()->getLengthGeometryFactor();
387  // return depending of fixedPos
388  if (fixedPos < 0) {
389  return 0;
390  } else if (fixedPos > (getParentLanes().front()->getLaneShapeLength() - POSITION_EPS)) {
391  return (getParentLanes().front()->getLaneShapeLength() - POSITION_EPS);
392  } else {
393  return fixedPos;
394  }
395  } else {
396  return 0;
397  }
398 }
399 
400 
401 double
403  if (myEndPosition != INVALID_DOUBLE) {
404  // get lane final and shape length
405  const double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
406  // get endPosition
407  double fixedPos = myEndPosition;
408  // adjust fixedPos
409  if (fixedPos < 0) {
410  fixedPos += laneLength;
411  }
412  fixedPos *= getParentLanes().front()->getLengthGeometryFactor();
413  // return depending of fixedPos
414  if (fixedPos < POSITION_EPS) {
415  return POSITION_EPS;
416  } else if (fixedPos > getParentLanes().front()->getLaneShapeLength()) {
417  return getParentLanes().front()->getLaneShapeLength();
418  } else {
419  return fixedPos;
420  }
421  } else {
422  return getParentLanes().front()->getLaneShapeLength();
423  }
424 }
425 
426 
427 void
430  // change only start position
431  myStartPosition = moveResult.newFirstPos;
432  // adjust startPos
433  if (myStartPosition > (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS)) {
435  }
437  // change only end position
438  myEndPosition = moveResult.newFirstPos;
439  // adjust endPos
440  if (myEndPosition < (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS)) {
442  }
443  } else {
444  // change both position
445  myStartPosition = moveResult.newFirstPos;
446  myEndPosition = moveResult.newSecondPos;
447  // set lateral offset
449  }
450  // update geometry
451  updateGeometry();
452 }
453 
454 
455 void
457  // begin change attribute
458  undoList->begin(this, "position of " + getTagStr());
459  // set attributes depending of operation type
461  // set only start position
462  setAttribute(SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos), undoList);
464  // set only end position
465  setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos), undoList);
466  } else {
467  // set both
468  setAttribute(SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos), undoList);
469  setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newSecondPos), undoList);
470  // check if lane has to be changed
471  if (moveResult.newFirstLane) {
472  // set new lane
473  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
474  }
475  }
476  // end change attribute
477  undoList->end();
478 }
479 
480 /****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
GUIGlObjectType
GUIViewObjectsHandler gViewObjectsHandler
#define TL(string)
Definition: MsgHandler.h:315
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_LANE
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_LEFTHAND
@ SUMO_ATTR_CENTER
const double INVALID_DOUBLE
invalid double
Definition: StdDefs.h:64
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:654
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition: GLHelper.cpp:539
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
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, const int align=0, double width=-1)
Definition: GLHelper.cpp:756
static void fixLaneDoublePosition(double &from, double &to, const double laneLengt)
fix the given positions over lane
static bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
GNEContour myAdditionalContour
variable used for draw additional contours
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
bool drawMovingGeometryPoints(const bool ignoreShift) const
check if draw additional extrem geometry points
const std::string getID() const
get ID (all Attribute Carriers have one)
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool hasAttribute(SumoXMLAttr key) const
GNENet * myNet
pointer to net
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset) const
calculate contour extruded (used in elements formed by a central shape)
Definition: GNEContour.cpp:88
void calculateContourLastGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for last geometry point
Definition: GNEContour.cpp:164
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double scale) const
calculate contour (circle elements)
Definition: GNEContour.cpp:117
void calculateContourFirstGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double radius, const double scale) const
calculate contour for first geometry point
Definition: GNEContour.cpp:152
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
move operation
move result
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
const GNEMoveOperation::OperationType operationType
move operation
double firstLaneOffset
lane offset
double newSecondPos
new second position
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2136
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
virtual double getAttributeDouble(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation()
get move operation
Position getPositionInView() const
Returns position of additional in view.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool checkDrawMoveContour() const
check if draw move contour (red)
void drawSign(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const RGBColor &baseColor, const RGBColor &signColor, const std::string &word) const
draw sign
~GNEStoppingPlace()
Destructor.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
const Parameterised::Map & getACParametersMap() const
get parameters map
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void calculateStoppingPlaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration, const bool movingGeometryPoints) const
check object in view
virtual void updateGeometry()=0
update pre-computed geometry information
bool myFriendlyPosition
Flag for friendly position.
void drawLines(const GUIVisualizationSettings::Detail d, const std::vector< std::string > &lines, const RGBColor &color) const
draw lines
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
GNEStoppingPlace(const std::string &id, GNENet *net, GUIGlObjectType type, SumoXMLTag tag, FXIcon *icon, GNELane *lane, const double startPos, const double endPos, const std::string &name, bool friendlyPosition, const Parameterised::Map &parameters)
Constructor.
Position mySymbolPosition
The position of the sign.
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
double myEndPosition
The position this stopping place is located at (-1 means empty)
GNEContour mySymbolContour
circle contour
std::string getParentName() const
Returns the name of the parent object (if any)
virtual std::string getAttribute(SumoXMLAttr key) const =0
double myStartPosition
The relative start position this stopping place is located at (-1 means empty)
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
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...
const GUIGlObject * getGUIGlObjectFront() const
get front attribute carrier or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:723
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
Definition: GNEViewNet.cpp:759
GNEViewParent * getViewParent() const
get the net object
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
Definition: GNEViewNet.cpp:477
GNEMoveFrame * getMoveFrame() const
get frame for move elements
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:59
const std::vector< int > & getGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
Stores the information about how to visualize structures.
GUIVisualizationStoppingPlaceSettings stoppingPlaceSettings
StoppingPlace settings.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:60
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double x() const
Returns the x-position.
Definition: Position.h:55
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
double length2D() const
Returns the length.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
@ FONS_ALIGN_LEFT
Definition: fontstash.h:42
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
static const double additionalGeometryPointRadius
moving additional geometry point radius
static const double symbolInternalRadius
symbol internal radius
static const double symbolExternalRadius
symbol external radius
static const double symbolInternalTextSize
symbol internal text size