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-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 /****************************************************************************/
14 // The Widget for add Crossing elements
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 #include <config.h>
21 
25 #include <netedit/GNENet.h>
26 #include <netedit/GNEViewNet.h>
30 #include <netedit/GNEUndoList.h>
31 
32 #include "GNECrossingFrame.h"
33 
34 
35 // ===========================================================================
36 // FOX callback mapping
37 // ===========================================================================
38 
39 FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[] = {
43 };
44 
45 FXDEFMAP(GNECrossingFrame::CrossingParameters) CrossingParametersMap[] = {
48 };
49 
50 FXDEFMAP(GNECrossingFrame::CreateCrossing) CreateCrossingMap[] = {
52 };
53 
54 // Object implementation
55 FXIMPLEMENT(GNECrossingFrame::EdgesSelector, FXGroupBox, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap))
56 FXIMPLEMENT(GNECrossingFrame::CrossingParameters, FXGroupBox, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap))
57 FXIMPLEMENT(GNECrossingFrame::CreateCrossing, FXGroupBox, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap))
58 
59 
60 // ===========================================================================
61 // method definitions
62 // ===========================================================================
63 
64 // ---------------------------------------------------------------------------
65 // GNECrossingFrame::CurrentJunction - methods
66 // ---------------------------------------------------------------------------
67 
69  FXGroupBox(crossingFrameParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame) {
70  // create junction label
71  myCurrentJunctionLabel = new FXLabel(this, "No junction selected", 0, GUIDesignLabelLeft);
72 }
73 
74 
76 
77 
78 void
80  if (junctionID.empty()) {
81  myCurrentJunctionLabel->setText("No junction selected");
82  } else {
83  myCurrentJunctionLabel->setText((std::string("Current Junction: ") + junctionID).c_str());
84  }
85 }
86 
87 // ---------------------------------------------------------------------------
88 // GNECrossingFrame::EdgesSelector - methods
89 // ---------------------------------------------------------------------------
90 
92  FXGroupBox(crossingFrameParent->myContentFrame, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame),
93  myCrossingFrameParent(crossingFrameParent),
94  myCurrentJunction(nullptr) {
95 
96  // Create button for selected edges
97  myUseSelectedEdges = new FXButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignButton);
98 
99  // Create button for clear selection
100  myClearEdgesSelection = new FXButton(this, ("Clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButton);
101 
102  // Create button for invert selection
103  myInvertEdgesSelection = new FXButton(this, ("Invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButton);
104 }
105 
106 
108 
109 
112  return myCurrentJunction;
113 }
114 
115 
116 void
118  // restore color of all lanes of edge candidates
119  restoreEdgeColors();
120  // Set current junction
121  myCurrentJunction = currentJunction;
122  // Update view net to show the new colors
123  myCrossingFrameParent->getViewNet()->update();
124  // check if use selected eges must be enabled
125  myUseSelectedEdges->disable();
126  for (auto i : myCurrentJunction->getGNEEdges()) {
127  if (i->isAttributeCarrierSelected()) {
128  myUseSelectedEdges->enable();
129  }
130  }
131  // Enable rest of elements
132  myClearEdgesSelection->enable();
133  myInvertEdgesSelection->enable();
134 }
135 
136 
137 void
139  // disable current junction
140  myCurrentJunction = nullptr;
141  // disable all elements of the EdgesSelector
142  myUseSelectedEdges->disable();
143  myClearEdgesSelection->disable();
144  myInvertEdgesSelection->disable();
145  // Disable crossing parameters
146  myCrossingFrameParent->myCrossingParameters->disableCrossingParameters();
147 }
148 
149 
150 void
152  if (myCurrentJunction != nullptr) {
153  // restore color of all lanes of edge candidates
154  for (auto i : myCurrentJunction->getGNEEdges()) {
155  for (auto j : i->getLanes()) {
156  j->setSpecialColor(nullptr);
157  }
158  }
159  // Update view net to show the new colors
160  myCrossingFrameParent->getViewNet()->update();
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->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().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->getGNEEdges()) {
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->getGNEEdges()) {
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->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().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 
396  // change color of textfield dependig of myCurrentParametersValid
397  if (myCurrentParametersValid) {
398  myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
399  myCrossingEdges->killFocus();
400  } else {
401  myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
402  myCurrentParametersValid = false;
403  }
404 
405  // Update colors of edges
406  for (auto i : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getGNEEdges()) {
407  if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) != myCurrentSelectedEdges.end()) {
408  for (auto j : i->getLanes()) {
409  j->setSpecialColor(&myCrossingFrameParent->getEdgeCandidateSelectedColor());
410  }
411  } else {
412  for (auto j : i->getLanes()) {
413  j->setSpecialColor(&myCrossingFrameParent->getEdgeCandidateColor());
414  }
415  }
416  }
417  // Update view net
418  myCrossingFrameParent->getViewNet()->update();
419 
420  // Check that at least there are a selected edge
421  if (crossingEdges.empty()) {
422  myCurrentParametersValid = false;
423  }
424 
425  // change label of crossing priority
426  if (myCrossingPriorityCheckButton->getCheck()) {
427  myCrossingPriorityCheckButton->setText("true");
428  } else {
429  myCrossingPriorityCheckButton->setText("false");
430  }
431 
432  // Check width
433  if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
434  GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
435  myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
436  myCrossingWidth->killFocus();
437  } else {
438  myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
439  myCurrentParametersValid = false;
440  }
441 
442  // Enable or disable create crossing button depending of the current parameters
443  myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid);
444  return 0;
445 }
446 
447 
448 long
449 GNECrossingFrame::CrossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {
450  myCrossingFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING));
451  return 1;
452 }
453 
454 // ---------------------------------------------------------------------------
455 // GNECrossingFrame::CreateCrossing - methods
456 // ---------------------------------------------------------------------------
457 
459  FXGroupBox(crossingFrameParent->myContentFrame, "Create", GUIDesignGroupBoxFrame),
460  myCrossingFrameParent(crossingFrameParent) {
461  // Create groupbox for create crossings
462  myCreateCrossingButton = new FXButton(this, "Create crossing", 0, this, MID_GNE_CREATE, GUIDesignButton);
463  myCreateCrossingButton->disable();
464 }
465 
466 
468 
469 
470 long
472  // First check that current parameters are valid
473  if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) {
474  // iterate over junction's crossing to find duplicated crossings
475  if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) {
476  // create new crossing
477  myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(),
478  myCrossingFrameParent->myCrossingParameters->getCrossingEdges(),
479  myCrossingFrameParent->myCrossingParameters->getCrossingWidth(),
480  myCrossingFrameParent->myCrossingParameters->getCrossingPriority(),
481  -1, -1,
483  false, true), true);
484  // clear selected edges
485  myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0);
486  } else {
487  WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed.");
488  }
489  }
490  return 1;
491 }
492 
493 
494 void
496  if (value) {
497  myCreateCrossingButton->enable();
498  } else {
499  myCreateCrossingButton->disable();
500  }
501 }
502 
503 // ---------------------------------------------------------------------------
504 // GNECrossingFrame - methods
505 // ---------------------------------------------------------------------------
506 
507 GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
508  GNEFrame(horizontalFrameParent, viewNet, "Crossings") {
509  // create CurrentJunction modul
511 
512  // Create edge Selector modul
513  myEdgeSelector = new EdgesSelector(this);
514 
515  // Create CrossingParameters modul
517 
518  // create CreateCrossing modul
519  myCreateCrossing = new CreateCrossing(this);
520 
521  // Create groupbox and labels for legends
522  FXGroupBox* groupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
523  FXLabel* colorCandidateLabel = new FXLabel(groupBoxLegend, "Candidate", 0, GUIDesignLabelLeft);
524  colorCandidateLabel->setBackColor(MFXUtils::getFXColor(getEdgeCandidateColor()));
525  FXLabel* colorSelectedLabel = new FXLabel(groupBoxLegend, "Selected", 0, GUIDesignLabelLeft);
526  colorSelectedLabel->setBackColor(MFXUtils::getFXColor(getEdgeCandidateSelectedColor()));
527 
528  // disable edge selector
530 }
531 
532 
534 }
535 
536 
537 void
539  // restore color of all lanes of edge candidates
541  // hide frame
542  GNEFrame::hide();
543 }
544 
545 
546 void
548  // If current element is a junction
549  if (objectsUnderCursor.getJunctionFront()) {
550  // change label
552  // Enable edge selector and crossing parameters
553  myEdgeSelector->enableEdgeSelector(objectsUnderCursor.getJunctionFront());
555  // clears selected edges
557  } else if (objectsUnderCursor.getEdgeFront()) {
558  // mark edge
559  myCrossingParameters->markEdge(objectsUnderCursor.getEdgeFront());
560  } else {
561  // set default label
563  // restore color of all lanes of edge candidates
565  // Disable edge selector
567  }
568  // always update view after an operation
569  myViewNet->update();
570 }
571 
572 
573 void
576  // simply call onCmdCreateCrossing of CreateCrossing modul
578  }
579 }
580 
581 /****************************************************************************/
MID_GNE_CREATE
@ MID_GNE_CREATE
create element
Definition: GUIAppEnum.h:648
GNECrossingFrame::CrossingParameters
Definition: GNECrossingFrame.h:121
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:273
GNECrossingFrame::CrossingParameters::isCrossingParametersEnabled
bool isCrossingParametersEnabled() const
check if currently the CrossingParameters is enabled
Definition: GNECrossingFrame.cpp:272
GNECrossingFrame::CrossingParameters::enableCrossingParameters
void enableCrossingParameters(bool hasTLS)
enable crossing parameters and set the default value of parameters
Definition: GNECrossingFrame.cpp:223
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:42
GNECrossingFrame::CrossingParameters::markEdge
void markEdge(GNEEdge *edge)
mark or dismark edge
Definition: GNECrossingFrame.cpp:278
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1289
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
GNECrossingFrame::CurrentJunction::updateCurrentJunctionLabel
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
Definition: GNECrossingFrame.cpp:79
GUIDesignLabelAttribute
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:170
MID_GNE_ADDITIONALFRAME_USESELECTED
@ MID_GNE_ADDITIONALFRAME_USESELECTED
use selected elements
Definition: GUIAppEnum.h:792
GNECrossingFrame::myEdgeSelector
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
Definition: GNECrossingFrame.h:272
GNECrossingFrame
Definition: GNECrossingFrame.h:32
GNECrossingFrame::CreateCrossing::myCreateCrossingButton
FXButton * myCreateCrossingButton
@field FXButton for create Crossing
Definition: GNECrossingFrame.h:241
GNECrossingFrame::EdgesSelector::restoreEdgeColors
void restoreEdgeColors()
restore colors of all edges
Definition: GNECrossingFrame.cpp:151
GNECrossingFrame::CrossingParameters::isCurrentParametersValid
bool isCurrentParametersValid() const
check if current parameters are valid
Definition: GNECrossingFrame.cpp:358
GNECrossingFrame::EdgesSelector::myInvertEdgesSelection
FXButton * myInvertEdgesSelection
button for invert selection
Definition: GNECrossingFrame.h:111
GNECrossingFrame::CrossingParameters::onCmdHelp
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
Definition: GNECrossingFrame.cpp:449
GNEFrame
Definition: GNEFrame.h:34
GNEViewNet
Definition: GNEViewNet.h:42
GNECrossingFrame::CrossingParameters::clearEdges
void clearEdges()
clear edges
Definition: GNECrossingFrame.cpp:301
GNEViewNetHelper::ObjectsUnderCursor::getEdgeFront
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:268
GUIDesigns.h
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:33
MID_GNE_SET_ATTRIBUTE
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:646
GNEViewNet::update
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:299
GNECrossingFrame::EdgesSelector::EdgesSelector
EdgesSelector(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
Definition: GNECrossingFrame.cpp:91
GNEFrame::myContentFrame
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:124
GNECrossingFrame::CrossingParameters::CrossingParameters
CrossingParameters(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
Definition: GNECrossingFrame.cpp:190
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:50
GUIAppEnum.h
GNEJunction.h
GNECrossingFrame::CreateCrossing::~CreateCrossing
~CreateCrossing()
destructor
Definition: GNECrossingFrame.cpp:467
GNECrossingFrame::EdgesSelector
Definition: GNECrossingFrame.h:62
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:56
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEFrame::getEdgeCandidateSelectedColor
const RGBColor & getEdgeCandidateSelectedColor() const
get selected color
Definition: GNEFrame.cpp:275
MID_HELP
@ MID_HELP
help button
Definition: GUIAppEnum.h:553
GNECrossingFrame::myCreateCrossing
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
Definition: GNECrossingFrame.h:278
GNEJunction::getNBNode
NBNode * getNBNode() const
Return net build node.
Definition: GNEJunction.cpp:398
GNECrossingFrame::EdgesSelector::~EdgesSelector
~EdgesSelector()
destructor
Definition: GNECrossingFrame.cpp:107
MID_GNE_ADDITIONALFRAME_CLEARSELECTION
@ MID_GNE_ADDITIONALFRAME_CLEARSELECTION
clear selection of elements
Definition: GUIAppEnum.h:796
NBNode::isTLControlled
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:313
GNECrossingFrame::createCrossingHotkey
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
Definition: GNECrossingFrame.cpp:574
GNECrossingFrame::CrossingParameters::getCrossingWidth
double getCrossingWidth() const
get crossing width
Definition: GNECrossingFrame.cpp:364
GNECrossingFrame::CreateCrossing::CreateCrossing
CreateCrossing(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
Definition: GNECrossingFrame.cpp:458
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:148
GNECrossingFrame::hide
void hide()
hide crossing frame
Definition: GNECrossingFrame.cpp:538
GNEViewNet.h
SUMO_ATTR_WIDTH
@ SUMO_ATTR_WIDTH
Definition: SUMOXMLDefinitions.h:386
SUMO_ATTR_EDGES
@ SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:427
GNECrossingFrame::CreateCrossing
Definition: GNECrossingFrame.h:213
GNECrossingFrame::CrossingParameters::disableCrossingParameters
void disableCrossingParameters()
disable crossing parameters and clear parameters
Definition: GNECrossingFrame.cpp:253
GNECrossingFrame::CrossingParameters::invertEdges
void invertEdges(GNEJunction *parentJunction)
invert edges
Definition: GNECrossingFrame.cpp:309
GNECrossingFrame::EdgesSelector::enableEdgeSelector
void enableEdgeSelector(GNEJunction *currentJunction)
enable edgeSelector
Definition: GNECrossingFrame.cpp:117
SUMO_TAG_EDGE
@ SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GUIDesignLabelLeft
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:149
GNECrossingFrame::myCurrentJunction
GNECrossingFrame::CurrentJunction * myCurrentJunction
current junction modul
Definition: GNECrossingFrame.h:269
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:115
GNEEdge.h
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:121
GNECrossingFrame::GNECrossingFrame
GNECrossingFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNECrossingFrame.cpp:507
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:239
PositionVector::EMPTY
static const PositionVector EMPTY
empty Vector
Definition: PositionVector.h:73
FXDEFMAP
FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[]
GNECrossingFrame::CreateCrossing::setCreateCrossingButton
void setCreateCrossingButton(bool value)
enable or disable button create crossing
Definition: GNECrossingFrame.cpp:495
GNECrossingFrame::CurrentJunction
Definition: GNECrossingFrame.h:40
Junction
C++ TraCI client API implementation.
GNECrossingFrame::CreateCrossing::onCmdCreateCrossing
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
Definition: GNECrossingFrame.cpp:471
GNELane.h
GNEViewNetHelper::ObjectsUnderCursor::getJunctionFront
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:258
GNECrossingFrame::EdgesSelector::disableEdgeSelector
void disableEdgeSelector()
disable edgeSelector
Definition: GNECrossingFrame.cpp:138
GNECrossingFrame::EdgesSelector::getCurrentJunction
GNEJunction * getCurrentJunction() const
get current junction
Definition: GNECrossingFrame.cpp:111
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNECrossingFrame::EdgesSelector::onCmdClearSelection
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
Definition: GNECrossingFrame.cpp:174
SUMO_ATTR_PRIORITY
@ SUMO_ATTR_PRIORITY
Definition: SUMOXMLDefinitions.h:382
GNECrossingFrame::myCrossingParameters
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
Definition: GNECrossingFrame.h:275
SUMO_TAG_CROSSING
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
Definition: SUMOXMLDefinitions.h:226
GNECrossingFrame::CrossingParameters::myCrossingPriorityLabel
FXLabel * myCrossingPriorityLabel
Label for Priority.
Definition: GNECrossingFrame.h:191
GNEChange_Crossing
Definition: GNEChange_Crossing.h:48
GNECrossingFrame::~GNECrossingFrame
~GNECrossingFrame()
Destructor.
Definition: GNECrossingFrame.cpp:533
GNEJunction::getGNEEdges
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
Definition: GNEJunction.cpp:475
GNENetElement::getNet
GNENet * getNet() const
get Net in which this element is placed
Definition: GNENetElement.cpp:58
GNECrossingFrame::CrossingParameters::myHelpCrossingAttribute
FXButton * myHelpCrossingAttribute
button for help
Definition: GNECrossingFrame.h:203
GNECrossingFrame::CrossingParameters::useSelectedEdges
void useSelectedEdges(GNEJunction *parentJunction)
use selected eges
Definition: GNECrossingFrame.cpp:323
GNECrossingFrame::EdgesSelector::onCmdInvertSelection
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
Definition: GNECrossingFrame.cpp:181
joinToString
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:246
GNECrossingFrame::CrossingParameters::myCrossingPriorityCheckButton
FXCheckButton * myCrossingPriorityCheckButton
CheckBox for Priority.
Definition: GNECrossingFrame.h:194
GNECrossingFrame::CrossingParameters::onCmdSetAttribute
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Definition: GNECrossingFrame.cpp:370
GNENet::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1069
MID_GNE_ADDITIONALFRAME_INVERTSELECTION
@ MID_GNE_ADDITIONALFRAME_INVERTSELECTION
invert selection of eleents
Definition: GUIAppEnum.h:798
GNECrossingFrame::CurrentJunction::~CurrentJunction
~CurrentJunction()
destructor
Definition: GNECrossingFrame.cpp:75
GNECrossingFrame::CrossingParameters::~CrossingParameters
~CrossingParameters()
destructor
Definition: GNECrossingFrame.cpp:219
GNEFrame::getEdgeCandidateColor
const RGBColor & getEdgeCandidateColor() const
get edge candidate color
Definition: GNEFrame.cpp:269
GNECrossingFrame::addCrossing
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
Definition: GNECrossingFrame.cpp:547
config.h
GNEAttributeCarrier::getTagProperties
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
Definition: GNEAttributeCarrier.cpp:1298
GNECrossingFrame::CrossingParameters::myCrossingEdges
FXTextField * myCrossingEdges
TextField for edges.
Definition: GNECrossingFrame.h:188
GNEChange_Crossing.h
GNECrossingFrame::CrossingParameters::myCrossingWidth
FXTextField * myCrossingWidth
TextField for width.
Definition: GNECrossingFrame.h:200
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:113
GNECrossingFrame::CrossingParameters::myCrossingEdgesLabel
FXLabel * myCrossingEdgesLabel
Label for edges.
Definition: GNECrossingFrame.h:185
GNEJunction
Definition: GNEJunction.h:47
GNECrossingFrame.h
GNECrossingFrame::CrossingParameters::myCrossingWidthLabel
FXLabel * myCrossingWidthLabel
Label for width.
Definition: GNECrossingFrame.h:197
GNECrossingFrame::CrossingParameters::getCrossingPriority
bool getCrossingPriority() const
get crossing priority
Definition: GNECrossingFrame.cpp:348
GNECrossingFrame::EdgesSelector::myClearEdgesSelection
FXButton * myClearEdgesSelection
button for clear selection
Definition: GNECrossingFrame.h:108
GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
Definition: GNECrossingFrame.cpp:167
GNECrossingFrame::EdgesSelector::myUseSelectedEdges
FXButton * myUseSelectedEdges
CheckBox for selected edges.
Definition: GNECrossingFrame.h:105
GNEFrame::hide
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:116
GNENet.h
GNEUndoList.h
GNECrossingFrame::CrossingParameters::getCrossingEdges
std::vector< NBEdge * > getCrossingEdges() const
get crossing NBedges
Definition: GNECrossingFrame.cpp:337