Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEVehicleFrame.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-2023 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 Vehicles/Flows/Trips/etc. elements
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
23#include <netedit/GNEViewNet.h>
29#include "GNEVehicleFrame.h"
30
31// ===========================================================================
32// method definitions
33// ===========================================================================
34
35// ---------------------------------------------------------------------------
36// GNEVehicleFrame::HelpCreation - methods
37// ---------------------------------------------------------------------------
38
40 MFXGroupBoxModule(vehicleFrameParent, TL("Help")),
41 myVehicleFrameParent(vehicleFrameParent) {
43}
44
45
47
48
49void
51 // first update help cration
52 updateHelpCreation();
53 // show modul
54 show();
55}
56
57
58void
62
63void
65 // create information label
66 std::ostringstream information;
67 // set text depending of selected vehicle type
68 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
69 // vehicles
71 information
72 << "- " << TL("Click over a route to create a vehicle.");
73 break;
74 case SUMO_TAG_TRIP:
75 information
76 << "- " << TL("Select two edges to create a trip.");
77 break;
79 information
80 << "- " << TL("Select two edges to create a vehicle with embedded route.");
81 break;
83 information
84 << "- " << TL("Select two junctions to create a trip.");
85 break;
87 information
88 << "- " << TL("Select two TAZS to create a trip.");
89 break;
90 // flows
92 information
93 << "- " << TL("Click over a route to create a routeFlow.");
94 break;
95 case SUMO_TAG_FLOW:
96 information
97 << "- " << TL("Select two edges to create a flow.");
98 break;
100 information
101 << "- " << TL("Select two edges to create a flow with embedded route.");
102 break;
104 information
105 << "- " << TL("Select two junctions to create a flow.");
106 break;
108 information
109 << "- " << TL("Select two TAZs to create a flow.");
110 break;
111 default:
112 break;
113 }
114 // set information label
115 myInformationLabel->setText(information.str().c_str());
116}
117
118// ---------------------------------------------------------------------------
119// GNEVehicleFrame - methods
120// ---------------------------------------------------------------------------
121
123 GNEFrame(viewParent, viewNet, "Vehicles"),
124 myRouteHandler("", viewNet->getNet(), true, false),
125 myVehicleBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
126
127 // Create item Selector modul for vehicles
129
130 // Create vehicle type selector and set DEFAULT_VTYPE_ID as default element
132
133 // Create vehicle parameters
135
136 // create GNEPathCreator Module
137 myPathCreator = new GNEPathCreator(this);
138
139 // Create Help Creation Module
140 myHelpCreation = new HelpCreation(this);
141
142 // create legend label
144}
145
146
150
151
152void
154 // refresh tag selector
156 // show frame
158}
159
160
161void
163 // reset edge candidates
164 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
165 edge.second->resetCandidateFlags();
166 }
167 // reset junctioncandidates
168 for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
169 junction.second->resetCandidateFlags();
170 }
171 // hide frame
173}
174
175
176bool
178 // check template AC
179 if (myVehicleTagSelector->getCurrentTemplateAC() == nullptr) {
180 return false;
181 }
182 // begin cleaning vehicle base object
184 // obtain tag (only for improve code legibility)
186 const bool addEdge = ((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) || (vehicleTag == SUMO_TAG_FLOW) || (vehicleTag == GNE_TAG_FLOW_WITHROUTE));
187 const bool addJunction = ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) || (vehicleTag == GNE_TAG_FLOW_JUNCTIONS));
188 const bool addTAZ = ((vehicleTag == GNE_TAG_TRIP_TAZS) || (vehicleTag == GNE_TAG_FLOW_TAZS));
189 // first check that current selected vehicle is valid
190 if (vehicleTag == SUMO_TAG_NOTHING) {
191 myViewNet->setStatusBarText(TL("Current selected vehicle isn't valid."));
192 return false;
193 }
194 // now check if VType is valid
195 if (myTypeSelector->getCurrentDemandElement() == nullptr) {
196 myViewNet->setStatusBarText(TL("Current selected vehicle type isn't valid."));
197 return false;
198 }
199 // now check if parameters are valid
202 return false;
203 }
204 // get vehicle attributes
206 // Check if ID has to be generated
209 }
210 // add VType
212 // set route or edges depending of vehicle type
213 if ((vehicleTag == SUMO_TAG_VEHICLE) || (vehicleTag == GNE_TAG_FLOW_ROUTE)) {
214 return buildVehicleOverRoute(vehicleTag, objectsUnderCursor.getDemandElementFront());
215 } else if (addEdge && objectsUnderCursor.getEdgeFront()) {
216 // add clicked edge in GNEPathCreator
217 return myPathCreator->addEdge(objectsUnderCursor.getEdgeFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed());
218 } else if (addJunction && objectsUnderCursor.getJunctionFront()) {
219 // add clicked junction in GNEPathCreator
220 return myPathCreator->addJunction(objectsUnderCursor.getJunctionFront());
221 } else if (addTAZ && objectsUnderCursor.getTAZFront()) {
222 // add clicked TAZ in GNEPathCreator
223 return myPathCreator->addTAZ(objectsUnderCursor.getTAZFront());
224 } else {
225 return false;
226 }
227}
228
229
234
235
240
241
246
247// ===========================================================================
248// protected
249// ===========================================================================
250
251void
278
279
280void
283 // show vehicle attributes modul
285 // clear colors
288 // set current VTypeClass in pathCreator
290 // show path creator module
292 // show help creation
294 // show warning if we have selected a vType oriented to pedestrians or containers
296 WRITE_WARNING(TL("VType with vClass == 'pedestrian' is oriented to pedestrians"));
298 WRITE_WARNING(TL("VType with vClass == 'ignoring' is oriented to containers"));
299 }
300 } else {
301 // hide all moduls if selected item isn't valid
306 }
307}
308
309
310bool
311GNEVehicleFrame::createPath(const bool useLastRoute) {
312 // first check if parameters are valid
314 // obtain tag (only for improve code legibility)
316 // begin cleaning vehicle base object
318 // Updated myVehicleBaseObject
320 // Check if ID has to be generated
323 }
324 // add VType
326 // check if use last route
327 if (useLastRoute) {
328 // build vehicle using last route
330 } else {
331 // extract via attribute
332 std::vector<std::string> viaEdges;
333 for (int i = 1; i < ((int)myPathCreator->getSelectedEdges().size() - 1); i++) {
334 viaEdges.push_back(myPathCreator->getSelectedEdges().at(i)->getID());
335 }
336 // continue depending of tag
337 if ((vehicleTag == SUMO_TAG_TRIP) && (myPathCreator->getSelectedEdges().size() > 0)) {
338 // set tag
340 // Add parameter departure
343 }
344 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
346 // obtain trip parameters
347 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
348 // check trip parameters
349 if (tripParameters) {
354 // parse vehicle
356 // delete tripParameters and base object
357 delete tripParameters;
358 }
359 } else if ((vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
360 // set tag
362 // Add parameter departure
365 }
366 // get route edges
367 std::vector<std::string> routeEdges;
368 for (const auto& subPath : myPathCreator->getPath()) {
369 for (const auto& edge : subPath.getSubPath()) {
370 routeEdges.push_back(edge->getID());
371 }
372 }
373 // avoid consecutive duplicated edges
374 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
375 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
377 // obtain vehicle parameters
378 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
379 // continue depending of vehicleParameters
380 if (vehicleParameters) {
381 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
382 // create route base object
384 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
385 embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, "");
386 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
388 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0),
389 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0),
390 // parse route
391 myRouteHandler.parseSumoBaseObject(embeddedRouteObject);
392 // delete vehicleParamters
393 delete vehicleParameters;
394 }
395 } else if ((vehicleTag == SUMO_TAG_FLOW) && (myPathCreator->getSelectedEdges().size() > 0)) {
396 // set tag
398 // set begin and end attributes
401 }
402 // adjust poisson value
405 }
406 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
408 // obtain flow parameters
409 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
410 // check flowParameters
411 if (flowParameters) {
416 // parse vehicle
418 // delete flowParameters and base object
419 delete flowParameters;
420 }
421 } else if ((vehicleTag == GNE_TAG_FLOW_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
422 // set tag
424 // set begin and end attributes
427 }
428 // adjust poisson value
431 }
432 // get route edges
433 std::vector<std::string> routeEdges;
434 for (const auto& subPath : myPathCreator->getPath()) {
435 for (const auto& edge : subPath.getSubPath()) {
436 routeEdges.push_back(edge->getID());
437 }
438 }
439 // avoid consecutive duplicated edges
440 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
441 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
443 // obtain flow parameters
444 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
445 // continue depending of vehicleParameters
446 if (flowParameters) {
448 // create under base object
450 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
451 embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, "");
452 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
454 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0),
455 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0),
456 // parse route
457 myRouteHandler.parseSumoBaseObject(embeddedRouteObject);
458 // delete vehicleParamters
459 delete flowParameters;
460 }
461 } else if ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
462 // set tag
464 // Add parameter departure
467 }
468 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
470 // obtain trip parameters
471 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
472 // check trip parameters
473 if (tripParameters) {
477 // parse vehicle
479 // delete tripParameters and base object
480 delete tripParameters;
481 }
482 } else if ((vehicleTag == GNE_TAG_TRIP_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
483 // set tag
485 // Add parameter departure
488 }
489 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
491 // obtain trip parameters
492 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
493 // check trip parameters
494 if (tripParameters) {
498 // parse vehicle
500 // delete tripParameters and base object
501 delete tripParameters;
502 }
503 } else if ((vehicleTag == GNE_TAG_FLOW_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
504 // set tag
506 // set begin and end attributes
509 }
510 // adjust poisson value
513 }
514 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
516 // obtain flow parameters
517 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
518 // check flowParameters
519 if (flowParameters) {
523 // parse vehicle
525 // delete flowParameters and base object
526 delete flowParameters;
527 }
528 } else if ((vehicleTag == GNE_TAG_FLOW_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
529 // set tag
531 // set begin and end attributes
534 }
535 // adjust poisson value
538 }
539 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
541 // obtain flow parameters
542 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
543 // check flowParameters
544 if (flowParameters) {
548 // parse vehicle
550 // delete flowParameters and base object
551 delete flowParameters;
552 }
553 }
554 // abort path creation
556 // refresh myVehicleAttributes
558 return true;
559 }
560 }
561 return false;
562}
563
564
565bool
567 if (route && (route->getTagProperty().isRoute())) {
568 // check if departLane is valid
570 GNEAttributeCarrier::canParse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE))) {
571 const int departLane = GNEAttributeCarrier::parse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE));
572 if (departLane >= (int)route->getParentEdges().front()->getLanes().size()) {
574 return false;
575 }
576 }
577 // check if departSpeed is valid
579 double departSpeed = GNEAttributeCarrier::parse<double>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED));
582 return false;
583 }
584 }
585 // check if we're creating a vehicle or a flow
586 if (vehicleTag == SUMO_TAG_VEHICLE) {
587 // set tag
589 // Add parameter departure
592 }
593 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
595 // obtain vehicle parameters in vehicleParameters
596 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
597 // check if vehicle was successfully created)
598 if (vehicleParameters) {
599 vehicleParameters->routeid = route->getID();
600 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
601 // parse vehicle
603 // delete vehicleParameters and sumoBaseObject
604 delete vehicleParameters;
605 }
606 } else {
607 // set tag
609 // set begin and end attributes
612 }
615 }
616 // adjust poisson value
619 }
620 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
622 // obtain routeFlow parameters in routeFlowParameters
623 SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
624 // check if flow was successfully created)
625 if (routeFlowParameters) {
626 routeFlowParameters->routeid = route->getID();
627 myVehicleBaseObject->setVehicleParameter(routeFlowParameters);
628 // parse flow
630 // delete vehicleParameters and sumoBaseObject
631 delete routeFlowParameters;
632 }
633 }
634 // center view after creation
636 if (vehicle && !myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
637 myViewNet->centerTo(vehicle->getPositionInView(), false);
638 }
639 // refresh myVehicleAttributes
641 // all ok, then return true;
642 return true;
643 } else {
644 myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route.");
645 return false;
646 }
647}
648
649/****************************************************************************/
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:274
#define WRITE_WARNING(msg)
Definition MsgHandler.h:270
#define TL(string)
Definition MsgHandler.h:287
#define SUMOTime_MAX
Definition SUMOTime.h:34
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_PEDESTRIAN
pedestrian
const std::string DEFAULT_VTYPE_ID
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_TRIP_TAZS
a single trip definition that uses TAZs
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ GNE_TAG_FLOW_TAZS
a flow between TAZs
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_ATTR_DEPART
@ SUMO_ATTR_VIA
@ SUMO_ATTR_FROMJUNCTION
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_POISSON
poisson definition (used in flow)
@ SUMO_ATTR_PERIOD
@ SUMO_ATTR_TO_TAZ
@ SUMO_ATTR_DEPARTSPEED
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_FROM_TAZ
@ SUMO_ATTR_DEPARTLANE
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_MAXSPEED
@ SUMO_ATTR_ID
@ SUMO_ATTR_REPEAT
@ SUMO_ATTR_CYCLETIME
@ SUMO_ATTR_TOJUNCTION
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
bool around(const Position &p, double offset=0) const
Returns whether the AbstractPoly the given coordinate.
Definition Boundary.cpp:172
void addIntAttribute(const SumoXMLAttr attr, const int value)
add int attribute into current SumoBaseObject node
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
std::map< std::string, std::string > getAllAttributes() const
get all attributes in string format
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
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
bool hasDoubleAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given double attribute
void setVehicleParameter(const SUMOVehicleParameter *vehicleParameter)
set vehicle parameters
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
GNEDemandElement * getCurrentDemandElement() const
get current demand element
void showDemandElementSelector()
show demand element selector
void hideDemandElementSelector()
hide demand element selector
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
An Element which don't belong to GNENet but has influence in the simulation.
virtual SUMOVehicleClass getVClass() const =0
virtual double getAttributeDouble(SumoXMLAttr key) const =0
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
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
Definition GNEFrame.cpp:311
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
std::string generateDemandElementID(SumoXMLTag tag) const
generate demand element id
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
const std::vector< GNETAZ * > & getSelectedTAZs() const
get current selected TAZs
void abortPathCreation()
abort path creation
bool addTAZ(GNETAZ *taz)
add TAZ
const std::vector< GNEJunction * > & getSelectedJunctions() const
get current selected junctions
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
void clearEdgeColors()
clear edge colors
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
bool addJunction(GNEJunction *junction)
add junction
void setVClass(SUMOVehicleClass vClass)
set vClass
const std::vector< Path > & getPath() const
get path route
void clearJunctionColors()
clear junction colors
void hidePathCreatorModule()
show GNEPathCreator
void showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives)
show GNEPathCreator for the given tag
void hidePathLegendModule()
hide Legend modul
void showPathLegendModule()
show Legend modul
bool isRoute() const
return true if tag correspond to a route element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
void showHelpCreation()
show HelpCreation
MFXDynamicLabel * myInformationLabel
Label with creation information.
void hideHelpCreation()
hide HelpCreation
void updateHelpCreation()
update HelpCreation
HelpCreation(GNEVehicleFrame *vehicleFrameParent)
constructor
GNEAttributesCreator * myVehicleAttributes
internal vehicle attributes
GNETagSelector * myVehicleTagSelector
vehicle tag selector (used to select diffent kind of vehicles)
void hide()
hide Frame
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
GNERouteHandler myRouteHandler
route handler
bool createPath(const bool useLastRoute)
create path
CommonXMLStructure::SumoBaseObject * myVehicleBaseObject
vehicle base object
~GNEVehicleFrame()
Destructor.
void show()
show Frame
GNEPathCreator * myPathCreator
edge path creator (used for trips and flows)
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
bool buildVehicleOverRoute(SumoXMLTag vehicleTag, GNEDemandElement *route)
build vehicle over route
void tagSelected()
Tag selected in GNETagSelector.
DemandElementSelector * getTypeSelector() const
getVehicle Type selectors
HelpCreation * myHelpCreation
Help creation.
GNEVehicleFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void demandElementSelected()
selected vehicle type in DemandElementSelector
GNEPathLegendModule * myPathLegend
path legend modul
GNETagSelector * getVehicleTagSelector() const
get vehicle tag selector (needed for transform vehicles)
DemandElementSelector * myTypeSelector
Vehicle Type selectors.
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
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
GNENet * getNet() const
get the net object
GNEDemandElement * getLastCreatedRoute() const
get last created route
void setStatusBarText(const std::string &text)
set statusBar text
A single child window which contains a view of the simulation area.
Boundary getVisibleBoundary() const
get visible boundary
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
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 const RGBColor INVISIBLE
Definition RGBColor.h:195
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
Encapsulated Xerces-SAX-attributes.
Structure representing possible vehicle parameter.
std::string routeid
The vehicle's route id.
static SUMOVehicleParameter * parseFlowAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs, const bool hardFail, const bool needID, const SUMOTime beginDefault, const SUMOTime endDefault)
Parses a flow's attributes.
static SUMOVehicleParameter * parseVehicleAttributes(int element, const SUMOSAXAttributes &attrs, const bool hardFail, const bool optionalID=false, const bool skipDepart=false)
Parses a vehicle's attributes.
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event