55 myRouteFrameParent(routeFrameParent),
56 myCurrentRouteMode(
RouteMode::NONCONSECUTIVE_EDGES),
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"));
64 for (
const auto& routeMode : myRouteModesStrings) {
65 myRouteModeMatchBox->appendItem(routeMode.second.c_str());
68 myRouteModeMatchBox->setNumVisible((
int)myRouteModeMatchBox->getNumItems());
73 myVClassMatchBox->appendItem(vClass.c_str());
76 myVClassMatchBox->setCurrentItem(7);
78 myVClassMatchBox->setNumVisible((
int)myVClassMatchBox->getNumItems());
89 return myCurrentRouteMode;
101 return myValidVClass;
114 myRouteFrameParent->myPathCreator->updateEdgeColors();
116 myRouteFrameParent->myPathLegend->showPathLegendModul();
119 myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul();
120 myRouteFrameParent->myPathCreator->hidePathCreatorModul();
121 myRouteFrameParent->myPathLegend->hidePathLegendModul();
123 for (
const auto& edge : myRouteFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
124 edge.second->resetCandidateFlags();
127 myRouteFrameParent->myViewNet->update();
135 myRouteFrameParent->myPathCreator->onCmdAbortPathCreation(0, 0, 0);
139 myRouteModeMatchBox->setTextColor(FXRGB(255, 0, 0));
141 for (
const auto& routeMode : myRouteModesStrings) {
142 if (routeMode.second == myRouteModeMatchBox->getText().text()) {
144 myCurrentRouteMode = routeMode.first;
146 myRouteModeMatchBox->setTextColor(FXRGB(0, 0, 0));
148 WRITE_DEBUG((
"Selected RouteMode '" + myRouteModeMatchBox->getText() +
"' in RouteModeSelector").text());
152 areParametersValid();
160 myRouteFrameParent->myPathCreator->onCmdAbortPathCreation(0, 0, 0);
162 myValidVClass =
false;
164 myVClassMatchBox->setTextColor(FXRGB(255, 0, 0));
167 if (vClass == myVClassMatchBox->getText().text()) {
169 myValidVClass =
true;
171 myVClassMatchBox->setTextColor(FXRGB(0, 0, 0));
175 WRITE_DEBUG((
"Selected VClass '" + myVClassMatchBox->getText() +
"' in RouteModeSelector").text());
179 areParametersValid();
188 GNEFrame(horizontalFrameParent, viewNet,
"Routes") {
220 edge.second->resetCandidateFlags();
258 for (
const auto& edgeID : path.getSubPath()) {
262 if (routeParameters.
edges.empty() || (routeParameters.
edges.back() != edge)) {
263 routeParameters.
edges.push_back(edge);
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 GUIDesignGroupBoxFrame
Group box design extended over frame.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_ATTR_COLOR
A color information.
static const GNETagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
const std::string & getTagStr() const
get tag assigned to this object in string format
A road/street connecting two junctions (netedit-version)
void refreshRows()
refresh rows (called after creating an element)
std::map< SumoXMLAttr, std::string > getAttributesAndValues(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
GNEViewNet * myViewNet
View Net.
virtual void show()
show Frame
virtual void hide()
hide Frame
std::vector< GNEEdge * > getSelectedEdges() const
get current selected additionals
const std::vector< Path > & getPath() const
get path route
SUMOVehicleClass getVClass() const
get vClass
void abortPathCreation()
abort path creation
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
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 failHard=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
std::string generateDemandElementID(SumoXMLTag tag) const
generate demand element id
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
GNEFrameModuls::PathCreator * myPathCreator
path creator modul
void show()
show delete frame
~GNERouteFrame()
Destructor.
GNEFrameAttributesModuls::AttributesCreator * myRouteAttributes
internal route attributes
RouteMode
route creation modes
void hide()
hide delete frame
GNEFrameModuls::PathCreator * getPathCreator() const
get path creator modul
RouteModeSelector * myRouteModeSelector
route mode selector
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
GNEFrameModuls::PathLegend * myPathLegend
path legend modul
GNERouteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void createPath()
create path
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
GNENet * getNet() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
C++ TraCI client API implementation.
struct for saving route parameters
std::string routeID
string for saving parsed Route ID
std::vector< GNEEdge * > edges
edges
RGBColor color
string for saving parsed route colors
SUMOVehicleClass vClass
vClass used by this route