40 myVehicleFrameParent(vehicleFrameParent) {
65 std::ostringstream information;
67 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) {
71 <<
TL(
"- Click over a route to\n")
72 <<
TL(
" create a vehicle.");
76 <<
TL(
"- Select two edges to\n")
77 <<
TL(
" create a Trip.");
81 <<
TL(
"- Select two edges to\n")
82 <<
TL(
" create a vehicle with\n")
83 <<
TL(
" embedded route.");
87 <<
TL(
"- Select two junctions\n")
88 <<
TL(
" to create a Trip.");
93 <<
TL(
"- Click over a route to\n")
94 <<
TL(
" create a routeFlow.");
98 <<
TL(
"- Select two edges to\n")
99 <<
TL(
" create a flow.");
103 <<
TL(
"- Select two edges to\n")
104 <<
TL(
" create a flow with\n")
105 <<
TL(
" embedded route.");
109 <<
TL(
"- Select two junctions\n")
110 <<
TL(
" to create a flow.");
116 myInformationLabel->setText(information.str().c_str());
124 GNEFrame(viewParent, viewNet,
"Vehicles"),
166 edge.second->resetCandidateFlags();
170 junction.second->resetCandidateFlags();
215 }
else if (addEdge && objectsUnderCursor.
getEdgeFront()) {
285 WRITE_WARNING(
TL(
"VType with vClass == 'pedestrian' is oriented to pedestrians"));
287 WRITE_WARNING(
TL(
"VType with vClass == 'ignoring' is oriented to containers"));
323 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());
371 if (vehicleParameters) {
384 delete vehicleParameters;
402 if (flowParameters) {
410 delete flowParameters;
424 std::vector<std::string> routeEdges;
426 for (
const auto& edge : subPath.getSubPath()) {
427 routeEdges.push_back(edge->getID());
431 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
437 if (flowParameters) {
450 delete flowParameters;
464 if (tripParameters) {
471 delete tripParameters;
489 if (flowParameters) {
496 delete flowParameters;
518 if (departLane >= (
int)route->
getParentEdges().front()->getLanes().size()) {
544 if (vehicleParameters) {
550 delete vehicleParameters;
571 if (routeFlowParameters) {
577 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 (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_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
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
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
~HelpCreation()
destructor
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)
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)
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
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
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.