Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 MFXGroupBoxModule(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
316 // check if use last route
317 if (useLastRoute) {
318 // build vehicle using last route
320 } else {
321 // extract via attribute
322 std::vector<std::string> viaEdges;
323 for (int i = 1; i < ((int)myPathCreator->getSelectedEdges().size() - 1); i++) {
324 viaEdges.push_back(myPathCreator->getSelectedEdges().at(i)->getID());
325 }
326 // continue depending of tag
327 if ((vehicleTag == SUMO_TAG_TRIP) && (myPathCreator->getSelectedEdges().size() > 0)) {
328 // set tag
330 // Add parameter departure
333 }
334 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
336 // obtain trip parameters
337 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
339 // check trip parameters
340 if (tripParameters) {
345 // parse vehicle
346 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
347 // delete tripParameters and base object
348 delete tripParameters;
349 }
350 } else if ((vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
351 // set tag
353 // Add parameter departure
356 }
357 // get route edges
358 std::vector<std::string> routeEdges;
359 for (const auto& subPath : myPathCreator->getPath()) {
360 for (const auto& edge : subPath.getSubPath()) {
361 routeEdges.push_back(edge->getID());
362 }
363 }
364 // avoid consecutive duplicated edges
365 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
366 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
368 // obtain vehicle parameters
369 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
370 vehicleParameters->setParameters(myVehicleBaseObject->getParameters());
371 // continue depending of vehicleParameters
372 if (vehicleParameters) {
373 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
374 // create route base object
376 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
377 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
379 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0);
380 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0);
381 embeddedRouteObject->addDoubleAttribute(SUMO_ATTR_PROB, 1.0);
382 // parse route
383 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
384 // delete vehicleParamters
385 delete vehicleParameters;
386 }
387 } else if ((vehicleTag == SUMO_TAG_FLOW) && (myPathCreator->getSelectedEdges().size() > 0)) {
388 // set tag
390 // set flow attributes
392 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
394 // obtain flow parameters
395 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
397 // check flowParameters
398 if (flowParameters) {
403 // parse vehicle
404 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
405 // delete flowParameters and base object
406 delete flowParameters;
407 }
408 } else if ((vehicleTag == GNE_TAG_FLOW_WITHROUTE) && (myPathCreator->getPath().size() > 0)) {
409 // set tag
411 // set flow attributes
413 // get route edges
414 std::vector<std::string> routeEdges;
415 for (const auto& subPath : myPathCreator->getPath()) {
416 for (const auto& edge : subPath.getSubPath()) {
417 routeEdges.push_back(edge->getID());
418 }
419 }
420 // avoid consecutive duplicated edges
421 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
422 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
424 // obtain flow parameters
425 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
427 // continue depending of vehicleParameters
428 if (flowParameters) {
430 // create under base object
432 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
433 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
435 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0);
436 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0);
437 embeddedRouteObject->addDoubleAttribute(SUMO_ATTR_PROB, 1.0);
438 // parse route
439 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
440 // delete vehicleParamters
441 delete flowParameters;
442 }
443 } else if ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
444 // set tag
446 // Add parameter departure
449 }
450 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
452 // obtain trip parameters
453 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
455 // check trip parameters
456 if (tripParameters) {
460 // parse vehicle
461 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
462 // delete tripParameters and base object
463 delete tripParameters;
464 }
465 } else if ((vehicleTag == GNE_TAG_TRIP_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
466 // set tag
468 // Add parameter departure
471 }
472 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
474 // obtain trip parameters
475 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
477 // check trip parameters
478 if (tripParameters) {
482 // parse vehicle
483 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
484 // delete tripParameters and base object
485 delete tripParameters;
486 }
487 } else if ((vehicleTag == GNE_TAG_FLOW_JUNCTIONS) && (myPathCreator->getSelectedJunctions().size() > 0)) {
488 // set tag
490 // set flow attributes
492 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
494 // obtain flow parameters
495 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
497 // check flowParameters
498 if (flowParameters) {
502 // parse vehicle
503 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
504 // delete flowParameters and base object
505 delete flowParameters;
506 }
507 } else if ((vehicleTag == GNE_TAG_FLOW_TAZS) && (myPathCreator->getSelectedTAZs().size() > 0)) {
508 // set tag
510 // set flow attributes
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);
517 // check flowParameters
518 if (flowParameters) {
522 // parse vehicle
523 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
524 // delete flowParameters and base object
525 delete flowParameters;
526 }
527 }
528 // abort path creation
530 // refresh attributes editor
532 return true;
533 }
534 }
535 return false;
536}
537
538
539bool
541 if (route && (route->getTagProperty()->isRoute())) {
542 // now check if parameters are valid
544 return false;
545 }
546 // get vehicle attributes
548 // declare route handler
552 // check if departLane is valid
554 GNEAttributeCarrier::canParse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE))) {
555 const int departLane = GNEAttributeCarrier::parse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE));
556 if (departLane >= (int)route->getParentEdges().front()->getChildLanes().size()) {
558 return false;
559 }
560 }
561 // check if departSpeed is valid
563 double departSpeed = GNEAttributeCarrier::parse<double>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED));
566 return false;
567 }
568 }
569 // check if we're creating a vehicle or a flow
570 if (vehicleTag == SUMO_TAG_VEHICLE) {
571 // set tag
573 // Add parameter departure
576 }
577 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
579 // obtain vehicle parameters in vehicleParameters
580 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
581 vehicleParameters->setParameters(myVehicleBaseObject->getParameters());
582 // check if vehicle was successfully created)
583 if (vehicleParameters) {
584 vehicleParameters->routeid = route->getID();
585 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
586 // parse vehicle
587 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
588 // delete vehicleParameters and sumoBaseObject
589 delete vehicleParameters;
590 }
591 } else {
592 // set tag
594 // set flow attributes
596 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
598 // obtain routeFlow parameters in routeFlowParameters
599 SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
600 routeFlowParameters->setParameters(myVehicleBaseObject->getParameters());
601 // check if flow was successfully created)
602 if (routeFlowParameters) {
603 routeFlowParameters->routeid = route->getID();
604 myVehicleBaseObject->setVehicleParameter(routeFlowParameters);
605 // parse flow
606 routeHandler.parseSumoBaseObject(myVehicleBaseObject);
607 // delete vehicleParameters and sumoBaseObject
608 delete routeFlowParameters;
609 }
610 }
611 // center view after creation
613 if (vehicle && !myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
614 myViewNet->centerTo(vehicle->getPositionInView(), false);
615 }
616 // refresh attributes editor
618 // all ok, then return true;
619 return true;
620 } else {
621 myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route.");
622 return false;
623 }
624}
625
626
627void
634
635/****************************************************************************/
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:279
#define TL(string)
Definition MsgHandler.h:305
#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)
@ GNE_ATTR_DEMAND_FILE
demand demand file
@ 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
const std::string getID() const
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
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:121
virtual void show()
show Frame
Definition GNEFrame.cpp:119
virtual void hide()
hide Frame
Definition GNEFrame.cpp:128
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
Definition GNEFrame.cpp:314
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
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:176
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:146
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.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
void setParameters(const Parameterised &params)
set the inner key/value map in map<string, string> format
static const RGBColor INVISIBLE
Definition RGBColor.h:198
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