Eclipse SUMO - Simulation of Urban MObility
GNECrossingFrame.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-2020 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 // The Widget for add Crossing elements
19 /****************************************************************************/
20 #include <config.h>
21 
25 #include <netedit/GNENet.h>
26 #include <netedit/GNEViewNet.h>
27 #include <netedit/GNEUndoList.h>
28 
29 #include "GNECrossingFrame.h"
30 
31 
32 // ===========================================================================
33 // FOX callback mapping
34 // ===========================================================================
35 
40 };
41 
42 FXDEFMAP(GNECrossingFrame::CrossingParameters) CrossingParametersMap[] = {
45 };
46 
49 };
50 
51 // Object implementation
52 FXIMPLEMENT(GNECrossingFrame::EdgesSelector, FXGroupBox, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap))
53 FXIMPLEMENT(GNECrossingFrame::CrossingParameters, FXGroupBox, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap))
54 FXIMPLEMENT(GNECrossingFrame::CreateCrossing, FXGroupBox, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap))
55 
56 
57 // ===========================================================================
58 // method definitions
59 // ===========================================================================
60 
61 // ---------------------------------------------------------------------------
62 // GNECrossingFrame::CurrentJunction - methods
63 // ---------------------------------------------------------------------------
64 
66  FXGroupBox(crossingFrameParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame) {
67  // Create frame for junction ID
68  FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
69  // create label
70  new FXLabel(junctionIDFrame, "", nullptr, GUIDesignLabelAttribute);
71  // create text field and disable it
72  myTextFieldJunctionID = new FXTextField(junctionIDFrame, GUIDesignTextFieldNCol, this, MID_GNE_TLSFRAME_SELECT_JUNCTION, GUIDesignTextField);
73  myTextFieldJunctionID->disable();
74 }
75 
76 
78 
79 
80 void
82  if (junctionID.empty()) {
83  myTextFieldJunctionID->setText("");
84  } else {
85  myTextFieldJunctionID->setText(junctionID.c_str());
86  }
87 }
88 
89 // ---------------------------------------------------------------------------
90 // GNECrossingFrame::EdgesSelector - methods
91 // ---------------------------------------------------------------------------
92 
94  FXGroupBox(crossingFrameParent->myContentFrame, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame),
95  myCrossingFrameParent(crossingFrameParent),
96  myCurrentJunction(nullptr) {
97 
98  // Create button for selected edges
99  myUseSelectedEdges = new FXButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignButton);
100 
101  // Create button for clear selection
102  myClearEdgesSelection = new FXButton(this, ("Clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButton);
103 
104  // Create button for invert selection
105  myInvertEdgesSelection = new FXButton(this, ("Invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButton);
106 }
107 
108 
110 
111 
114  return myCurrentJunction;
115 }
116 
117 
118 void
120  // restore color of all lanes of edge candidates
121  restoreEdgeColors();
122  // Set current junction
123  myCurrentJunction = currentJunction;
124  // Update view net to show the new colors
125  myCrossingFrameParent->getViewNet()->updateViewNet();
126  // check if use selected eges must be enabled
127  myUseSelectedEdges->disable();
128  for (const auto& edge : myCurrentJunction->getChildEdges()) {
129  if (edge->isAttributeCarrierSelected()) {
130  myUseSelectedEdges->enable();
131  }
132  }
133  // Enable rest of elements
134  myClearEdgesSelection->enable();
135  myInvertEdgesSelection->enable();
136 }
137 
138 
139 void
141  // disable current junction
142  myCurrentJunction = nullptr;
143  // disable all elements of the EdgesSelector
144  myUseSelectedEdges->disable();
145  myClearEdgesSelection->disable();
146  myInvertEdgesSelection->disable();
147  // Disable crossing parameters
148  myCrossingFrameParent->myCrossingParameters->disableCrossingParameters();
149 }
150 
151 
152 void
154  if (myCurrentJunction != nullptr) {
155  // restore color of all lanes of edge candidates
156  for (const auto& edge : myCurrentJunction->getChildEdges()) {
157  edge->resetCandidateFlags();
158  }
159  // Update view net to show the new colors
160  myCrossingFrameParent->getViewNet()->updateViewNet();
161  myCurrentJunction = nullptr;
162  }
163 }
164 
165 
166 long
168  myCrossingFrameParent->myCrossingParameters->useSelectedEdges(myCurrentJunction);
169  return 1;
170 }
171 
172 
173 long
175  myCrossingFrameParent->myCrossingParameters->clearEdges();
176  return 1;
177 }
178 
179 
180 long
182  myCrossingFrameParent->myCrossingParameters->invertEdges(myCurrentJunction);
183  return 1;
184 }
185 
186 // ---------------------------------------------------------------------------
187 // GNECrossingFrame::NeteditAttributes- methods
188 // ---------------------------------------------------------------------------
189 
191  FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame),
192  myCrossingFrameParent(crossingFrameParent),
193  myCurrentParametersValid(true) {
194  FXHorizontalFrame* crossingParameter = nullptr;
195  // create label and string textField for edges
196  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
197  myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), nullptr, GUIDesignLabelAttribute);
198  myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
199  myCrossingEdgesLabel->disable();
200  myCrossingEdges->disable();
201  // create label and checkbox for Priority
202  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
203  myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), nullptr, GUIDesignLabelAttribute);
204  myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
205  myCrossingPriorityLabel->disable();
207  // create label and textfield for width
208  crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
209  myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelAttribute);
210  myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
211  myCrossingWidthLabel->disable();
212  myCrossingWidth->disable();
213  // Create help button
214  myHelpCrossingAttribute = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
215  myHelpCrossingAttribute->disable();
216 }
217 
218 
220 
221 
222 void
224  // obtain Tag Values
225  const auto& tagProperties = GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING);
226  // Enable all elements of the crossing frames
227  myCrossingEdgesLabel->enable();
228  myCrossingEdges->enable();
229  myCrossingPriorityLabel->enable();
230  // only enable priority check button if junction's crossing doesn't have TLS
231  if (hasTLS) {
232  myCrossingPriorityCheckButton->disable();
233  } else {
234  myCrossingPriorityCheckButton->enable();
235  }
236  myCrossingWidthLabel->enable();
237  myCrossingWidth->enable();
238  myHelpCrossingAttribute->enable();
239  // set values of parameters
240  onCmdSetAttribute(nullptr, 0, nullptr);
241  // Crossings placed in junctinos with TLS always has priority
242  if (hasTLS) {
243  myCrossingPriorityCheckButton->setCheck(TRUE);
244  } else {
245  myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(tagProperties.getDefaultValue(SUMO_ATTR_PRIORITY)));
246  }
247  myCrossingWidth->setText(tagProperties.getDefaultValue(SUMO_ATTR_WIDTH).c_str());
248  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
249 }
250 
251 
252 void
254  // clear all values of parameters
255  myCrossingEdges->setText("");
256  myCrossingPriorityCheckButton->setCheck(false);
257  myCrossingPriorityCheckButton->setText("false");
258  myCrossingWidth->setText("");
259  // Disable all elements of the crossing frames
260  myCrossingEdgesLabel->disable();
261  myCrossingEdges->disable();
262  myCrossingPriorityLabel->disable();
263  myCrossingPriorityCheckButton->disable();
264  myCrossingWidthLabel->disable();
265  myCrossingWidth->disable();
266  myHelpCrossingAttribute->disable();
267  myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(false);
268 }
269 
270 
271 bool
273  return myCrossingEdgesLabel->isEnabled();
274 }
275 
276 
277 void
279  GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();
280  if (currentJunction != nullptr) {
281  // Check if edge belongs to junction's edge
282  if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) != currentJunction->getChildEdges().end()) {
283  // Update text field with the new edge
284  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
285  // Check if new edge must be added or removed
286  std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID());
287  if (itFinder == crossingEdges.end()) {
288  crossingEdges.push_back(edge->getID());
289  } else {
290  crossingEdges.erase(itFinder);
291  }
292  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
293  }
294  // Update colors and attributes
295  onCmdSetAttribute(nullptr, 0, nullptr);
296  }
297 }
298 
299 
300 void
302  myCrossingEdges->setText("");
303  // Update colors and attributes
304  onCmdSetAttribute(nullptr, 0, nullptr);
305 }
306 
307 
308 void
310  std::vector<std::string> crossingEdges;
311  for (auto i : parentJunction->getChildEdges()) {
312  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) == myCurrentSelectedEdges.end()) {
313  crossingEdges.push_back(i->getID());
314  }
315  }
316  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
317  // Update colors and attributes
318  onCmdSetAttribute(nullptr, 0, nullptr);
319 }
320 
321 
322 void
324  std::vector<std::string> crossingEdges;
325  for (auto i : parentJunction->getChildEdges()) {
326  if (i->isAttributeCarrierSelected()) {
327  crossingEdges.push_back(i->getID());
328  }
329  }
330  myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
331  // Update colors and attributes
332  onCmdSetAttribute(nullptr, 0, nullptr);
333 }
334 
335 
336 std::vector<NBEdge*>
338  std::vector<NBEdge*> NBEdgeVector;
339  // Iterate over myCurrentSelectedEdges
340  for (auto i : myCurrentSelectedEdges) {
341  NBEdgeVector.push_back(i->getNBEdge());
342  }
343  return NBEdgeVector;
344 }
345 
346 
347 bool
349  if (myCrossingPriorityCheckButton->getCheck()) {
350  return true;
351  } else {
352  return false;
353  }
354 }
355 
356 
357 bool
359  return myCurrentParametersValid;
360 }
361 
362 
363 double
365  return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());
366 }
367 
368 
369 long
371  myCurrentParametersValid = true;
372  // get string vector with the edges
373  std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
374  // Clear selected edges
375  myCurrentSelectedEdges.clear();
376  // iterate over vector of edge IDs
377  for (auto i : crossingEdges) {
378  GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->retrieveEdge(i, false);
379  GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();
380  // Check that edge exists and belongs to Junction
381  if (edge == nullptr) {
382  myCurrentParametersValid = false;
383  } else if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) == currentJunction->getChildEdges().end()) {
384  myCurrentParametersValid = false;
385  } else {
386  // select or unselected edge
387  auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
388  if (itFinder == myCurrentSelectedEdges.end()) {
389  myCurrentSelectedEdges.push_back(edge);
390  } else {
391  myCurrentSelectedEdges.erase(itFinder);
392  }
393  }
394  }
395  // change color of textfield dependig of myCurrentParametersValid
396  if (myCurrentParametersValid) {
397  myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
398  myCrossingEdges->killFocus();
399  } else {
400  myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
401  myCurrentParametersValid = false;
402  }
403  // Update edge colors
404  for (const auto& edge : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {
405  // restore colors
406  edge->resetCandidateFlags();
407  // set selected or candidate color
408  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge) != myCurrentSelectedEdges.end()) {
409  edge->setTargetCandidate(true);
410  } else {
411  edge->setPossibleCandidate(true);
412  }
413  }
414  // Update view net
415  myCrossingFrameParent->getViewNet()->updateViewNet();
416 
417  // Check that at least there are a selected edge
418  if (crossingEdges.empty()) {
419  myCurrentParametersValid = false;
420  }
421 
422  // change label of crossing priority
423  if (myCrossingPriorityCheckButton->getCheck()) {
424  myCrossingPriorityCheckButton->setText("true");
425  } else {
426  myCrossingPriorityCheckButton->setText("false");
427  }
428 
429  // Check width
430  if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
431  GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
432  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
433  myCrossingWidth->killFocus();
434  } else {
435  myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
436  myCurrentParametersValid = false;
437  }
438 
439  // Enable or disable create crossing button depending of the current parameters
440  myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid);
441  return 0;
442 }
443 
444 
445 long
446 GNECrossingFrame::CrossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {
447  myCrossingFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING));
448  return 1;
449 }
450 
451 // ---------------------------------------------------------------------------
452 // GNECrossingFrame::CreateCrossing - methods
453 // ---------------------------------------------------------------------------
454 
456  FXGroupBox(crossingFrameParent->myContentFrame, "Create", GUIDesignGroupBoxFrame),
457  myCrossingFrameParent(crossingFrameParent) {
458  // Create groupbox for create crossings
459  myCreateCrossingButton = new FXButton(this, "Create crossing", 0, this, MID_GNE_CREATE, GUIDesignButton);
460  myCreateCrossingButton->disable();
461 }
462 
463 
465 
466 
467 long
469  // First check that current parameters are valid
470  if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) {
471  // iterate over junction's crossing to find duplicated crossings
472  if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) {
473  // create new crossing
474  myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(),
475  myCrossingFrameParent->myCrossingParameters->getCrossingEdges(),
476  myCrossingFrameParent->myCrossingParameters->getCrossingWidth(),
477  myCrossingFrameParent->myCrossingParameters->getCrossingPriority(),
478  -1, -1,
480  false, true), true);
481  // clear selected edges
482  myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0);
483  } else {
484  WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
485  }
486  }
487  return 1;
488 }
489 
490 
491 void
493  if (value) {
494  myCreateCrossingButton->enable();
495  } else {
496  myCreateCrossingButton->disable();
497  }
498 }
499 
500 // ---------------------------------------------------------------------------
501 // GNECrossingFrame - methods
502 // ---------------------------------------------------------------------------
503 
504 GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
505  GNEFrame(horizontalFrameParent, viewNet, "Crossings") {
506  // create CurrentJunction modul
508 
509  // Create edge Selector modul
510  myEdgeSelector = new EdgesSelector(this);
511 
512  // Create CrossingParameters modul
514 
515  // create CreateCrossing modul
516  myCreateCrossing = new CreateCrossing(this);
517 
518  // Create groupbox and labels for legends
519  FXGroupBox* groupBoxLegend = new FXGroupBox(myContentFrame, "", GUIDesignGroupBoxFrame);
520  FXLabel* colorCandidateLabel = new FXLabel(groupBoxLegend, " Candidate", 0, GUIDesignLabelLeft);
521  colorCandidateLabel->setBackColor(MFXUtils::getFXColor(viewNet->getVisualisationSettings().candidateColorSettings.possible));
522  colorCandidateLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
523  FXLabel* colorSelectedLabel = new FXLabel(groupBoxLegend, " Selected", 0, GUIDesignLabelLeft);
524  colorSelectedLabel->setBackColor(MFXUtils::getFXColor(viewNet->getVisualisationSettings().candidateColorSettings.target));
525 
526  // disable edge selector
528 }
529 
530 
532 }
533 
534 
535 void
537  // restore color of all lanes of edge candidates
539  // hide frame
540  GNEFrame::hide();
541 }
542 
543 
544 void
546  // If current element is a junction
547  if (objectsUnderCursor.getJunctionFront()) {
548  // change label
550  // Enable edge selector and crossing parameters
551  myEdgeSelector->enableEdgeSelector(objectsUnderCursor.getJunctionFront());
553  // clears selected edges
555  } else if (objectsUnderCursor.getEdgeFront()) {
556  // mark edge
557  myCrossingParameters->markEdge(objectsUnderCursor.getEdgeFront());
558  } else {
559  // set default label
561  // restore color of all lanes of edge candidates
563  // Disable edge selector
565  }
566  // always update view after an operation
568 }
569 
570 
571 void
574  // simply call onCmdCreateCrossing of CreateCrossing modul
576  }
577 }
578 
579 
580 /****************************************************************************/
FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[]
@ MID_GNE_ADDITIONALFRAME_CLEARSELECTION
clear selection of elements
Definition: GUIAppEnum.h:915
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:717
@ MID_GNE_CREATE
create element
Definition: GUIAppEnum.h:719
@ MID_HELP
help button
Definition: GUIAppEnum.h:578
@ MID_GNE_ADDITIONALFRAME_USESELECTED
use selected elements
Definition: GUIAppEnum.h:911
@ MID_GNE_ADDITIONALFRAME_INVERTSELECTION
invert selection of eleents
Definition: GUIAppEnum.h:917
@ MID_GNE_TLSFRAME_SELECT_JUNCTION
selected junction von TLS
Definition: GUIAppEnum.h:859
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:175
#define GUIDesignButton
Definition: GUIDesigns.h:62
#define GUIDesignTextField
Definition: GUIDesigns.h:36
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:313
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:199
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:68
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:54
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:278
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:133
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_PRIORITY
@ SUMO_ATTR_WIDTH
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:250
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
static const GNETagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
GNENet * getNet() const
get pointer to net
void setCreateCrossingButton(bool value)
enable or disable button create crossing
CreateCrossing(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
FXButton * myCreateCrossingButton
@field FXButton for create Crossing
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
void enableCrossingParameters(bool hasTLS)
enable crossing parameters and set the default value of parameters
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
double getCrossingWidth() const
get crossing width
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXLabel * myCrossingWidthLabel
Label for width.
void markEdge(GNEEdge *edge)
mark or dismark edge
bool getCrossingPriority() const
get crossing priority
CrossingParameters(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
void disableCrossingParameters()
disable crossing parameters and clear parameters
FXTextField * myCrossingWidth
TextField for width.
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
void invertEdges(GNEJunction *parentJunction)
invert edges
bool isCrossingParametersEnabled() const
check if currently the CrossingParameters is enabled
FXButton * myHelpCrossingAttribute
button for help
FXTextField * myCrossingEdges
TextField for edges.
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
FXLabel * myCrossingEdgesLabel
Label for edges.
bool isCurrentParametersValid() const
check if current parameters are valid
FXLabel * myCrossingPriorityLabel
Label for Priority.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
EdgesSelector(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
FXButton * myInvertEdgesSelection
button for invert selection
GNEJunction * getCurrentJunction() const
get current junction
FXButton * myClearEdgesSelection
button for clear selection
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
void restoreEdgeColors()
restore colors of all edges
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
void disableEdgeSelector()
disable edgeSelector
FXButton * myUseSelectedEdges
CheckBox for selected edges.
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
GNECrossingFrame::CurrentJunction * myCurrentJunction
current junction modul
void hide()
hide crossing frame
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
GNECrossingFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:113
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:116
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
NBNode * getNBNode() const
Return net build node.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
Definition: GNENet.cpp:1141
const std::string & getID() const
get ID
class used to group all variables related with objects under cursor after a click over view
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:318
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
C++ TraCI client API implementation.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:317
static const PositionVector EMPTY
empty Vector
static const RGBColor WHITE
Definition: RGBColor.h:187
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element