Eclipse SUMO - Simulation of Urban MObility
GNECommonNetworkModules.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Common network modules
19 /****************************************************************************/
20 #include <config.h>
21 
24 #include <netedit/GNENet.h>
25 #include <netedit/GNEViewNet.h>
26 #include <netedit/GNEViewParent.h>
29 #include <utils/gui/div/GLHelper.h>
34 
36 
37 
38 // ===========================================================================
39 // FOX callback mapping
40 // ===========================================================================
41 
42 FXDEFMAP(GNECommonNetworkModules::NetworkElementsSelector) SelectorParentNetworkElementsMap[] = {
45 };
46 
47 
48 FXDEFMAP(GNECommonNetworkModules::ConsecutiveLaneSelector) ConsecutiveLaneSelectorMap[] = {
53 };
54 
55 // Object implementation
56 FXIMPLEMENT(GNECommonNetworkModules::NetworkElementsSelector, FXGroupBoxModule, SelectorParentNetworkElementsMap, ARRAYNUMBER(SelectorParentNetworkElementsMap))
57 FXIMPLEMENT(GNECommonNetworkModules::ConsecutiveLaneSelector, FXGroupBoxModule, ConsecutiveLaneSelectorMap, ARRAYNUMBER(ConsecutiveLaneSelectorMap))
58 
59 
60 // ---------------------------------------------------------------------------
61 // GNECommonNetworkModules::NetworkElementsSelector - methods
62 // ---------------------------------------------------------------------------
63 
65  FXGroupBoxModule(frameParent->getContentFrame(), "NetworkElements"),
66  myNetworkElementType(networkElementType),
67  myFrameParent(frameParent) {
68  // Create horizontal frame
69  FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
70  // Create buttons
71  myClearSelection = new FXButton(buttonsFrame, "Clear", nullptr, this, MID_GNE_CLEARSELECTION, GUIDesignButtonRectangular100);
72  myUseSelected = new FXButton(buttonsFrame, "Use selected", nullptr, this, MID_GNE_USESELECTED, GUIDesignButtonRectangular100);
73  // Create list
74  myList = new FXList(getCollapsableFrame(), this, MID_GNE_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100);
75  // create information label and update modul name
76  switch (myNetworkElementType) {
77  case NetworkElementType::EDGE:
78  new FXLabel(this,
79  "-Click over an edge to select\n-ESC to clear selection",
81  setText("Edges");
82  break;
83  case NetworkElementType::LANE:
84  new FXLabel(this,
85  "-Click over a lane to select\n-ESC to clear selection",
87  setText("Lanes");
88  break;
89  default:
90  throw ProcessError("Invalid NetworkElementType");
91  }
92  // Hide List
93  hide();
94 }
95 
96 
98 
99 
100 std::vector<std::string>
102  // declare solution
103  std::vector<std::string> solution;
104  // reserve
105  solution.reserve(myList->getNumItems());
106  // fill IDs
107  for (int i = 0; i < myList->getNumItems(); i++) {
108  solution.push_back(myList->getItem(i)->getText().text());
109  }
110  return solution;
111 }
112 
113 
114 bool
116  if (myFrameParent->shown() && shown()) {
117  // check if id is selected
118  for (int i = 0; i < myList->getNumItems(); i++) {
119  if (myList->getItem(i)->getText().text() == networkElement->getID()) {
120  return true;
121  }
122  }
123  }
124  return false;
125 }
126 
127 
128 void
130  // clear list of egdge ids
131  myList->clearItems();
132  // Show dialog
133  show();
134 }
135 
136 
137 void
139  hide();
140 }
141 
142 
143 bool
145  return shown();
146 }
147 
148 
149 bool
151  // Obtain Id's of list
152  for (int i = 0; i < myList->getNumItems(); i++) {
153  if (myList->getItem(i)->getText().text() == networkElement->getID()) {
154  // unselect element
155  myList->removeItem(i);
156  // update viewNet
157  myFrameParent->getViewNet()->update();
158  return true;
159  }
160  }
161  // select element
162  myList->appendItem(networkElement->getID().c_str(), networkElement->getIcon());
163  // update viewNet
164  myFrameParent->getViewNet()->update();
165  return true;
166 }
167 
168 
169 void
171  // clear list of egdge ids
172  myList->clearItems();
173  // update viewNet
174  myFrameParent->getViewNet()->update();
175 }
176 
177 
178 long
180  // clear list of egdge ids
181  myList->clearItems();
182  // set modul name
183  switch (myNetworkElementType) {
184  case NetworkElementType::EDGE:
185  for (const auto &edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
186  if (edge.second->isAttributeCarrierSelected()) {
187  myList->appendItem(edge.first.c_str(), edge.second->getIcon());
188  }
189  }
190  break;
191  case NetworkElementType::LANE:
192  for (const auto &lane : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getLanes()) {
193  if (lane->isAttributeCarrierSelected()) {
194  myList->appendItem(lane->getID().c_str(), lane->getIcon());
195  }
196  }
197  break;
198  default:
199  throw ProcessError("Invalid NetworkElementType");
200  }
201  // Update Frame
202  update();
203  return 1;
204 }
205 
206 
207 long
209  clearSelection();
210  return 1;
211 }
212 
213 
215  myFrameParent(nullptr),
216  myNetworkElementType(NetworkElementType::EDGE) {
217 }
218 
219 // ---------------------------------------------------------------------------
220 // GNECommonNetworkModules::ConsecutiveLaneSelector - methods
221 // ---------------------------------------------------------------------------
222 
224  FXGroupBoxModule(frameParent->getContentFrame(), "Consecutive lane selector"),
225  myFrameParent(frameParent) {
226  // create label for route info
227  myInfoRouteLabel = new FXLabel(getCollapsableFrame(), "No lanes selected", 0, GUIDesignLabelFrameThicked);
228  // create button for finish route creation
229  myFinishCreationButton = new FXButton(getCollapsableFrame(), "Finish route creation", nullptr, this, MID_GNE_FINISH, GUIDesignButton);
230  myFinishCreationButton->disable();
231  // create button for abort route creation
232  myAbortCreationButton = new FXButton(getCollapsableFrame(), "Abort route creation", nullptr, this, MID_GNE_ABORT, GUIDesignButton);
233  myAbortCreationButton->disable();
234  // create button for remove last inserted lane
235  myRemoveLastInsertedElement = new FXButton(getCollapsableFrame(), "Remove last inserted lane", nullptr, this, MID_GNE_REMOVELAST, GUIDesignButton);
236  myRemoveLastInsertedElement->disable();
237  // create check button
238  myShowCandidateLanes = new FXCheckButton(getCollapsableFrame(), "Show candidate lanes", this, MID_GNE_SHOWCANDIDATES, GUIDesignCheckButton);
239  myShowCandidateLanes->setCheck(TRUE);
240  // create backspace label (always shown)
241  new FXLabel(this, "BACKSPACE: undo click", 0, GUIDesignLabelFrameInformation);
242 }
243 
244 
246 
247 
248 void
250  // first abort creation
251  abortPathCreation();
252  // disable buttons
253  myFinishCreationButton->disable();
254  myAbortCreationButton->disable();
255  myRemoveLastInsertedElement->disable();
256  // update lane colors
257  updateLaneColors();
258  // recalc before show (to avoid graphic problems)
259  recalc();
260  // show modul
261  show();
262 }
263 
264 
265 void
267  // clear path
268  clearPath();
269  // hide modul
270  hide();
271 }
272 
273 
274 const std::vector<std::pair<GNELane*, double> >&
276  return myLanePath;
277 }
278 
279 
280 const std::vector<std::string>
282  std::vector<std::string> laneIDs;
283  for (const auto& lane : myLanePath) {
284  laneIDs.push_back(lane.first->getID());
285  }
286  return laneIDs;
287 }
288 
289 
290 bool
292  // first check if lane is valid
293  if (lane == nullptr) {
294  return false;
295  }
296  // continue depending of number of selected eges
297  if ((myLanePath.size() > 0) && (myLanePath.back().first == lane)) {
298  // Write warning
299  WRITE_WARNING("Double lanes aren't allowed");
300  // abort add lane
301  return false;
302  }
303  // check candidate lane
304  if ((myShowCandidateLanes->getCheck() == TRUE) && !lane->isPossibleCandidate()) {
305  if (lane->isSpecialCandidate() || lane->isConflictedCandidate()) {
306  // Write warning
307  WRITE_WARNING("Invalid lane");
308  // abort add lane
309  return false;
310  }
311  }
312  // get mouse position
313  const Position mousePos = myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation());
314  // calculate lane offset
315  const double offset = lane->getLaneShape().nearest_offset_to_point2D(mousePos);
316  // All checks ok, then add it in selected elements
317  myLanePath.push_back(std::make_pair(lane, offset));
318  // enable abort route button
319  myAbortCreationButton->enable();
320  // enable finish button
321  myFinishCreationButton->enable();
322  // disable undo/redo
323  myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation");
324  // enable or disable remove last lane button
325  if (myLanePath.size() > 1) {
326  myRemoveLastInsertedElement->enable();
327  } else {
328  myRemoveLastInsertedElement->disable();
329  }
330  // update info route label
331  updateInfoRouteLabel();
332  // update lane colors
333  updateLaneColors();
334  return true;
335 }
336 
337 
338 bool
340  return (myShowCandidateLanes->getCheck() == TRUE);
341 }
342 
343 
344 void
346  // reset all flags
347  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
348  for (const auto& lane : edge.second->getLanes()) {
349  lane->resetCandidateFlags();
350  }
351  }
352  // set reachability
353  if (myLanePath.size() > 0 && (myShowCandidateLanes->getCheck() == TRUE)) {
354  // first mark all lanes as invalid
355  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
356  for (const auto& lane : edge.second->getLanes()) {
357  lane->setConflictedCandidate(true);
358  }
359  }
360  // now mark lane paths as valid
361  for (const auto& lane : myLanePath) {
362  // disable conflicted candidate
363  lane.first->setConflictedCandidate(false);
364  if (lane == myLanePath.back()) {
365  lane.first->setSourceCandidate(true);
366  } else {
367  lane.first->setTargetCandidate(true);
368  }
369  }
370  // get parent edge
371  const GNEEdge* edge = myLanePath.back().first->getParentEdge();
372  // iterate over connections
373  for (const auto& connection : edge->getGNEConnections()) {
374  // mark possible candidates
375  if (connection->getLaneFrom() == myLanePath.back().first) {
376  connection->getLaneTo()->setConflictedCandidate(false);
377  connection->getLaneTo()->setPossibleCandidate(true);
378  }
379  }
380  }
381  // update view net
382  myFrameParent->getViewNet()->updateViewNet();
383 }
384 
385 
386 void
388  // Only draw if there is at least one lane
389  if (myLanePath.size() > 0) {
390  // get widths
391  const double lineWidth = 0.35;
392  const double lineWidthin = 0.25;
393  // declare vector with shapes
394  std::vector<PositionVector> shapes;
395  // iterate over lanes (only if there is more than one)
396  if (myLanePath.size() > 1) {
397  // get shapes
398  for (int i = 0; i < (int)myLanePath.size(); i++) {
399  // get lane
400  const GNELane* lane = myLanePath.at(i).first;
401  // add lane shape
402  shapes.push_back(lane->getLaneShape());
403  // draw connection between lanes
404  if ((i + 1) < (int)myLanePath.size()) {
405  // get next lane
406  const GNELane* nextLane = myLanePath.at(i + 1).first;
407  if (lane->getLane2laneConnections().exist(nextLane)) {
408  shapes.push_back(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape());
409  } else {
410  shapes.push_back({lane->getLaneShape().back(), nextLane->getLaneShape().front()});
411  }
412  }
413  }
414  // adjust first and last shape
415  shapes.front() = shapes.front().splitAt(myLanePath.front().second).second;
416  shapes.back() = shapes.back().splitAt(myLanePath.back().second).first;
417  }
418  // Add a draw matrix
420  // move to temporal shape
421  glTranslated(0, 0, GLO_TEMPORALSHAPE);
422  // iterate over shapes
423  for (const auto &shape : shapes) {
424  // set extern
426  // draw extern shape
427  GLHelper::drawBoxLines(shape, lineWidth);
428  // push matrix
430  // move to front
431  glTranslated(0, 0, 0.1);
432  // set orange color
434  // draw intern shape
435  GLHelper::drawBoxLines(shape, lineWidthin);
436  // Pop matrix
438  }
439  // draw points
440  const RGBColor pointColor = RGBColor::RED;
441  // positions
442  const Position firstPosition = myLanePath.front().first->getLaneShape().positionAtOffset2D(myLanePath.front().second);
443  const Position secondPosition = myLanePath.back().first->getLaneShape().positionAtOffset2D(myLanePath.back().second);
444  // draw geometry points
445  GUIGeometry::drawGeometryPoints(s, myFrameParent->getViewNet()->getPositionInformation(), {firstPosition, secondPosition},
446  pointColor, RGBColor::WHITE, s.neteditSizeSettings.polylineWidth, 1, false, true);
447  // Pop last matrix
449  }
450 }
451 
452 
453 void
455  // first check that there is elements
456  if (myLanePath.size() > 0) {
457  // unblock undo/redo
458  myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->enableUndoRedo();
459  // clear lanes
460  clearPath();
461  // disable buttons
462  myFinishCreationButton->disable();
463  myAbortCreationButton->disable();
464  myRemoveLastInsertedElement->disable();
465  // update info route label
466  updateInfoRouteLabel();
467  // update reachability
468  updateLaneColors();
469  // update view (to see the new route)
470  myFrameParent->getViewNet()->updateViewNet();
471  }
472 }
473 
474 
475 void
477  if (myLanePath.size() > 1) {
478  // remove special color of last selected lane
479  myLanePath.back().first->resetCandidateFlags();
480  // remove last lane
481  myLanePath.pop_back();
482  // change last lane flag
483  if ((myLanePath.size() > 0) && myLanePath.back().first->isSourceCandidate()) {
484  myLanePath.back().first->setSourceCandidate(false);
485  myLanePath.back().first->setTargetCandidate(true);
486  }
487  // enable or disable remove last lane button
488  if (myLanePath.size() > 1) {
489  myRemoveLastInsertedElement->enable();
490  } else {
491  myRemoveLastInsertedElement->disable();
492  }
493  // update info route label
494  updateInfoRouteLabel();
495  // update reachability
496  updateLaneColors();
497  // update view
498  myFrameParent->getViewNet()->updateViewNet();
499  }
500 }
501 
502 
503 long
505  myFrameParent->createPath();
506  return 1;
507 }
508 
509 
510 long
512  // just call abort path creation
513  abortPathCreation();
514  return 1;
515 }
516 
517 
518 long
520  // just call remove last element
521  removeLastElement();
522  return 1;
523 }
524 
525 
526 long
528  // recalc frame
529  recalc();
530  // update lane colors (view will be updated within function)
531  updateLaneColors();
532  return 1;
533 }
534 
535 
536 void
538  if (myLanePath.size() > 0) {
539  // declare variables for route info
540  double length = 0;
541  for (const auto& lane : myLanePath) {
542  length += lane.first->getParentEdge()->getNBEdge()->getLength();
543  }
544  // declare ostringstream for label and fill it
545  std::ostringstream information;
546  information
547  << "- Selected lanes: " << toString(myLanePath.size()) << "\n"
548  << "- Length: " << toString(length);
549  // set new label
550  myInfoRouteLabel->setText(information.str().c_str());
551  } else {
552  myInfoRouteLabel->setText("No lanes selected");
553  }
554 }
555 
556 
557 void
559  // reset all flags
560  for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
561  for (const auto& lane : edge.second->getLanes()) {
562  lane->resetCandidateFlags();
563  }
564  }
565  // clear path
566  myLanePath.clear();
567  // update info route label
568  updateInfoRouteLabel();
569 }
570 
571 /****************************************************************************/
RGBColor::GREY
static const RGBColor GREY
Definition: RGBColor.h:194
GUIDesignLabelFrameThicked
#define GUIDesignLabelFrameThicked
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:247
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:340
GNEAttributeCarrier::getIcon
FXIcon * getIcon() const
get FXIcon associated to this AC
Definition: GNEAttributeCarrier.cpp:579
GLO_TEMPORALSHAPE
@ GLO_TEMPORALSHAPE
temporal shape (used in NETEDIT)
Definition: GUIGlObjectTypes.h:255
GNECommonNetworkModules::ConsecutiveLaneSelector::myRemoveLastInsertedElement
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
Definition: GNECommonNetworkModules.h:194
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:280
GNECommonNetworkModules::ConsecutiveLaneSelector::drawTemporalConsecutiveLanePath
void drawTemporalConsecutiveLanePath(const GUIVisualizationSettings &s) const
draw temporal consecutive lane path
Definition: GNECommonNetworkModules.cpp:387
GNECommonNetworkModules::NetworkElementsSelector::clearSelection
void clearSelection()
clear selection
Definition: GNECommonNetworkModules.cpp:170
GLHelper::drawBoxLines
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:279
GUIGeometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GUIGeometry.cpp:202
MID_GNE_SELECT
@ MID_GNE_SELECT
select element
Definition: GUIAppEnum.h:825
GNECommonNetworkModules::NetworkElementsSelector::getSelectedIDs
std::vector< std::string > getSelectedIDs() const
get selected IDs
Definition: GNECommonNetworkModules.cpp:101
GNECandidateElement::isConflictedCandidate
bool isConflictedCandidate() const
check if this element is a conflicted candidate
Definition: GNECandidateElement.cpp:81
MID_GNE_FINISH
@ MID_GNE_FINISH
finish lane path creation
Definition: GUIAppEnum.h:859
GNECommonNetworkModules::ConsecutiveLaneSelector::clearPath
void clearPath()
clear lanes (and restore colors)
Definition: GNECommonNetworkModules.cpp:558
GUIDesignListFixedHeight
#define GUIDesignListFixedHeight
design for FXLists with height fixed
Definition: GUIDesigns.h:615
GNEFrame
Definition: GNEFrame.h:33
GNEEdge::getGNEConnections
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
Definition: GNEEdge.cpp:791
GNELane::getLane2laneConnections
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition: GNELane.cpp:831
GLHelper.h
GUIDesigns.h
FXDEFMAP
FXDEFMAP(GNECommonNetworkModules::NetworkElementsSelector) SelectorParentNetworkElementsMap[]
GNECommonNetworkModules::ConsecutiveLaneSelector::myFinishCreationButton
FXButton * myFinishCreationButton
button for finish route creation
Definition: GNECommonNetworkModules.h:188
GNECommonNetworkModules
Definition: GNECommonNetworkModules.h:31
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:509
GNECommonNetworkModules::NetworkElementsSelector::NetworkElementsSelector
NetworkElementsSelector()
FOX need this.
Definition: GNECommonNetworkModules.cpp:214
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:68
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdCreatePath
long onCmdCreatePath(FXObject *, FXSelector, void *)
Definition: GNECommonNetworkModules.cpp:504
GUIAppEnum.h
GLHelper::pushMatrix
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:114
GNELane2laneConnection::getLane2laneGeometry
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
Definition: GNELane2laneConnection.cpp:80
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:244
GNECommonNetworkModules::ConsecutiveLaneSelector::myShowCandidateLanes
FXCheckButton * myShowCandidateLanes
CheckBox for show candidate lanes.
Definition: GNECommonNetworkModules.h:197
GNECommonNetworkModules.h
GNECommonNetworkModules::ConsecutiveLaneSelector::removeLastElement
void removeLastElement()
remove path element
Definition: GNECommonNetworkModules.cpp:476
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
GNECommonNetworkModules::NetworkElementsSelector::~NetworkElementsSelector
~NetworkElementsSelector()
destructor
Definition: GNECommonNetworkModules.cpp:97
GNECommonNetworkModules::ConsecutiveLaneSelector::~ConsecutiveLaneSelector
~ConsecutiveLaneSelector()
destructor
Definition: GNECommonNetworkModules.cpp:245
GNECommonNetworkModules::ConsecutiveLaneSelector::ConsecutiveLaneSelector
ConsecutiveLaneSelector(GNEFrame *frameParent)
FOX-declaration.
Definition: GNECommonNetworkModules.cpp:223
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:829
RGBColor
Definition: RGBColor.h:38
GNECommonNetworkModules::ConsecutiveLaneSelector::showConsecutiveLaneSelectorModule
void showConsecutiveLaneSelectorModule()
show ConsecutiveLaneSelector
Definition: GNECommonNetworkModules.cpp:249
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdRemoveLastElement
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted lane".
Definition: GNECommonNetworkModules.cpp:519
GNECommonNetworkModules::NetworkElementsSelector::hideNetworkElementsSelector
void hideNetworkElementsSelector()
hide NetworkElementsSelector Module
Definition: GNECommonNetworkModules.cpp:138
GNELane::getLaneShape
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:132
RGBColor::ORANGE
static const RGBColor ORANGE
Definition: RGBColor.h:191
GNECommonNetworkModules::NetworkElementsSelector::isShown
bool isShown() const
return true if modul is shown
Definition: GNECommonNetworkModules.cpp:144
GUIVisualizationNeteditSizeSettings::polylineWidth
static const double polylineWidth
poly line width
Definition: GUIVisualizationSettings.h:311
GNEViewNet.h
GNEAdditionalHandler.h
update
GNECandidateElement::isSpecialCandidate
bool isSpecialCandidate() const
check if this element is a special candidate
Definition: GNECandidateElement.cpp:75
GUIVisualizationSettings::neteditSizeSettings
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
Definition: GUIVisualizationSettings.h:984
GNECommonNetworkModules::NetworkElementsSelector::NetworkElementType
NetworkElementType
FOX-declaration.
Definition: GNECommonNetworkModules.h:45
MID_GNE_REMOVELAST
@ MID_GNE_REMOVELAST
remove last inserted element in path
Definition: GUIAppEnum.h:861
ProcessError
Definition: UtilExceptions.h:37
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:145
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
GNEApplicationWindow.h
RGBColor::RED
static const RGBColor RED
named colors
Definition: RGBColor.h:185
GNECommonNetworkModules::ConsecutiveLaneSelector::myAbortCreationButton
FXButton * myAbortCreationButton
button for abort route creation
Definition: GNECommonNetworkModules.h:191
GNECommonNetworkModules::ConsecutiveLaneSelector::drawCandidateLanesWithSpecialColor
bool drawCandidateLanesWithSpecialColor() const
draw candidate lanes with special color (Only for candidates, special and conflicted)
Definition: GNECommonNetworkModules.cpp:339
GUIIcon::EDGE
@ EDGE
GNECommonNetworkModules::NetworkElementsSelector::onCmdUseSelectedElements
long onCmdUseSelectedElements(FXObject *, FXSelector, void *)
Definition: GNECommonNetworkModules.cpp:179
GNELane2laneConnection.h
GNECommonNetworkModules::NetworkElementsSelector
Definition: GNECommonNetworkModules.h:39
GNEViewParent.h
GLIncludes.h
GUIGeometry::drawGeometryPoints
static void drawGeometryPoints(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const RGBColor &geometryPointColor, const RGBColor &textColor, const double radius, const double exaggeration, const bool editingElevation, const bool drawExtremeSymbols)
draw geometry points
Definition: GUIGeometry.cpp:322
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
GNENetworkElement::getID
const std::string & getID() const
get ID
Definition: GNENetworkElement.cpp:48
MID_GNE_ABORT
@ MID_GNE_ABORT
abort lane path creation
Definition: GUIAppEnum.h:857
GNECommonNetworkModules::NetworkElementsSelector::showNetworkElementsSelector
void showNetworkElementsSelector()
show NetworkElementsSelector Module
Definition: GNECommonNetworkModules.cpp:129
MID_GNE_CLEARSELECTION
@ MID_GNE_CLEARSELECTION
clear selection of elements
Definition: GUIAppEnum.h:1010
GNECommonNetworkModules::ConsecutiveLaneSelector::updateLaneColors
void updateLaneColors()
update lane colors
Definition: GNECommonNetworkModules.cpp:345
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdShowCandidateLanes
long onCmdShowCandidateLanes(FXObject *, FXSelector, void *)
Called when the user click over check button "show candidate lanes".
Definition: GNECommonNetworkModules.cpp:527
GNECommonNetworkModules::ConsecutiveLaneSelector::getLaneIDPath
const std::vector< std::string > getLaneIDPath() const
get lane IDs
Definition: GNECommonNetworkModules.cpp:281
GNECommonNetworkModules::ConsecutiveLaneSelector
Definition: GNECommonNetworkModules.h:111
FXGroupBoxModule
FXGroupBoxModule (based on FXGroupBox)
Definition: FXGroupBoxModule.h:27
SUMOSAXAttributesImpl_Cached.h
GNECommonNetworkModules::NetworkElementsSelector::isNetworkElementSelected
bool isNetworkElementSelected(const GNENetworkElement *networkElement) const
check if the given networkElement is being selected
Definition: GNECommonNetworkModules.cpp:115
MID_GNE_SHOWCANDIDATES
@ MID_GNE_SHOWCANDIDATES
enable or disable show path candidates
Definition: GUIAppEnum.h:863
GNECommonNetworkModules::ConsecutiveLaneSelector::updateInfoRouteLabel
void updateInfoRouteLabel()
FOX need this.
Definition: GNECommonNetworkModules.cpp:537
GNENetworkElement
Definition: GNENetworkElement.h:41
GLHelper::popMatrix
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
FXGroupBoxModule::getCollapsableFrame
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
Definition: FXGroupBoxModule.cpp:82
GNECommonNetworkModules::ConsecutiveLaneSelector::getLanePath
const std::vector< std::pair< GNELane *, double > > & getLanePath() const
get vector with lanes and clicked positions
Definition: GNECommonNetworkModules.cpp:275
config.h
GNECommonNetworkModules::NetworkElementsSelector::toogleSelectedElement
bool toogleSelectedElement(const GNENetworkElement *networkElement)
toogle selected networkElement
Definition: GNECommonNetworkModules.cpp:150
MID_GNE_USESELECTED
@ MID_GNE_USESELECTED
use selected elements
Definition: GUIAppEnum.h:1008
GNECommonNetworkModules::NetworkElementsSelector::onCmdClearSelection
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
Definition: GNECommonNetworkModules.cpp:208
GNECommonNetworkModules::ConsecutiveLaneSelector::addLane
bool addLane(GNELane *lane)
add lane
Definition: GNECommonNetworkModules.cpp:291
GUIDesignButtonRectangular100
#define GUIDesignButtonRectangular100
button rectangular with thick and raise frame with a width of 100
Definition: GUIDesigns.h:83
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:583
GNECommonNetworkModules::ConsecutiveLaneSelector::hideConsecutiveLaneSelectorModule
void hideConsecutiveLaneSelectorModule()
show ConsecutiveLaneSelector
Definition: GNECommonNetworkModules.cpp:266
GNECandidateElement::isPossibleCandidate
bool isPossibleCandidate() const
check if this element is a possible candidate
Definition: GNECandidateElement.cpp:56
GNECommonNetworkModules::ConsecutiveLaneSelector::abortPathCreation
void abortPathCreation()
abort path creation
Definition: GNECommonNetworkModules.cpp:454
GNECandidateElement::setConflictedCandidate
void setConflictedCandidate(const bool value)
set element as conflicted candidate
Definition: GNECandidateElement.cpp:111
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNECommonNetworkModules::ConsecutiveLaneSelector::onCmdAbortPathCreation
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
Definition: GNECommonNetworkModules.cpp:511
GNELane2laneConnection::exist
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
Definition: GNELane2laneConnection.cpp:74
GNECommonNetworkModules::ConsecutiveLaneSelector::myInfoRouteLabel
FXLabel * myInfoRouteLabel
label with route info
Definition: GNECommonNetworkModules.h:185
GNENet.h
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:192
GNEConnection.h