SUMO - Simulation of Urban MObility
GNEInspectorFrame.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The Widget for modifying network-element attributes (i.e. lane speed)
18 /****************************************************************************/
19 #ifndef GNEInspectorFrame_h
20 #define GNEInspectorFrame_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEFrame.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
38 class GNEAdditional;
39 class GNEEdge;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class GNEInspectorFrame : public GNEFrame {
50  FXDECLARE(GNEInspectorFrame)
51 
52 public:
53 
54  // ===========================================================================
55  // class AttributeInput
56  // ===========================================================================
57 
58  class AttributeInput : public FXHorizontalFrame {
61 
62  public:
64  AttributeInput(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent);
65 
67  void showAttribute(SumoXMLTag ACTag, SumoXMLAttr ACAttribute, const std::string& value);
68 
70  void hideAttribute();
71 
73  void refreshAttribute();
74 
76  SumoXMLTag getTag() const;
77 
79  SumoXMLAttr getAttr() const;
80 
84  long onCmdSetAttribute(FXObject*, FXSelector, void*);
85 
87  long onCmdOpenAllowDisallowEditor(FXObject*, FXSelector, void*);
89 
90  protected:
93 
95  std::string stripWhitespaceAfterComma(const std::string& stringValue);
96 
97  private:
100 
103 
106 
108  FXLabel* myLabel;
109 
111  FXTextField* myTextFieldInt;
112 
114  FXTextField* myTextFieldReal;
115 
117  FXTextField* myTextFieldStrings;
118 
120  FXComboBox* myChoicesCombo;
121 
123  FXCheckButton* myBoolCheckButton;
124 
127 
129  void show();
130 
132  void hide();
133  };
134 
135  // ===========================================================================
136  // class editorParameters
137  // ===========================================================================
138 
139  class NeteditParameters : public FXGroupBox {
142 
143  public:
145  NeteditParameters(GNEInspectorFrame* inspectorFrameParent);
146 
149 
151  void show();
152 
154  void hide();
155 
159  long onCmdChangeAdditionalParent(FXObject*, FXSelector, void*);
160 
162  long onCmdSetBlockingMovement(FXObject*, FXSelector, void*);
163 
165  long onCmdSetBlockingShape(FXObject*, FXSelector, void*);
166 
168  long onCmdSetClosingShape(FXObject*, FXSelector, void*);
170 
171  protected:
174 
175  private:
178 
181 
184 
187 
189  FXHorizontalFrame* myHorizontalFrameBlockMovement;
190 
193 
195  FXCheckButton* myCheckBoxBlockMovement;
196 
198  FXHorizontalFrame* myHorizontalFrameBlockShape;
199 
202 
204  FXCheckButton* myCheckBoxBlockShape;
205 
207  FXHorizontalFrame* myHorizontalFrameCloseShape;
208 
211 
213  FXCheckButton* myCheckBoxCloseShape;
214  };
215 
220  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
221 
224 
226  void show();
227 
230 
232  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
233 
235  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
236 
238  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
239 
241  void refreshValues();
242 
244  const std::vector<GNEAttributeCarrier*>& getACs() const;
245 
247  GNEEdge* getEdgeTemplate() const;
248 
250  void setEdgeTemplate(GNEEdge* tpl);
251 
255  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
256 
258  long onCmdSetTemplate(FXObject*, FXSelector, void*);
259 
261  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
262 
264  long onCmdGoBack(FXObject*, FXSelector, void*);
265 
267  long onCmdShowChildMenu(FXObject*, FXSelector, void* data);
268 
270  long onCmdCenterItem(FXObject*, FXSelector, void*);
271 
273  long onCmdInspectItem(FXObject*, FXSelector, void*);
274 
276  long onCmdDeleteItem(FXObject*, FXSelector, void*);
278 
279 protected:
282 
283  // @brief create pop-up menu in the positions X-Y for the attribute carrier ac
284  void createPopUpMenu(int X, int Y, GNEAttributeCarrier* ac);
285 
288 
290  const std::vector<GNEAttributeCarrier*>& getInspectedACs() const;
291 
292 private:
295 
297  std::vector<GNEInspectorFrame::AttributeInput*> myVectorOfAttributeInputs;
298 
301 
303  FXButton* myBackButton;
304 
307 
310 
313 
316 
319 
322 
325 
327  std::vector<GNEAttributeCarrier*> myACs;
328 
331 
333  FXTreeList* myTreelist;
334 
336  std::map<FXTreeItem*, GNEAttributeCarrier*> myTreeItemToACMap;
337 
339  std::set<FXTreeItem*> myTreeItemsWithoutAC;
340 
343 };
344 
345 
346 #endif
347 
348 /****************************************************************************/
349 
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
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
FXHorizontalFrame * myHorizontalFrameAdditionalParent
horizontal frame for change additional parent
FXHorizontalFrame * myHorizontalFrameBlockMovement
horizontal frame for block movement
GNEInspectorFrame()
FOX needs this.
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
void refreshAttribute()
refresh attribute
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
void refreshValues()
Refresh inspected values (used when values can be changed externally by other modul) ...
FXButton * myCopyTemplateButton
copy template button
FXLabel * myLabelAdditionalParent
Label for additional parent.
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
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.
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get reference to current inspected Attribute carriers
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"
SumoXMLAttr getAttr() const
get current Attr
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
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:59
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
void showAttribute(SumoXMLTag ACTag, SumoXMLAttr ACAttribute, const std::string &value)
show attribute of ac
std::vector< GNEInspectorFrame::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
FXHorizontalFrame * myHorizontalFrameBlockShape
horizontal frame for block shape
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
FXTextField * myTextFieldAdditionalParent
pointer for change additional parent
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
FXHorizontalFrame * myHorizontalFrameCloseShape
horizontal frame for close shape
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 *)