Eclipse SUMO - Simulation of Urban MObility
GNEDeleteFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 // The Widget for remove network-elements
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 
25 // ===========================================================================
26 // class definitions
27 // ===========================================================================
32 class GNEDeleteFrame : public GNEFrame {
33 
34 public:
35 
36  // ===========================================================================
37  // class DeleteOptions
38  // ===========================================================================
39 
43 
44  public:
46  DeleteOptions(GNEDeleteFrame* deleteFrameParent);
47 
50 
52  bool deleteOnlyGeometryPoints() const;
53 
57  long onCmdSetOption(FXObject*, FXSelector, void*);
58 
60 
61  protected:
63  FOX_CONSTRUCTOR(DeleteOptions)
64 
65  private:
68 
71  };
72 
73  // ===========================================================================
74  // class ProtectElements
75  // ===========================================================================
76 
78 
79  public:
81  ProtectElements(GNEDeleteFrame* deleteFrameParent);
82 
85 
87  bool protectAdditionals() const;
88 
90  bool protectTAZs() const;
91 
93  bool protectShapes() const;
94 
96  bool protectDemandElements() const;
97 
99  bool protectGenericDatas() const;
100 
101  private:
103  FXCheckButton* myProtectAdditionals;
104 
106  FXCheckButton* myProtectTAZs;
107 
109  FXCheckButton* myProtectShapes;
110 
112  FXCheckButton* myProtectDemandElements;
113 
115  FXCheckButton* myProtectGenericDatas;
116  };
117 
122  GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
123 
125  ~GNEDeleteFrame();
126 
128  void show();
129 
131  void hide();
132 
135 
140  void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions = false);
141 
145  void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
146 
149 
150 protected:
151 
154 
155  public:
157  SubordinatedElements(const GNEJunction* junction);
158 
160  SubordinatedElements(const GNEEdge* edge);
161 
163  SubordinatedElements(const GNELane* lane);
164 
166  SubordinatedElements(const GNEAdditional* additional);
167 
169  SubordinatedElements(const GNEShape* shape);
170 
172  SubordinatedElements(const GNEDemandElement* demandElement);
173 
175  SubordinatedElements(const GNEGenericData* genericData);
176 
179 
181  bool checkElements(const ProtectElements* protectElements);
182 
183  protected:
186 
189 
192 
195 
197  size_t myTAZParents;
198 
200  size_t myTAZChilds;
201 
204 
207 
210 
213 
216 
219 
220  private:
221  // default constructor for non-net elements
222  SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet);
223 
224  // default constructor for Net Elements
225  SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet, const GNEHierarchicalElement* hierarchicalElement);
226 
229 
230  // @brief open warning dialog
231  void openWarningDialog(const std::string& elementType, const size_t number, const bool isChild);
232 
235 
238  };
239 
241  bool selectedACsToDelete() const;
242 
243 private:
246 
249 };
FXGroupBoxModule (based on FXGroupBox)
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
long onCmdSetOption(FXObject *, FXSelector, void *)
GNEDeleteFrame * myDeleteFrameParent
FOX need this.
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
FOX-declaration.
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
FXCheckButton * myProtectShapes
checkbox for enable/disable protect shapes
bool protectShapes() const
check if protect shapes elements checkbox is enabled
ProtectElements(GNEDeleteFrame *deleteFrameParent)
constructor
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
size_t myDemandElementParents
parent demand elements
size_t myGenericDataChilds
child demand elements
size_t myGenericDataParents
parent demand elements
SubordinatedElements(const SubordinatedElements &)=delete
Invalidated copy constructor.
SubordinatedElements & operator=(const SubordinatedElements &)=delete
Invalidated assignment operator.
const GNEAttributeCarrier * myAttributeCarrier
parent of SubordinatedElements
size_t myDemandElementChilds
child demand elements
size_t myAdditionalParents
parent additionals (except TAZs)
GNEViewNet * myViewNet
pointer to view net
void openWarningDialog(const std::string &elementType, const size_t number, const bool isChild)
size_t myAdditionalChilds
child additional (except TAZs)
bool checkElements(const ProtectElements *protectElements)
if element can be removed
void addValuesFromSubordinatedElements(SubordinatedElements *originalSE, const SubordinatedElements &newSE)
add in originalSE the values of newSE
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
bool selectedACsToDelete() const
check if there is selected ACs to delete
DeleteOptions * getDeleteOptions() const
get delete options
~GNEDeleteFrame()
Destructor.
DeleteOptions * myDeleteOptions
modul for delete options
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void hide()
hide delete frame
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
ProtectElements * myProtectElements
modul for protect elements
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
An Element which don't belongs to GNENet but has influency in the simulation.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
class used to group all variables related with objects under cursor after a click over view