59 myConflictVClass(false),
60 myConflictDisconnected(false) {
62 mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(vClass, fromEdge, toEdge);
64 if (mySubPath.empty()) {
65 mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(
SVC_PEDESTRIAN, fromEdge, toEdge);
66 if (mySubPath.empty()) {
67 mySubPath = {fromEdge, toEdge};
68 myConflictDisconnected =
true;
70 myConflictVClass =
true;
77 myConflictVClass(false),
78 myConflictDisconnected(false) {
96 myConflictVClass(false),
97 myConflictDisconnected(false) {
115 myConflictVClass(false),
116 myConflictDisconnected(false) {
131const std::vector<GNEEdge*>&
139 return myConflictVClass;
145 return myConflictDisconnected;
150 myConflictVClass(false),
151 myConflictDisconnected(false) {
183 if (planTemplate ==
nullptr) {
218 if (planTagProperties.planRoute()) {
226 if (planTagProperties.planEdge()) {
229 if (planTagProperties.planStoppingPlace()) {
232 if (planTagProperties.planConsecutiveEdges()) {
237 if (planTagProperties.planFromEdge() || planTagProperties.planToEdge()) {
243 if (planTagProperties.planFromJunction() || planTagProperties.planToJunction()) {
249 if (planTagProperties.planFromTAZ() || planTagProperties.planToTAZ()) {
255 if (planTagProperties.planFromStoppingPlace() || planTagProperties.planToStoppingPlace()) {
267 if (previousTagProperty.planToEdge() || previousTagProperty.planEdge()) {
269 }
else if (previousTagProperty.planToJunction()) {
271 }
else if (previousTagProperty.planToTAZ()) {
273 }
else if (previousTagProperty.planToStoppingPlace() || previousTagProperty.planStoppingPlace()) {
278 if (planTagProperties.isPlanRide() || planTagProperties.isPlanContainer()) {
371const std::vector<GNEPlanCreator::PlanPath>&
380 const double lineWidth = 0.35;
381 const double lineWidthin = 0.25;
385 glTranslated(0, 0,
GLO_MAX - 0.1);
391 for (
int i = 0; i < (int)
myPath.size(); i++) {
395 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
397 if (((i == 0) && (j == 0)) || (j > 0)) {
401 if ((j + 1) < (
int)path.
getSubPath().size()) {
411 glTranslated(0, 0, 0.1);
413 for (
int i = 0; i < (int)
myPath.size(); i++) {
425 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
427 if (((i == 0) && (j == 0)) || (j > 0)) {
431 if ((j + 1) < (
int)path.
getSubPath().size()) {
447 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
457 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) 180.0 / (
double)
M_PI);
548 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
550 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
625 if (fromEdge && toEdge) {
697 std::ostringstream information;
699 <<
TL(
"Click over:") <<
"\n"
700 << (consecutiveEdges ?
"- Consecutive edges\n" :
"")
701 << (route ?
"- Routes\n" :
"")
702 << (edges ?
"- Edges\n" :
"")
703 << (TAZs ?
"- TAZs\n" :
"")
704 << (junctions ?
"- Junctions\n" :
"")
705 << (stoppingPlace ?
"- StoppingPlaces\n" :
"");
707 std::string informationStr = information.str();
708 informationStr.pop_back();
884 const auto stoppingPlaceID = stoppingPlace->
getID();
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)
std::string fromJunction
from junction
std::string fromContainerStop
from containerStop
std::string toTrainStop
to trainStop
int getNumberOfDefinedParameters() const
get number of defined plans
std::string fromTrainStop
from trainStop
std::string toParkingArea
to parkingArea
std::string fromEdge
from edge
std::string fromBusStop
from busStop
std::string toEdge
to edge
void clear()
clear parameters
std::vector< std::string > consecutiveEdges
consecutive edges
std::string toJunction
to junction
std::string toBusStop
to busStop
std::string fromChargingStation
from chargingStation
std::string fromTAZ
from TAZ
std::string toChargingStation
to chargingStation
std::string toRoute
to route
std::string fromParkingArea
from parkingArea
std::string toContainerStop
to containerStop
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 enableUndoRedoTemporally()
enable undo-redo temporally (for example, after creating an edge)
void disableUndoRedoTemporally(const std::string &reason)
disable undo-redo temporally giving a string with the reason (for example, if we're creating an edge)
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
static std::pair< SumoXMLTag, GUIIcon > getPersonTripTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the personTrip tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getContainerStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the container stop tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getRideTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the ride tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getPersonStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the person stop tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getWalkTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the walk tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getTranshipTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the tranship tag and icon for the combination
static std::pair< SumoXMLTag, GUIIcon > getTransportTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the transport 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 * > getParentStoppingPlaces() const
get parent stoppingPlaces (used by plans)
const std::vector< GNEAdditional * > getParentTAZs() const
get parent TAZs (used by plans)
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
GNEEdge * getParentEdge() const
get parent edge
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
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
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
GNENet * getNet() const
get the net object
GNEDemandElement * getLastCreatedRoute() const
get last created route
GNEViewParent * getViewParent() const
get the net object
void updateViewNet(const bool ignoreViewUpdater=true) 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)