55 myRouteFrameParent(routeFrameParent) {
59 myRouteModesStrings.push_back(std::make_pair(RouteMode::NONCONSECUTIVE_EDGES,
"non consecutive edges"));
60 myRouteModesStrings.push_back(std::make_pair(RouteMode::CONSECUTIVE_EDGES,
"consecutive edges"));
65 for (
const auto& routeMode : myRouteModesStrings) {
66 myRouteModeMatchBox->appendIconItem(routeMode.second.c_str());
73 myVClassMatchBox->appendIconItem(vClass.c_str());
76 myVClassMatchBox->setCurrentItem(7);
89 return myCurrentRouteMode;
101 return myValidVClass;
112 myRouteFrameParent->myRouteAttributes->showAttributesCreatorModule(myRouteTemplate, {});
114 myRouteFrameParent->myPathCreator->showPathCreatorModule(myRouteTemplate->getTagProperty(), consecutiveEdges);
116 myRouteFrameParent->myPathCreator->updateEdgeColors();
118 myRouteFrameParent->myPathLegend->showPathLegendModule();
121 myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModule();
122 myRouteFrameParent->myPathCreator->hidePathCreatorModule();
123 myRouteFrameParent->myPathLegend->hidePathLegendModule();
125 for (
const auto& edge : myRouteFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
126 edge.second->resetCandidateFlags();
129 myRouteFrameParent->myViewNet->update();
137 myRouteFrameParent->myPathCreator->onCmdAbortPathCreation(0, 0, 0);
141 myRouteModeMatchBox->setTextColor(FXRGB(255, 0, 0));
143 for (
const auto& routeMode : myRouteModesStrings) {
144 if (routeMode.second == myRouteModeMatchBox->getText().text()) {
146 myCurrentRouteMode = routeMode.first;
148 myRouteModeMatchBox->setTextColor(FXRGB(0, 0, 0));
150 WRITE_DEBUG((
"Selected RouteMode '" + myRouteModeMatchBox->getText() +
"' in RouteModeSelector").text());
154 areParametersValid();
162 myRouteFrameParent->myPathCreator->onCmdAbortPathCreation(0, 0, 0);
164 myValidVClass =
false;
166 myVClassMatchBox->setTextColor(FXRGB(255, 0, 0));
169 if (vClass == myVClassMatchBox->getText().text()) {
171 myValidVClass =
true;
173 myVClassMatchBox->setTextColor(FXRGB(0, 0, 0));
177 WRITE_DEBUG((
"Selected VClass '" + myVClassMatchBox->getText() +
"' in RouteModeSelector").text());
181 areParametersValid();
226 edge.second->resetCandidateFlags();
271 std::vector<std::string> edges;
273 for (
const auto& edgeID : path.getSubPath()) {
277 if (edges.empty() || (edges.back() != edge->
getID())) {
278 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 GUIDesignComboBox
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignComboBoxVisibleItems
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ 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 addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
void clear()
clear SumoBaseObject
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::string getID() const
get ID (all Attribute Carriers have one)
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, 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
void refreshAttributesCreator()
refresh attribute creator
virtual void computePathElement()=0
compute pathElement
A road/street connecting two junctions (netedit-version)
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
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
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
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
GNERoute * myRouteTemplate
route template
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
GNEAttributesCreator * myRouteAttributes
internal route attributes
GNEPathLegendModule * myPathLegend
path legend modul
GNERouteHandler myRouteHandler
route handler
~GNERouteFrame()
Destructor.
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
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.
MFXGroupBoxModule (based on FXGroupBox)
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
C++ TraCI client API implementation.