104const std::vector<std::pair<GNELane*, double> >&
110const std::vector<std::string>
112 std::vector<std::string> laneIDs;
114 if (laneIDs.empty() || (laneIDs.back() != lane.first->getID())) {
115 laneIDs.push_back(lane.first->getID());
125 if (lane ==
nullptr) {
143 myLanePath.push_back(std::make_pair(lane, posOverLane));
146 myLanePath.push_back(std::make_pair(lane, posOverLane));
157 myLanePath.push_back(std::make_pair(lane, posOverLane));
169 myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedoTemporally(
TL(
"route creation"));
193 for (
const auto& edge :
myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
194 for (
const auto& lane : edge.second->getChildLanes()) {
195 lane->resetCandidateFlags();
201 for (
const auto& edge :
myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
202 for (
const auto& lane : edge.second->getChildLanes()) {
203 lane->setConflictedCandidate(
true);
209 lane.first->setConflictedCandidate(
false);
211 lane.first->setSourceCandidate(
true);
213 lane.first->setTargetCandidate(
true);
221 if (connection->getLaneFrom() ==
myLanePath.back().first) {
222 connection->getLaneTo()->setConflictedCandidate(
false);
223 connection->getLaneTo()->setPossibleCandidate(
true);
237 const double lineWidth = 0.35;
238 const double lineWidthin = 0.25;
240 std::vector<PositionVector> shapes;
244 shapes.push_back(
myLanePath.front().first->getLaneShape());
246 shapes.front() = shapes.front().getSubpart(
myLanePath.front().second,
myLanePath.back().second);
249 for (
int i = 0; i < (int)
myLanePath.size(); i++) {
266 shapes.front() = shapes.front().splitAt(
myLanePath.front().second).second;
267 shapes.back() = shapes.back().splitAt(
myLanePath.back().second).first;
274 for (
const auto& shape : shapes) {
282 glTranslated(0, 0, 0.1);
291 if (shapes.size() > 0) {
294 {shapes.front().front(), shapes.back().back()},
RGBColor::RED,
295 myFrameParent->getViewNet()->getVisualisationSettings().neteditSizeSettings.additionalGeometryPointRadius, 1,
false);
308 myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->enableUndoRedoTemporally();
329 myLanePath.back().first->resetCandidateFlags();
334 myLanePath.back().first->setSourceCandidate(
false);
335 myLanePath.back().first->setTargetCandidate(
true);
398 length += lane.first->getParentEdge()->getNBEdge()->getLength();
401 std::ostringstream information;
416 for (
const auto& edge :
myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
417 for (
const auto& lane : edge.second->getChildLanes()) {
418 lane->resetCandidateFlags();
FXDEFMAP(GNEConsecutiveSelector) ConsecutiveLaneSelectorMap[]
@ MID_GNE_SHOWCANDIDATES
enable or disable show path candidates
@ MID_GNE_REMOVELAST
remove last inserted element in path
@ MID_GNE_FINISH
finish lane path creation
@ MID_GNE_ABORT
abort lane path creation
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
#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...
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
#define WRITE_WARNING(msg)
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 pushMatrix()
push matrix
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
std::vector< std::pair< GNELane *, double > > myLanePath
vector with lanes and clicked positions
void drawTemporalConsecutiveLanePath() const
draw temporal consecutive lane path
GNEConsecutiveSelector()
FOX need this.
bool addLane(GNELane *lane)
add lane
void abortPathCreation()
abort path creation
FXLabel * myInfoPathLabel
label with path info
GNEFrame * myFrameParent
pointer to frame parent
const bool myAllowOneLane
allow one lane
void updateLaneColors()
update lane colors
void showConsecutiveLaneSelectorModule()
show GNEConsecutiveSelector
long onCmdCreatePath(FXObject *, FXSelector, void *)
void clearPath()
clear lanes (and restore colors)
GNEConsecutiveSelector(GNEFrame *frameParent, const bool allowOneLane)
FOX-declaration.
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
FXCheckButton * myShowCandidateLanes
CheckBox for show candidate lanes.
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted lane".
void updateInfoRouteLabel()
update InfoRouteLabel
~GNEConsecutiveSelector()
destructor
const std::vector< std::pair< GNELane *, double > > & getLanePath() const
get vector with lanes and clicked positions
void removeLastElement()
remove path element
bool drawCandidateLanesWithSpecialColor() const
draw candidate lanes with special color (Only for candidates, special and conflicted)
void hideConsecutiveLaneSelectorModule()
show GNEConsecutiveSelector
long onCmdShowCandidateLanes(FXObject *, FXSelector, void *)
Called when the user click over check button "show candidate lanes".
const std::vector< std::string > getLaneIDPath() const
get lane IDs
FXButton * myFinishCreationButton
button for finish route creation
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
FXButton * myAbortCreationButton
button for abort route creation
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
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
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
static void drawGeometryPoints(const GUIVisualizationSettings::Detail d, const PositionVector &shape, const RGBColor &color, const double radius, const double exaggeration, const bool editingElevation)
draw geometry points
const PositionVector & getShape() const
The shape of the additional element.
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 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 RED
named colors