Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNENetworkElement.h
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 abstract class for network elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
27
28// ===========================================================================
29// class declaration
30// ===========================================================================
31
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
39
40public:
46
52 GNENetworkElement(GNENet* net, const std::string& id, SumoXMLTag tag);
53
55 virtual ~GNENetworkElement();
56
59
62
64 GUIGlObject* getGUIGlObject() override;
65
67 const GUIGlObject* getGUIGlObject() const override;
68
70
72 FileBucket* getFileBucket() const override;
73
75 virtual bool isNetworkElementValid() const;
76
78 virtual std::string getNetworkElementProblem() const;
79
82
91
93 bool isGLObjectLocked() const override;
94
96 void markAsFrontElement() override;
97
99 void selectGLObject() override;
100
102 virtual const std::string getOptionalName() const override;
103
105
108
110 std::string getPopUpID() const override;
111
113 std::string getHierarchyName() const override;
114
116
119
121 void setShapeEdited(const bool value);
122
124 bool isShapeEdited() const;
125
128
130 void simplifyShapeEdited(GNEUndoList* undoList);
131
133 void straigthenShapeEdited(GNEUndoList* undoList);
134
136 void closeShapeEdited(GNEUndoList* undoList);
137
139 void openShapeEdited(GNEUndoList* undoList);
140
142 void setFirstGeometryPointShapeEdited(const int index, GNEUndoList* undoList);
143
145 void deleteGeometryPointShapeEdited(const int index, GNEUndoList* undoList);
146
148 void resetShapeEdited(GNEUndoList* undoList);
149
151
153 void setNetworkElementID(const std::string& newID);
154
155protected:
158
161
162 // @brief check if we're drawing using a boundary but element was already selected
164
167
172 int getVertexIndex(const PositionVector& shape, const Position& pos);
173
174private:
177
180};
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool checkDrawingBoundarySelection() const
GNENetworkElement(const GNENetworkElement &)=delete
Invalidated copy constructor.
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
virtual bool isNetworkElementValid() const
check if current network element is valid to be written into XML (by default true,...
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this AttributeCarrier
GNEContour myNetworkElementContour
network element contour
GNENetworkElement & operator=(const GNENetworkElement &)=delete
Invalidated assignment operator.
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this network element
bool isGLObjectLocked() const override
check if element is locked
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
void setShapeEdited(const bool value)
set shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
bool myShapeEdited
flag to check if element shape is being edited
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straighten shape edited
GUIGLObjectPopupMenu * getShapeEditedPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent, const PositionVector &shape)
get shape edited popup menu
void markAsFrontElement() override
mark element as front element
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
void selectGLObject() override
select element
virtual const std::string getOptionalName() const override
Returns the name of the object (default "")
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void setNetworkElementID(const std::string &newID)
set network element id
bool isShapeEdited() const
check if shape is being edited
int getVertexIndex(const PositionVector &shape, const Position &pos)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
virtual ~GNENetworkElement()
Destructor.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
virtual std::string getNetworkElementProblem() const
return a string with the current network element problem (by default empty, can be reimplemented in c...
The popup menu of a globject.
A window containing a gl-object's parameter.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.