Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNECrossingFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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
28#include <netedit/GNENet.h>
29#include <netedit/GNEViewNet.h>
31#include <netedit/GNEUndoList.h>
32
33#include "GNECrossingFrame.h"
34
35
36// ===========================================================================
37// FOX callback mapping
38// ===========================================================================
39
44
49
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, GUIDesignLabelThickedFixed(100));
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, TL("selection of edges")),
98 myCrossingFrameParent(crossingFrameParent),
99 myCurrentJunction(nullptr) {
100
101 // Create button for selected edges
103
104 // Create button for clear selection
106}
107
108
110
111
114 return myCurrentJunction;
115}
116
117
118void
120 // restore color of all lanes of edge candidates
121 restoreEdgeColors();
122 // Set current junction
123 myCurrentJunction = currentJunction;
124 // Update view net to show the new colors
125 myCrossingFrameParent->getViewNet()->updateViewNet();
126 // check if use selected eges must be enabled
127 myUseSelectedEdges->disable();
128 for (const auto& edge : myCurrentJunction->getChildEdges()) {
129 if (edge->isAttributeCarrierSelected()) {
130 myUseSelectedEdges->enable();
131 }
132 }
133 // Enable rest of elements
134 myClearEdgesSelection->enable();
135}
136
137
138void
140 // disable current junction
141 myCurrentJunction = nullptr;
142 // disable all elements of the EdgesSelector
143 myUseSelectedEdges->disable();
144 myClearEdgesSelection->disable();
145 // Disable crossing parameters
146 myCrossingFrameParent->myCrossingParameters->disableCrossingParameters();
147 // Update view net to show the new colors
148 myCrossingFrameParent->getViewNet()->updateViewNet();
149}
150
151
152void
154 if (myCurrentJunction != nullptr) {
155 // restore color of all lanes of edge candidates
156 for (const auto& edge : myCurrentJunction->getChildEdges()) {
157 edge->resetCandidateFlags();
158 }
159 // Update view net to show the new colors
160 myCrossingFrameParent->getViewNet()->updateViewNet();
161 myCurrentJunction = nullptr;
162 }
163}
164
165
166long
168 myCrossingFrameParent->myCrossingParameters->useSelectedEdges(myCurrentJunction);
169 return 1;
170}
171
172
173long
175 myCrossingFrameParent->myCrossingParameters->clearEdges();
176 return 1;
177}
178
179// ---------------------------------------------------------------------------
180// GNECrossingFrame::GNENeteditAttributes- methods
181// ---------------------------------------------------------------------------
182
184 MFXGroupBoxModule(crossingFrameParent, TL("Crossing parameters")),
185 myCrossingFrameParent(crossingFrameParent),
186 myCrossingTemplate(nullptr),
187 myCurrentParametersValid(true) {
188 // createcrossing template
189 myCrossingTemplate = new GNECrossing(crossingFrameParent->getViewNet()->getNet());
190 FXHorizontalFrame* crossingParameter = nullptr;
191 // create label and string textField for edges
192 crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
193 myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), nullptr, GUIDesignLabelThickedFixed(100));
194 myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
195 myCrossingEdgesLabel->disable();
196 myCrossingEdges->disable();
197 // create label and checkbox for Priority
198 crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
199 myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), nullptr, GUIDesignLabelThickedFixed(100));
200 myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
201 myCrossingPriorityLabel->disable();
203 // create label and textfield for width
204 crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
205 myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelThickedFixed(100));
206 myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
207 myCrossingWidthLabel->disable();
208 myCrossingWidth->disable();
209 // Create help button
211 myHelpCrossingAttribute->disable();
212}
213
214
216 delete myCrossingTemplate;
217}
218
219
220void
222 // obtain Tag Values
223 const auto& tagProperties = GNEAttributeCarrier::getTagProperty(SUMO_TAG_CROSSING);
224 // Enable all elements of the crossing frames
225 myCrossingEdgesLabel->enable();
226 myCrossingEdges->enable();
227 myCrossingPriorityLabel->enable();
228 // only enable priority check button if junction's crossing doesn't have TLS
229 if (hasTLS) {
230 myCrossingPriorityCheckButton->disable();
231 } else {
232 myCrossingPriorityCheckButton->enable();
233 }
234 myCrossingWidthLabel->enable();
235 myCrossingWidth->enable();
236 myHelpCrossingAttribute->enable();
237 // set values of parameters
238 onCmdSetAttribute(nullptr, 0, nullptr);
239 // Crossings placed in junctinos with TLS always has priority
240 if (hasTLS) {
241 myCrossingPriorityCheckButton->setCheck(TRUE);
242 } else {
243 myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(tagProperties.getDefaultValue(SUMO_ATTR_PRIORITY)));
244 }
245 myCrossingWidth->setText(tagProperties.getDefaultValue(SUMO_ATTR_WIDTH).c_str());
246 myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
247}
248
249
250void
252 // clear all values of parameters
253 myCrossingEdges->setText("");
254 myCrossingPriorityCheckButton->setCheck(false);
255 myCrossingPriorityCheckButton->setText("false");
256 myCrossingWidth->setText("");
257 // Disable all elements of the crossing frames
258 myCrossingEdgesLabel->disable();
259 myCrossingEdges->disable();
260 myCrossingPriorityLabel->disable();
261 myCrossingPriorityCheckButton->disable();
262 myCrossingWidthLabel->disable();
263 myCrossingWidth->disable();
264 myHelpCrossingAttribute->disable();
265 myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(false);
266}
267
268
269bool
271 return myCrossingEdgesLabel->isEnabled();
272}
273
274
275void
277 GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();
278 if (currentJunction != nullptr) {
279 // Check if edge belongs to junction's edge
280 if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) != currentJunction->getChildEdges().end()) {
281 // Update text field with the new edge
282 std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
283 // Check if new edge must be added or removed
284 std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID());
285 if (itFinder == crossingEdges.end()) {
286 crossingEdges.push_back(edge->getID());
287 } else {
288 crossingEdges.erase(itFinder);
289 }
290 myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
291 }
292 // Update colors and attributes
293 onCmdSetAttribute(nullptr, 0, nullptr);
294 }
295}
296
297
298void
300 myCrossingEdges->setText("");
301 // Update colors and attributes
302 onCmdSetAttribute(nullptr, 0, nullptr);
303}
304
305
306void
308 std::vector<std::string> crossingEdges;
309 for (const auto& edge : parentJunction->getChildEdges()) {
310 if (edge->isAttributeCarrierSelected()) {
311 crossingEdges.push_back(edge->getID());
312 }
313 }
314 myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());
315 // Update colors and attributes
316 onCmdSetAttribute(nullptr, 0, nullptr);
317}
318
319
320std::vector<NBEdge*>
322 std::vector<NBEdge*> NBEdgeVector;
323 // Iterate over myCurrentSelectedEdges
324 for (const auto& edge : myCurrentSelectedEdges) {
325 NBEdgeVector.push_back(edge->getNBEdge());
326 }
327 return NBEdgeVector;
328}
329
330
331bool
333 if (myCrossingPriorityCheckButton->getCheck()) {
334 return true;
335 } else {
336 return false;
337 }
338}
339
340
341bool
343 return myCurrentParametersValid;
344}
345
346
347double
349 return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());
350}
351
352
353long
355 myCurrentParametersValid = true;
356 // get string vector with the edges
357 const auto& crossingEdgeIDs = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());
358 // Clear selected edges
359 myCurrentSelectedEdges.clear();
360 // iterate over vector of edge IDs
361 for (const auto& crossingEdgeID : crossingEdgeIDs) {
362 GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveEdge(crossingEdgeID, false);
363 GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();
364 // Check that edge exists and belongs to Junction
365 if (edge == nullptr) {
366 myCurrentParametersValid = false;
367 } else if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) == currentJunction->getChildEdges().end()) {
368 myCurrentParametersValid = false;
369 } else {
370 // select or unselected edge
371 auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);
372 if (itFinder == myCurrentSelectedEdges.end()) {
373 myCurrentSelectedEdges.push_back(edge);
374 } else {
375 myCurrentSelectedEdges.erase(itFinder);
376 }
377 }
378 }
379 // change color of textfield dependig of myCurrentParametersValid
380 if (myCurrentParametersValid) {
381 myCrossingEdges->setTextColor(FXRGB(0, 0, 0));
382 myCrossingEdges->killFocus();
383 } else {
384 myCrossingEdges->setTextColor(FXRGB(255, 0, 0));
385 myCurrentParametersValid = false;
386 }
387 // Update edge colors
388 if (myCurrentSelectedEdges.empty()) {
389 for (const auto& edge : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {
390 // restore colors
391 edge->resetCandidateFlags();
392 // mark all edges as possible candidate
393 edge->setPossibleCandidate(true);
394 }
395 } else {
396 EdgeVector selected;
397 for (GNEEdge* e : myCurrentSelectedEdges) {
398 selected.push_back(e->getNBEdge());
399 }
400 NBNode* node = myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode();
401 for (const auto& edge : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {
402 // restore colors
403 edge->resetCandidateFlags();
404 // set selected or candidate color
405 if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge) != myCurrentSelectedEdges.end()) {
406 edge->setTargetCandidate(true);
407 } else {
408 EdgeVector newCandidates = selected;;
409 newCandidates.push_back(edge->getNBEdge());
410 if (node->checkCrossing(newCandidates, true) == 0) {
411 edge->setInvalidCandidate(true);
412 } else {
413 edge->setPossibleCandidate(true);
414 }
415 }
416 }
417 }
418 // Update view net
419 myCrossingFrameParent->getViewNet()->updateViewNet();
420 // Check that at least there are one selected edge
421 if (crossingEdgeIDs.empty()) {
422 myCurrentParametersValid = false;
423 }
424 // change label of crossing priority
425 if (myCrossingPriorityCheckButton->getCheck()) {
426 myCrossingPriorityCheckButton->setText("true");
427 } else {
428 myCrossingPriorityCheckButton->setText("false");
429 }
430
431 // Check width
432 if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&
433 GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {
434 myCrossingWidth->setTextColor(FXRGB(0, 0, 0));
435 myCrossingWidth->killFocus();
436 } else {
437 myCrossingWidth->setTextColor(FXRGB(255, 0, 0));
438 myCurrentParametersValid = false;
439 }
440
441 // Enable or disable create crossing button depending of the current parameters
442 myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid);
443 return 0;
444}
445
446
447long
449 myCrossingFrameParent->openHelpAttributesDialog(myCrossingTemplate);
450 return 1;
451}
452
453// ---------------------------------------------------------------------------
454// GNECrossingFrame::CreateCrossing - methods
455// ---------------------------------------------------------------------------
456
458 MFXGroupBoxModule(crossingFrameParent, TL("Create")),
459 myCrossingFrameParent(crossingFrameParent) {
460 // Create groupbox for create crossings
462 myCreateCrossingButton->disable();
463}
464
465
467
468
469long
471 // First check that current parameters are valid
472 if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) {
473 // iterate over junction's crossing to find duplicated crossings
474 if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) {
475 // create new crossing
476 myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(),
477 myCrossingFrameParent->myCrossingParameters->getCrossingEdges(),
478 myCrossingFrameParent->myCrossingParameters->getCrossingWidth(),
479 myCrossingFrameParent->myCrossingParameters->getCrossingPriority(),
480 -1, -1,
482 false, true), true);
483 // clear selected edges
484 myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0);
485 // update default create edge option
486 myCrossingFrameParent->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->enableCheckBoxDisablePedestrians();
487 } else {
488 WRITE_WARNING(TL("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed."));
489 }
490 }
491 return 1;
492}
493
494
495void
497 if (value) {
498 myCreateCrossingButton->enable();
499 } else {
500 myCreateCrossingButton->disable();
501 }
502}
503
504// ---------------------------------------------------------------------------
505// GNECrossingFrame::Legend - methods
506// ---------------------------------------------------------------------------
507
509 MFXGroupBoxModule(crossingFrameParent, TL("Information")) {
510
511 // create label
512 new MFXDynamicLabel(getCollapsableFrame(), (std::string("- ") + TL("Click over junction to mark candidate edges.") + std::string("\n- ") + TL("Click over candidate edges for selecting.")).c_str(), 0, GUIDesignLabelFrameInformation);
513 // candidate
514 FXLabel* colorCandidateLabel = new FXLabel(getCollapsableFrame(), TL(" Candidate"), 0, GUIDesignLabel(JUSTIFY_LEFT));
515 colorCandidateLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible));
516 colorCandidateLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
517 // selected
518 FXLabel* colorSelectedLabel = new FXLabel(getCollapsableFrame(), TL(" Selected"), 0, GUIDesignLabel(JUSTIFY_LEFT));
519 colorSelectedLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target));
520 // invalid
521 FXLabel* colorInvalidLabel = new FXLabel(getCollapsableFrame(), TL(" Invalid"), 0, GUIDesignLabel(JUSTIFY_LEFT));
522 colorInvalidLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.invalid));
523 colorInvalidLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
524}
525
526
528
529// ---------------------------------------------------------------------------
530// GNECrossingFrame - methods
531// ---------------------------------------------------------------------------
532
534 GNEFrame(viewParent, viewNet, TL("Crossings")) {
535 // create JunctionInformation module
537
538 // Create edge Selector module
539 myEdgeSelector = new EdgesSelector(this);
540
541 // Create CrossingParameters module
543
544 // create CreateCrossing module
546
547 // create information module
548 myInformation = new Information(this);
549
550 // disable edge selector
552}
553
554
557
558
559void
561 // restore color of all lanes of edge candidates
563 // hide frame
565}
566
567
568void
570 // If current element is a junction
571 if (viewObjects.getJunctionFront()) {
572 // change label
574 // Enable edge selector and crossing parameters
577 // clears selected edges
579 } else if (viewObjects.getEdgeFront()) {
580 // check if mark edge
581 if (!viewObjects.getEdgeFront()->isInvalidCandidate()) {
583 }
584 } else {
585 // set default label
587 // restore color of all lanes of edge candidates
589 // Disable edge selector
591 }
592 // always update view after an operation
594}
595
596
597void
600 // simply call onCmdCreateCrossing of CreateCrossing module
602 }
603}
604
605
606void
615
616/****************************************************************************/
FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:939
@ MID_GNE_CLEARSELECTION
clear selection of elements
@ MID_GNE_USESELECTED
use selected elements
@ MID_GNE_CREATE
create element
Definition GUIAppEnum.h:941
@ MID_HELP
help button
Definition GUIAppEnum.h:653
@ MID_GNE_SELECT
select element
Definition GUIAppEnum.h:957
#define GUIDesignButton
Definition GUIDesigns.h:88
#define GUIDesignTextField
Definition GUIDesigns.h:65
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:100
#define GUIDesignLabel(justify)
Definition GUIDesigns.h:249
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:198
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:258
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:285
#define WRITE_WARNING(msg)
Definition MsgHandler.h:295
#define TL(string)
Definition MsgHandler.h:315
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition NBCont.h:42
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ 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:283
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 resetCandidateFlags()
reset candidate flags
bool isInvalidCandidate() const
check if this element is a invalid candidate
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
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 *)
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
EdgesSelector(GNECrossingFrame *crossingFrameParent)
FOX-declaration.
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
GNEJunction * getCurrentJunction() const
get current junction
FXButton * myClearEdgesSelection
button for clear selection
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
void updateCurrentJunctionLabel(const std::string &junctionID)
set current junction label
GNECrossingFrame::CreateCrossing * myCreateCrossing
create crossing modul
GNECrossingFrame::Information * myInformation
information modul
GNECrossingFrame::EdgesSelector * myEdgeSelector
edge selector modul
~GNECrossingFrame()
Destructor.
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
GNECrossingFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void hide()
hide crossing frame
GNECrossingFrame::CrossingParameters * myCrossingParameters
crossing parameters modul
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
GNECrossingFrame::JunctionInformation * myJunctionInformation
FOX need this.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition GNECrossing.h:44
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:127
class used to group all variables related with objects under cursor after a click over view
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNENet * getNet() const
get the net object
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
A single child window which contains a view of the simulation area.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
C++ TraCI client API implementation.
A list item which allows for custom coloring.
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
Represents a single node (junction) during network building.
Definition NBNode.h:66
int checkCrossing(EdgeVector candidates, bool checkOnly=false)
Definition NBNode.cpp:2775
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition NBNode.h:331
static const PositionVector EMPTY
empty Vector
static const RGBColor WHITE
Definition RGBColor.h:192
static const RGBColor invalid
color for invalid elements
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element