48 myVehicleFrameParent(vehicleFrameParent) {
73 std::ostringstream information;
75 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty()->getTag()) {
79 <<
"- " <<
TL(
"Click over a route to create a vehicle.");
83 <<
"- " <<
TL(
"Select two edges to create a trip.");
87 <<
"- " <<
TL(
"Select two edges to create a vehicle with embedded route.");
91 <<
"- " <<
TL(
"Select two junctions to create a trip.");
95 <<
"- " <<
TL(
"Select two TAZS to create a trip.");
100 <<
"- " <<
TL(
"Click over a route to create a routeFlow.");
104 <<
"- " <<
TL(
"Select two edges to create a flow.");
108 <<
"- " <<
TL(
"Select two edges to create a flow with embedded route.");
112 <<
"- " <<
TL(
"Select two junctions to create a flow.");
116 <<
"- " <<
TL(
"Select two TAZs to create a flow.");
122 myInformationLabel->setText(information.str().c_str());
130 GNEFrame(viewParent, viewNet,
TL(
"Vehicles")),
171 edge.second->resetCandidateFlags();
175 junction.second->resetCandidateFlags();
322 std::vector<std::string> viaEdges;
340 if (tripParameters) {
348 delete tripParameters;
358 std::vector<std::string> routeEdges;
360 for (
const auto& edge : subPath.getSubPath()) {
361 routeEdges.push_back(edge->getID());
365 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
372 if (vehicleParameters) {
385 delete vehicleParameters;
398 if (flowParameters) {
406 delete flowParameters;
414 std::vector<std::string> routeEdges;
416 for (
const auto& edge : subPath.getSubPath()) {
417 routeEdges.push_back(edge->getID());
421 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
428 if (flowParameters) {
441 delete flowParameters;
456 if (tripParameters) {
463 delete tripParameters;
478 if (tripParameters) {
485 delete tripParameters;
498 if (flowParameters) {
505 delete flowParameters;
518 if (flowParameters) {
525 delete flowParameters;
556 if (departLane >= (
int)route->
getParentEdges().front()->getChildLanes().size()) {
583 if (vehicleParameters) {
589 delete vehicleParameters;
602 if (routeFlowParameters) {
608 delete routeFlowParameters;
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
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_FROM_JUNCTION
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_POISSON
poisson definition (used in flow)
@ SUMO_ATTR_COLOR
A color information.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool around(const Position &p, double offset=0) const
Returns whether the boundary contains the given coordinate.
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 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
bool isUndoRedoAllowed() const
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.
virtual void show()
show Frame
virtual void hide()
hide Frame
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
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
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
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
~HelpCreation()
destructor
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)
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.
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 ¶ms)
set the inner key/value map in map<string, string> format
static const RGBColor INVISIBLE
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.