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 GNENetworkElement(GNENet* net, const std::string& id, SumoXMLTag tag);
47
49 virtual ~GNENetworkElement();
50
53
55 GUIGlObject* getGUIGlObject() override;
56
58 const GUIGlObject* getGUIGlObject() const override;
59
61 virtual bool isNetworkElementValid() const;
62
64 virtual std::string getNetworkElementProblem() const;
65
68
77
79 bool isGLObjectLocked() const override;
80
82 void markAsFrontElement() override;
83
85 void selectGLObject() override;
86
88 virtual const std::string getOptionalName() const override;
89
91
94
96 std::string getPopUpID() const override;
97
99 std::string getHierarchyName() const override;
100
102
105
107 void setShapeEdited(const bool value);
108
110 bool isShapeEdited() const;
111
114
116 void simplifyShapeEdited(GNEUndoList* undoList);
117
119 void straigthenShapeEdited(GNEUndoList* undoList);
120
122 void closeShapeEdited(GNEUndoList* undoList);
123
125 void openShapeEdited(GNEUndoList* undoList);
126
128 void setFirstGeometryPointShapeEdited(const int index, GNEUndoList* undoList);
129
131 void deleteGeometryPointShapeEdited(const int index, GNEUndoList* undoList);
132
134 void resetShapeEdited(GNEUndoList* undoList);
135
137
139 void setNetworkElementID(const std::string& newID);
140
141protected:
144
147
148 // @brief check if we're drawing using a boundary but element was already selected
150
153
158 int getVertexIndex(const PositionVector& shape, const Position& pos);
159
160private:
163
166};
SumoXMLTag
Numbers representing SUMO-XML - element names.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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
get GNEHierarchicalElement associated with this AttributeCarrier
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
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.