Eclipse 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-2019 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 GNEViewNetHelper::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 onCmdShowList(FXObject*, FXSelector, void*);
83 
85  long onCmdListItemSelected(FXObject*, FXSelector, void*);
86 
88  long onCmdOverlappingHelp(FXObject*, FXSelector, void*);
90 
91  protected:
94 
95  private:
98 
100  FXButton* myPreviousElement;
101 
104 
106  FXButton* myNextElement;
107 
110 
112  FXButton* myHelpButton;
113 
115  std::vector<GNEAttributeCarrier*> myOverlappedACs;
116 
118  size_t myItemIndex;
119 
122 
125  };
126 
127  // ===========================================================================
128  // class NeteditAttributesEditor
129  // ===========================================================================
130 
131  class NeteditAttributesEditor : private FXGroupBox {
134 
135  public:
137  NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
138 
141 
143  void showNeteditAttributesEditor();
144 
146  void hideNeteditAttributesEditor();
147 
149  void refreshNeteditAttributesEditor(bool forceRefresh);
150 
154  long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*);
155 
157  long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*);
159 
160  protected:
163 
164  private:
167 
170 
173 
176 
178  FXHorizontalFrame* myHorizontalFrameBlockMovement;
179 
182 
184  FXCheckButton* myCheckBoxBlockMovement;
185 
187  FXHorizontalFrame* myHorizontalFrameBlockShape;
188 
191 
193  FXCheckButton* myCheckBoxBlockShape;
194 
196  FXHorizontalFrame* myHorizontalFrameCloseShape;
197 
200 
202  FXCheckButton* myCheckBoxCloseShape;
203 
205  FXButton* myHelpButton;
206  };
207 
208  // ===========================================================================
209  // class GEOAttributesEditor
210  // ===========================================================================
211 
212  class GEOAttributesEditor : private FXGroupBox {
215 
216  public:
218  GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
219 
222 
224  void showGEOAttributesEditor();
225 
227  void hideGEOAttributesEditor();
228 
230  void refreshGEOAttributesEditor(bool forceRefresh);
231 
234 
236  long onCmdSetGEOAttribute(FXObject*, FXSelector, void*);
237 
239  long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*);
241 
242  protected:
245 
246  private:
249 
251  FXHorizontalFrame* myGEOAttributeFrame;
252 
255 
258 
260  FXHorizontalFrame* myUseGEOFrame;
261 
263  FXLabel* myUseGEOLabel;
264 
266  FXCheckButton* myUseGEOCheckButton;
267 
269  FXButton* myHelpButton;
270  };
271 
272  // ===========================================================================
273  // class TemplateEditor
274  // ===========================================================================
275 
276  class TemplateEditor : private FXGroupBox {
279 
280  public:
282  TemplateEditor(GNEInspectorFrame* inspectorFrameParent);
283 
285  ~TemplateEditor();
286 
288  void showTemplateEditor();
289 
291  void hideTemplateEditor();
292 
294  GNEEdge* getEdgeTemplate() const;
295 
297  void setEdgeTemplate(GNEEdge* tpl);
298 
301 
303  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
304 
306  long onCmdSetTemplate(FXObject*, FXSelector, void*);
307 
309  long onUpdCopyTemplate(FXObject*, FXSelector, void*);
311 
312  protected:
315 
316  private:
319 
322 
325 
328  };
329 
334  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
335 
338 
340  void show();
341 
343  void hide();
344 
350  bool processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
351 
357  bool processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
358 
361 
363  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
364 
367 
369  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
370 
372  void clearInspectedAC();
373 
376 
379 
382 
385 
387  long onCmdGoBack(FXObject*, FXSelector, void*);
389 
392 
393 protected:
396 
398  void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition);
399 
401  void attributeUpdated();
402 
403 private:
406 
409 
412 
415 
418 
421 
424 
426  FXButton* myBackButton;
427 
430 
433 
436 };
437 
438 
439 #endif
440 
441 /****************************************************************************/
442 
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
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
FXHorizontalFrame * myHorizontalFrameBlockMovement
horizontal frame for block movement
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children) ...
GNEInspectorFrame()
FOX needs this.
FXButton * mySetTemplateButton
set template button
long onCmdPreviousElement(FXObject *, FXSelector, void *)
Inspect previous element (from top to bot)
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
void hideOverlappedInspection()
hide template editor
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
FXButton * myCurrentIndexButton
Button for current index.
FXTextField * myTextFieldAdditionalParent
pointer for change additional parent
FXLabel * myLabelCloseShape
Label for close shape.
~GNEInspectorFrame()
Destructor.
OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
void attributeUpdated()
function called after set a valid attribute in AttributeEditor
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
GNEFrameAttributesModuls::GenericParametersEditor * myGenericParametersEditor
Generic parameters editor.
FXHorizontalFrame * myHorizontalFrameBlockShape
horizontal frame for block shape
long onCmdShowList(FXObject *, FXSelector, void *)
show list of overlapped elements
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
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
FXButton * myCopyTemplateButton
copy template button
FXList * myOverlappedElementList
list of overlapped elements
class used to group all variables related with objects under cursor after a click over view ...
GNEFrameAttributesModuls::AttributesEditor * myAttributesEditor
Attribute editor.
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
void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
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
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.
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
FXLabel * myUseGEOLabel
Label for use GEO.
long onCmdListItemSelected(FXObject *, FXSelector, void *)
called when a list item is selected
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
void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
show template editor
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
FXButton * myBackButton
back Button
void inspectMultisection(const std::vector< GNEAttributeCarrier *> &ACs)
Inspect the given multi-selection.
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
void inspectOverlappedAttributeCarrier()
inspect attributeCarrier correspond to current index
OverlappedInspection * myOverlappedInspection
Overlapped Inspection.
GNEFrameModuls::AttributeCarrierHierarchy * myAttributeCarrierHierarchy
Attribute Carrier Hierarchy.