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-2024 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#include <config.h>
21
22#include <netbuild/NBNodeCont.h>
23#include <netedit/GNENet.h>
24#include <netedit/GNEUndoList.h>
26
28
29// ===========================================================================
30// FOX-declarations
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
53 // show extra information for tests
54 WRITE_DEBUG("Reverting join registration");
56}
57
58
59void
61 // show extra information for tests
62 WRITE_DEBUG("Redo join registration");
64}
65
66
67std::string
69 return (TL("Undo register joined junctions"));
70}
71
72
73std::string
75 return (TL("Redo register joined junctions"));
76}
77
78
79GNEChange_RegisterJoin::GNEChange_RegisterJoin(const std::set<NBNode*, ComparatorIdLess>& cluster, NBNodeCont& nc) :
80 GNEChange(Supermode::NETWORK, true, false),
81 myNC(nc) {
82 for (NBNode* n : cluster) {
83 myNodeIDs.insert(n->getID());
84 }
85}
86
87
88/****************************************************************************/
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
std::string joinNamedToString(const std::set< T *, C > &ns, const T_BETWEEN &between)
Definition ToString.h:317
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