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 "GNEFrame.h"
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
34 class GNEInspectorFrame : public GNEFrame {
36  FXDECLARE(GNEInspectorFrame)
37 
38 public:
39  // ===========================================================================
40  // class OverlappedInspection
41  // ===========================================================================
42 
43  class OverlappedInspection : private FXGroupBox {
46 
47  public:
49  OverlappedInspection(GNEInspectorFrame* inspectorFrameParent);
50 
53 
55  void showOverlappedInspection(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition);
56 
59 
61  bool overlappedInspectionShown() const;
62 
64  bool checkSavedPosition(const Position &clickedPosition) const;
65 
67  bool nextElement(const Position &clickedPosition);
68 
70  bool previousElement(const Position &clickedPosition);
71 
74 
76  long onCmdNextElement(FXObject*, FXSelector, void*);
77 
79  long onCmdPreviousElement(FXObject*, FXSelector, void*);
80 
82  long onCmdOverlappingHelp(FXObject*, FXSelector, void*);
84 
85  protected:
88 
89  private:
92 
94  FXButton* myPreviousElement;
95 
98 
100  FXButton* myNextElement;
101 
103  FXButton* myHelpButton;
104 
106  std::vector<GNEAttributeCarrier*> myOverlappedACs;
107 
109  size_t myItemIndex;
110 
113  };
114 
115  // ===========================================================================
116  // class AttributesEditor
117  // ===========================================================================
118 
119  class AttributesEditor : private FXGroupBox {
122 
123  public:
124 
125  // ===========================================================================
126  // class AttributeInput
127  // ===========================================================================
128 
129  class AttributeInput : private FXHorizontalFrame {
132 
133  public:
135  AttributeInput(GNEInspectorFrame::AttributesEditor* attributeEditorParent);
136 
138  void showAttribute(SumoXMLTag ACTag, SumoXMLAttr ACAttribute, const std::string& value);
139 
141  void hideAttribute();
142 
144  void refreshAttributeInput(const std::string& value, bool forceRefresh);
145 
147  bool isCurrentAttributeValid() const;
148 
151 
153  long onCmdSetAttribute(FXObject*, FXSelector, void*);
154 
156  long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*);
158 
159  protected:
162 
164  std::string stripWhitespaceAfterComma(const std::string& stringValue);
165 
166  private:
168  void enableAttributeInputElements();
169 
171  void disableAttributeInputElements();
172 
175 
178 
181 
184 
186  FXLabel* myLabel;
187 
189  FXTextField* myTextFieldInt;
190 
192  FXTextField* myTextFieldReal;
193 
195  FXTextField* myTextFieldStrings;
196 
198  FXComboBox* myChoicesCombo;
199 
201  FXCheckButton* myBoolCheckButton;
202 
205 
207  FXButton* myColorEditor;
208  };
209 
211  AttributesEditor(GNEInspectorFrame* inspectorFrameParent);
212 
214  void showAttributeEditorModul();
215 
217  void hideAttributesEditorModul();
218 
220  void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition);
221 
223  GNEInspectorFrame* getInspectorFrameParent() const;
224 
227 
229  long onCmdAttributeHelp(FXObject*, FXSelector, void*);
231 
232  protected:
235 
236  private:
239 
241  std::vector<GNEInspectorFrame::AttributesEditor::AttributeInput*> myVectorOfAttributeInputs;
242 
244  FXButton* myHelpButton;
245  };
246 
247  // ===========================================================================
248  // class NeteditAttributesEditor
249  // ===========================================================================
250 
251  class NeteditAttributesEditor : private FXGroupBox {
254 
255  public:
257  NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
258 
261 
263  void showNeteditAttributesEditor();
264 
266  void hideNeteditAttributesEditor();
267 
269  void refreshNeteditAttributesEditor(bool forceRefresh);
270 
273 
275  long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*);
276 
278  long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*);
280 
281  protected:
284 
285  private:
288 
291 
294 
297 
299  FXHorizontalFrame* myHorizontalFrameBlockMovement;
300 
303 
305  FXCheckButton* myCheckBoxBlockMovement;
306 
308  FXHorizontalFrame* myHorizontalFrameBlockShape;
309 
312 
314  FXCheckButton* myCheckBoxBlockShape;
315 
317  FXHorizontalFrame* myHorizontalFrameCloseShape;
318 
321 
323  FXCheckButton* myCheckBoxCloseShape;
324 
326  FXButton* myHelpButton;
327  };
328 
329  // ===========================================================================
330  // class GEOAttributesEditor
331  // ===========================================================================
332 
333  class GEOAttributesEditor : private FXGroupBox {
336 
337  public:
339  GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
340 
343 
345  void showGEOAttributesEditor();
346 
348  void hideGEOAttributesEditor();
349 
351  void refreshGEOAttributesEditor(bool forceRefresh);
352 
355 
357  long onCmdSetGEOAttribute(FXObject*, FXSelector, void*);
358 
360  long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*);
362 
363  protected:
366 
367  private:
370 
372  FXHorizontalFrame* myGEOAttributeFrame;
373 
376 
379 
381  FXHorizontalFrame* myUseGEOFrame;
382 
384  FXLabel* myUseGEOLabel;
385 
387  FXCheckButton* myUseGEOCheckButton;
388 
390  FXButton* myHelpButton;
391  };
392 
393  // ===========================================================================
394  // class TemplateEditor
395  // ===========================================================================
396 
397  class TemplateEditor : private FXGroupBox {
400 
401  public:
403  TemplateEditor(GNEInspectorFrame* inspectorFrameParent);
404 
406  ~TemplateEditor();
407 
409  void showTemplateEditor();
410 
412  void hideTemplateEditor();
413 
415  GNEEdge* getEdgeTemplate() const;
416 
418  void setEdgeTemplate(GNEEdge* tpl);
419 
422 
424  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
425 
427  long onCmdSetTemplate(FXObject*, FXSelector, void*);
428 
430  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
432 
433  protected:
436 
437  private:
440 
443 
446 
449  };
450 
455  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
456 
459 
461  void show();
462 
464  void hide();
465 
471  bool processClick(const Position& clickedPosition, GNEViewNet::ObjectsUnderCursor &objectsUnderCursor);
472 
475 
477  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
478 
481 
483  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
484 
487 
489  void clearInspectedAC();
490 
493 
496 
499 
502 
504  long onCmdGoBack(FXObject*, FXSelector, void*);
506 
508  const std::vector<GNEAttributeCarrier*>& getInspectedACs() const;
509 
510 protected:
513 
515  void inspectClickedElement(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition);
516 
517 private:
520 
523 
526 
529 
532 
535 
538 
540  FXButton* myBackButton;
541 
544 
547 
550 
552  std::vector<GNEAttributeCarrier*> myInspectedACs;
553 };
554 
555 
556 #endif
557 
558 /****************************************************************************/
559 
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
bool nextElement(const Position &clickedPosition)
try to go to next element if clicked position is near to saved position
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
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.
long onCmdPreviousElement(FXObject *, FXSelector, void *)
Inspect previous element (from top to bot)
void inspectClickedElement(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
FXTextField * myTextFieldInt
textField to modify the value of int attributes
FXLabel * myLabel
pointer to attribute label
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
Position mySavedClickedPosition
saved clicked position
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
bool processClick(const Position &clickedPosition, GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
void hideOverlappedInspection()
hide template editor
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
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
FXTextField * myTextFieldAdditionalParent
pointer for change additional parent
FXLabel * myLabelCloseShape
Label for close shape.
~GNEInspectorFrame()
Destructor.
OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
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 previousElement(const Position &clickedPosition)
try to go to previous element if clicked position is near to saved position
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
FXLabel * myCurrentIndexLabel
label for current index
FXButton * myHelpButton
button for help
FXButton * myColorEditor
Button for open color editor.
FXHorizontalFrame * myHorizontalFrameBlockShape
horizontal frame for block shape
FXCheckButton * myBoolCheckButton
pointer to menu check
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
FXButton * myHelpButton
button for help
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
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
FXButton * myHelpButton
button for help
void clearInspectedAC()
Clear all current inspected ACs.
std::vector< GNEAttributeCarrier * > myOverlappedACs
objects under cursor
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"
GNEEdge * myEdgeTemplate
the edge template
long onCmdNextElement(FXObject *, FXSelector, void *)
Inspect next Element (from top to bot)
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
void showOverlappedInspection(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
show template editor
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
FXButton * myPreviousElement
Previous element button.
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
long onCmdOverlappingHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXButton * myNextElement
Next element button.
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
FXLabel * myUseGEOLabel
Label for use GEO.
TemplateEditor * getTemplateEditor() const
get template editor
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
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
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
GNEInspectorFrame::AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent
OverlappedInspection * myOverlappedInspection
Overlapped Inspection.