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-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 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
50 class GNEInspectorFrame : public GNEFrame {
52  FXDECLARE(GNEInspectorFrame)
53 
54 public:
55 
56  // ===========================================================================
57  // class AttrInput
58  // ===========================================================================
59 
60  class AttrInput : public FXMatrix {
63 
64  public:
66  AttrInput(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent);
67 
69  void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string& value);
70 
72  void hiddeAttribute();
73 
75  SumoXMLTag getTag() const;
76 
78  SumoXMLAttr getAttr() const;
79 
81  long onCmdSetAttribute(FXObject*, FXSelector, void*);
82 
84  long onCmdOpenAttributeEditor(FXObject*, FXSelector, void*);
85 
86  protected:
88  AttrInput() {}
89 
90  private:
93 
96 
99 
101  FXLabel* myLabel;
102 
104  FXTextField* myTextFieldInt;
105 
107  FXTextField* myTextFieldReal;
108 
110  FXTextField* myTextFieldStrings;
111 
113  FXComboBox* myChoicesCombo;
114 
116  FXCheckButton* myCheckBox;
117 
120 
122  void show();
123 
125  void hide();
126  };
127 
128  // ===========================================================================
129  // class AttrEditor
130  // ===========================================================================
131 
132  class AttrEditor : public FXDialogBox {
135 
136  public:
138  AttrEditor(AttrInput* attrInputParent, FXTextField* textFieldAttr);
139 
141  ~AttrEditor();
142 
144  long onCmdReset(FXObject*, FXSelector, void*);
145 
146  protected:
149 
150  private:
153 
154  // @brief Pointer to TexField in which write attribute
155  FXTextField* myTextFieldAttr;
156 
157  // @brief Matrix in that CheckBoxs will be inserted
158  FXMatrix* myCheckBoxMatrix;
159 
161  std::vector<FXCheckButton*> myVectorOfCheckBox;
162 
164  FXHorizontalFrame* frameButtons;
165 
167  FXButton* myAcceptButton;
168 
170  FXButton* myCancelButton;
171 
173  FXButton* myResetButton;
174  };
175 
176 public:
181  GNEInspectorFrame(FXComposite* parent, GNEViewNet* viewNet);
182 
185 
187  void show();
188 
190  void hide();
191 
193  void inspect(const std::vector<GNEAttributeCarrier*>& ACs);
194 
196  const std::vector<GNEAttributeCarrier*>& getACs() const;
197 
199  GNEEdge* getEdgeTemplate() const;
200 
202  void setEdgeTemplate(GNEEdge* tpl);
203 
205  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
206 
208  long onCmdSetTemplate(FXObject*, FXSelector, void*);
209 
211  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
212 
214  long onCmdSetBlocking(FXObject*, FXSelector, void*);
215 
216 protected:
219 
220 private:
223 
225  std::vector<GNEInspectorFrame::AttrInput*> vectorOfAttrInput;
226 
229 
232 
235 
238 
240  FXGroupBox* myGroupBoxForEditor;
241 
243  FXCheckButton* myCheckBlocked;
244 
247 
249  std::vector<GNEAttributeCarrier*> myACs;
250 };
251 
252 
253 #endif
254 
255 /****************************************************************************/
256 
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
FXTextField * myTextFieldStrings
textField to modify the value of strings values
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 hide()
set hide as private function
void show()
set show as private function
SumoXMLTag getTag() const
get current tag
SumoXMLTag myTag
current tag
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:86
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
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
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
GNEEdge * myEdgeTemplate
the edge template
FXTextField * myTextFieldInt
textField to modify the value of int values
void inspect(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
AttrInput * myAttrInputParent
Pointer to AttrInput parent.
void hiddeAttribute()
show attribute
FXButton * myResetButton
Button Reset.
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
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:63
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
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