Eclipse SUMO - Simulation of Urban MObility
GNEVehicleFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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>
27
28#include "GNEVehicleFrame.h"
29
30// ===========================================================================
31// method definitions
32// ===========================================================================
33
34// ---------------------------------------------------------------------------
35// GNEVehicleFrame::HelpCreation - methods
36// ---------------------------------------------------------------------------
37
39 MFXGroupBoxModule(vehicleFrameParent, TL("Help")),
40 myVehicleFrameParent(vehicleFrameParent) {
42}
43
44
46
47
48void
50 // first update help cration
51 updateHelpCreation();
52 // show modul
53 show();
54}
55
56
57void
59 hide();
60}
61
62void
64 // create information label
65 std::ostringstream information;
66 // set text depending of selected vehicle type
67 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
68 // vehicles
70 information
71 << TL("- Click over a route to\n")
72 << TL(" create a vehicle.");
73 break;
74 case SUMO_TAG_TRIP:
75 information
76 << TL("- Select two edges to\n")
77 << TL(" create a Trip.");
78 break;
80 information
81 << TL("- Select two edges to\n")
82 << TL(" create a vehicle with\n")
83 << TL(" embedded route.");
84 break;
86 information
87 << TL("- Select two junctions\n")
88 << TL(" to create a Trip.");
89 break;
90 // flows
92 information
93 << TL("- Click over a route to\n")
94 << TL(" create a routeFlow.");
95 break;
96 case SUMO_TAG_FLOW:
97 information
98 << TL("- Select two edges to\n")
99 << TL(" create a flow.");
100 break;
102 information
103 << TL("- Select two edges to\n")
104 << TL(" create a flow with\n")
105 << TL(" embedded route.");
106 break;
108 information
109 << TL("- Select two junctions\n")
110 << TL(" to create a flow.");
111 break;
112 default:
113 break;
114 }
115 // set information label
116 myInformationLabel->setText(information.str().c_str());
117}
118
119// ---------------------------------------------------------------------------
120// GNEVehicleFrame - methods
121// ---------------------------------------------------------------------------
122
124 GNEFrame(viewParent, viewNet, "Vehicles"),
125 myRouteHandler("", viewNet->getNet(), true, false),
126 myVehicleBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) {
127
128 // Create item Selector modul for vehicles
129 myVehicleTagSelector = new GNETagSelector(this, GNETagProperties::TagType::VEHICLE, SUMO_TAG_TRIP);
130
131 // Create vehicle type selector and set DEFAULT_VTYPE_ID as default element
133
134 // Create vehicle parameters
136
137 // create GNEPathCreator Module
138 myPathCreator = new GNEPathCreator(this);
139
140 // Create Help Creation Module
141 myHelpCreation = new HelpCreation(this);
142
143 // create legend label
144 myPathLegend = new GNEM_PathLegend(this);
145}
146
147
149 delete myVehicleBaseObject;
150}
151
152
153void
155 // refresh tag selector
157 // show frame
159}
160
161
162void
164 // reset edge candidates
165 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
166 edge.second->resetCandidateFlags();
167 }
168 // reset junctioncandidates
169 for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
170 junction.second->resetCandidateFlags();
171 }
172 // hide frame
174}
175
176
177bool
179 // check template AC
180 if (myVehicleTagSelector->getCurrentTemplateAC() == nullptr) {
181 return false;
182 }
183 // begin cleaning vehicle base object
185 // obtain tag (only for improve code legibility)
187 const bool addEdge = ((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) || (vehicleTag == SUMO_TAG_FLOW) || (vehicleTag == GNE_TAG_FLOW_WITHROUTE));
188 const bool addJunction = ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) || (vehicleTag == GNE_TAG_FLOW_JUNCTIONS));
189 // first check that current selected vehicle is valid
190 if (vehicleTag == SUMO_TAG_NOTHING) {
191 myViewNet->setStatusBarText("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("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(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed());
221 } else {
222 return false;
223 }
224}
225
226
230}
231
232
235 return myPathCreator;
236}
237
238// ===========================================================================
239// protected
240// ===========================================================================
241
242void
245 // show vehicle type selector modul
247 // show path creator modul
249 // check if show path legend
255 } else {
257 }
258 } else {
259 // hide all moduls if tag isn't valid
265 }
266}
267
268
269void
272 // show vehicle attributes modul
274 // clear colors
277 // set current VTypeClass in pathCreator
279 // show path creator module
281 // show help creation
283 // show warning if we have selected a vType oriented to pedestrians or containers
285 WRITE_WARNING(TL("VType with vClass == 'pedestrian' is oriented to pedestrians"));
287 WRITE_WARNING(TL("VType with vClass == 'ignoring' is oriented to containers"));
288 }
289 } else {
290 // hide all moduls if selected item isn't valid
295 }
296}
297
298
299bool
300GNEVehicleFrame::createPath(const bool useLastRoute) {
301 // first check if parameters are valid
303 // obtain tag (only for improve code legibility)
305 // begin cleaning vehicle base object
307 // Updated myVehicleBaseObject
309 // Check if ID has to be generated
312 }
313 // add VType
315 // check if use last route
316 if (useLastRoute) {
317 // build vehicle using last route
319 } else {
320 // check number of edges
321 if ((myPathCreator->getSelectedEdges().size() > 0) || (myPathCreator->getSelectedJunctions().size() > 0)) {
322 // extract via attribute
323 std::vector<std::string> viaEdges;
324 for (int i = 1; i < ((int)myPathCreator->getSelectedEdges().size() - 1); i++) {
325 viaEdges.push_back(myPathCreator->getSelectedEdges().at(i)->getID());
326 }
327 // continue depending of tag
328 if (vehicleTag == SUMO_TAG_TRIP) {
329 // set tag
331 // Add parameter departure
334 }
335 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
337 // obtain trip parameters
338 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
339 // check trip parameters
340 if (tripParameters) {
345 // parse vehicle
347 // delete tripParameters and base object
348 delete tripParameters;
349 }
350 } else if (vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) {
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 // continue depending of vehicleParameters
371 if (vehicleParameters) {
372 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
373 // create route base object
375 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
376 embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, "");
377 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
379 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0),
380 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0),
381 // parse route
382 myRouteHandler.parseSumoBaseObject(embeddedRouteObject);
383 // delete vehicleParamters
384 delete vehicleParameters;
385 }
386 } else if (vehicleTag == SUMO_TAG_FLOW) {
387 // set tag
389 // set begin and end attributes
392 }
393 // adjust poisson value
396 }
397 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
399 // obtain flow parameters
400 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
401 // check flowParameters
402 if (flowParameters) {
407 // parse vehicle
409 // delete flowParameters and base object
410 delete flowParameters;
411 }
412 } else if (vehicleTag == GNE_TAG_FLOW_WITHROUTE) {
413 // set tag
415 // set begin and end attributes
418 }
419 // adjust poisson value
422 }
423 // get route edges
424 std::vector<std::string> routeEdges;
425 for (const auto& subPath : myPathCreator->getPath()) {
426 for (const auto& edge : subPath.getSubPath()) {
427 routeEdges.push_back(edge->getID());
428 }
429 }
430 // avoid consecutive duplicated edges
431 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
432 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
434 // obtain flow parameters
435 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
436 // continue depending of vehicleParameters
437 if (flowParameters) {
439 // create under base object
441 embeddedRouteObject->setTag(SUMO_TAG_ROUTE);
442 embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, "");
443 embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges);
445 embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0),
446 embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0),
447 // parse route
448 myRouteHandler.parseSumoBaseObject(embeddedRouteObject);
449 // delete vehicleParamters
450 delete flowParameters;
451 }
452 } else if (vehicleTag == GNE_TAG_TRIP_JUNCTIONS) {
453 // set tag
455 // Add parameter departure
458 }
459 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
461 // obtain trip parameters
462 SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
463 // check trip parameters
464 if (tripParameters) {
468 // parse vehicle
470 // delete tripParameters and base object
471 delete tripParameters;
472 }
473 } else if (vehicleTag == GNE_TAG_FLOW_JUNCTIONS) {
474 // set tag
476 // set begin and end attributes
479 }
480 // adjust poisson value
483 }
484 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
486 // obtain flow parameters
487 SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
488 // check flowParameters
489 if (flowParameters) {
493 // parse vehicle
495 // delete flowParameters and base object
496 delete flowParameters;
497 }
498 }
499 // abort path creation
501 // refresh myVehicleAttributes
503 return true;
504 }
505 }
506 }
507 return false;
508}
509
510
511bool
513 if (route && (route->getTagProperty().isRoute())) {
514 // check if departLane is valid
516 GNEAttributeCarrier::canParse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE))) {
517 const int departLane = GNEAttributeCarrier::parse<int>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTLANE));
518 if (departLane >= (int)route->getParentEdges().front()->getLanes().size()) {
520 return false;
521 }
522 }
523 // check if departSpeed is valid
525 double departSpeed = GNEAttributeCarrier::parse<double>(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED));
528 return false;
529 }
530 }
531 // check if we're creating a vehicle or a flow
532 if (vehicleTag == SUMO_TAG_VEHICLE) {
533 // set tag
535 // Add parameter departure
538 }
539 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
541 // obtain vehicle parameters in vehicleParameters
542 SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false);
543 // check if vehicle was successfully created)
544 if (vehicleParameters) {
545 vehicleParameters->routeid = route->getID();
546 myVehicleBaseObject->setVehicleParameter(vehicleParameters);
547 // parse vehicle
549 // delete vehicleParameters and sumoBaseObject
550 delete vehicleParameters;
551 }
552 } else {
553 // set tag
555 // set begin and end attributes
558 }
561 }
562 // adjust poisson value
565 }
566 // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
568 // obtain routeFlow parameters in routeFlowParameters
569 SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX);
570 // check if flow was successfully created)
571 if (routeFlowParameters) {
572 routeFlowParameters->routeid = route->getID();
573 myVehicleBaseObject->setVehicleParameter(routeFlowParameters);
574 // parse flow
576 // delete vehicleParameters and sumoBaseObject
577 delete routeFlowParameters;
578 }
579 }
580 // center view after creation
582 if (vehicle && !myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) {
583 myViewNet->centerTo(vehicle->getPositionInView(), false);
584 }
585 // refresh myVehicleAttributes
587 // all ok, then return true;
588 return true;
589 } else {
590 myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route.");
591 return false;
592 }
593}
594
595/****************************************************************************/
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:271
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:265
#define TL(string)
Definition: MsgHandler.h:282
#define SUMOTime_MAX
Definition: SUMOTime.h:33
@ 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 (used in NETEDIT)
@ 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 (used in NETEDIT)
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions (used in NETEDIT)
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ 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_DEPARTSPEED
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_END
weights: time range end
@ 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 clear()
clear SumoBaseObject
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:310
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
void showPathLegendModule()
show Legend modul
void hidePathLegendModule()
hide Legend modul
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:132
void abortPathCreation()
abort path creation
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
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
bool addJunction(GNEJunction *junction, const bool shiftKeyPressed, const bool controlKeyPressed)
add junction
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
void hideHelpCreation()
hide HelpCreation
void updateHelpCreation()
update HelpCreation
HelpCreation(GNEVehicleFrame *vehicleFrameParent)
constructor
FXLabel * myInformationLabel
Label with creation information.
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)
GNEM_PathLegend * myPathLegend
path legend modul
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.
HelpCreation * myHelpCreation
Help creation.
GNEVehicleFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void demandElementSelected()
selected vehicle type in DemandElementSelector
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
GNENet * getNet() const
get the net object
GNEDemandElement * getLastCreatedRoute() const
get last created route
void setStatusBarText(const std::string &text)
set statusBar text
Definition: GNEViewNet.cpp:768
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:84
Boundary getVisibleBoundary() const
get visible boundary
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
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