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 AttributeInput
57  // ===========================================================================
58 
59  class AttributeInput : public FXHorizontalFrame {
62 
63  public:
65  AttributeInput(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 onCmdOpenAllowDisallowEditor(FXObject*, FXSelector, void*);
84 
85  protected:
88 
89  private:
92 
95 
98 
100  FXLabel* myLabel;
101 
103  FXTextField* myTextFieldInt;
104 
106  FXTextField* myTextFieldReal;
107 
109  FXTextField* myTextFieldStrings;
110 
112  FXComboBox* myChoicesCombo;
113 
115  FXCheckButton* myBoolCheckButton;
116 
119 
121  void show();
122 
124  void hide();
125  };
126 
127 public:
132  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
133 
136 
138  void show();
139 
142 
144  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
145 
147  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
148 
150  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
151 
153  const std::vector<GNEAttributeCarrier*>& getACs() const;
154 
156  GNEEdge* getEdgeTemplate() const;
157 
159  void setEdgeTemplate(GNEEdge* tpl);
160 
164  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
165 
167  long onCmdSetTemplate(FXObject*, FXSelector, void*);
168 
170  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
171 
173  long onCmdSetBlocking(FXObject*, FXSelector, void*);
174 
176  long onCmdGoBack(FXObject*, FXSelector, void*);
177 
179  long onCmdShowChildMenu(FXObject*, FXSelector, void* data);
180 
182  long onCmdCenterItem(FXObject*, FXSelector, void*);
183 
185  long onCmdInspectItem(FXObject*, FXSelector, void*);
186 
188  long onCmdDeleteItem(FXObject*, FXSelector, void*);
190 
191 protected:
194 
195  // @brief create pop-up menu in the positions X-Y for the attribute carrier ac
196  void createPopUpMenu(int X, int Y, GNEAttributeCarrier* ac);
197 
200 
201 private:
204 
206  std::vector<GNEInspectorFrame::AttributeInput*> myVectorOfAttributeInputs;
207 
209  FXButton* myBackButton;
210 
213 
216 
219 
222 
224  FXGroupBox* myGroupBoxForEditor;
225 
228 
230  FXCheckButton* myCheckBlocked;
231 
234 
237 
240 
243 
245  std::vector<GNEAttributeCarrier*> myACs;
246 
249 
251  FXTreeList* myTreelist;
252 
254  std::map<FXTreeItem*, GNEAttributeCarrier*> myTreeItemToACMap;
255 
257  std::set<FXTreeItem*> myTreeItemsWithoutAC;
258 
261 };
262 
263 
264 #endif
265 
266 /****************************************************************************/
267 
SumoXMLTag
Numbers representing SUMO-XML - element names.
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
void show()
set show as private function
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEInspectorFrame()
FOX needs this.
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
FXButton * myCopyTemplateButton
copy template button
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
called when user press right click over an item of list of childs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXButton * mySetTemplateButton
set template button
GNEAdditional * myAdditional
pointer to additional element
FXLabel * myCheckBlockedLabel
Label for Check blocked.
~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
void hide()
set hide as private function
FXLabel * myLabel
pointer to label
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
GNEEdge * myEdgeTemplate
the edge template
std::set< FXTreeItem * > myTreeItemsWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
GNEInspectorFrame * myInspectorFrameParent
pointer to GNEInspectorFrame parent
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string &value)
show attribute of ac
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
SumoXMLAttr getAttr() const
get current Attr
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:57
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
long onCmdOpenAllowDisallowEditor(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
FXCheckButton * myBoolCheckButton
pointer to menu check
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
SumoXMLAttr myAttr
current Attr
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
FXComboBox * myChoicesCombo
pointer to combo box choices
std::vector< GNEInspectorFrame::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
SumoXMLTag getTag() const
get current tag
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
FXTextField * myTextFieldStrings
textField to modify the value of string attributes
FXTextField * myTextFieldInt
textField to modify the value of int attributes
FXButton * myBackButton
back Button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
void inspectMultisection(const std::vector< GNEAttributeCarrier *> &ACs)
Inspect the given multi-selection.
FXTextField * myTextFieldReal
textField to modify the value of real/Time attributes
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
FXCheckButton * myCheckBlocked
pointer to menu check block