78 myRouteFrameParent(routeFrameParent),
79 myCurrentRouteMode(ROUTEMODE_CONSECUTIVE_EDGES),
83 myRouteModesStrings.push_back(std::make_pair(ROUTEMODE_CONSECUTIVE_EDGES,
"consecutive edges"));
84 myRouteModesStrings.push_back(std::make_pair(ROUTEMODE_NONCONSECUTIVE_EDGES,
"non consecutive edges"));
88 for (
const auto& i : myRouteModesStrings) {
89 myRouteModeMatchBox->appendItem(i.second.c_str());
92 myRouteModeMatchBox->setNumVisible((
int)myRouteModeMatchBox->getNumItems());
97 myVClassMatchBox->appendItem(i.c_str());
100 myVClassMatchBox->setCurrentItem(7);
102 myVClassMatchBox->setNumVisible((
int)myVClassMatchBox->getNumItems());
198 WRITE_DEBUG(
"Selected invalid RouteMode in RouteModeSelector");
243 WRITE_DEBUG(
"Selected invalid VClass in RouteModeSelector");
308 for (
const auto& i :
myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) {
311 for (
const auto& j :
myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) {
312 for (
const auto& k : j->getLanes()) {
313 k->setSpecialColor(
nullptr);
338 for (
const auto& k : j->getLanes()) {
343 for (
const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) {
346 for (
const auto& k : j->getLanes()) {
362 for (
const auto& j :
myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) {
363 for (
const auto& k : j->getLanes()) {
364 k->setSpecialColor(
nullptr);
369 for (
const auto& k : j->getLanes()) {
370 k->setSpecialColor(
nullptr);
374 myRouteEdges.clear();
378 const std::vector<GNEEdge*>&
397 routeParameters.
color = GNEAttributeCarrier::parse<RGBColor>(routeAttributes.at(
SUMO_ATTR_COLOR));
438 for (
const auto& j :
myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) {
439 for (
const auto& k : j->getLanes()) {
440 k->setSpecialColor(
nullptr);
447 for (
const auto& k : j->getLanes()) {
452 for (
const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) {
453 if (j != myRouteEdges.back()) {
454 for (
const auto& k : j->getLanes()) {
460 if (myRouteEdges.size() == 1) {
481 lenght += i->getNBEdge()->getLength();
482 speed += i->getNBEdge()->getSpeed();
485 std::ostringstream information;
487 <<
"- Number of Edges: " <<
toString(myRouteEdges.size()) <<
"\n" 488 <<
"- Lenght: " <<
toString(lenght) <<
"\n" 489 <<
"- Average speed: " <<
toString(speed / myRouteEdges.size());
541 std::vector<GNEEdge*>
585 for (
const auto& j : i->getLanes()) {
586 j->setSpecialColor(
nullptr);
590 mySelectedEdges.clear();
595 const std::vector<GNEEdge*>&
624 routeParameters.
color = GNEAttributeCarrier::parse<RGBColor>(routeAttributes.at(
SUMO_ATTR_COLOR));
665 i->setSpecialColor(0);
697 lenght += i->getNBEdge()->getLength();
698 speed += i->getNBEdge()->getSpeed();
701 std::ostringstream information;
703 <<
"- Number of Edges: " <<
toString(myTemporalRoute.size()) <<
"\n" 704 <<
"- Lenght: " <<
toString(lenght) <<
"\n" 705 <<
"- Average speed: " <<
toString(speed / myTemporalRoute.size());
718 GNEFrame(horizontalFrameParent, viewNet,
"Routes") {
764 WRITE_DEBUG(
"Edge added in ConsecutiveEdges mode");
766 WRITE_DEBUG(
"Edge wasn't added in ConsecutiveEdges mode");
772 WRITE_DEBUG(
"Edge added in NonConsecutiveEdges mode");
774 WRITE_DEBUG(
"Edge wasn't added in NonConsecutiveEdges mode");
852 std::vector<GNEEdge*> temporalRoute;
859 temporalRoute.push_back(i);
869 if (temporalRoute.size() > 1) {
879 GLHelper::drawLine(temporalRoute.at(0)->getNBEdge()->getLanes().front().shape.front(),
880 temporalRoute.at(0)->getNBEdge()->getLanes().front().shape.back());
882 for (
int i = 1; i < (int)temporalRoute.size(); i++) {
883 GLHelper::drawLine(temporalRoute.at(i - 1)->getNBEdge()->getLanes().front().shape.back(),
884 temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front());
885 GLHelper::drawLine(temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front(),
886 temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.back());
void showConsecutiveEdgesModul()
show ConsecutiveEdges modul
const RGBColor & getEdgeCandidateColor() const
get edge candidate color
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
SUMOVehicleClass VClass
VClass used by this route.
ConsecutiveEdges()
FOX needs this.
std::vector< GNEEdge * > calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector< GNEEdge *> &partialEdges) const
calculate Dijkstra route between a list of partial edges
#define GUIDesignComboBoxNCol
number of column of every combo box
FXButton * myCreateRouteButton
FXButton for create routes.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void hotkeyBackSpace()
function called when user press BACKSPACE key
void hotkeyEsc()
function called when user press ESC key
FXButton * myRemoveLastInsertedEdge
button for removing last inserted edge
long onCmdSelectVClass(FXObject *, FXSelector, void *)
Called when the user select another VClass.
void refreshEdgeCandidates()
refresh edge candidates
void hideAttributesCreatorModul()
hide group box
struct for saving route parameters
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void update() const
Mark the entire GNEViewNet to be repainted later.
void clearEdges()
clear edges (and restore colors)
long onCmdRemoveLastRouteEdge(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
FXComboBox * myRouteModeMatchBox
comboBox with the list of route modes
long onCmdRemoveLastRouteEdge(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
RouteMode
route creation modes
FXLabel * myInfoRouteLabel
label with route info
GNEViewParent * getViewParent() const
get the net object
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show AttributesCreator modul
C++ TraCI client API implementation.
void drawTemporalRoute() const
draw temporal route
RGBColor color
string for saving parsed route colors
const RGBColor & getEdgeCandidateSelectedColor() const
get selected color
long onCmdAbortRoute(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
std::vector< std::pair< RouteMode, std::string > > myRouteModesStrings
list of Route modes that will be shown in Match Box
static const RGBColor ORANGE
FXLabel * myInfoRouteLabel
label with route info
void updateInfoRouteLabel()
update InfoRouteLabel
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...
remove last inserted element in path
void hideNonConsecutiveEdgesModul()
show NonConsecutiveEdges
bool addEdge(GNEEdge *edge)
set edge from (and change color)
NonConsecutiveEdges * myNonConsecutiveEdges
Create routes using non consecutive edges modul.
void show()
show delete frame
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
GNERouteFrame * myRouteFrameParent
pointer to Vehicle Frame Parent
GNEViewNet * getViewNet() const
get view net
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
begin/end of the description of a route
void enableUndoRedo()
disable undo-redo
bool areValuesValid() const
check if parameters of attributes are valid
void handleEdgeClick(GNEEdge *clickedEdge)
handle edge click
void disableUndoRedo(const std::string &reason)
disable undo-redo giving a string with the reason
#define GUIDesignComboBox
GNEViewNet * myViewNet
View Net.
bool addEdge(GNEEdge *edge)
add edge to current route (note: edge must be included in set of candidate edges
long onCmdCreateRoute(FXObject *, FXSelector, void *)
std::vector< GNEEdge * > edges
edges
GNERouteFrame * myRouteFrameParent
pointer to Frame Parent
GNEUndoList * getUndoList() const
get the undoList object
NonConsecutiveEdges()
FOX needs this.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
SUMOVehicleClass myCurrentVehicleClass
current selected VClass
FXButton * myAbortCreationButton
FXButton for abort creating route
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
const RouteMode & getCurrentRouteMode() const
get current route mode
SUMOVehicleClass getCurrentVehicleClass() const
get current selected VClass
ConsecutiveEdges * myConsecutiveEdges
Create routes using consecutive edges modul.
bool isValidVehicleClass() const
check if current VClass is Valid
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
~ConsecutiveEdges()
destructor
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
finish edge path creation
~RouteModeSelector()
destructor
GNERouteFrame * myRouteFrameParent
pointer to Frame Parent
FXButton * myRemoveLastInsertedEdge
button for removing last inserted edge
void updateInfoRouteLabel()
update InfoRouteLabel
FXButton * myFinishCreationButton
button for finish route creation
RouteModeSelector * myRouteModeSelector
route mode selector
const std::vector< GNEEdge * > & getTemporalRoute() const
get temporal route
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
GNEFrameAttributesModuls::AttributesCreator * myRouteAttributes
internal additional attributes
long onCmdAbortRoute(FXObject *, FXSelector, void *)
Called when the user press create route button.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
std::vector< GNEEdge * > mySelectedEdges
current selected edges
long onCmdCreateRoute(FXObject *, FXSelector, void *)
vehicle is a passenger car (a "normal" car)
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
FXButton * myAbortCreationButton
button for abort route creation
A road/street connecting two junctions (netedit-version)
virtual void show()
show Frame
std::vector< GNEEdge * > myTemporalRoute
vector with temporal route edges
void clearEdges()
clear edges (and restore colors)
void setCurrentRouteMode(RouteMode routemode)
set current route mode type manually
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
RouteMode myCurrentRouteMode
current selected route mode
const std::string & getTagStr() const
get tag assigned to this object in string format
void showNonConsecutiveEdgesModul()
show NonConsecutiveEdges
std::vector< GNEEdge * > getSelectedEdges() const
get current selected edgesm
const std::vector< GNEEdge * > & getRouteEdges() const
get temporal route
std::vector< GNEEdge * > myRouteEdges
vector with current route edges
void hideConsecutiveEdgesModul()
hide ConsecutiveEdges modul
virtual void hide()
hide Frame
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
GNENet * getNet() const
get the net object
~NonConsecutiveEdges()
destructor
bool myValidVClass
flag to check if VClass is Valid
~GNERouteFrame()
Destructor.
FXComboBox * myVClassMatchBox
comboBox with the list of VClass
std::string routeID
string for saving parsed Route ID
FXDEFMAP(GNERouteFrame::RouteModeSelector) RouteModeSelectorMap[]
vehicles ignoring classes
long onCmdSelectRouteMode(FXObject *, FXSelector, void *)
void hotkeyEnter()
function called when user press ENTER key
void hide()
hide delete frame
bool isValid(SUMOVehicleClass vehicleClass) const
check if from and to edges create a valid route
GNERouteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.