SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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-2016 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 // ===========================================================================
38 class GNENet;
39 class GNEEdge;
41 class GNEAdditional;
42 class GNEConnection;
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 class GNEInspectorFrame : public GNEFrame {
53  FXDECLARE(GNEInspectorFrame)
54 
55 public:
56 
57  // ===========================================================================
58  // class AttrInput
59  // ===========================================================================
60 
61  class AttrInput : public FXMatrix {
64 
65  public:
67  AttrInput(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent);
68 
70  void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string& value);
71 
73  void hideAttribute();
74 
76  SumoXMLTag getTag() const;
77 
79  SumoXMLAttr getAttr() const;
80 
82  long onCmdSetAttribute(FXObject*, FXSelector, void*);
83 
85  long onCmdOpenAttributeEditor(FXObject*, FXSelector, void*);
86 
87  protected:
89  AttrInput() {}
90 
91  private:
94 
97 
100 
102  FXLabel* myLabel;
103 
105  FXTextField* myTextFieldInt;
106 
108  FXTextField* myTextFieldReal;
109 
111  FXTextField* myTextFieldStrings;
112 
114  FXComboBox* myChoicesCombo;
115 
117  FXCheckButton* myCheckBox;
118 
121 
123  void show();
124 
126  void hide();
127  };
128 
129  // ===========================================================================
130  // class AttrEditor
131  // ===========================================================================
132 
133  class AttrEditor : public FXDialogBox {
136 
137  public:
139  AttrEditor(AttrInput* attrInputParent, FXTextField* textFieldAttr);
140 
142  ~AttrEditor();
143 
145  long onCmdReset(FXObject*, FXSelector, void*);
146 
147  protected:
150 
151  private:
154 
155  // @brief Pointer to TexField in which write attribute
156  FXTextField* myTextFieldAttr;
157 
158  // @brief Matrix in that CheckBoxs will be inserted
159  FXMatrix* myCheckBoxMatrix;
160 
162  std::vector<FXCheckButton*> myVectorOfCheckBox;
163 
165  FXHorizontalFrame* frameButtons;
166 
168  FXButton* myAcceptButton;
169 
171  FXButton* myCancelButton;
172 
174  FXButton* myResetButton;
175  };
176 
177  // ===========================================================================
178  // class AttrConnection
179  // ===========================================================================
180 
181  class AttrConnection : public FXHorizontalFrame {
184 
185  public:
187  AttrConnection(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent);
188 
190  ~AttrConnection();
191 
193  void showConnections(GNEConnection* connection);
194 
196  void hideAttrConnection();
197 
199  long onCmdSetShowConnection(FXObject*, FXSelector, void*);
200 
202  long onCmdInspectConnection(FXObject*, FXSelector, void*);
203 
204  protected:
207 
208  private:
211 
214 
217 
219  FXCheckButton* myShowConnection;
220 
223 
225  void show();
226 
228  void hide();
229  };
230 
231 public:
236  GNEInspectorFrame(FXComposite* parent, GNEViewNet* viewNet);
237 
240 
242  void show();
243 
245  void hide();
246 
248  void inspect(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement = NULL);
249 
251  void inspect(const std::vector<GNEAttributeCarrier*>& ACs, GNEAttributeCarrier* previousElement = NULL);
252 
254  const std::vector<GNEAttributeCarrier*>& getACs() const;
255 
257  GNEEdge* getEdgeTemplate() const;
258 
260  void setEdgeTemplate(GNEEdge* tpl);
261 
263  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
264 
266  long onCmdSetTemplate(FXObject*, FXSelector, void*);
267 
269  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
270 
272  long onCmdSetBlocking(FXObject*, FXSelector, void*);
273 
275  long onCmdGoBack(FXObject*, FXSelector, void*);
276 
277 protected:
280 
281 private:
284 
286  std::vector<GNEInspectorFrame::AttrInput*> vectorOfAttrInput;
287 
289  FXButton* myBackButton;
290 
293 
296 
299 
302 
304  FXGroupBox* myGroupBoxForEditor;
305 
307  FXCheckButton* myCheckBlocked;
308 
311 
314 
317 
319  std::vector<AttrConnection*> myAttrConnections;
320 
322  std::vector<GNEAttributeCarrier*> myACs;
323 };
324 
325 
326 #endif
327 
328 /****************************************************************************/
329 
FXCheckButton * myCheckBox
pointer to checkBox
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
std::vector< AttrConnection * > myAttrConnections
vector of attrConnections
FXTextField * myTextFieldStrings
textField to modify the value of strings values
SumoXMLAttr myAttr
current Attr
void hide()
set hide as private function
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
long onCmdReset(FXObject *, FXSelector, void *)
call when user press button reset
void hide()
set hide as private function
void show()
set show as private function
SumoXMLTag getTag() const
get current tag
SumoXMLTag myTag
current tag
FXGroupBox * myGroupBoxForAttrConnections
groupBox for AttrConnection
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:87
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
FXTextField * myTextFieldReal
textField to modify the value of real values
void inspect(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement=NULL)
Inspect a single element.
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.
void showConnections(GNEConnection *connection)
show attribute
GNEConnection * myConnection
pointer to current connection
void hide()
hide Frame
long onCmdSetBlocking(FXObject *, FXSelector, void *)
called when user toogle the blocking button
void show()
set show as private function
GNEAttributeCarrier * myPreviousElement
pointer to previous element (If exist)
long onCmdInspectConnection(FXObject *, FXSelector, void *)
inspect connection
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
GNEEdge * myEdgeTemplate
the edge template
FXButton * myInspectConnection
FXCheckBox to hide/show connection individually.
FXTextField * myTextFieldInt
textField to modify the value of int values
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
FXCheckButton * myShowConnection
FXCheckBox to hide/show connection individually.
AttrInput * myAttrInputParent
Pointer to AttrInput parent.
void hideAttrConnection()
show attribute
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
FXButton * myResetButton
Button Reset.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:55
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
GNEInspectorFrame * myInspectorFrameParent
pointer to inspectorFrame Parent
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:63
FXLabel * myConnectionInfoLabel
Label for show information of connection.
void show()
show Frame
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
FXLabel * myLabel
pointer to label
void hideAttribute()
show attribute
long onCmdSetShowConnection(FXObject *, FXSelector, void *)
set show connection attribute
FXButton * myBackButton
back Button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
std::vector< FXCheckButton * > myVectorOfCheckBox
vector of CheckBoxs
SumoXMLAttr getAttr() const
get current Attr
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
std::vector< GNEInspectorFrame::AttrInput * > vectorOfAttrInput
list of Attribute inputs
FXCheckButton * myCheckBlocked
pointer to check button block