SUMO - Simulation of Urban MObility
GNEInspector.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 GNEInspector_h
21 #define GNEInspector_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 <fx.h>
34 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class GNENet;
41 class GNEEdge;
43 class GNEUndoList;
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
52 class GNEInspector : public FXScrollWindow {
53  // FOX-declarations
54  FXDECLARE(GNEInspector)
55 
56 public:
57  // ===========================================================================
58  // class AttrPanel
59  // ===========================================================================
60  class AttrPanel : public FXVerticalFrame {
61  // FOX-declarations
62  // FXDECLARE(GNEInspector::AttrPanel)
63  public:
64  AttrPanel(GNEInspector* parent, const std::vector<GNEAttributeCarrier*>& ACs, GNEUndoList* undoList);
65 
66  protected:
68  AttrPanel() {}
69  };
70 
71  // ===========================================================================
72  // class AttrInput
73  // ===========================================================================
74  class AttrInput : public FXHorizontalFrame {
75  // FOX-declarations
76  FXDECLARE(GNEInspector::AttrInput)
77  public:
78  AttrInput(
79  FXComposite* parent,
80  const std::vector<GNEAttributeCarrier*>& ACs, SumoXMLAttr attr, std::string initialValue,
81  GNEUndoList* undoList);
82 
84  long onCmdSetAttribute(FXObject*, FXSelector, void*);
86  long onCmdOpenAttributeEditor(FXObject*, FXSelector, void*);
87 
88  protected:
90  AttrInput() {}
91 
92  private:
95  const std::vector<GNEAttributeCarrier*>* myACs;
97  FXTextField* myTextField;
98  FXComboBox* myChoicesCombo;
99  };
100 
101 
102 public:
108  GNEInspector(FXComposite* parent, GNEUndoList* undoList);
109 
110 
112  ~GNEInspector();
113 
115  void inspect(const std::vector<GNEAttributeCarrier*>& ACs);
116 
118  void create();
119 
121  void update();
122 
123  FXFont* getHeaderFont() {
124  return myHeaderFont;
125  }
126 
127  // @brief the template edge (to copy attributes from)
129  return myEdgeTemplate;
130  }
131 
132  // @brief seh the template edge (we assume shared responsibility via reference counting)
133  void setEdgeTemplate(GNEEdge* tpl);
134 
136  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
138  long onCmdSetTemplate(FXObject*, FXSelector, void*);
139 
141  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
142 
143 protected:
146 
147 
148 private:
150 
152  FXFont* myHeaderFont;
153 
155 
158 
160  std::vector<GNEAttributeCarrier*> myACs;
161 
162  static const int WIDTH;
163 };
164 
165 
166 #endif
167 
168 /****************************************************************************/
169 
AttrPanel()
FOX needs this.
Definition: GNEInspector.h:68
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
Definition: GNEInspector.h:160
void inspect(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
FXFont * myHeaderFont
Font for the widget.
Definition: GNEInspector.h:152
void create()
Creates the widget.
~GNEInspector()
Destructor.
FXTextField * myTextField
Definition: GNEInspector.h:97
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
GNEEdge * getEdgeTemplate()
Definition: GNEInspector.h:128
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setEdgeTemplate(GNEEdge *tpl)
GNEUndoList * myUndoList
Definition: GNEInspector.h:96
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
GNEEdge * myEdgeTemplate
the edge template
Definition: GNEInspector.h:157
FXFont * getHeaderFont()
Definition: GNEInspector.h:123
void update()
update the widget
AttrPanel * myPanel
Definition: GNEInspector.h:154
GNEInspector()
FOX needs this.
Definition: GNEInspector.h:145
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:61
const std::vector< GNEAttributeCarrier * > * myACs
Definition: GNEInspector.h:95
FXComboBox * myChoicesCombo
Definition: GNEInspector.h:98
GNEUndoList * myUndoList
Definition: GNEInspector.h:149
AttrInput()
FOX needs this.
Definition: GNEInspector.h:90
static const int WIDTH
Definition: GNEInspector.h:162