SUMO - Simulation of Urban MObility
GNEInspectorFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for modifying network-element attributes (i.e. lane speed)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEInspectorFrame_h
21 #define GNEInspectorFrame_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEFrame.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
39 class GNEAdditional;
40 class GNEEdge;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class GNEInspectorFrame : public GNEFrame {
51  FXDECLARE(GNEInspectorFrame)
52 
53 public:
54 
55  // ===========================================================================
56  // class AttrInput
57  // ===========================================================================
58 
59  class AttrInput : public FXMatrix {
62 
63  public:
65  AttrInput(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent);
66 
68  void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string& value);
69 
71  void hideAttribute();
72 
74  SumoXMLTag getTag() const;
75 
77  SumoXMLAttr getAttr() const;
78 
80  long onCmdSetAttribute(FXObject*, FXSelector, void*);
81 
83  long onCmdOpenAttributeEditor(FXObject*, FXSelector, void*);
84 
85  protected:
87  AttrInput() {}
88 
89  private:
92 
95 
98 
100  FXLabel* myLabel;
101 
103  FXTextField* myTextFieldInt;
104 
106  FXTextField* myTextFieldReal;
107 
109  FXSpinner* myTimeSpinDial;
110 
112  FXTextField* myTextFieldStrings;
113 
115  FXComboBox* myChoicesCombo;
116 
118  FXMenuCheck* myCheckBox;
119 
122 
124  void show();
125 
127  void hide();
128  };
129 
130  // ===========================================================================
131  // class AttrEditor
132  // ===========================================================================
133 
134  class AttrEditor : public FXDialogBox {
137 
138  public:
140  AttrEditor(AttrInput* attrInputParent, FXTextField* textFieldAttr);
141 
143  ~AttrEditor();
144 
146  long onCmdReset(FXObject*, FXSelector, void*);
147 
148  protected:
151 
152  private:
155 
156  // @brief Pointer to TexField in which write attribute
157  FXTextField* myTextFieldAttr;
158 
159  // @brief Matrix in that CheckBoxs will be inserted
160  FXMatrix* myCheckBoxMatrix;
161 
163  std::vector<FXMenuCheck*> myVectorOfCheckBox;
164 
166  FXHorizontalFrame* frameButtons;
167 
169  FXButton* myAcceptButton;
170 
172  FXButton* myCancelButton;
173 
175  FXButton* myResetButton;
176  };
177 
178 public:
183  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
184 
187 
189  void show();
190 
193 
195  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
196 
198  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
199 
201  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
202 
204  const std::vector<GNEAttributeCarrier*>& getACs() const;
205 
207  GNEEdge* getEdgeTemplate() const;
208 
210  void setEdgeTemplate(GNEEdge* tpl);
211 
215  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
216 
218  long onCmdSetTemplate(FXObject*, FXSelector, void*);
219 
221  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
222 
224  long onCmdSetBlocking(FXObject*, FXSelector, void*);
225 
227  long onCmdGoBack(FXObject*, FXSelector, void*);
228 
230  long onCmdShowChildMenu(FXObject*, FXSelector, void* data);
231 
233  long onCmdCenterItem(FXObject*, FXSelector, void*);
234 
236  long onCmdInspectItem(FXObject*, FXSelector, void*);
237 
239  long onCmdDeleteItem(FXObject*, FXSelector, void*);
241 
242 protected:
245 
246  // @brief create pop-up menu in the positions X-Y for the attribute carrier ac
247  void createPopUpMenu(int X, int Y, GNEAttributeCarrier* ac);
248 
251 
252 private:
255 
257  std::vector<GNEInspectorFrame::AttrInput*> vectorOfAttrInput;
258 
260  FXButton* myBackButton;
261 
264 
267 
270 
273 
275  FXGroupBox* myGroupBoxForEditor;
276 
278  FXMenuCheck* myCheckBlocked;
279 
282 
285 
288 
291 
293  std::vector<GNEAttributeCarrier*> myACs;
294 
297 
299  FXTreeList* myTreelist;
300 
302  std::map<FXTreeItem*, GNEAttributeCarrier*> myTreeItemToACMap;
303 
305  std::set<FXTreeItem*> myTreeItesmWithoutAC;
306 
309 };
310 
311 
312 #endif
313 
314 /****************************************************************************/
315 
FXHorizontalFrame * frameButtons
frame for the buttons
SumoXMLTag
Numbers representing SUMO-XML - element names.
FXComboBox * myChoicesCombo
pointer to combo box choices
GNEInspectorFrame * myInspectorFrameParent
pointer to GNEInspectorFrame parent
FXTextField * myTextFieldStrings
textField to modify the value of string attributes
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
SumoXMLAttr myAttr
current Attr
GNEInspectorFrame()
FOX needs this.
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
FXButton * myCopyTemplateButton
copy template button
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
void hide()
set hide as private function
void show()
set show as private function
SumoXMLTag getTag() const
get current tag
SumoXMLTag myTag
current tag
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
FXTextField * myTextFieldReal
textField to modify the value of real attributes
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
called when user press right click over an item of list of childs
FXButton * myCancelButton
Button Cancel.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXButton * mySetTemplateButton
set template button
GNEAdditional * myAdditional
pointer to additional element
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
long onCmdOpenAttributeEditor(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
FXButton * myAcceptButton
Button Accept.
void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string &value)
show attribute
~GNEInspectorFrame()
Destructor.
long onCmdSetBlocking(FXObject *, FXSelector, void *)
called when user toogle the blocking button
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
void showAttributeCarrierChilds()
show child of current attributeCarrier
std::vector< FXMenuCheck * > myVectorOfCheckBox
vector of Menuchecks
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
GNEEdge * myEdgeTemplate
the edge template
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
FXTextField * myTextFieldInt
textField to modify the value of int attributes
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
AttrInput * myAttrInputParent
Pointer to AttrInput parent.
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
FXButton * myResetButton
Button Reset.
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
FXGroupBox * myGroupBoxForTreeList
groupBox for AttrConnection
FXTreeList * myTreelist
tree list to show the childs of the element to erase
FXMenuCheck * myCheckBox
pointer to menu check
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
FXMenuCheck * myCheckBlocked
pointer to menu check block
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
std::set< FXTreeItem * > myTreeItesmWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
FXLabel * myLabel
pointer to label
void hideAttribute()
show attribute
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
FXButton * myBackButton
back Button
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
FXSpinner * myTimeSpinDial
SpinDial to modify the value of time attributes
SumoXMLAttr getAttr() const
get current Attr
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
std::vector< GNEInspectorFrame::AttrInput * > vectorOfAttrInput
list of Attribute inputs