58 mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(vClass, fromEdge, toEdge);
61 mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, fromEdge, toEdge);
62 if (mySubPath.empty()) {
63 mySubPath = {fromEdge, toEdge};
64 myConflictDisconnected = true;
66 myConflictVClass = true;
79 mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, fromEdge, toJunction);
80 if (mySubPath.empty()) {
81 mySubPath = {fromEdge};
82 myConflictDisconnected = true;
84 myConflictVClass = true;
98 mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, fromJunction, toEdge);
99 if (mySubPath.empty()) {
100 mySubPath = {toEdge};
101 myConflictDisconnected = true;
103 myConflictVClass = true;
117 if (mySubPath.empty()) {
118 myConflictDisconnected = true;
120 myConflictVClass = true;
127const std::vector<GNEEdge*>&
179 if (planTemplate ==
nullptr) {
214 if (planTagProperty->planRoute()) {
222 if (planTagProperty->planEdge()) {
225 if (planTagProperty->planStoppingPlace()) {
228 if (planTagProperty->planConsecutiveEdges()) {
233 if (planTagProperty->planFromEdge() || planTagProperty->planToEdge()) {
239 if (planTagProperty->planFromJunction() || planTagProperty->planToJunction()) {
245 if (planTagProperty->planFromTAZ() || planTagProperty->planToTAZ()) {
251 if (planTagProperty->planFromStoppingPlace() || planTagProperty->planToStoppingPlace()) {
263 if (previousTagProperty->planToEdge() || previousTagProperty->planEdge()) {
265 }
else if (previousTagProperty->planToJunction()) {
267 }
else if (previousTagProperty->planToTAZ()) {
269 }
else if (previousTagProperty->planToStoppingPlace() || previousTagProperty->planStoppingPlace()) {
274 if (planTagProperty->isPlanRide() || planTagProperty->isPlanContainer()) {
367const std::vector<GNEPlanCreator::PlanPath>&
375 const auto& ACs =
myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
376 const double lineWidth = 0.35;
377 const double lineWidthin = 0.25;
381 glTranslated(0, 0,
GLO_MAX - 0.1);
387 for (
int i = 0; i < (int)
myPath.size(); i++) {
391 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
393 if (((i == 0) && (j == 0)) || (j > 0)) {
397 if ((j + 1) < (
int)path.
getSubPath().size()) {
407 glTranslated(0, 0, 0.1);
409 for (
int i = 0; i < (int)
myPath.size(); i++) {
421 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
423 if (((i == 0) && (j == 0)) || (j > 0)) {
427 if ((j + 1) < (
int)path.
getSubPath().size()) {
443 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
453 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
468 myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->enableUndoRedoTemporally();
544 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
546 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
578 const auto& ACs =
myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
621 if (fromEdge && toEdge) {
693 std::ostringstream information;
695 <<
TL(
"Click over:") <<
"\n"
696 << (consecutiveEdges ?
"- Consecutive edges\n" :
"")
697 << (route ?
"- Routes\n" :
"")
698 << (edges ?
"- Edges\n" :
"")
699 << (TAZs ?
"- TAZs\n" :
"")
700 << (junctions ?
"- Junctions\n" :
"")
701 << (stoppingPlace ?
"- StoppingPlaces\n" :
"");
703 std::string informationStr = information.str();
704 informationStr.pop_back();
715 const auto clickedPos =
myFrameParent->getViewNet()->getPositionInformation();
880 const auto stoppingPlaceID = stoppingPlace->
getID();
947 myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedoTemporally(
"creation of stoppingPlace path");
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_TAZ
a traffic assignment zone
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop).
plan parameters (used for group all from-to parameters related with plans)
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
const std::string getID() const override
get ID (all Attribute Carriers have one)
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
const GNEHierarchicalContainerParents< 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
const PositionVector & getLaneShape() const
get elements shape
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
GNEEdge * getParentEdge() const
get parent edge
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
PlanPath(GNEPathManager *pathManager, const SUMOVehicleClass vClass, GNEEdge *fromEdge, GNEEdge *toEdge)
constructor for from-to edges
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
void removeLastElement()
remove path element
bool addRoute(GNEDemandElement *route)
add route
double myClickedPositionOverLane
clicked position over lane
const GNEDemandElement * myPreviousPlanElement
previous person plan element
double getClickedPositionOverLane() const
get clicked position over lane
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
GNEPlanCreator(GNEFrame *frameParent, GNEPathManager *pathManager)
default constructor
GNEFrame * myFrameParent
current frame parent
int myPlanParents
allowed plan parents
void hidePathCreatorModule()
show GNEPlanCreator
long onCmdCreatePath(FXObject *, FXSelector, void *)
void showCreationButtons()
show creation buttons
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
int getNumberOfSelectedElements() const
get number of selected elements
void recalculatePath()
recalculate path
CommonXMLStructure::PlanParameters myPlanParameteres
plan parameters
bool addEdge(GNELane *lane)
add edge (clicking over lanes)
SUMOVehicleClass myVClass
current vClass
bool addFromToEdge(GNEEdge *edge)
add from to edge
~GNEPlanCreator()
destructor
FXButton * myAbortCreationButton
button for abort route creation
GNEPathManager * myPathManager
path manager used in this plan creator
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
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
bool addFromToTAZ(GNEAdditional *taz)
add TAZ
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
std::vector< PlanPath > myPath
vector with current path
const std::vector< PlanPath > & getPath() const
get path route
FXButton * myUseLastRoute
button for use last inserted route
bool addFromToStoppingPlace(GNEAdditional *stoppingPlace)
add from to stoppingPlace
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
const CommonXMLStructure::PlanParameters & getPlanParameteres() const
get plan parameters
void updateInfoLabel()
update info label
bool addSingleStoppingPlace(GNEAdditional *stoppingPlace)
add stoppingPlace
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
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isPlanPersonTrip() const
return true if tag correspond to a person trip plan
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
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
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)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
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)