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-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// The Widget for add Crossing elements
19/****************************************************************************/
20#include <config.h>
21
27#include <netedit/GNENet.h>
28#include <netedit/GNEViewNet.h>
30#include <netedit/GNEUndoList.h>
31
32#include "GNECrossingFrame.h"
33
34
35// ===========================================================================
36// FOX callback mapping
37// ===========================================================================
38
43};
44
48};
49
52};
53
54// Object implementation
55FXIMPLEMENT(GNECrossingFrame::EdgesSelector, MFXGroupBoxModule, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap))
56FXIMPLEMENT(GNECrossingFrame::CrossingParameters, MFXGroupBoxModule, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap))
57FXIMPLEMENT(GNECrossingFrame::CreateCrossing, MFXGroupBoxModule, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap))
58
59
60// ===========================================================================
61// method definitions
62// ===========================================================================
63
64// ---------------------------------------------------------------------------
65// GNECrossingFrame::CurrentJunction - methods
66// ---------------------------------------------------------------------------
67
69 MFXGroupBoxModule(crossingFrameParent, TL("Junction")) {
70 // Create frame for junction ID
71 FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
72 // create label
73 new FXLabel(junctionIDFrame, "", nullptr, GUIDesignLabelAttribute);
74 // create text field and disable it
75 myTextFieldJunctionID = new FXTextField(junctionIDFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECT, GUIDesignTextField);
76 myTextFieldJunctionID->disable();
77}
78
79
81
82
83void
85 if (junctionID.empty()) {
86 myTextFieldJunctionID->setText("");
87 } else {
88 myTextFieldJunctionID->setText(junctionID.c_str());
89 }
90}
91
92// ---------------------------------------------------------------------------
93// GNECrossingFrame::EdgesSelector - methods
94// ---------------------------------------------------------------------------
95
97 MFXGroupBoxModule(crossingFrameParent, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str()),
98 myCrossingFrameParent(crossingFrameParent),
99 myCurrentJunction(nullptr) {
100
101 // Create button for selected edges
102 myUseSelectedEdges = new FXButton(getCollapsableFrame(), ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_USESELECTED, GUIDesignButton);
103
104 // Create button for clear selection
105 myClearEdgesSelection = new FXButton(getCollapsableFrame(), ("Clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_CLEARSELECTION, GUIDesignButton);
106
107 // Create button for invert selection
108 myInvertEdgesSelection = new FXButton(getCollapsableFrame(), ("Invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_INVERTSELECTION, GUIDesignButton);
109}
110
111
113
114
117 return myCurrentJunction;
118}
119
120
121void
123 // restore color of all lanes of edge candidates
124 restoreEdgeColors();
125 // Set current junction
126 myCurrentJunction = currentJunction;
127 // Update view net to show the new colors
128 myCrossingFrameParent->getViewNet()->updateViewNet();
129 // check if use selected eges must be enabled
130 myUseSelectedEdges->disable();
131 for (const auto& edge : myCurrentJunction->getChildEdges()) {
132 if (edge->isAttributeCarrierSelected()) {
133 myUseSelectedEdges->enable();
134 }
135 }
136 // Enable rest of elements
137 myClearEdgesSelection->enable();
138 myInvertEdgesSelection->enable();
139}
140
141
142void
144 // disable current junction
145 myCurrentJunction = nullptr;
146 // disable all elements of the EdgesSelector
147 myUseSelectedEdges->disable();
148 myClearEdgesSelection->disable();
149 myInvertEdgesSelection->disable();
150 // Disable crossing parameters
151 myCrossingFrameParent->myCrossingParameters->disableCrossingParameters();
152}
153
154
155void
157 if (myCurrentJunction != nullptr) {
158 // restore color of all lanes of edge candidates
159 for (const auto& edge : myCurrentJunction->getChildEdges()) {
160 edge->resetCandidateFlags();
161 }
162 // Update view net to show the new colors
163 myCrossingFrameParent->getViewNet()->updateViewNet();
164 myCurrentJunction = nullptr;
165 }
166}
167
168
169long
171 myCrossingFrameParent->myCrossingParameters->useSelectedEdges(myCurrentJunction);
172 return 1;
173}
174
175
176long
178 myCrossingFrameParent->myCrossingParameters->clearEdges();
179 return 1;
180}
181
182
183long
185 myCrossingFrameParent->myCrossingParameters->invertEdges(myCurrentJunction);
186 return 1;
187}
188
189// ---------------------------------------------------------------------------
190// GNECrossingFrame::GNENeteditAttributes- methods
191// ---------------------------------------------------------------------------
192
194 MFXGroupBoxModule(crossingFrameParent, TL("Crossing parameters")),
195 myCrossingFrameParent(crossingFrameParent),
196 myCrossingTemplate(nullptr),
197 myCurrentParametersValid(true) {
198 // createcrossing template
199 myCrossingTemplate = new GNECrossing(crossingFrameParent->getViewNet()->getNet());
200 FXHorizontalFrame* crossingParameter = nullptr;
201 // create label and string textField for edges
202 crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
203 myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), nullptr, GUIDesignLabelAttribute);
204 myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
205 myCrossingEdgesLabel->disable();
206 myCrossingEdges->disable();
207 // create label and checkbox for Priority
208 crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
209 myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), nullptr, GUIDesignLabelAttribute);
210 myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
211 myCrossingPriorityLabel->disable();
213 // create label and textfield for width
214 crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
215 myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelAttribute);
216 myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
217 myCrossingWidthLabel->disable();
218 myCrossingWidth->disable();
219 // Create help button
220 myHelpCrossingAttribute = new FXButton(getCollapsableFrame(), TL("Help"), nullptr, this, MID_HELP, GUIDesignButtonRectangular);
221 myHelpCrossingAttribute->disable();
222}
223
224
226 delete myCrossingTemplate;
227}
228
229
230void
232 // obtain Tag Values
233 const auto& tagProperties = GNEAttributeCarrier::getTagProperty(SUMO_TAG_CROSSING);
234 // Enable all elements of the crossing frames
235 myCrossingEdgesLabel->enable();
236 myCrossingEdges->enable();
237 myCrossingPriorityLabel->enable();
238 // only enable priority check button if junction's crossing doesn't have TLS
239 if (hasTLS) {
240 myCrossingPriorityCheckButton->disable();
241 } else {
242 myCrossingPriorityCheckButton->enable();
243 }
244 myCrossingWidthLabel->enable();
245 myCrossingWidth->enable();
246 myHelpCrossingAttribute->enable();
247 // set values of parameters
248 onCmdSetAttribute(nullptr, 0, nullptr);
249 // Crossings placed in junctinos with TLS always has priority
250 if (hasTLS) {
251 myCrossingPriorityCheckButton->setCheck(TRUE);
252 } else {
253 myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(tagProperties.getDefaultValue(SUMO_ATTR_PRIORITY)));
254 }
255 myCrossingWidth->setText(tagProperties.getDefaultValue(SUMO_ATTR_WIDTH).c_str());
256 myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
257}
258
259
260void
262 // clear all values of parameters
263 myCrossingEdges->setText("");
264 myCrossingPriorityCheckButton->setCheck(false);
265 myCrossingPriorityCheckButton->setText(TL("false"));
266 myCrossingWidth->setText("");
267 // Disable all elements of the crossing frames
268 myCrossingEdgesLabel->disable();
269 myCrossingEdges->disable();
270 myCrossingPriorityLabel->disable();
271 myCrossingPriorityCheckButton->disable();
272 myCrossingWidthLabel->disable();
273 myCrossingWidth->disable();
274 myHelpCrossingAttribute->disable();
275 myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(false);
276}
277
278
279bool
281 return myCrossingEdgesLabel->isEnabled();
282}
283
284
285void
287 GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();
288 if (currentJunction != nullptr) {
289 // Check if edge belongs to junction's edge
290 if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) != currentJunction->getChildEdges().end()) {
291 // Update text field with the new edge
292 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
293 // Check if new edge must be added or removed
294 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID());
295 if (itFinder == crossingEdges.end()) {
296 crossingEdges.push_back(edge->getID());
297 } else {
298 crossingEdges.erase(itFinder);
299 }
300 myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
301 }
302 // Update colors and attributes
303 onCmdSetAttribute(nullptr, 0, nullptr);
304 }
305}
306
307
308void
310 myCrossingEdges->setText("");
311 // Update colors and attributes
312 onCmdSetAttribute(nullptr, 0, nullptr);
313}
314
315
316void
318 std::vector<std::string> crossingEdges;
319 for (auto i : parentJunction->getChildEdges()) {
320 if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) == myCurrentSelectedEdges.end()) {
321 crossingEdges.push_back(i->getID());
322 }
323 }
324 myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
325 // Update colors and attributes
326 onCmdSetAttribute(nullptr, 0, nullptr);
327}
328
329
330void
332 std::vector<std::string> crossingEdges;
333 for (auto i : parentJunction->getChildEdges()) {
334 if (i->isAttributeCarrierSelected()) {
335 crossingEdges.push_back(i->getID());
336 }
337 }
338 myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
339 // Update colors and attributes
340 onCmdSetAttribute(nullptr, 0, nullptr);
341}
342
343
344std::vector<NBEdge*>
346 std::vector<NBEdge*> NBEdgeVector;
347 // Iterate over myCurrentSelectedEdges
348 for (auto i : myCurrentSelectedEdges) {
349 NBEdgeVector.push_back(i->getNBEdge());
350 }
351 return NBEdgeVector;
352}
353
354
355bool
357 if (myCrossingPriorityCheckButton->getCheck()) {
358 return true;
359 } else {
360 return false;
361 }
362}
363
364
365bool
367 return myCurrentParametersValid;
368}
369
370
371double
373 return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());
374}
375
376
377long
379 myCurrentParametersValid = true;
380 // get string vector with the edges
381 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
382 // Clear selected edges
383 myCurrentSelectedEdges.clear();
384 // iterate over vector of edge IDs
385 for (auto i : crossingEdges) {
386 GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveEdge(i, false);
387 GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();
388 // Check that edge exists and belongs to Junction
389 if (edge == nullptr) {
390 myCurrentParametersValid = false;
391 } else if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) == currentJunction->getChildEdges().end()) {
392 myCurrentParametersValid = false;
393 } else {
394 // select or unselected edge
395 auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
396 if (itFinder == myCurrentSelectedEdges.end()) {
397 myCurrentSelectedEdges.push_back(edge);
398 } else {
399 myCurrentSelectedEdges.erase(itFinder);
400 }
401 }
402 }
403 // change color of textfield dependig of myCurrentParametersValid
404 if (myCurrentParametersValid) {
405 myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
406 myCrossingEdges->killFocus();
407 } else {
408 myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
409 myCurrentParametersValid = false;
410 }
411 // Update edge colors
412 for (const auto& edge : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {
413 // restore colors
414 edge->resetCandidateFlags();
415 // set selected or candidate color
416 if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge) != myCurrentSelectedEdges.end()) {
417 edge->setTargetCandidate(true);
418 } else {
419 edge->setPossibleCandidate(true);
420 }
421 }
422 // Update view net
423 myCrossingFrameParent->getViewNet()->updateViewNet();
424
425 // Check that at least there are a selected edge
426 if (crossingEdges.empty()) {
427 myCurrentParametersValid = false;
428 }
429
430 // change label of crossing priority
431 if (myCrossingPriorityCheckButton->getCheck()) {
432 myCrossingPriorityCheckButton->setText(TL("true"));
433 } else {
434 myCrossingPriorityCheckButton->setText(TL("false"));
435 }
436
437 // Check width
438 if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
439 GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
440 myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
441 myCrossingWidth->killFocus();
442 } else {
443 myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
444 myCurrentParametersValid = false;
445 }
446
447 // Enable or disable create crossing button depending of the current parameters
448 myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid);
449 return 0;
450}
451
452
453long
455 myCrossingFrameParent->openHelpAttributesDialog(myCrossingTemplate);
456 return 1;
457}
458
459// ---------------------------------------------------------------------------
460// GNECrossingFrame::CreateCrossing - methods
461// ---------------------------------------------------------------------------
462
464 MFXGroupBoxModule(crossingFrameParent, TL("Create")),
465 myCrossingFrameParent(crossingFrameParent) {
466 // Create groupbox for create crossings
467 myCreateCrossingButton = new FXButton(getCollapsableFrame(), TL("Create crossing"), 0, this, MID_GNE_CREATE, GUIDesignButton);
468 myCreateCrossingButton->disable();
469}
470
471
473
474
475long
477 // First check that current parameters are valid
478 if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) {
479 // iterate over junction's crossing to find duplicated crossings
480 if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) {
481 // create new crossing
482 myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(),
483 myCrossingFrameParent->myCrossingParameters->getCrossingEdges(),
484 myCrossingFrameParent->myCrossingParameters->getCrossingWidth(),
485 myCrossingFrameParent->myCrossingParameters->getCrossingPriority(),
486 -1, -1,
488 false, true), true);
489 // clear selected edges
490 myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0);
491 // update default create edge option
492 myCrossingFrameParent->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->enableCheckBoxDisablePedestrians();
493 } else {
494 WRITE_WARNING(TL("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed."));
495 }
496 }
497 return 1;
498}
499
500
501void
503 if (value) {
504 myCreateCrossingButton->enable();
505 } else {
506 myCreateCrossingButton->disable();
507 }
508}
509
510// ---------------------------------------------------------------------------
511// GNECrossingFrame::Legend - methods
512// ---------------------------------------------------------------------------
513
515 MFXGroupBoxModule(crossingFrameParent, TL("Information")) {
516 // candidate
517 FXLabel* colorCandidateLabel = new FXLabel(getCollapsableFrame(), " Candidate", 0, GUIDesignLabelLeft);
518 colorCandidateLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible));
519 colorCandidateLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
520 // selected
521 FXLabel* colorSelectedLabel = new FXLabel(getCollapsableFrame(), " Selected", 0, GUIDesignLabelLeft);
522 colorSelectedLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target));
523}
524
525
527
528// ---------------------------------------------------------------------------
529// GNECrossingFrame - methods
530// ---------------------------------------------------------------------------
531
533 GNEFrame(viewParent, viewNet, "Crossings") {
534 // create CurrentJunction modul
536
537 // Create edge Selector modul
538 myEdgeSelector = new EdgesSelector(this);
539
540 // Create CrossingParameters modul
542
543 // create CreateCrossing modul
545
546 // create information modul
547 myInformation = new Information(this);
548
549 // disable edge selector
551}
552
553
555}
556
557
558void
560 // restore color of all lanes of edge candidates
562 // hide frame
564}
565
566
567void
569 // If current element is a junction
570 if (objectsUnderCursor.getJunctionFront()) {
571 // change label
573 // Enable edge selector and crossing parameters
576 // clears selected edges
578 } else if (objectsUnderCursor.getEdgeFront()) {
579 // mark edge
580 myCrossingParameters->markEdge(objectsUnderCursor.getEdgeFront());
581 } else {
582 // set default label
584 // restore color of all lanes of edge candidates
586 // Disable edge selector
588 }
589 // always update view after an operation
591}
592
593
594void
597 // simply call onCmdCreateCrossing of CreateCrossing modul
599 }
600}
601
602
603/****************************************************************************/
FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:870
@ MID_GNE_CLEARSELECTION
clear selection of elements
Definition: GUIAppEnum.h:1101
@ MID_GNE_USESELECTED
use selected elements
Definition: GUIAppEnum.h:1099
@ MID_GNE_CREATE
create element
Definition: GUIAppEnum.h:872
@ MID_HELP
help button
Definition: GUIAppEnum.h:641
@ MID_GNE_SELECT
select element
Definition: GUIAppEnum.h:886
@ MID_GNE_INVERTSELECTION
invert selection of elements
Definition: GUIAppEnum.h:1103
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:217
#define GUIDesignButton
Definition: GUIDesigns.h:77
#define GUIDesignTextField
Definition: GUIDesigns.h:48
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:397
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:241
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:83
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:69
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:169
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:265
#define TL(string)
Definition: MsgHandler.h:282
@ 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:282
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
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.
GNECrossing * myCrossingTemplate
crossing template
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.
Information(GNECrossingFrame *crossingFrameParent)
constructor
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::Information * myInformation
information modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
GNECrossingFrame::CurrentJunction * myCurrentJunction
FOX need this.
GNECrossingFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
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)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:42
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:150
GNEViewNet * myViewNet
FOX need this.
Definition: GNEFrame.h:117
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:124
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
NBNode * getNBNode() const
Return net build node.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:132
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
GNENet * getNet() const
get the net object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:414
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:84
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
C++ TraCI client API implementation.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
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:321
static const PositionVector EMPTY
empty Vector
static const RGBColor WHITE
Definition: RGBColor.h:192
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element