41 myVehicleFrameParent(vehicleFrameParent) {
66 std::ostringstream information;
68 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
72 <<
"- " <<
TL(
"Click over a route to create a vehicle.");
76 <<
"- " <<
TL(
"Select two edges to create a trip.");
80 <<
"- " <<
TL(
"Select two edges to create a vehicle with embedded route.");
84 <<
"- " <<
TL(
"Select two junctions to create a trip.");
88 <<
"- " <<
TL(
"Select two TAZS to create a trip.");
93 <<
"- " <<
TL(
"Click over a route to create a routeFlow.");
97 <<
"- " <<
TL(
"Select two edges to create a flow.");
101 <<
"- " <<
TL(
"Select two edges to create a flow with embedded route.");
105 <<
"- " <<
TL(
"Select two junctions to create a flow.");
109 <<
"- " <<
TL(
"Select two TAZs to create a flow.");
115 myInformationLabel->setText(information.str().c_str());
123 GNEFrame(viewParent, viewNet,
"Vehicles"),
165 edge.second->resetCandidateFlags();
169 junction.second->resetCandidateFlags();
215 }
else if (addEdge && objectsUnderCursor.
getEdgeFront()) {
221 }
else if (addTAZ && objectsUnderCursor.
getTAZFront()) {
296 WRITE_WARNING(
TL(
"VType with vClass == 'pedestrian' is oriented to pedestrians"));
298 WRITE_WARNING(
TL(
"VType with vClass == 'ignoring' is oriented to containers"));
332 std::vector<std::string> viaEdges;
349 if (tripParameters) {
357 delete tripParameters;
367 std::vector<std::string> routeEdges;
369 for (
const auto& edge : subPath.getSubPath()) {
370 routeEdges.push_back(edge->getID());
374 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
380 if (vehicleParameters) {
393 delete vehicleParameters;
411 if (flowParameters) {
419 delete flowParameters;
433 std::vector<std::string> routeEdges;
435 for (
const auto& edge : subPath.getSubPath()) {
436 routeEdges.push_back(edge->getID());
440 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
446 if (flowParameters) {
459 delete flowParameters;
473 if (tripParameters) {
480 delete tripParameters;
494 if (tripParameters) {
501 delete tripParameters;
519 if (flowParameters) {
526 delete flowParameters;
544 if (flowParameters) {
551 delete flowParameters;
572 if (departLane >= (
int)route->
getParentEdges().front()->getLanes().size()) {
598 if (vehicleParameters) {
604 delete vehicleParameters;
625 if (routeFlowParameters) {
631 delete routeFlowParameters;
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
#define WRITE_WARNING(msg)
@ 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
@ 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
@ 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
begin/end of the 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_BEGIN
weights: time range begin
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_POISSON
poisson definition (used in flow)
@ SUMO_ATTR_END
weights: time range end
@ 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 AbstractPoly 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
SumoXMLTag getTag() const
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.
virtual void show()
show Frame
virtual void hide()
hide Frame
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
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
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(SumoXMLTag element, const bool firstElement, 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
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
GNEAttributesCreator * myVehicleAttributes
internal vehicle attributes
GNETagSelector * myVehicleTagSelector
vehicle tag selector (used to select diffent kind of vehicles)
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.
GNEPathCreator * myPathCreator
edge path creator (used for trips and flows)
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.
DemandElementSelector * getTypeSelector() const
getVehicle Type selectors
HelpCreation * myHelpCreation
Help creation.
GNEVehicleFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void demandElementSelected()
selected vehicle type in DemandElementSelector
GNEPathLegendModule * myPathLegend
path legend modul
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
GNETAZ * getTAZFront() const
get front TAZ 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
A single child window which contains a view of the simulation area.
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)
static const RGBColor INVISIBLE
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.