62 FXIMPLEMENT(
GNEConnectorFrame, FXVerticalFrame, GNEConnectorFrameMap, ARRAYNUMBER(GNEConnectorFrameMap))
77 GNEFrame(horizontalFrameParent, viewNet,
"Edit Connections"),
175 bool changed =
false;
213 }
else if ((fromPermissions & toPermissions) == 0) {
260 std::vector<GNEAttributeCarrier*> deadEnds;
263 for (
auto i : edges) {
264 for (
auto j : i->getLanes()) {
265 if (i->getNBEdge()->getConnectionsFromLane(j->getIndex()).size() == 0) {
266 deadEnds.push_back(j);
277 std::vector<GNEAttributeCarrier*> deadStarts;
280 for (
auto i : junctions) {
282 for (
auto j : i->getNBNode()->getOutgoingEdges()) {
285 deadStarts.push_back(k);
289 for (
auto j : i->getNBNode()->getIncomingEdges()) {
303 std::vector<GNEAttributeCarrier*> conflicts;
306 for (
auto i : edges) {
307 const EdgeVector destinations = i->getNBEdge()->getConnectedEdges();
308 for (
auto j : destinations) {
311 const bool isConflicted = count_if(i->getNBEdge()->getConnections().begin(), i->getNBEdge()->getConnections().end(),
314 conflicts.push_back(k);
327 std::vector<GNEAttributeCarrier*> pass;
329 for (
auto i : edges) {
330 for (
auto j : i->getNBEdge()->getConnections()) {
331 if (j.mayDefinitelyPass) {
332 pass.push_back(i->getLanes()[j.fromLane]);
347 for (
auto i : junctions) {
353 for (
auto i : edges) {
354 for (
auto j : i->getLanes()) {
360 for (
auto i : lanes) {
383 for (
auto i : junctions) {
407 for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
410 for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
441 (*it)->setSpecialColor(0);
457 const int toIndex = targetLane->
getIndex();
458 std::vector<NBEdge::Connection>::const_iterator con_it = find_if(
459 connections.begin(), connections.end(),
461 const bool isConnected = con_it != connections.end();
463 if (con_it->mayDefinitelyPass) {
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
static RGBColor targetColor
color for the to-lane of a connection
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
A structure which describes a connection between edges or lanes.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
select lanes that have no connection leading to it
begin/end of the description of a junction
FXButton * mySelectPassingButton
"Select Edges which may always pass"
void handleIDs(const std::vector< GNEAttributeCarrier *> &ACs, ModificationMode::SetOperation setop=ModificationMode::SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
long onCmdSelectDeadStarts(FXObject *, FXSelector, void *)
FXLabel * myHoldShiftLabel
Selection Hint.
static const NBConnection InvalidConnection
long onCmdSelectPass(FXObject *, FXSelector, void *)
FXLabel * myHoldControlLabel
hold control label
connectio between two lanes
GNEViewParent * getViewParent() const
get the net object
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
The representation of a single edge during network building.
std::vector< GNELane * > LaneVector
Definition of the lane's vector.
FXGroupBox * myGroupBoxSelection
groupbox for selection hints
FXGroupBox * myGroupBoxModifications
GroupBox for Buttons.
std::set< GNELane * > myPotentialTargets
the set of lanes to which the current lane may be connected
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
long onCmdClearSelectedConnections(FXObject *, FXSelector, void *)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
FXGroupBox * myGroupBoxLegend
group box for legend
FXDEFMAP(GNEConnectorFrame) GNEConnectorFrameMap[]
FXGroupBox * myGroupBoxDescription
Groupbox for description.
FXLabel * myConflictLabel
conflict label
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
GNEViewNet * myViewNet
View Net for changes.
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
return the status of toLane
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
static RGBColor potentialTargetColor
color for potential to-lane targets (currently unconnected)
void handleLaneClick(GNELane *lane, bool mayDefinitelyPass, bool allowConflict, bool toggle)
either sets the current lane or toggles the connection of the current lane to this lane (if they shar...
long onCmdSelectConflicts(FXObject *, FXSelector, void *)
select lanes with connections that have the pass attribute set to 'true'
GNEUndoList * getUndoList() const
get the undoList object
int getIndex() const
returns the index of the lane
static const RGBColor GREEN
int myNumChanges
number of changes
FXGroupBox * myGroupBoxOperations
groupbox for operations
void initTargets()
init targets
GNEConnectorFrame()
FOX needs this.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
GNEEdge & getParentEdge()
Returns underlying parent edge.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
void removeConnections(GNELane *lane)
remove connections
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
FXButton * myResetSelectedButton
"Reset Selected"
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
static RGBColor sourceColor
color for the from-lane of a connection
FXLabel * myTargetLabel
target label
static const RGBColor MAGENTA
FXButton * mySelectDeadStartsButton
"Select Dead Starts" button
static RGBColor targetPassColor
color for the to-lane of a connection with pass attribute
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
FXLabel * myPossibleTargetLabel
possible target label
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
GNEJunction * getGNEJunctionSource() const
returns the source-junction
FXButton * mySelectConflictsButton
"Select Conflicts" button
void p_abort()
reverts and discards ALL active command groups
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
std::vector< NBEdge::Connection > myDeletedConnections
vector of connections deleted in the current editing step
A road/street connecting two junctions (netedit-version)
long onCmdOK(FXObject *, FXSelector, void *)
select lanes that are connected from concurrent lanes
static const RGBColor YELLOW
static RGBColor conflictColor
color for a to-lane that cannot be used because another connection conflicts
FXButton * mySaveButton
"OK" button
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
static const RGBColor CYAN
FXButton * myCancelButton
"Cancel" button
const std::vector< Connection > & getConnections() const
Returns the connections.
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
FXLabel * mySourceLabel
source label
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
void setSpecialColor(const RGBColor *Color2)
FXLabel * myLaneDescriptionLabel
the label that shows the current editing state
LaneStatus
the status of a target lane
GNENet * getNet() const
get the net object
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Represents a single node (junction) during network building.
long onCmdSelectDeadEnds(FXObject *, FXSelector, void *)
Called when the user presses the Corresponding-button.
void setStatusBarText(const std::string &text)
set staturBar text
GNELane * myCurrentLane
the lane of which connections are to be modified
~GNEConnectorFrame()
Destructor.
#define GUIDesignLabelLeft
FXLabel * myTargetPassLabel
target pass label
NBEdge * getNBEdge()
returns the internal NBEdge
FXButton * myClearSelectedButton
"Clear Selected"
NBNode * getNBNode() const
Return net build node.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void cleanup()
clean up when deselecting current lane
FXButton * mySelectDeadEndsButton
"Select Dead Ends" button
void updateDescription() const
update description
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection, const NBConnection &addedConnection=NBConnection::InvalidConnection)
long onCmdResetSelectedConnections(FXObject *, FXSelector, void *)