57 myRouteFrameParent(routeFrameParent) {
58 const auto statictooltipMenu = routeFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
60 myRouteModesStrings.push_back(std::make_pair(RouteMode::NONCONSECUTIVE_EDGES,
TL(
"non consecutive edges")));
61 myRouteModesStrings.push_back(std::make_pair(RouteMode::CONSECUTIVE_EDGES,
TL(
"consecutive edges")));
66 for (
const auto& routeMode : myRouteModesStrings) {
67 myRouteModeMatchBox->appendIconItem(routeMode.second.c_str());
74 myVClassMatchBox->appendIconItem(vClass.c_str());
77 myVClassMatchBox->setCurrentItem(7);
89 return myCurrentRouteMode;
101 return myValidVClass;
107 const auto routeTemplate = myRouteFrameParent->getViewNet()->getNet()->getACTemplates()->getTemplateAC(
SUMO_TAG_ROUTE);
113 myRouteFrameParent->myRouteAttributesEditor->showAttributesEditor(routeTemplate,
true);
115 myRouteFrameParent->myPathCreator->showPathCreatorModule(routeTemplate->getTagProperty(), consecutiveEdges);
117 myRouteFrameParent->myPathCreator->updateEdgeColors();
119 myRouteFrameParent->myPathLegend->showPathLegendModule();
122 myRouteFrameParent->myRouteAttributesEditor->hideAttributesEditor();
123 myRouteFrameParent->myPathCreator->hidePathCreatorModule();
124 myRouteFrameParent->myPathLegend->hidePathLegendModule();
126 for (
const auto& edge : myRouteFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
127 edge.second->resetCandidateFlags();
130 myRouteFrameParent->myViewNet->update();
138 myRouteFrameParent->myPathCreator->onCmdAbortPathCreation(0, 0, 0);
144 for (
const auto& routeMode : myRouteModesStrings) {
145 if (routeMode.second == myRouteModeMatchBox->getText().text()) {
147 myCurrentRouteMode = routeMode.first;
153 areParametersValid();
161 myRouteFrameParent->myPathCreator->onCmdAbortPathCreation(0, 0, 0);
163 myValidVClass =
false;
168 if (vClass == myVClassMatchBox->getText().text()) {
170 myValidVClass =
true;
178 areParametersValid();
222 edge.second->resetCandidateFlags();
264 std::vector<std::string> edges;
266 for (
const auto& edgeID : path.getSubPath()) {
270 if (edges.empty() || (edges.back() != edge->
getID())) {
271 edges.push_back(edge->
getID());
FXDEFMAP(GNERouteFrame::RouteModeSelector) RouteModeSelectorMap[]
@ MID_GNE_ROUTEFRAME_ROUTEMODE
select a route mode
@ MID_GNE_ROUTEFRAME_VCLASS
select a VClass
#define GUIDesignTextColorRed
red color (for invalid text)
#define GUIDesignComboBox
#define GUIDesignComboBoxVisibleItems
#define GUIDesignTextColorBlack
black color (for correct text)
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ SUMO_TAG_ROUTE
description of a route
@ GNE_ATTR_DEMAND_FILE
demand demand file
@ SUMO_ATTR_EDGES
the edges of a route
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
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
void clear()
clear SumoBaseObject
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)
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject) const
fill sumo Base object
void refreshAttributesEditor()
refresh attribute editor
bool checkAttributes(const bool showWarning)
check if current edited attributes are valid
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
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
void abortPathCreation()
abort path creation
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
const std::vector< Path > & getPath() const
get path route
virtual void computePathElement()=0
implement in children+
long onCmdSelectVClass(FXObject *, FXSelector, void *)
Called when the user select another VClass.
long onCmdSelectRouteMode(FXObject *, FXSelector, void *)
const RouteMode & getCurrentRouteMode() const
get current route mode
bool isValidMode() const
check if current mode is Valid
~RouteModeSelector()
destructor
bool isValidVehicleClass() const
check if current VClass is Valid
void areParametersValid()
called after setting a new route or vclass, for showing moduls
void show()
show delete frame
CommonXMLStructure::SumoBaseObject * myRouteBaseObject
route base object
GNEPathCreator * myPathCreator
path creator modul
GNEPathLegendModule * myPathLegend
path legend modul
~GNERouteFrame()
Destructor.
GNEAttributesEditor * myRouteAttributesEditor
internal route attributes editor
GNERouteFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
bool createPath(const bool useLastRoute)
create path
RouteMode
route creation modes
void hide()
hide delete frame
GNEPathCreator * getPathCreator() const
get path creator module
RouteModeSelector * myRouteModeSelector
route mode selector
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
GNENet * getNet() const
get the net object
GNEViewParent * getViewParent() const
get the net object
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
MFXGroupBoxModule (based on FXGroupBox)
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
C++ TraCI client API implementation.