Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAdditionalFrame.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 additional elements
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
23#include <netedit/GNEViewNet.h>
28
29#include "GNEAdditionalFrame.h"
30
31
32// ===========================================================================
33// method definitions
34// ===========================================================================
35
36// ---------------------------------------------------------------------------
37// GNEAdditionalFrame::E2MultilaneLegendModule - methods
38// ---------------------------------------------------------------------------
39
41 MFXGroupBoxModule(frameParent, TL("Legend")) {
42 // declare label
43 FXLabel* legendLabel = nullptr;
44 // edge candidate
45 legendLabel = new FXLabel(getCollapsableFrame(), TL(" edge candidate"), 0, GUIDesignLabel(JUSTIFY_LEFT));
47 legendLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
48 // last edge selected
49 legendLabel = new FXLabel(getCollapsableFrame(), TL(" last edge selected"), 0, GUIDesignLabel(JUSTIFY_LEFT));
50 legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target));
51 // edge selected
52 legendLabel = new FXLabel(getCollapsableFrame(), TL(" edge selected"), 0, GUIDesignLabel(JUSTIFY_LEFT));
53 legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.source));
54 // edge disconnected
55 legendLabel = new FXLabel(getCollapsableFrame(), TL(" edge disconnected"), 0, GUIDesignLabel(JUSTIFY_LEFT));
57}
58
59
61
62
63void
67
68
69void
73
74// ---------------------------------------------------------------------------
75// GNEAdditionalFrame::HelpCreationModule - methods
76// ---------------------------------------------------------------------------
77
78#define TLSX(string) std::string(gettext((string)))
79
80
81
83 MFXGroupBoxModule(frameParent, TL("Help")) {
84 // edge candidate
86 // fill map
87 //addTLString(TL("-Requires EntryExitDetector\n")) +
88 // E1
89 myHelpMap[SUMO_TAG_INDUCTION_LOOP] = addTLString(TL("-Click over lane to create it"));
90 // E1 Instant
91 myHelpMap[SUMO_TAG_INSTANT_INDUCTION_LOOP] = addTLString(TL("-Click over lane to create it"));
92 // E2
93 myHelpMap[SUMO_TAG_LANE_AREA_DETECTOR] = addTLString(TL("-Click over lane to create it"));
94 // E3
95 myHelpMap[SUMO_TAG_ENTRY_EXIT_DETECTOR] = addTLString(TL("-Click over view to create it")) +
96 addTLString(TL("-Requires at least one Entry\n and one Exit"));
97 // E3 Entry
98 myHelpMap[SUMO_TAG_DET_ENTRY] = addTLString(TL("-Requires EntryExitDetector\n parent\n")) +
99 addTLString(TL("-Select EntryExitDetector\n before creating either\n clicking over one in view\n or by selecting from list"));
100 // E3 Exit
101 myHelpMap[SUMO_TAG_DET_EXIT] = addTLString(TL("-Requires EntryExitDetector\n parent\n")) +
102 addTLString(TL("-Select EntryExitDetector\n before creating either\n clicking over one in view\n or by selecting from list"));
103}
104
105
107
108
109void
111 if (myHelpMap.count(XMLTag) > 0) {
112 myHelpLabel->setText(myHelpMap.at(XMLTag).c_str());
113 show();
114 } else {
115 hide();
116 }
117}
118
119
120void
124
125
126std::string
128 return std::string(str.c_str());
129}
130
131// ---------------------------------------------------------------------------
132// GNEAdditionalFrame: - methods
133// ---------------------------------------------------------------------------
134
136 GNEFrame(viewParent, viewNet, TL("Additionals")) {
137
138 // create item Selector module for additionals
140
141 // Create additional parameters
143
144 // Create netedit parameter
146
147 // Create selector parent
149
150 // Create selector child edges
152
153 // Create selector child lanes
155
156 // Create list for E2Multilane lane selector
158
159 // create help creation module
161
162 // Create legend for E2 detector
164}
165
166
168 // check if we have to delete base additional object
169 if (myBaseAdditional) {
170 delete myBaseAdditional;
171 }
172}
173
174
175void
177 // refresh tag selector
179 // reset last position
181 // show frame
183}
184
185
186bool
188 // first check that current selected additional is valid
190 myViewNet->setStatusBarText(TL("Current selected additional isn't valid."));
191 return false;
192 }
193 // check if add or remove edge
194 if (myEdgesSelector->isShown() && viewObjects.getEdgeFront()) {
196 return true;
197 }
198 // check if add or remove lane
199 if (myLanesSelector->isShown() && viewObjects.getLaneFront()) {
201 return true;
202 }
203 // show warning dialogbox and stop check if input parameters are valid
206 return false;
207 }
208 // obtain tagproperty (only for improve code legibility)
209 const auto& tagProperties = myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty();
210 // create base additional
211 if (!createBaseAdditionalObject(tagProperties)) {
212 return false;
213 }
214 // obtain attributes and values
216 // fill netedit attributes
218 return false;
219 }
220 // If consecutive Lane Selector is enabled, it means that either we're selecting lanes or we're finished or we'rent started
221 if (tagProperties.hasAttribute(SUMO_ATTR_EDGE) || (tagProperties.getTag() == SUMO_TAG_VAPORIZER)) {
222 return buildAdditionalOverEdge(viewObjects.getLaneFront(), tagProperties);
223 } else if (tagProperties.hasAttribute(SUMO_ATTR_LANE)) {
224 return buildAdditionalOverLane(viewObjects.getLaneFront(), tagProperties);
225 } else if (tagProperties.getTag() == GNE_TAG_MULTI_LANE_AREA_DETECTOR) {
226 return myConsecutiveLaneSelector->addLane(viewObjects.getLaneFront());
227 } else {
228 return buildAdditionalOverView(tagProperties);
229 }
230}
231
232
237
238
243
244
249
250
255
256
257bool
258GNEAdditionalFrame::createPath(const bool /* useLastRoute */) {
259 // obtain tagproperty (only for improve code legibility)
260 const auto& tagProperty = myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty();
261 // first check that current tag is valid (currently only for E2 multilane detectors)
262 if (tagProperty.getTag() == GNE_TAG_MULTI_LANE_AREA_DETECTOR) {
263 // now check number of lanes
264 if (myConsecutiveLaneSelector->getLanePath().size() < 2) {
265 WRITE_WARNING(TL("E2 multilane detectors need at least two consecutive lanes"));
266 } else if (createBaseAdditionalObject(tagProperty)) {
267 // get attributes and values
269 // fill netedit attributes
271 // Check if ID has to be generated
272 if (tagProperty.hasAttribute(SUMO_ATTR_ID)) {
274 }
275 // add lane IDs
277 // set positions
280 // parse common attributes
281 if (buildAdditionalCommonAttributes(tagProperty)) {
282 // show warning dialogbox and stop check if input parameters are valid
285 } else {
286 // declare additional handler
288 // build additional
289 additionalHandler.parseSumoBaseObject(myBaseAdditional);
290 // Refresh additional Parent Selector (For additionals that have a limited number of children)
292 // abort E2 creation
294 // refresh additional attributes
296 return true;
297 }
298 }
299 }
300 }
301 }
302 return false;
303}
304
305
306void
308 // get template AC
309 const auto templateAC = myAdditionalTagSelector->getCurrentTemplateAC();
310 if (templateAC) {
311 // show additional attributes module
313 // show netedit attributes
315 // Show myAdditionalFrameParent if we're adding an slave element
316 if (templateAC->getTagProperty().isChild()) {
317 mySelectorAdditionalParent->showSelectorParentModule(templateAC->getTagProperty().getParentTags());
318 } else {
320 }
321 // Show EdgesSelector if we're adding an additional that own the attribute SUMO_ATTR_EDGES
322 if (templateAC->getTagProperty().hasAttribute(SUMO_ATTR_EDGES)) {
324 } else {
326 }
327 // show help creation modul
328 myHelpCreationModule->showHelpCreationModule(templateAC->getTagProperty().getTag());
329 // check if we must show consecutive lane selector
330 if (templateAC->getTagProperty().getTag() == GNE_TAG_MULTI_LANE_AREA_DETECTOR) {
334 // recompute network
336 } else if (templateAC->getTagProperty().hasAttribute(SUMO_ATTR_LANES)) {
340 } else {
344 }
345 // reset last position
347 } else {
348 // hide all modules if additional isn't valid
357 }
358}
359
360
361bool
363 // check if baseAdditional exist, and if yes, delete it
364 if (myBaseAdditional) {
365 // go to base additional root
368 }
369 // delete baseAdditional (and all children)
370 delete myBaseAdditional;
371 // reset baseAdditional
372 myBaseAdditional = nullptr;
373 }
374 // declare tag for base additional
375 SumoXMLTag baseAdditionalTag = tagProperty.getTag();
376 // check if baseAdditionalTag has to be updated
377 if (baseAdditionalTag == GNE_TAG_MULTI_LANE_AREA_DETECTOR) {
378 baseAdditionalTag = SUMO_TAG_LANE_AREA_DETECTOR;
379 } else if (baseAdditionalTag == GNE_TAG_CALIBRATOR_FLOW) {
380 baseAdditionalTag = SUMO_TAG_FLOW;
381 }
382 // check if additional is child
383 if (tagProperty.isChild()) {
384 // get additional under cursor
385 const GNEAdditional* additionalUnderCursor = myViewNet->getViewObjectsSelector().getAdditionalFront();
386 // if user click over an additional element parent, mark int in ParentAdditionalSelector
387 if (additionalUnderCursor && (additionalUnderCursor->getTagProperty().getTag() == tagProperty.getParentTags().front())) {
388 // update parent additional selected
389 mySelectorAdditionalParent->setIDSelected(additionalUnderCursor->getID());
390 }
391 // stop if currently there isn't a valid selected parent
394 TL(" must be selected before insertion of ") + myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + ".");
395 return false;
396 } else {
397 // create baseAdditional parent
399 // set parent tag
400 myBaseAdditional->setTag(tagProperty.getParentTags().front());
401 // add ID
403 // create baseAdditional again as child of current myBaseAdditional
405 }
406 } else {
407 // just create a base additional
409 }
410 // set baseAdditional tag
411 myBaseAdditional->setTag(baseAdditionalTag);
412 // BaseAdditional created, then return true
413 return true;
414}
415
416
417bool
419 // If additional has a interval defined by a begin or end, check that is valid
420 if (tagProperties.hasAttribute(SUMO_ATTR_STARTTIME) && tagProperties.hasAttribute(SUMO_ATTR_END)) {
423 if (begin > end) {
424 myAdditionalAttributes->showWarningMessage(TL("Attribute '") + toString(SUMO_ATTR_STARTTIME) + TL("' cannot be greater than attribute '") + toString(SUMO_ATTR_END) + "'.");
425 return false;
426 }
427 }
428 // If additional own the attribute SUMO_ATTR_FILE but was't defined, will defined as <ID>.xml
431 // SUMO_ATTR_FILE is optional for calibrators and rerouters (fails to load in sumo when given and the file does not exist)
433 }
434 }
435 // check edge children
437 // obtain edge IDs
439 // check if attribute has at least one edge
441 myAdditionalAttributes->showWarningMessage(TL("List of edges cannot be empty"));
442 return false;
443 }
444 }
445 // check lane children
447 // obtain lane IDs
449 // check if attribute has at least one lane
451 myAdditionalAttributes->showWarningMessage(TL("List of lanes cannot be empty"));
452 return false;
453 }
454 }
455 // all ok, continue building additional
456 return true;
457}
458
459
460bool
462 // check that lane exist
463 if (lane) {
464 // Get attribute lane's edge
466 // Check if ID has to be generated
467 if (tagProperties.getTag() == SUMO_TAG_VAPORIZER) {
471 }
472 } else {
473 return false;
474 }
475 // parse common attributes
476 if (!buildAdditionalCommonAttributes(tagProperties)) {
477 return false;
478 }
479 // show warning dialogbox and stop check if input parameters are valid
482 return false;
483 } else {
484 // declare additional handler
486 // build additional
487 additionalHandler.parseSumoBaseObject(myBaseAdditional);
488 // Refresh additional Parent Selector (For additionals that have a limited number of children)
490 // clear selected edges and lanes
491 myEdgesSelector->onCmdClearSelection(nullptr, 0, nullptr);
492 myLanesSelector->onCmdClearSelection(nullptr, 0, nullptr);
493 // refresh additional attributes
495 return true;
496 }
497}
498
499
500bool
502 // check that lane exist
503 if (lane != nullptr) {
504 // Get attribute lane
506 // Check if ID has to be generated
509 }
510 } else {
511 return false;
512 }
513 // Obtain position of the mouse over lane (limited over grid)
515 // set attribute position as mouse position over lane
518 } else {
520 }
521 // parse common attributes
522 if (!buildAdditionalCommonAttributes(tagProperties)) {
523 return false;
524 }
525 // show warning dialogbox and stop check if input parameters are valid
528 return false;
529 } else {
530 // declare additional handler
532 // build additional
533 additionalHandler.parseSumoBaseObject(myBaseAdditional);
534 // Refresh additional Parent Selector (For additionals that have a limited number of children)
536 // clear selected edges and lanes
537 myEdgesSelector->onCmdClearSelection(nullptr, 0, nullptr);
538 myLanesSelector->onCmdClearSelection(nullptr, 0, nullptr);
539 // refresh additional attributes
541 return true;
542 }
543}
544
545
546bool
548 // disable intervals (temporal)
549 if ((tagProperties.getTag() == SUMO_TAG_INTERVAL) ||
550 (tagProperties.getTag() == SUMO_TAG_DEST_PROB_REROUTE) ||
551 (tagProperties.getTag() == SUMO_TAG_CLOSING_REROUTE) ||
552 (tagProperties.getTag() == SUMO_TAG_CLOSING_LANE_REROUTE) ||
553 (tagProperties.getTag() == SUMO_TAG_ROUTE_PROB_REROUTE) ||
554 (tagProperties.getTag() == SUMO_TAG_PARKING_AREA_REROUTE)) {
555 WRITE_WARNING(TL("Currently unsupported. Create rerouter elements using rerouter dialog"));
556 return false;
557 }
558 // disable steps (temporal)
559 if (tagProperties.getTag() == SUMO_TAG_STEP) {
560 WRITE_WARNING(TL("Currently unsupported. Create VSS steps using VSS dialog"));
561 return false;
562 }
563 // disable flows (temporal)
564 if (tagProperties.getTag() == GNE_TAG_CALIBRATOR_FLOW) {
565 WRITE_WARNING(TL("Currently unsupported. Create calibratorFlows using calibrator dialog"));
566 return false;
567 }
568 // Check if ID has to be generated
569 if (tagProperties.hasAttribute(SUMO_ATTR_ID)) {
571 }
572 // Obtain position as the clicked position over view
574 // add position and X-Y-Z attributes
579 // parse common attributes
580 if (!buildAdditionalCommonAttributes(tagProperties)) {
581 return false;
582 }
583 // special case for VSS Steps
585 // get VSS parent
588 // get last step
589 GNEAdditional* step = nullptr;
590 for (const auto& additionalChild : VSSParent->getChildAdditionals()) {
591 if (!additionalChild->getTagProperty().isSymbol()) {
592 step = additionalChild;
593 }
594 }
595 // set time
596 if (step) {
598 } else {
600 }
601 }
602 // show warning dialogbox and stop check if input parameters are valid
605 return false;
606 } else {
607 // declare additional handler
609 // build additional
610 additionalHandler.parseSumoBaseObject(myBaseAdditional);
611 // Refresh additional Parent Selector (For additionals that have a limited number of children)
613 // clear selected edges and lanes
614 myEdgesSelector->onCmdClearSelection(nullptr, 0, nullptr);
615 myLanesSelector->onCmdClearSelection(nullptr, 0, nullptr);
616 // refresh additional attributes
618 return true;
619 }
620}
621
622/****************************************************************************/
#define GUIDesignLabel(justify)
Definition GUIDesigns.h:249
#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
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition SUMOTime.cpp:46
#define TIME2STEPS(x)
Definition SUMOTime.h:57
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ SUMO_TAG_REROUTER
A rerouter.
@ GNE_TAG_MULTI_LANE_AREA_DETECTOR
an e2 detector over multiple lanes (placed here due create Additional Frame)
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_STEP
trigger: a step description
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_DET_ENTRY
an e3 entry point
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
@ GNE_TAG_CALIBRATOR_FLOW
a flow definition within in Calibrator
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destination of a reroute
@ SUMO_TAG_DET_EXIT
an e3 exit point
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
@ SUMO_TAG_LANE_AREA_DETECTOR
alternative tag for e2 detector
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_ENTRY_EXIT_DETECTOR
alternative tag for e3 detector
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_ATTR_LANE
@ SUMO_ATTR_FILE
@ SUMO_ATTR_Y
@ SUMO_ATTR_Z
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_X
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_LANES
@ SUMO_ATTR_STARTTIME
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_ID
@ SUMO_ATTR_POSITION
@ SUMO_ATTR_TIME
trigger: the time of the step
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
SumoBaseObject * getParentSumoBaseObject() const
get pointer to mySumoBaseObjectParent SumoBaseObject (if is null, then is the root)
SumoXMLTag getTag() const
get XML myTag
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addPositionAttribute(const SumoXMLAttr attr, const Position &value)
add Position attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::vector< std::string > & getStringListAttribute(const SumoXMLAttr attr) const
get string list attribute
bool hasStringListAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given string list attribute
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
E2MultilaneLegendModule(GNEFrame *frameParent)
constructor
std::map< SumoXMLTag, std::string > myHelpMap
map with tags and their associated help
std::string addTLString(const std::string &str)
add translated string
void showHelpCreationModule(SumoXMLTag XMLTag)
show Legend modul
HelpCreationModule(GNEFrame *frameParent)
constructor
GNESelectorParent * mySelectorAdditionalParent
Module for select a single parent additional.
bool buildAdditionalOverLane(GNELane *lane, const GNETagProperties &tagValues)
build additional over a single lane
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
GNETagSelector * myAdditionalTagSelector
item selector
GNENetworkSelector * getLanesSelector() const
get edges selector
bool createPath(const bool useLastRoute)
create path
GNEAdditionalFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
E2MultilaneLegendModule * myE2MultilaneLegendModule
Module for show E2 Detector legend.
GNENetworkSelector * getEdgesSelector() const
get edges selector
void tagSelected()
Tag selected in GNETagSelector.
GNENetworkSelector * myLanesSelector
Module for select lanes.
bool buildAdditionalOverView(const GNETagProperties &tagValues)
build additional over view
GNENeteditAttributes * getNeteditAttributes() const
get Netedit parameter
bool buildAdditionalCommonAttributes(const GNETagProperties &tagValues)
build common additional attributes
HelpCreationModule * myHelpCreationModule
Module for show additional help legend.
GNEAttributesCreator * myAdditionalAttributes
internal additional attributes
GNENetworkSelector * myEdgesSelector
Module for select edges.
CommonXMLStructure::SumoBaseObject * myBaseAdditional
SumoBaseObject used for create additional.
bool createBaseAdditionalObject(const GNETagProperties &tagProperty)
GNENeteditAttributes * myNeteditAttributes
Netedit parameter.
bool buildAdditionalOverEdge(GNELane *lane, const GNETagProperties &tagValues)
build additional over an edge (parent of lane)
GNEConsecutiveSelector * myConsecutiveLaneSelector
Module for select consecutive lanes.
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
An Element which don't belong to GNENet but has influence in the simulation.
virtual std::string getAttribute(SumoXMLAttr key) const =0
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
bool areValuesValid() const
check if parameters of attributes are valid
void showAttributesCreatorModule(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show GNEAttributesCreator modul
void hideAttributesCreatorModule()
hide group box
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
void refreshAttributesCreator()
refresh attribute creator
bool addLane(GNELane *lane)
add lane
void abortPathCreation()
abort path creation
void showConsecutiveLaneSelectorModule()
show GNEConsecutiveSelector
const std::vector< std::pair< GNELane *, double > > & getLanePath() const
get vector with lanes and clicked positions
void hideConsecutiveLaneSelectorModule()
show GNEConsecutiveSelector
const std::vector< std::string > getLaneIDPath() const
get lane IDs
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:150
GNEViewNet * myViewNet
FOX need this.
Definition GNEFrame.h:117
virtual void show()
show Frame
Definition GNEFrame.cpp:115
virtual void hide()
hide Frame
Definition GNEFrame.cpp:124
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:214
double getLengthGeometryFactor() const
get length geometry factor
Definition GNELane.cpp:1982
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:196
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false)
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition GNENet.cpp:1406
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
void showNeteditAttributesModule(GNEAttributeCarrier *templateAC)
show Netedit attributes modul
void hideNeteditAttributesModule()
hide Netedit attributes modul
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
void hideNetworkElementsSelector()
hide GNENetworkSelector Module
bool toggleSelectedElement(const GNENetworkElement *networkElement)
toggle selected networkElement
bool isShown() const
return true if module is shown
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
void showNetworkElementsSelector()
show GNENetworkSelector Module
std::vector< std::string > getSelectedIDs() const
get selected IDs
void setIDSelected(const std::string &id)
select manually a element of the list
void showSelectorParentModule(const std::vector< SumoXMLTag > &parentTags)
Show list of GNESelectorParent Module.
void refreshSelectorParentModule()
Refresh list of Additional Parents Module.
std::string getIdSelected() const
get currently parent additional selected
void hideSelectorParentModule()
hide GNESelectorParent Module
const std::vector< SumoXMLTag > & getParentTags() const
get parent tags
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
bool isChild() const
return true if tag correspond to an element child of another element (Example: E3->Entry/Exit)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
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
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNENet * getNet() const
get the net object
GNEViewParent * getViewParent() const
get the net object
void resetLastClickedPosition()
reset last clicked position
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void setStatusBarText(const std::string &text)
set statusBar text
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
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
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double x() const
Returns the x-position.
Definition Position.h:55
double z() const
Returns the z-position.
Definition Position.h:65
double y() const
Returns the y-position.
Definition Position.h:60
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
static const RGBColor WHITE
Definition RGBColor.h:192
static const RGBColor conflict
color for selected conflict candidate element (Usually selected using ctrl+click)
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element
static const RGBColor source
color for selected candidate source