58 myFromBusStop(
nullptr),
60 myConflictVClass(
false),
61myConflictDisconnected(
false) {
63 if (edge->getNBEdge()->getNumLanesThatAllow(vClass) == 0) {
64 myConflictVClass =
true;
70 myFromBusStop(nullptr),
72 myConflictVClass(false),
73 myConflictDisconnected(false) {
90 myFromBusStop(nullptr),
92 myConflictVClass(false),
93 myConflictDisconnected(false) {
108const std::vector<GNEEdge*>&
115 return myFromBusStop;
126 return myConflictVClass;
132 return myConflictDisconnected;
137 myFromBusStop(nullptr),
138 myToBusStop(nullptr),
139 myConflictVClass(false),
140 myConflictDisconnected(false) {
170 "SHIFT-click: ignore vClass",
174 "CTRL-click: force add",
178 "BACKSPACE: undo click",
189 bool showPathCreator =
true;
340 showPathCreator =
false;
347 if (showPathCreator) {
490 const auto& outgoingEdges =
mySelectedEdges.back()->getToJunction()->getGNEOutgoingEdges();
491 if (std::find(outgoingEdges.begin(), outgoingEdges.end(), edge) == outgoingEdges.end()) {
509 if (!shiftKeyPressed) {
511 WRITE_WARNING(
TL(
"Invalid edge (SHIFT + click to add an invalid vClass edge)"));
516 if (!controlKeyPressed) {
518 WRITE_WARNING(
TL(
"Invalid edge (CONTROL + click to add a disconnected edge)"));
564const std::vector<GNEEdge*>&
570const std::vector<GNEJunction*>&
576const std::vector<GNETAZ*>&
584 if (stoppingPlace ==
nullptr) {
687const std::vector<GNEPathCreator::Path>&
707 junction.second->resetCandidateFlags();
708 junction.second->setPossibleCandidate(
true);
715 junction->resetCandidateFlags();
716 junction->setSourceCandidate(
true);
735 if (edge.second->getNBEdge()->getNumLanesThatAllow(
myVClass) > 0) {
736 edge.second->setPossibleCandidate(
true);
738 edge.second->setSpecialCandidate(
true);
748 edge.second->resetCandidateFlags();
749 edge.second->setConflictedCandidate(
true);
755 edge.second->setConflictedCandidate(
true);
762 edge->resetCandidateFlags();
763 edge->setSourceCandidate(
true);
778 junction.second->resetCandidateFlags();
787 edge.second->resetCandidateFlags();
794 const double lineWidth = 0.35;
795 const double lineWidthin = 0.25;
799 glTranslated(0, 0,
GLO_MAX - 0.1);
805 for (
int i = 0; i < (int)
myPath.size(); i++) {
809 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
811 if (((i == 0) && (j == 0)) || (j > 0)) {
815 if ((j + 1) < (
int)path.
getSubPath().size()) {
825 glTranslated(0, 0, 0.1);
827 for (
int i = 0; i < (int)
myPath.size(); i++) {
841 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
843 if (((i == 0) && (j == 0)) || (j > 0)) {
847 if ((j + 1) < (
int)path.
getSubPath().size()) {
865 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
878 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
968 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
970 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
1015 for (
const auto& path :
myPath) {
1016 for (
const auto& edge : path.getSubPath()) {
1017 length += edge->getNBEdge()->getLength();
1018 speed += edge->getNBEdge()->getSpeed();
1020 pathSize += (int)path.getSubPath().size();
1023 std::ostringstream information;
1026 <<
TL(
"- Path edges: ") <<
toString(pathSize) <<
"\n"
1027 <<
TL(
"- Length: ") <<
toString(length) <<
"\n"
1028 <<
TL(
"- Average speed: ") <<
toString(speed / pathSize);
1060 std::vector<GNEEdge*> edges;
1067 edges.push_back(edge);
1075 if (edges.size() == 1) {
1082 for (
int i = 1; i < (int)edges.size(); i++) {
1095 for (
const auto& lane : edge.second->getLanes()) {
1096 if (lane->getReachability() > 0) {
1097 lane->getParentEdge()->resetCandidateFlags();
1098 lane->getParentEdge()->setSpecialCandidate(
true);
1110 for (
const auto& lane : edge.second->getLanes()) {
1111 if (lane->getReachability() > 0) {
1112 lane->getParentEdge()->resetCandidateFlags();
1113 lane->getParentEdge()->setPossibleCandidate(
true);
FXDEFMAP(GNEPathCreator) PathCreatorMap[]
@ MID_GNE_PATHCREATOR_FINISH
finish edge path creation
@ MID_GNE_PATHCREATOR_REMOVELAST
remove last inserted element in path
@ MID_GNE_PATHCREATOR_USELASTROUTE
use last inserted route
@ MID_GNE_PATHCREATOR_ABORT
abort edge path creation
@ MID_GNE_PATHCREATOR_SHOWCANDIDATES
enable or disable show path candidates
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
#define WRITE_WARNING(msg)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_PEDESTRIAN
pedestrian
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_TRIP_TAZS
a single trip definition that uses TAZs
@ GNE_TAG_PERSONTRIP_JUNCTIONS
@ SUMO_TAG_EDGEREL
a relation between two edges
@ GNE_TAG_TRANSPORT_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ GNE_TAG_STOPCONTAINER_EDGE
@ SUMO_TAG_BUS_STOP
A bus stop.
@ GNE_TAG_STOPPERSON_BUSSTOP
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_STOPCONTAINER_CONTAINERSTOP
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ GNE_TAG_PERSONTRIP_TRAINSTOP
@ GNE_TAG_FLOW_TAZS
a flow between TAZs
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
@ GNE_TAG_STOPPERSON_TRAINSTOP
@ GNE_TAG_PERSONTRIP_EDGE
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ GNE_TAG_STOPPERSON_EDGE
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ GNE_TAG_TRANSHIP_CONTAINERSTOP
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void pushMatrix()
push matrix
An Element which don't belong to GNENet but has influence in the simulation.
void disableUndoRedo(const std::string &reason)
disable undo-redo giving a string with the reason
void enableUndoRedo()
disable undo-redo
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isSpecialCandidate() const
check if this element is a special candidate
bool isPossibleCandidate() const
check if this element is a possible candidate
bool isConflictedCandidate() const
check if this element is a conflicted candidate
An Element which don't belong to GNENet but has influence in the simulation.
A road/street connecting two junctions (netedit-version)
GNEViewNet * getViewNet() const
get view net
virtual bool createPath(const bool useLastRoute)
create path between two elements
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given toLane
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
get elements shape
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
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
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEPathManager * getPathManager()
get path manager
bool isConflictVClass() const
check if current path is conflict due vClass
bool myConflictDisconnected
flag to mark this path as disconnected
bool myConflictVClass
flag to mark this path as conflicted
bool isConflictDisconnected() const
check if current path is conflict due is disconnected
GNEAdditional * getToBusStop() const
to additional
std::vector< GNEEdge * > mySubPath
sub path
Path()
default constructor
const std::vector< GNEEdge * > & getSubPath() const
get sub path
GNEAdditional * getFromBusStop() const
get from additional
long onCmdCreatePath(FXObject *, FXSelector, void *)
GNEAdditional * getToStoppingPlace(SumoXMLTag expectedTag) const
get to stoppingPlace
std::vector< Path > myPath
vector with current path
FXButton * myAbortCreationButton
button for abort route creation
bool addStoppingPlace(GNEAdditional *stoppingPlace, const bool shiftKeyPressed, const bool controlKeyPressed)
add stoppingPlace
void updateEdgeColors()
update edge colors
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
bool addRoute(GNEDemandElement *route, const bool shiftKeyPressed, const bool controlKeyPressed)
add route
GNEAdditional * myToStoppingPlace
to additional (usually a busStop)
@ SHOW_CANDIDATE_JUNCTIONS
FXLabel * myControlLabel
label for control information
GNEFrame * myFrameParent
current frame parent
std::vector< GNEEdge * > mySelectedEdges
vector with selected edges
std::vector< GNETAZ * > mySelectedTAZs
vector with selected TAZs
GNEDemandElement * myRoute
route (usually a busStop)
const std::vector< GNETAZ * > & getSelectedTAZs() const
get current selected TAZs
void abortPathCreation()
abort path creation
void updateInfoRouteLabel()
update InfoRouteLabel
bool addTAZ(GNETAZ *taz)
add TAZ
FXCheckButton * myShowCandidateEdges
CheckBox for show candidate edges.
long onCmdShowCandidateEdges(FXObject *, FXSelector, void *)
Called when the user click over check button "show candidate edges".
~GNEPathCreator()
destructor
const std::vector< GNEJunction * > & getSelectedJunctions() const
get current selected junctions
void clearPath()
clear edges (and restore colors)
SUMOVehicleClass myVClass
current vClass
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
void setPossibleCandidates(GNEEdge *originEdge, const SUMOVehicleClass vClass)
set edgereachability (This function will be called recursively)
long onCmdUseLastRoute(FXObject *, FXSelector, void *)
Called when the user click over button "Use last route".
void clearEdgeColors()
clear edge colors
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
GNEDemandElement * getRoute() const
get route
void removeLastElement()
remove path element
bool addJunction(GNEJunction *junction)
add junction
bool createPath(const bool useLastRoute)
create path
void setVClass(SUMOVehicleClass vClass)
set vClass
void updateJunctionColors()
update junction colors
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
SUMOVehicleClass getVClass() const
get vClass
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
int myCreationMode
current creation mode
FXLabel * myInfoRouteLabel
label with route info
FXLabel * myBackSpaceLabel
label for backSpace information
bool drawCandidateEdgesWithSpecialColor() const
draw candidate edges with special color (Only for candidates, special and conflicted)
void setSpecialCandidates(GNEEdge *originEdge)
set special candidates (This function will be called recursively)
FXButton * myFinishCreationButton
button for finish route creation
long onUpdUseLastRoute(FXObject *, FXSelector, void *)
Called when update button "Use last route".
FXLabel * myShiftLabel
label for shift information
void recalculatePath()
recalculate path
GNEPathCreator(GNEFrame *frameParent)
default constructor
const std::vector< Path > & getPath() const
get path route
void clearJunctionColors()
clear junction colors
void hidePathCreatorModule()
show GNEPathCreator
void showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives)
show GNEPathCreator for the given tag
FXButton * myUseLastRoute
button for use last inserted route
std::vector< GNEJunction * > mySelectedJunctions
vector with selected junctions
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
std::vector< GNEEdge * > calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
GNENet * getNet() const
get the net object
GNEDemandElement * getLastCreatedRoute() const
get last created route
GNEViewParent * getViewParent() const
get the net object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
const PositionVector & getShape() const
The shape of the additional element.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Stores the information about how to visualize structures.
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
A point in 2D or 3D with translation and scaling methods.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
double x() const
Returns the x-position.
double y() const
Returns the y-position.
static const RGBColor GREY
static const RGBColor ORANGE
static const RGBColor special
color for selected special candidate element (Usually selected using shift+click)
static const RGBColor conflict
color for selected conflict candidate element (Usually selected using ctrl+click)