41 myVehicleFrameParent(vehicleFrameParent) {
66 std::ostringstream information;
68 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTagProperties().getTag()) {
71 <<
"- Click over a route to\n"
72 <<
" create a vehicle.";
76 <<
"- Select two edges to\n"
81 <<
"- Click over a route to\n"
82 <<
" create a routeFlow.";
86 <<
"- Select two edges to\n"
93 myInformationLabel->setText(information.str().c_str());
101 GNEFrame(horizontalFrameParent, viewNet,
"Vehicles") {
139 edge.second->resetCandidateFlags();
207 if (vehicleParameters) {
213 delete vehicleParameters;
228 if (routeFlowParameters) {
234 delete routeFlowParameters;
245 }
else if (addEdge && objectsUnderCursor.
getEdgeFront()) {
314 std::vector<GNEEdge*> viaEdges;
331 delete tripParameters;
338 std::vector<GNEEdge*> routeEdges;
340 for (
const auto& edge : subPath.getSubPath()) {
341 routeEdges.push_back(edge);
351 delete vehicleParameters;
364 delete flowParameters;
371 std::vector<GNEEdge*> routeEdges;
373 for (
const auto& edge : subPath.getSubPath()) {
374 routeEdges.push_back(edge);
384 delete flowParameters;
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#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.
@ SUMO_TAG_VTYPE
description of a vehicle 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_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
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_END
weights: time range end
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
virtual SUMOVehicleClass getVClass() const =0
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::string & getID() const
get ID
void hideAttributesCreatorModul()
hide group box
void refreshRows()
refresh rows (called after creating an element)
void showAttributesCreatorModul(const GNETagProperties &tagProperties, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
bool areValuesValid() const
check if parameters of attributes are valid
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
GNEViewNet * myViewNet
View Net.
virtual void show()
show Frame
virtual void hide()
hide Frame
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
GNEDemandElement * getCurrentDemandElement() const
get current demand element
void showDemandElementSelector()
show demand element selector
void hideDemandElementSelector()
hide demand element selector
std::vector< GNEEdge * > getSelectedEdges() const
get current selected additionals
const std::vector< Path > & getPath() const
get path route
void abortPathCreation()
abort path creation
void showPathCreatorModul(SumoXMLTag tag, const bool firstElement, const bool consecutives)
show PathCreator for the given tag
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
void setVClass(SUMOVehicleClass vClass)
set vClass
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show
const GNETagProperties & getCurrentTagProperties() const
get current type tag
void setCurrentTag(SumoXMLTag newTag)
set current type manually
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
std::string generateDemandElementID(SumoXMLTag tag) const
generate demand element id
static void buildVehicleOverRoute(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters)
build a vehicle over an existent route
static void buildFlowEmbeddedRoute(GNENet *net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, const std::vector< GNEEdge * > &edges)
build flow with a embedded route
static void buildVehicleEmbeddedRoute(GNENet *net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, const std::vector< GNEEdge * > &edges)
build vehicle with a embedded route
static void buildFlowOverRoute(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters)
build a flow over an existent route
static void buildFlow(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters, GNEEdge *fromEdge, GNEEdge *toEdge, const std::vector< GNEEdge * > &via)
build flow
static void buildTrip(GNENet *net, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters, GNEEdge *fromEdge, GNEEdge *toEdge, const std::vector< GNEEdge * > &via)
build trip
bool isRoute() const
return true if tag correspond to a route element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
~HelpCreation()
destructor
void showHelpCreation()
show HelpCreation
void hideHelpCreation()
hide HelpCreation
void updateHelpCreation()
update HelpCreation
HelpCreation(GNEVehicleFrame *vehicleFrameParent)
constructor
FXLabel * myInformationLabel
Label with creation information.
GNEFrameModuls::TagSelector * myVehicleTagSelector
vehicle tag selector (used to select diffent kind of vehicles)
GNEFrameModuls::PathCreator * getPathCreator() const
get PathCreator modul
~GNEVehicleFrame()
Destructor.
void createPath()
create path
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
void tagSelected()
Tag selected in TagSelector.
GNEFrameModuls::DemandElementSelector * myVTypeSelector
Vehicle Type selectors.
GNEVehicleFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
GNEFrameAttributesModuls::AttributesCreator * myVehicleAttributes
internal vehicle attributes
HelpCreation * myHelpCreation
Help creation.
GNEFrameModuls::PathCreator * myPathCreator
edge path creator (used for trips and flows)
void demandElementSelected()
selected vehicle type in DemandElementSelector
class used to group all variables related with objects under cursor after a click over view
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
void setStatusBarText(const std::string &text)
set staturBar text
Encapsulated Xerces-SAX-attributes.
Structure representing possible vehicle parameter.
static SUMOVehicleParameter * parseFlowAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs, const bool hardFail, const SUMOTime beginDefault, const SUMOTime endDefault, bool isPerson=false)
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.