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 ACTag, SumoXMLAttr ACAttribute, const std::string& value);
69 
71  void hideAttribute();
72 
74  void refreshAttribute();
75 
77  SumoXMLTag getTag() const;
78 
80  SumoXMLAttr getAttr() const;
81 
85  long onCmdSetAttribute(FXObject*, FXSelector, void*);
86 
88  long onCmdOpenAllowDisallowEditor(FXObject*, FXSelector, void*);
90 
91  protected:
94 
96  std::string stripWhitespaceAfterComma(const std::string& stringValue);
97 
98  private:
101 
104 
107 
109  FXLabel* myLabel;
110 
112  FXTextField* myTextFieldInt;
113 
115  FXTextField* myTextFieldReal;
116 
118  FXTextField* myTextFieldStrings;
119 
121  FXComboBox* myChoicesCombo;
122 
124  FXCheckButton* myBoolCheckButton;
125 
128 
130  void show();
131 
133  void hide();
134  };
135 
136  // ===========================================================================
137  // class editorParameters
138  // ===========================================================================
139 
140  class NeteditParameters : public FXGroupBox {
143 
144  public:
146  NeteditParameters(GNEInspectorFrame* inspectorFrameParent);
147 
150 
152  void show();
153 
155  void hide();
156 
160  long onCmdSetBlockingMovement(FXObject*, FXSelector, void*);
161 
163  long onCmdSetBlockingShape(FXObject*, FXSelector, void*);
164 
166  long onCmdSetClosingShape(FXObject*, FXSelector, void*);
168 
169  protected:
172 
173  private:
176 
179 
181  FXCheckButton* myCheckBoxBlockMovement;
182 
185 
187  FXCheckButton* myCheckBoxBlockShape;
188 
191 
193  FXCheckButton* myCheckBoxCloseShape;
194  };
195 
200  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
201 
204 
206  void show();
207 
210 
212  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
213 
215  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
216 
218  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
219 
221  const std::vector<GNEAttributeCarrier*>& getACs() const;
222 
224  GNEEdge* getEdgeTemplate() const;
225 
227  void setEdgeTemplate(GNEEdge* tpl);
228 
232  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
233 
235  long onCmdSetTemplate(FXObject*, FXSelector, void*);
236 
238  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
239 
241  long onCmdGoBack(FXObject*, FXSelector, void*);
242 
244  long onCmdShowChildMenu(FXObject*, FXSelector, void* data);
245 
247  long onCmdCenterItem(FXObject*, FXSelector, void*);
248 
250  long onCmdInspectItem(FXObject*, FXSelector, void*);
251 
253  long onCmdDeleteItem(FXObject*, FXSelector, void*);
255 
256 protected:
259 
260  // @brief create pop-up menu in the positions X-Y for the attribute carrier ac
261  void createPopUpMenu(int X, int Y, GNEAttributeCarrier* ac);
262 
265 
267  const std::vector<GNEAttributeCarrier*>& getInspectedACs() const;
268 
269 private:
272 
274  std::vector<GNEInspectorFrame::AttributeInput*> myVectorOfAttributeInputs;
275 
278 
280  FXButton* myBackButton;
281 
284 
287 
290 
293 
296 
299 
302 
304  std::vector<GNEAttributeCarrier*> myACs;
305 
308 
310  FXTreeList* myTreelist;
311 
313  std::map<FXTreeItem*, GNEAttributeCarrier*> myTreeItemToACMap;
314 
316  std::set<FXTreeItem*> myTreeItemsWithoutAC;
317 
320 };
321 
322 
323 #endif
324 
325 /****************************************************************************/
326 
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
SumoXMLTag
Numbers representing SUMO-XML - element names.
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
void show()
set show as private function
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEInspectorFrame()
FOX needs this.
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
void refreshAttribute()
refresh attribute
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
FXButton * myCopyTemplateButton
copy template button
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
NeteditParameters * myNeteditParameters
Netedit Parameters.
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.
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
FXLabel * myLabelCloseShape
Label for close shape.
FXButton * mySetTemplateButton
set template button
~GNEInspectorFrame()
Destructor.
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
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)
FXLabel * myLabelBlockShape
Label for Check blocked shape.
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
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
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:58
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
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get reference to current inspected Attribute carriers
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
SumoXMLTag getTag() const
get current tag
FXComboBox * myChoicesCombo
pointer to combo box choices
void showAttribute(SumoXMLTag ACTag, SumoXMLAttr ACAttribute, const std::string &value)
show attribute of ac
std::vector< GNEInspectorFrame::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
SumoXMLAttr getAttr() const
get current Attr
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
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
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
FXTextField * myTextFieldReal
textField to modify the value of real/Time attributes
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
long onCmdSetAttribute(FXObject *, FXSelector, void *)