SUMO - Simulation of Urban MObility
GNEFrame.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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Abstract class for lateral frames in NetEdit
16 /****************************************************************************/
17 #ifndef GNEFrame_h
18 #define GNEFrame_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <fx.h>
26 #include <netbuild/NBEdge.h>
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class GNEViewNet;
37 class GNEUndoList;
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
42 
47 class GNEFrame : public FXVerticalFrame {
48 
49 public:
50 
51  // ===========================================================================
52  // class ACHierarchy
53  // ===========================================================================
54 
55  class ACHierarchy : private FXGroupBox {
57  FXDECLARE(GNEFrame::ACHierarchy)
58 
59  public:
61  ACHierarchy(GNEFrame* frameParent);
62 
64  ~ACHierarchy();
65 
68 
70  void hideACHierarchy();
71 
73  void refreshACHierarchy();
74 
78  long onCmdShowChildMenu(FXObject*, FXSelector, void* data);
79 
81  long onCmdCenterItem(FXObject*, FXSelector, void*);
82 
84  long onCmdInspectItem(FXObject*, FXSelector, void*);
85 
87  long onCmdDeleteItem(FXObject*, FXSelector, void*);
89 
90  protected:
93 
94  // @brief create pop-up menu in the positions X-Y for the attribute carrier ac
95  void createPopUpMenu(int X, int Y, GNEAttributeCarrier* ac);
96 
98  FXTreeItem* showAttributeCarrierParents();
99 
101  void showAttributeCarrierChilds(GNEAttributeCarrier* AC, FXTreeItem* itemParent);
102 
104  FXTreeItem* addACIntoList(GNEAttributeCarrier* AC, FXTreeItem* itemParent);
105 
106  private:
109 
112 
114  FXTreeList* myTreelist;
115 
117  std::map<FXTreeItem*, GNEAttributeCarrier*> myTreeItemToACMap;
118 
120  std::set<FXTreeItem*> myTreeItemsConnections;
121 
124  };
125 
126  // ===========================================================================
127  // class GenericParametersEditor
128  // ===========================================================================
129 
130  class GenericParametersEditor : private FXGroupBox {
133 
134  public:
136  GenericParametersEditor(GNEFrame* frameParent);
137 
140 
142  void showGenericParametersEditor(GNEAttributeCarrier* AC);
143 
145  void showGenericParametersEditor(std::vector<GNEAttributeCarrier*> ACs);
146 
148  void hideGenericParametersEditor();
149 
151  void refreshGenericParametersEditor();
152 
154  std::string getGenericParametersStr() const;
155 
159  long onCmdEditGenericParameter(FXObject*, FXSelector, void*);
160 
162  long onCmdSetGenericParameter(FXObject*, FXSelector, void*);
164 
165  protected:
168 
169  private:
172 
174  std::vector<GNEAttributeCarrier*> myACs;
175 
177  std::vector<std::pair<std::string, std::string> >* myGenericParameters;
178 
181 
184 
187  };
188 
194  GNEFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, const std::string& frameLabel);
195 
197  ~GNEFrame();
198 
200  void focusUpperElement();
201 
205  virtual void show();
206 
210  virtual void hide();
211 
213  void setFrameWidth(int newWidth);
214 
216  GNEViewNet* getViewNet() const;
217 
219  FXLabel* getFrameHeaderLabel() const;
220 
222  FXFont* getFrameHeaderFont() const;
223 
224 protected:
226  GNEFrame() {}
227 
229  void openHelpAttributesDialog(SumoXMLTag tag) const;
230 
233 
235  FXVerticalFrame* myContentFrame;
236 
238  FXHorizontalFrame* myHeaderFrame;
239 
241  FXHorizontalFrame* myHeaderLeftFrame;
242 
244  FXHorizontalFrame* myHeaderRightFrame;
245 
246 private:
248  FXScrollWindow* myScrollWindowsContents;
249 
252 
255 
257  GNEFrame(const GNEFrame&) = delete;
258 
260  GNEFrame& operator=(const GNEFrame&) = delete;
261 };
262 
263 
264 #endif
265 
266 /****************************************************************************/
GNEFrame()
FOX needs this.
Definition: GNEFrame.h:226
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEFrame & operator=(const GNEFrame &)=delete
Invalidated assignment operator.
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:772
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
Definition: GNEFrame.cpp:204
FXFont * myFrameHeaderFont
Font for the Header.
Definition: GNEFrame.h:251
FXHorizontalFrame * myHeaderRightFrame
fame for right header elements
Definition: GNEFrame.h:244
void showACHierarchy(GNEAttributeCarrier *AC)
show ACHierarchy
Definition: GNEFrame.cpp:99
void hideACHierarchy()
hide ACHierarchy
Definition: GNEFrame.cpp:110
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
Definition: GNEFrame.h:117
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
Definition: GNEFrame.cpp:164
GNEFrame * myFrameParent
pointer to inspector frame parent
Definition: GNEFrame.h:180
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
Definition: GNEFrame.h:123
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
Definition: GNEFrame.h:248
FXFont * getFrameHeaderFont() const
get font of the header&#39;s frame
Definition: GNEFrame.cpp:778
FXHorizontalFrame * myHeaderFrame
fame for header elements
Definition: GNEFrame.h:238
void openHelpAttributesDialog(SumoXMLTag tag) const
Open help attributes dialog.
Definition: GNEFrame.cpp:784
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:766
GNEFrame * myFrameParent
Frame Parent.
Definition: GNEFrame.h:108
FXTreeItem * addACIntoList(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
add item into list
Definition: GNEFrame.cpp:482
std::set< FXTreeItem * > myTreeItemsConnections
set used to save tree items without AC assigned, the Incoming/Outcoming connections ...
Definition: GNEFrame.h:120
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
Definition: GNEFrame.cpp:155
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:232
std::vector< GNEAttributeCarrier * > myACs
list of edited ACs
Definition: GNEFrame.h:174
GNEAttributeCarrier * myAC
edited Attribute Carrier
Definition: GNEFrame.h:171
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:235
void showAttributeCarrierChilds(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
show child of current attributeCarrier
Definition: GNEFrame.cpp:381
FXLabel * myFrameHeaderLabel
the label for the frame&#39;s header
Definition: GNEFrame.h:254
std::vector< std::pair< std::string, std::string > > * myGenericParameters
pointer to current vector of generic parameters
Definition: GNEFrame.h:177
void refreshACHierarchy()
refresh ACHierarchy
Definition: GNEFrame.cpp:117
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
Definition: GNEFrame.cpp:130
void setFrameWidth(int newWidth)
set width of GNEFrame
Definition: GNEFrame.cpp:759
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
Definition: GNEFrame.cpp:183
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:735
GNEAttributeCarrier * myAC
Attribute carrier.
Definition: GNEFrame.h:111
~ACHierarchy()
destructor
Definition: GNEFrame.cpp:95
ACHierarchy()
FOX needs this.
Definition: GNEFrame.h:92
~GNEFrame()
destructor
Definition: GNEFrame.cpp:729
GenericParametersEditor()
FOX needs this.
Definition: GNEFrame.h:167
virtual void show()
show Frame
Definition: GNEFrame.cpp:741
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:750
FXTextField * myTextFieldGenericParameter
text field for write generic parameter
Definition: GNEFrame.h:183
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
Definition: GNEFrame.cpp:144
FXTreeList * myTreelist
tree list to show the childs of the element to erase
Definition: GNEFrame.h:114
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:241
FXButton * myEditGenericParameterButton
button for add generic parameter
Definition: GNEFrame.h:186