41 myVehicleFrameParent(vehicleFrameParent) {
66 std::ostringstream information;
68 switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().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"),
140 edge.second->resetCandidateFlags();
144 junction.second->resetCandidateFlags();
190 if (route && (route->getTagProperty().isRoute())) {
195 if (departLane >= route->getParentEdges().front()->getLanes().size()) {
221 if (vehicleParameters) {
222 vehicleParameters->
routeid = route->getID();
227 delete vehicleParameters;
244 if (routeFlowParameters) {
245 routeFlowParameters->
routeid = route->getID();
250 delete routeFlowParameters;
266 }
else if (addEdge && objectsUnderCursor.
getEdgeFront()) {
337 WRITE_WARNING(
"Current selected vType is oriented to pedestrians");
339 WRITE_WARNING(
"Current selected vType is oriented to containers");
370 std::vector<std::string> viaEdges;
387 if (tripParameters) {
395 delete tripParameters;
405 std::vector<std::string> routeEdges;
407 for (
const auto& edge : subPath.getSubPath()) {
408 routeEdges.push_back(edge->getID());
412 routeEdges.erase(std::unique(routeEdges.begin(), routeEdges.end()), routeEdges.end());
418 if (vehicleParameters) {
431 delete vehicleParameters;
448 if (flowParameters) {
456 delete flowParameters;
469 std::vector<std::string> routeEdges;
471 for (
const auto& edge : subPath.getSubPath()) {
472 routeEdges.push_back(edge->getID());
480 if (flowParameters) {
493 delete flowParameters;
507 if (tripParameters) {
514 delete tripParameters;
531 if (flowParameters) {
538 delete flowParameters;
#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
@ 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
void setVehicleParameter(const SUMOVehicleParameter *vehicleParameter)
set vehicle parameters
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
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
FXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual SUMOVehicleClass getVClass() const =0
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::string & getID() const
get ID
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
bool areValuesValid() const
check if parameters of attributes are valid
void refreshAttributesCreator()
refresh attribute creator
void showAttributesCreatorModule(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
void hideAttributesCreatorModule()
hide group box
GNEViewNet * myViewNet
View Net.
virtual void show()
show Frame
virtual void hide()
hide Frame
const std::vector< std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
void showDemandElementSelector()
show demand element selector
GNEDemandElement * getCurrentDemandElement() const
get current demand element
void hideDemandElementSelector()
hide demand element selector
void setVClass(SUMOVehicleClass vClass)
set vClass
const std::vector< Path > & getPath() const
get path route
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
void abortPathCreation()
abort path creation
void hidePathCreatorModule()
show PathCreator
void clearEdgeColors()
clear edge colors
void updateJunctionColors()
update junction colors
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
void clearJunctionColors()
clear junction colors
bool addJunction(GNEJunction *junction, const bool shiftKeyPressed, const bool controlKeyPressed)
add junction
const std::vector< GNEJunction * > & getSelectedJunctions() const
get current selected junctions
void showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives)
show PathCreator for the given tag
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
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
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.
GNEFrameModules::DemandElementSelector * myTypeSelector
Vehicle Type selectors.
GNERouteHandler myRouteHandler
route handler
GNEFrameModules::TagSelector * myVehicleTagSelector
vehicle tag selector (used to select diffent kind of vehicles)
CommonXMLStructure::SumoBaseObject * myVehicleBaseObject
vehicle base object
GNEFrameModules::PathCreator * getPathCreator() const
get PathCreator modul
~GNEVehicleFrame()
Destructor.
void createPath()
create path
GNEFrameAttributeModules::AttributesCreator * myVehicleAttributes
internal vehicle attributes
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
GNEFrameModules::TagSelector * getVehicleTagSelector() const
get vehicle tag selector (needed for transform vehicles)
void tagSelected()
Tag selected in TagSelector.
GNEVehicleFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
HelpCreation * myHelpCreation
Help creation.
GNEFrameModules::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
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
void setStatusBarText(const std::string &text)
set staturBar text
Boundary getVisibleBoundary() const
get visible boundary
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
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.