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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The Widget for modifying network-element attributes (i.e. lane speed)
17 /****************************************************************************/
18 #ifndef GNEInspectorFrame_h
19 #define GNEInspectorFrame_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "GNEFrame.h"
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
33 class GNEAdditional;
34 class GNEEdge;
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 class GNEInspectorFrame : public GNEFrame {
46  FXDECLARE(GNEInspectorFrame)
47 
48 public:
49 
50  // ===========================================================================
51  // class AttributesEditor
52  // ===========================================================================
53 
54  class AttributesEditor : private FXGroupBox {
57 
58  public:
59 
60  // ===========================================================================
61  // class AttributeInput
62  // ===========================================================================
63 
64  class AttributeInput : private FXHorizontalFrame {
67 
68  public:
71 
73  void showAttribute(SumoXMLTag ACTag, SumoXMLAttr ACAttribute, const std::string& value);
74 
76  void hideAttribute();
77 
79  void refreshAttributeInput(const std::string& value, bool forceRefresh);
80 
82  bool isCurrentAttributeValid() const;
83 
86 
88  long onCmdSetAttribute(FXObject*, FXSelector, void*);
89 
91  long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*);
93 
94  protected:
97 
99  std::string stripWhitespaceAfterComma(const std::string& stringValue);
100 
101  private:
104 
107 
110 
113 
116 
119 
121  FXLabel* myLabel;
122 
124  FXTextField* myTextFieldInt;
125 
127  FXTextField* myTextFieldReal;
128 
130  FXTextField* myTextFieldStrings;
131 
133  FXComboBox* myChoicesCombo;
134 
136  FXCheckButton* myBoolCheckButton;
137 
140 
142  FXButton* myColorEditor;
143  };
144 
146  AttributesEditor(GNEInspectorFrame* inspectorFrameParent);
147 
149  void showAttributeEditor();
150 
152  void hideAttributesEditor();
153 
155  void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition);
156 
159 
162 
164  long onCmdAttributeHelp(FXObject*, FXSelector, void*);
166 
167  protected:
170 
171  private:
174 
176  std::vector<GNEInspectorFrame::AttributesEditor::AttributeInput*> myVectorOfAttributeInputs;
177 
179  FXButton* myHelpButton;
180  };
181 
182  // ===========================================================================
183  // class NeteditAttributesEditor
184  // ===========================================================================
185 
186  class NeteditAttributesEditor : private FXGroupBox {
189 
190  public:
192  NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
193 
196 
198  void showNeteditAttributesEditor();
199 
201  void hideNeteditAttributesEditor();
202 
204  void refreshNeteditAttributesEditor(bool forceRefresh);
205 
208 
210  long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*);
211 
213  long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*);
215 
216  protected:
219 
220  private:
223 
226 
229 
232 
234  FXHorizontalFrame* myHorizontalFrameBlockMovement;
235 
238 
240  FXCheckButton* myCheckBoxBlockMovement;
241 
243  FXHorizontalFrame* myHorizontalFrameBlockShape;
244 
247 
249  FXCheckButton* myCheckBoxBlockShape;
250 
252  FXHorizontalFrame* myHorizontalFrameCloseShape;
253 
256 
258  FXCheckButton* myCheckBoxCloseShape;
259 
261  FXButton* myHelpButton;
262  };
263 
264  // ===========================================================================
265  // class GEOAttributesEditor
266  // ===========================================================================
267 
268  class GEOAttributesEditor : private FXGroupBox {
271 
272  public:
274  GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
275 
278 
280  void showGEOAttributesEditor();
281 
283  void hideGEOAttributesEditor();
284 
286  void refreshGEOAttributesEditor(bool forceRefresh);
287 
290 
292  long onCmdSetGEOAttribute(FXObject*, FXSelector, void*);
293 
295  long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*);
297 
298  protected:
301 
302  private:
305 
307  FXHorizontalFrame* myGEOAttributeFrame;
308 
311 
314 
316  FXHorizontalFrame* myUseGEOFrame;
317 
319  FXLabel* myUseGEOLabel;
320 
322  FXCheckButton* myUseGEOCheckButton;
323 
325  FXButton* myHelpButton;
326  };
327 
328  // ===========================================================================
329  // class TemplateEditor
330  // ===========================================================================
331 
332  class TemplateEditor : private FXGroupBox {
335 
336  public:
338  TemplateEditor(GNEInspectorFrame* inspectorFrameParent);
339 
341  ~TemplateEditor();
342 
344  void showTemplateEditor();
345 
347  void hideTemplateEditor();
348 
350  GNEEdge* getEdgeTemplate() const;
351 
353  void setEdgeTemplate(GNEEdge* tpl);
354 
357 
359  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
360 
362  long onCmdSetTemplate(FXObject*, FXSelector, void*);
363 
365  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
367 
368  protected:
371 
372  private:
375 
378 
381 
384  };
385 
390  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
391 
394 
396  void show();
397 
399  void hide();
400 
403 
405  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
406 
408  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
409 
411  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
412 
415 
417  void clearInspectedAC();
418 
421 
424 
427 
429  long onCmdGoBack(FXObject*, FXSelector, void*);
431 
433  const std::vector<GNEAttributeCarrier*>& getInspectedACs() const;
434 
435 protected:
438 
439 private:
442 
445 
448 
451 
454 
457 
459  FXButton* myBackButton;
460 
463 
466 
469 
471  std::vector<GNEAttributeCarrier*> myInspectedACs;
472 };
473 
474 
475 #endif
476 
477 /****************************************************************************/
478 
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
SumoXMLTag
Numbers representing SUMO-XML - element names.
void removeInspectedAC(GNEAttributeCarrier *ac)
remove AC from current inspected ACs
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
FXHorizontalFrame * myHorizontalFrameBlockMovement
horizontal frame for block movement
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEInspectorFrame * myInspectorFrameParent
pointer to GNEInspectorFrame parent
std::vector< GNEAttributeCarrier * > myInspectedACs
the multi-selection currently being inspected
GNEInspectorFrame()
FOX needs this.
FXButton * mySetTemplateButton
set template button
AttributesEditor * myAttributesEditor
Attribute editor.
FXTextField * myTextFieldInt
textField to modify the value of int attributes
FXLabel * myLabel
pointer to attribute label
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
bool isCurrentAttributeValid() const
check if current attribute of TextField/ComboBox is valid
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
void refreshAttributeInput(const std::string &value, bool forceRefresh)
refresh current attribute input
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
GNEFrame::ACHierarchy * myACHierarchy
Attribute Carrier Hierarchy.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXTextField * myTextFieldStrings
textField to modify the value of string attributes
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
FXTextField * myTextFieldAdditionalParent
pointer for change additional parent
FXLabel * myLabelCloseShape
Label for close shape.
~GNEInspectorFrame()
Destructor.
GenericParametersEditor * myGenericParametersEditor
Generic parameters editor.
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get current list of inspected ACs
void hide()
hide inspector frame
FXHorizontalFrame * myHorizontalFrameAdditionalParent
horizontal frame for change additional parent
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
FXButton * myHelpButton
button for help
FXButton * myColorEditor
Button for open color editor.
void enableAttributeInputElements()
enable attribute input elements
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
FXHorizontalFrame * myHorizontalFrameBlockShape
horizontal frame for block shape
FXCheckButton * myBoolCheckButton
pointer to menu check
FXButton * myHelpButton
button for help
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
void disableAttributeInputElements()
disable attribute input elements
FXTextField * myTextFieldReal
textField to modify the value of real/Time attributes
GNEFrame::ACHierarchy * getACHierarchy() const
get ACHierarchy
FXButton * myCopyTemplateButton
copy template button
FXLabel * myLabelAdditionalParent
Label for additional parent.
FXHorizontalFrame * myHorizontalFrameCloseShape
horizontal frame for close shape
void clearInspectedAC()
Clear all current inspected ACs.
FXComboBox * myChoicesCombo
pointer to combo box choices
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
void showAttributeEditor()
show attributes of ac
GNEEdge * myEdgeTemplate
the edge template
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
void showAttribute(SumoXMLTag ACTag, SumoXMLAttr ACAttribute, const std::string &value)
show attribute of ac
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:53
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
FXLabel * myUseGEOLabel
Label for use GEO.
TemplateEditor * getTemplateEditor() const
get template editor
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
GNEInspectorFrame * getInspectorFrameParent() const
get InspectorFrame Parent
TemplateEditor * myTemplateEditor
Template editor.
FXLabel * myLabelBlockShape
Label for Check blocked shape.
void show()
show inspector frame
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void hideAttributesEditor()
hide attribute editor
FXButton * myBackButton
back Button
bool myMultiple
flag to check if input element contains multiple values
void inspectMultisection(const std::vector< GNEAttributeCarrier *> &ACs)
Inspect the given multi-selection.
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
std::vector< GNEInspectorFrame::AttributesEditor::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
long onCmdAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
GNEInspectorFrame::AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent