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-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 Vehicles/Flows/Trips/etc. elements
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
23#include <netedit/GNEViewNet.h>
31
32#include "GNEVehicleFrame.h"
33
34// ===========================================================================
35// method definitions
36// ===========================================================================
37
38// ---------------------------------------------------------------------------
39// GNEVehicleFrame::HelpCreation - methods
40// ---------------------------------------------------------------------------
41
43 MFXGroupBoxModule(vehicleFrameParent, TL("Help")),
44 myVehicleFrameParent(vehicleFrameParent) {
46}
47
48
50
51
52void
54 // first update help cration
55 updateHelpCreation();
56 // show modul
57 show();
58}
59
60
61void
65
66void
68 // create information label
69 std::ostringstream information;
70 // set text depending of selected vehicle type
71 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
72 // vehicles
74 information
75 << "- " << TL("Click over a route to create a vehicle.");
76 break;
77 case SUMO_TAG_TRIP:
78 information
79 << "- " << TL("Select two edges to create a trip.");
80 break;
82 information
83 << "- " << TL("Select two edges to create a vehicle with embedded route.");
84 break;
86 information
87 << "- " << TL("Select two junctions to create a trip.");
88 break;
90 information
91 << "- " << TL("Select two TAZS to create a trip.");
92 break;
93 // flows
95 information
96 << "- " << TL("Click over a route to create a routeFlow.");
97 break;
98 case SUMO_TAG_FLOW:
99 information
100 << "- " << TL("Select two edges to create a flow.");
101 break;
103 information
104 << "- " << TL("Select two edges to create a flow with embedded route.");
105 break;
107 information
108 << "- " << TL("Select two junctions to create a flow.");
109 break;
111 information
112 << "- " << TL("Select two TAZs to create a flow.");
113 break;
114 default:
115 break;
116 }
117 // set information label
118 myInformationLabel->setText(information.str().c_str());
119}
120
121// ---------------------------------------------------------------------------
122// GNEVehicleFrame - methods
123// ---------------------------------------------------------------------------
124
126 GNEFrame(viewParent, viewNet, TL("Vehicles")),
127 myRouteHandler("", viewNet->getNet(), myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed(), false),
128 myVehicleBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
129
130 // Create item Selector module for vehicles
132
133 // Create vehicle type selector and set DEFAULT_VTYPE_ID as default element
135
136 // Create vehicle parameters
138
139 // create GNEPathCreator Module
140 myPathCreator = new GNEPathCreator(this, viewNet->getNet()->getDemandPathManager());
141
142 // Create Help Creation Module
143 myHelpCreation = new HelpCreation(this);
144
145 // create legend label
147}
148
149
153
154
155void
157 // refresh tag selector
159 // show frame
161}
162
163
164void
166 // reset edge candidates
167 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
168 edge.second->resetCandidateFlags();
169 }
170 // reset junctioncandidates
171 for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
172 junction.second->resetCandidateFlags();
173 }
174 // hide frame
176}
177
178
179bool
181 // check template AC
182 if (myVehicleTagSelector->getCurrentTemplateAC() == nullptr) {
183 return false;
184 }
185 // begin cleaning vehicle base object
187 // obtain tag (only for improve code legibility)
189 const bool addEdge = ((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) || (vehicleTag == SUMO_TAG_FLOW) || (vehicleTag == GNE_TAG_FLOW_WITHROUTE));
190 const bool addJunction = ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) || (vehicleTag == GNE_TAG_FLOW_JUNCTIONS));
191 const bool addTAZ = ((vehicleTag == GNE_TAG_TRIP_TAZS) || (vehicleTag == GNE_TAG_FLOW_TAZS));
192 // first check that current selected vehicle is valid
193 if (vehicleTag == SUMO_TAG_NOTHING) {
194 myViewNet->setStatusBarText(TL("Current selected vehicle isn't valid."));
195 return false;
196 }
197 // now check if VType is valid
198 if (myTypeSelector->getCurrentDemandElement() == nullptr) {
199 myViewNet->setStatusBarText(TL("Current selected vehicle type isn't valid."));
200 return false;
201 }
202 // now check if parameters are valid
205 return false;
206 }
207 // get vehicle attributes
209 // Check if ID has to be generated
212 }
213 // add VType
215 // set route or edges depending of vehicle type
217 return buildVehicleOverRoute(vehicleTag, viewObjects.getDemandElementFront());
218 } else if (addEdge && viewObjects.getEdgeFront()) {
219 // add clicked edge in GNEPathCreator
220 return myPathCreator->addEdge(viewObjects.getEdgeFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed());
221 } else if (addJunction && viewObjects.getJunctionFront()) {
222 // add clicked junction in GNEPathCreator
223 return myPathCreator->addJunction(viewObjects.getJunctionFront());
224 } else if (addTAZ && viewObjects.getTAZFront()) {
225 // add clicked TAZ in GNEPathCreator
226 return myPathCreator->addTAZ(viewObjects.getTAZFront());
227 } else {
228 return false;
229 }
230}
231
232
237
238
243
244
249
250
255
256// ===========================================================================
257// protected
258// ===========================================================================
259
260void
282
283
284void
287 // show vehicle attributes modul
289 // clear colors
292 // set current VTypeClass in pathCreator
294 // show path creator module
296 // show help creation
298 } else {
299 // hide all moduls if selected item isn't valid
304 }
305}
306
307
308bool
309GNEVehicleFrame::createPath(const bool useLastRoute) {
310 // first check if parameters are valid
312 // obtain tag (only for improve code legibility)
314 // begin cleaning vehicle base object
316 // Updated myVehicleBaseObject
318 // Check if ID has to be generated
321 }
322 // add VType
324 // check if use last route
325 if (useLastRoute) {
326 // build vehicle using last route
328 } else {
329 // extract via attribute
330 std::vector<std::string> viaEdges;
331 for (int i = 1; i < ((int)myPathCreator->getSelectedEdges().size() - 1); i++) {
332 viaEdges.push_back(myPathCreator->getSelectedEdges().at(i)->getID());
333 }
334 // continue depending of tag
335 if ((vehicleTag == SUMO_TAG_TRIP) && (myPathCreator->getSelectedEdges().size() > 0)) {
336 // set tag
338 // Add parameter departure
341 }
342 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
344 // obtain trip parameters
345 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
346 // check trip parameters
347 if (tripParameters) {
352 // parse vehicle
354 // delete tripParameters and base object
355 delete tripParameters;
356 }
357 } else if ((vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
358 // set tag
360 // Add parameter departure
363 }
364 // get route edges
365 std::vector<std::string> routeEdges;
366 for (const auto& subPath : myPathCreator->getPath()) {
367 for (const auto& edge : subPath.getSubPath()) {
368 routeEdges.push_back(edge->getID());
369 }
370 }
371 // avoid consecutive duplicated edges
372 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
373 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
375 // obtain vehicle parameters
376 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
377 // continue depending of vehicleParameters
378 if (vehicleParameters) {
379 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
380 // create route base object
382 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
383 embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, "");
384 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
386 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0),
387 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0),
388 // parse route
389 myRouteHandler.parseSumoBaseObject(embeddedRouteObject);
390 // delete vehicleParamters
391 delete vehicleParameters;
392 }
393 } else if ((vehicleTag == SUMO_TAG_FLOW) && (myPathCreator->getSelectedEdges().size() > 0)) {
394 // set tag
396 // set begin and end attributes
399 }
400 // adjust poisson value
403 }
404 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
406 // obtain flow parameters
407 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
408 // check flowParameters
409 if (flowParameters) {
414 // parse vehicle
416 // delete flowParameters and base object
417 delete flowParameters;
418 }
419 } else if ((vehicleTag == GNE_TAG_FLOW_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
420 // set tag
422 // set begin and end attributes
425 }
426 // adjust poisson value
429 }
430 // get route edges
431 std::vector<std::string> routeEdges;
432 for (const auto& subPath : myPathCreator->getPath()) {
433 for (const auto& edge : subPath.getSubPath()) {
434 routeEdges.push_back(edge->getID());
435 }
436 }
437 // avoid consecutive duplicated edges
438 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
439 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
441 // obtain flow parameters
442 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
443 // continue depending of vehicleParameters
444 if (flowParameters) {
446 // create under base object
448 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
449 embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, "");
450 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
452 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0),
453 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0),
454 // parse route
455 myRouteHandler.parseSumoBaseObject(embeddedRouteObject);
456 // delete vehicleParamters
457 delete flowParameters;
458 }
459 } else if ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
460 // set tag
462 // Add parameter departure
465 }
466 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
468 // obtain trip parameters
469 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
470 // check trip parameters
471 if (tripParameters) {
475 // parse vehicle
477 // delete tripParameters and base object
478 delete tripParameters;
479 }
480 } else if ((vehicleTag == GNE_TAG_TRIP_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
481 // set tag
483 // Add parameter departure
486 }
487 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
489 // obtain trip parameters
490 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
491 // check trip parameters
492 if (tripParameters) {
496 // parse vehicle
498 // delete tripParameters and base object
499 delete tripParameters;
500 }
501 } else if ((vehicleTag == GNE_TAG_FLOW_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
502 // set tag
504 // set begin and end attributes
507 }
508 // adjust poisson value
511 }
512 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
514 // obtain flow parameters
515 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
516 // check flowParameters
517 if (flowParameters) {
521 // parse vehicle
523 // delete flowParameters and base object
524 delete flowParameters;
525 }
526 } else if ((vehicleTag == GNE_TAG_FLOW_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
527 // set tag
529 // set begin and end attributes
532 }
533 // adjust poisson value
536 }
537 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
539 // obtain flow parameters
540 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
541 // check flowParameters
542 if (flowParameters) {
546 // parse vehicle
548 // delete flowParameters and base object
549 delete flowParameters;
550 }
551 }
552 // abort path creation
554 // refresh myVehicleAttributes
556 return true;
557 }
558 }
559 return false;
560}
561
562
563bool
565 if (route && (route->getTagProperty().isRoute())) {
566 // check if departLane is valid
568 GNEAttributeCarrier::canParse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE))) {
569 const int departLane = GNEAttributeCarrier::parse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE));
570 if (departLane >= (int)route->getParentEdges().front()->getLanes().size()) {
572 return false;
573 }
574 }
575 // check if departSpeed is valid
577 double departSpeed = GNEAttributeCarrier::parse<double>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED));
580 return false;
581 }
582 }
583 // check if we're creating a vehicle or a flow
584 if (vehicleTag == SUMO_TAG_VEHICLE) {
585 // set tag
587 // Add parameter departure
590 }
591 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
593 // obtain vehicle parameters in vehicleParameters
594 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
595 // check if vehicle was successfully created)
596 if (vehicleParameters) {
597 vehicleParameters->routeid = route->getID();
598 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
599 // parse vehicle
601 // delete vehicleParameters and sumoBaseObject
602 delete vehicleParameters;
603 }
604 } else {
605 // set tag
607 // set begin and end attributes
610 }
613 }
614 // adjust poisson value
617 }
618 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
620 // obtain routeFlow parameters in routeFlowParameters
621 SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
622 // check if flow was successfully created)
623 if (routeFlowParameters) {
624 routeFlowParameters->routeid = route->getID();
625 myVehicleBaseObject->setVehicleParameter(routeFlowParameters);
626 // parse flow
628 // delete vehicleParameters and sumoBaseObject
629 delete routeFlowParameters;
630 }
631 }
632 // center view after creation
634 if (vehicle && !myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
635 myViewNet->centerTo(vehicle->getPositionInView(), false);
636 }
637 // refresh myVehicleAttributes
639 // all ok, then return true;
640 return true;
641 } else {
642 myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route.");
643 return false;
644 }
645}
646
647/****************************************************************************/
#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 TL(string)
Definition MsgHandler.h:315
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:69
#define SUMOTime_MAX
Definition SUMOTime.h:34
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, must be the last one
@ 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_FROM_JUNCTION
@ SUMO_ATTR_VIA
@ SUMO_ATTR_TO_JUNCTION
@ 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
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 boundary contains the given coordinate.
Definition Boundary.cpp:172
void addIntAttribute(const SumoXMLAttr attr, const int value)
add int attribute into current SumoBaseObject node
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time attribute
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
bool hasTimeAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given time attribute
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 setVehicleParameter(const SUMOVehicleParameter *vehicleParameter)
set vehicle parameters
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
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
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
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
virtual double getAttributeDouble(SumoXMLAttr key) const =0
void showDemandElementSelector()
show demand element selector
GNEDemandElement * getCurrentDemandElement() const
get current demand element
void hideDemandElementSelector()
hide demand element selector
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.
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:142
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:125
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
void showPathCreatorModule(const GNETagProperties &tagProperty, const bool consecutives)
show GNEPathCreator for the given tag
const std::vector< Path > & getPath() const
get path route
void clearJunctionColors()
clear junction colors
void hidePathCreatorModule()
show GNEPathCreator
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
bool vehicleRouteEmbedded() const
return true if tag correspond to a vehicle placed over an embedded route
bool vehicleRoute() const
plan parents
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
GNEDemandElementSelector * myTypeSelector
Vehicle Type selectors.
bool createPath(const bool useLastRoute)
create path
CommonXMLStructure::SumoBaseObject * myVehicleBaseObject
vehicle base object
GNEAttributesCreator * getVehicleAttributes() const
get attributes creator
~GNEVehicleFrame()
Destructor.
void show()
show Frame
GNEPathCreator * myPathCreator
edge path creator (used for trips and flows)
bool buildVehicleOverRoute(SumoXMLTag vehicleTag, GNEDemandElement *route)
build vehicle over route
GNEDemandElementSelector * getTypeSelector() const
getVehicle Type selectors
void tagSelected()
Tag selected in GNETagSelector.
HelpCreation * myHelpCreation
Help creation.
GNEVehicleFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void demandElementSelected()
selected vehicle type in DemandElementSelector
GNEPathLegendModule * myPathLegend
path legend modul
bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
GNETagSelector * getVehicleTagSelector() const
get vehicle tag selector (needed for transform vehicles)
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
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element 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 * parseVehicleAttributes(int element, const SUMOSAXAttributes &attrs, const bool hardFail, const bool optionalID=false, const bool skipDepart=false, const bool allowInternalRoutes=false)
Parses a vehicle's attributes.
static SUMOVehicleParameter * parseFlowAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs, const bool hardFail, const bool needID, const SUMOTime beginDefault, const SUMOTime endDefault, const bool allowInternalRoutes=false)
Parses a flow'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