58 myConflictVClass(false),
59 myConflictDisconnected(false) {
61 mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(vClass, fromEdge, toEdge);
63 if (mySubPath.empty()) {
64 mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(
SVC_PEDESTRIAN, fromEdge, toEdge);
65 if (mySubPath.empty()) {
66 mySubPath = {fromEdge, toEdge};
67 myConflictDisconnected =
true;
69 myConflictVClass =
true;
76 myConflictVClass(false),
77 myConflictDisconnected(false) {
95 myConflictVClass(false),
96 myConflictDisconnected(false) {
114 myConflictVClass(false),
115 myConflictDisconnected(false) {
130 const std::vector<GNEEdge*>&
138 return myConflictVClass;
144 return myConflictDisconnected;
149 myConflictVClass(false),
150 myConflictDisconnected(false) {
181 if (planTemplate ==
nullptr) {
237 if (planTagProperties.planRoute()) {
245 if (planTagProperties.planEdge()) {
248 if (planTagProperties.planBusStop()) {
251 if (planTagProperties.planTrainStop()) {
254 if (planTagProperties.planContainerStop()) {
257 if (planTagProperties.planConsecutiveEdges()) {
262 if (planTagProperties.planFromEdge() || planTagProperties.planToEdge()) {
268 if (planTagProperties.planFromJunction() || planTagProperties.planToJunction()) {
274 if (planTagProperties.planFromTAZ() || planTagProperties.planToTAZ()) {
280 if (planTagProperties.planFromBusStop() || planTagProperties.planToBusStop()) {
286 if (planTagProperties.planFromTrainStop() || planTagProperties.planToTrainStop()) {
292 if (planTagProperties.planFromContainerStop() || planTagProperties.planToContainerStop()) {
304 if (previousTagProperty.planToEdge() || previousTagProperty.planEdge()) {
306 }
else if (previousTagProperty.planToJunction()) {
308 }
else if (previousTagProperty.planToTAZ()) {
310 }
else if (previousTagProperty.planToStoppingPlace() || previousTagProperty.planStoppingPlace()) {
315 if (planTagProperties.isPlanRide() || planTagProperties.isPlanContainer()) {
406 const std::vector<GNEEdge*>
412 const std::vector<std::string>
414 std::vector<std::string> edgeIDs;
416 edgeIDs.push_back(edge->getID());
566 const std::vector<GNEPlanCreator::PlanPath>&
574 const double lineWidth = 0.35;
575 const double lineWidthin = 0.25;
579 glTranslated(0, 0,
GLO_MAX - 0.1);
585 for (
int i = 0; i < (int)
myPath.size(); i++) {
589 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
591 if (((i == 0) && (j == 0)) || (j > 0)) {
595 if ((j + 1) < (
int)path.
getSubPath().size()) {
605 glTranslated(0, 0, 0.1);
607 for (
int i = 0; i < (int)
myPath.size(); i++) {
619 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
621 if (((i == 0) && (j == 0)) || (j > 0)) {
625 if ((j + 1) < (
int)path.
getSubPath().size()) {
641 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
651 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
726 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
728 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
795 if (fromEdge && toEdge) {
879 std::ostringstream information;
881 <<
TL(
"Click over:") <<
"\n"
882 << (consecutiveEdges ?
"- Consecutive edges\n" :
"")
883 << (route ?
"- Routes\n" :
"")
884 << (edges ?
"- Edges\n" :
"")
885 << (TAZs ?
"- TAZs\n" :
"")
886 << (junctions ?
"- Junctions\n" :
"")
887 << (busStops ?
"- BusStops\n" :
"")
888 << (trainStops ?
"- TrainStops\n" :
"")
889 << (containerStops ?
"- ContainerStops\n" :
"");
891 std::string informationStr = information.str();
892 informationStr.pop_back();
FXDEFMAP(GNEPlanCreator) 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
#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
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
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.
virtual Position getPositionInView() const =0
Returns position of additional in view.
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
static std::pair< SumoXMLTag, GUIIcon > getPersonStopTagIcon(const GNEEdge *edge, const GNEAdditional *busStop, const GNEAdditional *trainStop)
get the person stop tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getPersonTripTagIcon(const GNEEdge *fromEdge, const GNEEdge *toEdge, const GNEAdditional *fromTAZ, const GNEAdditional *toTAZ, const GNEJunction *fromJunction, const GNEJunction *toJunction, const GNEAdditional *fromBusStop, const GNEAdditional *toBusStop, const GNEAdditional *fromTrainStop, const GNEAdditional *toTrainStop)
get the personTrip tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getRideTagIcon(const GNEEdge *fromEdge, const GNEEdge *toEdge, const GNEAdditional *fromBusStop, const GNEAdditional *toBusStop, const GNEAdditional *fromTrainStop, const GNEAdditional *toTrainStop)
get the ride tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getContainerStopTagIcon(const GNEEdge *edge, const GNEAdditional *containerStop)
get the container stop tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getTransportTagIcon(const GNEEdge *fromEdge, const GNEEdge *toEdge, const GNEAdditional *fromContainerStop, const GNEAdditional *toContainerStop)
get the transport tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getTranshipTagIcon(const std::vector< GNEEdge * > &consecutiveEdges, const GNEEdge *fromEdge, const GNEEdge *toEdge, const GNEAdditional *fromContainerStop, const GNEAdditional *toContainerStop)
get the tranship tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getWalkTagIcon(const std::vector< GNEEdge * > &consecutiveEdges, const GNEDemandElement *route, const GNEEdge *fromEdge, const GNEEdge *toEdge, const GNEAdditional *fromTAZ, const GNEAdditional *toTAZ, const GNEJunction *fromJunction, const GNEJunction *toJunction, const GNEAdditional *fromBusStop, const GNEAdditional *toBusStop, const GNEAdditional *fromTrainStop, const GNEAdditional *toTrainStop)
get the walk tag and icon for the combination
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< GNEJunction * > & getParentJunctions() const
get parent junctions
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Position getPositionInView() const
Returns position of hierarchical element in view.
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
GNEEdge * getParentEdge() const
get parent edge
GNEPathManager * getPathManager()
get path manager
std::vector< GNEEdge * > calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &edges) const
calculate Dijkstra path between a list of edges (for example, from-via-to edges)
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
bool myConflictVClass
flag to mark this path as conflicted
bool isConflictDisconnected() const
check if current path is conflict due is disconnected
bool myConflictDisconnected
flag to mark this path as disconnected
const std::vector< GNEEdge * > & getSubPath() const
get sub path
PlanPath()
default constructor
std::vector< GNEEdge * > mySubPath
sub path
bool isConflictVClass() const
check if current path is conflict due vClass
bool addStoppingPlace(GNEAdditional *stoppingPlace)
add from to stoppingPlace
bool addConsecutiveEdge(GNEEdge *edge)
add consecutive edge
GNEDemandElement * myRoute
route
void removeLastElement()
remove path element
bool addRoute(GNEDemandElement *route)
add route
GNEAdditional * getFromContainerStop() const
get from container stop
double myClickedPositionOverLane
clicked position over lane
GNEAdditional * myFromTAZ
from TAZ
GNEJunction * getFromJunction() const
get from junction
const GNEDemandElement * myPreviousPlanElement
previous person plan element
double getClickedPositionOverLane() const
get clicked position over lane
const std::vector< std::string > getConsecutiveEdgeIDs() const
get consecutive edge IDs
bool addFromToJunction(GNEJunction *junction)
add junction
bool planCanBeCreated(const GNEDemandElement *planTemplate) const
check if plan can be created
long onUpdUseLastRoute(FXObject *, FXSelector, void *)
Called when update button "Use last route".
bool addSingleEdge(GNELane *lane)
add edge
GNEJunction * myFromJunction
from junction
GNEFrame * myFrameParent
current frame parent
int myPlanParents
allowed plan parents
void hidePathCreatorModule()
show GNEPlanCreator
long onCmdCreatePath(FXObject *, FXSelector, void *)
void showCreationButtons()
show creation buttons
GNEEdge * getToEdge() const
get to edge
long onCmdUseLastRoute(FXObject *, FXSelector, void *)
Called when the user click over button "Use last route".
bool addTAZ(GNEAdditional *taz)
add TAZ
void updateRemoveLastItemButton() const
check if enable remove last item button
bool addJunction(GNEJunction *junction)
add junction
GNEEdge * myToEdge
to edge
GNEAdditional * getTrainStop() const
get trainStop
GNEAdditional * getFromTAZ() const
get from TAZ
int getNumberOfSelectedElements() const
get number of selected elements
void recalculatePath()
recalculate path
bool addEdge(GNELane *lane)
add edge (clicking over lanes)
GNEAdditional * myToStoppingPlace
to StoppingPlace
SUMOVehicleClass myVClass
current vClass
bool addFromToEdge(GNEEdge *edge)
add from to edge
~GNEPlanCreator()
destructor
GNEAdditional * myFromStoppingPlace
from StoppingPlace
GNEAdditional * getFromTrainStop() const
get from train stop
FXButton * myAbortCreationButton
button for abort route creation
GNEAdditional * getToContainerStop() const
get to container stop
GNEAdditional * getFromBusStop() const
get from bus stop
GNEAdditional * getToTAZ() const
get to TAZ
void abortPathCreation()
abort path creation
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
void clearPath()
clear edges
FXButton * myFinishCreationButton
button for finish route creation
GNEEdge * myFromEdge
from edge
const std::vector< GNEEdge * > getConsecutiveEdges() const
get consecutive edge
GNEDemandElement * getRoute() const
get route
GNEEdge * getFromEdge() const
get from edge
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
bool addFromToTAZ(GNEAdditional *taz)
add TAZ
GNEAdditional * myStoppingPlace
stoppingPlace
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
GNEAdditional * getBusStop() const
get busStop
std::vector< PlanPath > myPath
vector with current path
const std::vector< PlanPath > & getPath() const
get path route
GNEPlanCreator(GNEFrame *frameParent)
default constructor
GNEAdditional * getContainerStop() const
get containerStop
FXButton * myUseLastRoute
button for use last inserted route
bool addFromToStoppingPlace(GNEAdditional *stoppingPlace)
add from to stoppingPlace
GNEEdge * getEdge() const
get edge
GNEJunction * getToJunction() const
get to junction
FXLabel * myInfoLabel
info label
void hideCreationButtons()
hide creation buttons
void showPlanCreatorModule(const GNEPlanSelector *planSelector, const GNEDemandElement *previousPlan)
show plan creator for the given tag property
GNEAdditional * getToTrainStop() const
get to train stop
GNEAdditional * getToBusStop() const
get to bus stop
void updateInfoLabel()
update info label
GNEJunction * myToJunction
to junction
std::vector< GNEEdge * > myConsecutiveEdges
vector with consecutive edges
bool addSingleStoppingPlace(GNEAdditional *stoppingPlace)
add stoppingPlace
GNEAdditional * myToTAZ
to TAZ
const GNETagProperties & getCurrentPlanTagProperties() const
get current plan tag properties
bool isPlanTransport() const
return true if tag correspond to a transport
bool isPlanStopContainer() const
return true if tag correspond to a container stop plan
bool isPersonTrip() const
return true if tag correspond to a person trip
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isPlanRide() const
return true if tag correspond to a ride plan
bool isPlanStopPerson() const
return true if tag correspond to a person stop plan
bool isPlanWalk() const
return true if tag correspond to a walk plan
bool isPlanTranship() const
return true if tag correspond to a tranship
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
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
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.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
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)