56 myFrameParent(frameParent),
57 myAllowOneLane(allowOneLane) {
59 myInfoPathLabel =
new FXLabel(getCollapsableFrame(),
TL(
"No lanes selected"), 0,
GUIDesignLabelThick(JUSTIFY_LEFT));
62 myFinishCreationButton->disable();
65 myAbortCreationButton->disable();
68 myRemoveLastInsertedElement->disable();
71 myShowCandidateLanes->setCheck(TRUE);
106const std::vector<std::pair<GNELane*, double> >&
112const std::vector<std::string>
114 std::vector<std::string> laneIDs;
116 if (laneIDs.empty() || (laneIDs.back() != lane.first->getID())) {
117 laneIDs.push_back(lane.first->getID());
127 if (lane ==
nullptr) {
145 myLanePath.push_back(std::make_pair(lane, posOverLane));
148 myLanePath.push_back(std::make_pair(lane, posOverLane));
159 myLanePath.push_back(std::make_pair(lane, posOverLane));
196 for (
const auto& lane : edge.second->getLanes()) {
197 lane->resetCandidateFlags();
204 for (
const auto& lane : edge.second->getLanes()) {
205 lane->setConflictedCandidate(
true);
211 lane.first->setConflictedCandidate(
false);
213 lane.first->setSourceCandidate(
true);
215 lane.first->setTargetCandidate(
true);
223 if (connection->getLaneFrom() ==
myLanePath.back().first) {
225 connection->getLaneTo()->setPossibleCandidate(
true);
239 const double lineWidth = 0.35;
240 const double lineWidthin = 0.25;
242 std::vector<PositionVector> shapes;
246 shapes.push_back(
myLanePath.front().first->getLaneShape());
248 shapes.front() = shapes.front().getSubpart(
myLanePath.front().second,
myLanePath.back().second);
251 for (
int i = 0; i < (int)
myLanePath.size(); i++) {
268 shapes.front() = shapes.front().splitAt(
myLanePath.front().second).second;
269 shapes.back() = shapes.back().splitAt(
myLanePath.back().second).first;
276 for (
const auto& shape : shapes) {
284 glTranslated(0, 0, 0.1);
334 myLanePath.back().first->resetCandidateFlags();
339 myLanePath.back().first->setSourceCandidate(
false);
340 myLanePath.back().first->setTargetCandidate(
true);
392 myFrameParent(nullptr),
393 myAllowOneLane(false) {
403 length += lane.first->getParentEdge()->getNBEdge()->getLength();
406 std::ostringstream information;
422 for (
const auto& lane : edge.second->getLanes()) {
423 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
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)
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
void setConflictedCandidate(const bool value)
set element as 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)
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
A road/street connecting two junctions (netedit-version)
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
GNEViewNet * getViewNet() const
get view net
virtual bool createPath(const bool useLastRoute)
create path between two elements
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
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNENet * getNet() const
get the net object
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.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
MFXGroupBoxModule (based on FXGroupBox)
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