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