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-2020 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 
23 
24 // ===========================================================================
25 // class definitions
26 // ===========================================================================
31 class GNEDeleteFrame : public GNEFrame {
32 
33 public:
34 
35  // ===========================================================================
36  // class DeleteOptions
37  // ===========================================================================
38 
39  class DeleteOptions : protected FXGroupBox {
40 
41  public:
43  DeleteOptions(GNEDeleteFrame* deleteFrameParent);
44 
47 
49  bool deleteOnlyGeometryPoints() const;
50 
52  bool protectAdditionals() const;
53 
55  bool protectTAZs() const;
56 
58  bool protectShapes() const;
59 
61  bool protectDemandElements() const;
62 
64  bool protectGenericDatas() const;
65 
66  private:
69 
71  FXCheckButton* myProtectAdditionals;
72 
74  FXCheckButton* myProtectTAZs;
75 
77  FXCheckButton* myProtectShapes;
78 
80  FXCheckButton* myProtectDemandElements;
81 
83  FXCheckButton* myProtectGenericDatas;
84  };
85 
90  GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
91 
94 
96  void show();
97 
99  void hide();
100 
103 
108  void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions = false);
109 
113  void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
114 
117 
118 protected:
119 
122 
123  public:
125  SubordinatedElements(const GNEJunction* junction);
126 
128  SubordinatedElements(const GNEEdge* edge);
129 
131  SubordinatedElements(const GNELane* lane);
132 
134  SubordinatedElements(const GNEAdditional* additional);
135 
137  SubordinatedElements(const GNEShape* shape);
138 
140  SubordinatedElements(const GNEDemandElement* demandElement);
141 
143  SubordinatedElements(const GNEGenericData* genericData);
144 
147 
149  bool checkElements(const DeleteOptions* deleteOptions);
150 
151  protected:
154 
157 
160 
163 
165  size_t myTAZParents;
166 
168  size_t myTAZChilds;
169 
172 
175 
178 
181 
184 
187 
188  private:
189  // default constructor for non-net elements
190  SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet);
191 
192  // default constructor for Net Elements
193  SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet, const GNEHierarchicalElement* hierarchicalElement);
194 
197 
198  // @brief open warning dialog
199  void openWarningDialog(const std::string& elementType, const size_t number, const bool isChild);
200 
203 
206  };
207 
209  bool selectedACsToDelete() const;
210 
211 private:
214 };
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
bool protectShapes() const
check if protect shapes elements checkbox is enabled
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
FXCheckButton * myProtectShapes
checkbox for enable/disable protect shapes
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
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 DeleteOptions *deleteOptions)
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.
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:49
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:45
class used to group all variables related with objects under cursor after a click over view