Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEChange_RegisterJoin.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A network change in which something is changed (for undo/redo)
19/****************************************************************************/
20
21#include <netbuild/NBNodeCont.h>
22#include <netedit/GNENet.h>
23#include <netedit/GNEUndoList.h>
25
27
28// ===========================================================================
29// FOX-declarations
30// ===========================================================================
31
32FXIMPLEMENT_ABSTRACT(GNEChange_RegisterJoin, GNEChange, nullptr, 0)
33
34// ===========================================================================
35// member method definitions
36// ===========================================================================
37
38void
39GNEChange_RegisterJoin::registerJoin(const std::set<NBNode*, ComparatorIdLess>& cluster, NBNodeCont& nc, GNEUndoList* undoList) {
40 auto change = new GNEChange_RegisterJoin(cluster, nc);
41 undoList->begin(GUIIcon::UNDO, TLF("Register joined junctions '%'", joinNamedToString(cluster, ",")));
42 undoList->add(change, true);
43 undoList->end();
44}
45
46
49
50
51void
55
56
57void
61
62
63std::string
65 return (TL("Undo register joined junctions"));
66}
67
68
69std::string
71 return (TL("Redo register joined junctions"));
72}
73
74
75GNEChange_RegisterJoin::GNEChange_RegisterJoin(const std::set<NBNode*, ComparatorIdLess>& cluster, NBNodeCont& nc) :
76 GNEChange(Supermode::NETWORK, true, false),
77 myNC(nc) {
78 for (NBNode* n : cluster) {
79 myNodeIDs.insert(n->getID());
80 }
81}
82
83
84/****************************************************************************/
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
#define TL(string)
Definition MsgHandler.h:305
#define TLF(string,...)
Definition MsgHandler.h:307
std::string joinNamedToString(const std::set< T *, C > &ns, const T_BETWEEN &between)
Definition ToString.h:326
the function-object for an editing operation (abstract base)
std::string redoName() const
get Redo name
std::string undoName() const
get undo Name
GNEChange_RegisterJoin(const std::set< NBNode *, ComparatorIdLess > &cluster, NBNodeCont &nc)
constructor
std::set< std::string > myNodeIDs
the function-object for an editing operation (abstract base)
Definition GNEChange.h:56
Container for nodes during the netbuilding process.
Definition NBNodeCont.h:57
void registerJoinedCluster(const NodeSet &cluster)
gets all joined clusters (see doc for myClusters2Join)
void unregisterJoinedCluster(const std::set< std::string > &cluster)
remove cluster from list (on netedit-undo)
Represents a single node (junction) during network building.
Definition NBNode.h:66
Definition json.hpp:4471
Function-object for stable sorting of objects acting like Named without being derived (SUMOVehicle)
Definition Named.h:30