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-2025 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
22#include <netedit/GNENet.h>
35
36#include "GNEVehicleFrame.h"
37
38// ===========================================================================
39// method definitions
40// ===========================================================================
41
42// ---------------------------------------------------------------------------
43// GNEVehicleFrame::HelpCreation - methods
44// ---------------------------------------------------------------------------
45
47 GNEGroupBoxModule(vehicleFrameParent, TL("Help")),
48 myVehicleFrameParent(vehicleFrameParent) {
50}
51
52
54
55
56void
58 // first update help cration
59 updateHelpCreation();
60 // show modul
61 show();
62}
63
64
65void
69
70void
72 // create information label
73 std::ostringstream information;
74 // set text depending of selected vehicle type
75 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty()->getTag()) {
76 // vehicles
78 information
79 << "- " << TL("Click over a route to create a vehicle.");
80 break;
81 case SUMO_TAG_TRIP:
82 information
83 << "- " << TL("Select two edges to create a trip.");
84 break;
86 information
87 << "- " << TL("Select two edges to create a vehicle with embedded route.");
88 break;
90 information
91 << "- " << TL("Select two junctions to create a trip.");
92 break;
94 information
95 << "- " << TL("Select two TAZS to create a trip.");
96 break;
97 // flows
99 information
100 << "- " << TL("Click over a route to create a routeFlow.");
101 break;
102 case SUMO_TAG_FLOW:
103 information
104 << "- " << TL("Select two edges to create a flow.");
105 break;
107 information
108 << "- " << TL("Select two edges to create a flow with embedded route.");
109 break;
111 information
112 << "- " << TL("Select two junctions to create a flow.");
113 break;
115 information
116 << "- " << TL("Select two TAZs to create a flow.");
117 break;
118 default:
119 break;
120 }
121 // set information label
122 myInformationLabel->setText(information.str().c_str());
123}
124
125// ---------------------------------------------------------------------------
126// GNEVehicleFrame - methods
127// ---------------------------------------------------------------------------
128
130 GNEFrame(viewParent, viewNet, TL("Vehicles")),
131 myVehicleBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
132
133 // Create item Selector module for vehicles
135
136 // Create vehicle type selector and set DEFAULT_VTYPE_ID as default element
138
139 // Create attributes editor
141
142 // create GNEPathCreator Module
143 myPathCreator = new GNEPathCreator(this, viewNet->getNet()->getDemandPathManager());
144
145 // Create Help Creation Module
146 myHelpCreation = new HelpCreation(this);
147
148 // create legend label
150}
151
152
156
157
158void
160 // refresh tag selector
162 // show frame
164}
165
166
167void
169 // reset edge candidates
170 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
171 edge.second->resetCandidateFlags();
172 }
173 // reset junctioncandidates
174 for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
175 junction.second->resetCandidateFlags();
176 }
177 // hide frame
179}
180
181
182bool
184 // check template AC
185 if (myVehicleTagSelector->getCurrentTemplateAC() == nullptr) {
186 return false;
187 }
188 // begin cleaning vehicle base object
190 // obtain tag (only for improve code legibility)
192 const bool addEdge = ((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) || (vehicleTag == SUMO_TAG_FLOW) || (vehicleTag == GNE_TAG_FLOW_WITHROUTE));
193 const bool addJunction = ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) || (vehicleTag == GNE_TAG_FLOW_JUNCTIONS));
194 const bool addTAZ = ((vehicleTag == GNE_TAG_TRIP_TAZS) || (vehicleTag == GNE_TAG_FLOW_TAZS));
195 // first check that current selected vehicle is valid
196 if (vehicleTag == SUMO_TAG_NOTHING) {
197 myViewNet->setStatusBarText(TL("Current selected vehicle isn't valid."));
198 return false;
199 }
200 // now check if VType is valid
201 if (myTypeSelector->getCurrentDemandElement() == nullptr) {
202 myViewNet->setStatusBarText(TL("Current selected vehicle type isn't valid."));
203 return false;
204 }
205 // add VType
207 // set route or edges depending of vehicle type
209 return buildVehicleOverRoute(vehicleTag, viewObjects.getDemandElementFront());
210 } else if (addEdge && viewObjects.getEdgeFront()) {
211 // add clicked edge in GNEPathCreator
212 return myPathCreator->addEdge(viewObjects.getEdgeFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed());
213 } else if (addJunction && viewObjects.getJunctionFront()) {
214 // add clicked junction in GNEPathCreator
215 return myPathCreator->addJunction(viewObjects.getJunctionFront());
216 } else if (addTAZ && viewObjects.getTAZFront()) {
217 // add clicked TAZ in GNEPathCreator
218 return myPathCreator->addTAZ(viewObjects.getTAZFront());
219 } else {
220 return false;
221 }
222}
223
224
229
230
235
236
241
242
247
248// ===========================================================================
249// protected
250// ===========================================================================
251
252void
274
275
276void
279 // show vehicle attributes modul
281 // clear colors
284 // set current VTypeClass in pathCreator
286 // show path creator module
288 // show help creation
290 } else {
291 // hide all moduls if selected item isn't valid
296 }
297}
298
299
300bool
301GNEVehicleFrame::createPath(const bool useLastRoute) {
302 // first check if parameters are valid
304 // obtain tag (only for improve code legibility)
306 // begin cleaning vehicle base object
308 // Updated myVehicleBaseObject
310 // add VType
312 // declare route handler
315 // check if use last route
316 if (useLastRoute) {
317 // build vehicle using last route
319 } else {
320 // extract via attribute
321 std::vector<std::string> viaEdges;
322 for (int i = 1; i < ((int)myPathCreator->getSelectedEdges().size() - 1); i++) {
323 viaEdges.push_back(myPathCreator->getSelectedEdges().at(i)->getID());
324 }
325 // continue depending of tag
326 if ((vehicleTag == SUMO_TAG_TRIP) && (myPathCreator->getSelectedEdges().size() > 0)) {
327 // set tag
329 // Add parameter departure
332 }
333 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
335 // obtain trip parameters
336 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
338 // check trip parameters
339 if (tripParameters) {
344 // parse vehicle
346 // delete tripParameters and base object
347 delete tripParameters;
348 }
349 } else if ((vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
350 // set tag
352 // Add parameter departure
355 }
356 // get route edges
357 std::vector<std::string> routeEdges;
358 for (const auto& subPath : myPathCreator->getPath()) {
359 for (const auto& edge : subPath.getSubPath()) {
360 routeEdges.push_back(edge->getID());
361 }
362 }
363 // avoid consecutive duplicated edges
364 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
365 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
367 // obtain vehicle parameters
368 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
369 vehicleParameters->setParameters(myVehicleBaseObject->getParameters());
370 // continue depending of vehicleParameters
371 if (vehicleParameters) {
372 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
373 // create route base object
375 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
376 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
378 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0);
379 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0);
380 embeddedRouteObject->addDoubleAttribute(SUMO_ATTR_PROB, 1.0);
381 // parse route
383 // delete vehicleParamters
384 delete vehicleParameters;
385 }
386 } else if ((vehicleTag == SUMO_TAG_FLOW) && (myPathCreator->getSelectedEdges().size() > 0)) {
387 // set tag
389 // set flow attributes
391 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
393 // obtain flow parameters
394 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
396 // check flowParameters
397 if (flowParameters) {
402 // parse vehicle
404 // delete flowParameters and base object
405 delete flowParameters;
406 }
407 } else if ((vehicleTag == GNE_TAG_FLOW_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
408 // set tag
410 // set flow attributes
412 // get route edges
413 std::vector<std::string> routeEdges;
414 for (const auto& subPath : myPathCreator->getPath()) {
415 for (const auto& edge : subPath.getSubPath()) {
416 routeEdges.push_back(edge->getID());
417 }
418 }
419 // avoid consecutive duplicated edges
420 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
421 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
423 // obtain flow parameters
424 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
426 // continue depending of vehicleParameters
427 if (flowParameters) {
429 // create under base object
431 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
432 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
434 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0);
435 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0);
436 embeddedRouteObject->addDoubleAttribute(SUMO_ATTR_PROB, 1.0);
437 // parse route
439 // delete vehicleParamters
440 delete flowParameters;
441 }
442 } else if ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
443 // set tag
445 // Add parameter departure
448 }
449 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
451 // obtain trip parameters
452 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
454 // check trip parameters
455 if (tripParameters) {
459 // parse vehicle
461 // delete tripParameters and base object
462 delete tripParameters;
463 }
464 } else if ((vehicleTag == GNE_TAG_TRIP_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
465 // set tag
467 // Add parameter departure
470 }
471 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
473 // obtain trip parameters
474 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
476 // check trip parameters
477 if (tripParameters) {
481 // parse vehicle
483 // delete tripParameters and base object
484 delete tripParameters;
485 }
486 } else if ((vehicleTag == GNE_TAG_FLOW_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
487 // set tag
489 // set flow attributes
491 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
493 // obtain flow parameters
494 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
496 // check flowParameters
497 if (flowParameters) {
501 // parse vehicle
503 // delete flowParameters and base object
504 delete flowParameters;
505 }
506 } else if ((vehicleTag == GNE_TAG_FLOW_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
507 // set tag
509 // set flow attributes
511 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
513 // obtain flow parameters
514 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 }
527 // abort path creation
529 // refresh attributes editor
531 return true;
532 }
533 }
534 return false;
535}
536
537
538bool
540 if (route && (route->getTagProperty()->isRoute())) {
541 // now check if parameters are valid
543 return false;
544 }
545 // get vehicle attributes
547 // declare route handler
548 GNERouteHandler routeHandler(myViewNet->getNet(), route->getFileBucket(),
550 // check if departLane is valid
552 GNEAttributeCarrier::canParse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE))) {
553 const int departLane = GNEAttributeCarrier::parse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE));
554 if (departLane >= (int)route->getParentEdges().front()->getChildLanes().size()) {
556 return false;
557 }
558 }
559 // check if departSpeed is valid
561 double departSpeed = GNEAttributeCarrier::parse<double>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED));
564 return false;
565 }
566 }
567 // check if we're creating a vehicle or a flow
568 if (vehicleTag == SUMO_TAG_VEHICLE) {
569 // set tag
571 // Add parameter departure
574 }
575 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
577 // obtain vehicle parameters in vehicleParameters
578 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
579 vehicleParameters->setParameters(myVehicleBaseObject->getParameters());
580 // check if vehicle was successfully created)
581 if (vehicleParameters) {
582 vehicleParameters->routeid = route->getID();
583 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
584 // parse vehicle
586 // delete vehicleParameters and sumoBaseObject
587 delete vehicleParameters;
588 }
589 } else {
590 // set tag
592 // set flow attributes
594 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
596 // obtain routeFlow parameters in routeFlowParameters
597 SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
598 routeFlowParameters->setParameters(myVehicleBaseObject->getParameters());
599 // check if flow was successfully created)
600 if (routeFlowParameters) {
601 routeFlowParameters->routeid = route->getID();
602 myVehicleBaseObject->setVehicleParameter(routeFlowParameters);
603 // parse flow
605 // delete vehicleParameters and sumoBaseObject
606 delete routeFlowParameters;
607 }
608 }
609 // center view after creation
611 if (vehicle && !myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
612 myViewNet->centerTo(vehicle->getPositionInView(), false);
613 }
614 // refresh attributes editor
616 // all ok, then return true;
617 return true;
618 } else {
619 myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route.");
620 return false;
621 }
622}
623
624
625void
632
633/****************************************************************************/
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:281
#define TL(string)
Definition MsgHandler.h:304
#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
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_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_FROM_TAZ
@ SUMO_ATTR_DEPARTLANE
@ SUMO_ATTR_PROB
@ 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:169
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
const std::map< std::string, std::string > & getParameters() const
get parameters
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
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)
add string attribute into current SumoBaseObject node
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
virtual double getAttributeDouble(SumoXMLAttr key) const =0
virtual FileBucket * getFileBucket() const =0
get reference to fileBucket in which save this AC
const std::string getID() const override
get ID (all Attribute Carriers have one)
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject) const
fill sumo Base object
void showAttributesEditor(GNEAttributeCarrier *AC, const bool primaryAttributeEditor)
edit attributes of the given AC (usually the edited template AC)
void refreshAttributesEditor()
refresh attribute editor
bool checkAttributes(const bool showWarning)
check if current edited attributes are valid
void hideAttributesEditor()
hide attribute editor
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
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:122
virtual void show()
show Frame
Definition GNEFrame.cpp:110
virtual void hide()
hide Frame
Definition GNEFrame.cpp:119
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
Definition GNEFrame.cpp:240
GNEGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
GNEAttributeCarrier * getTemplateAC(const SumoXMLTag tag) const
get template AC by tag
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:198
GNENetHelper::ACTemplate * getACTemplates() const
get all attribute carriers templates used in this net
Definition GNENet.cpp:180
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
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(const GNETagProperties *tagProperty, 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
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
GNETagSelector * myVehicleTagSelector
vehicle tag selector (used to select diffent kind of vehicles)
void hide()
hide Frame
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
GNEDemandElementSelector * myTypeSelector
Vehicle Type selectors.
GNEAttributesEditor * getVehicleAttributesEditor() const
get attributes creator
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)
void updateFlowAttributes()
update flow attributes
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.
GNEAttributesEditor * myVehicleAttributesEditor
attributes editor
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
GNEViewParent * getViewParent() const
get the net object
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
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.
void setParameters(const Parameterised &params)
set the given key/value map in map<string, string> format
static const RGBColor INVISIBLE
Definition RGBColor.h:198
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