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 /****************************************************************************/
15 // The Widget for modifying network-element attributes (i.e. lane speed)
16 /****************************************************************************/
17 #ifndef GNEInspectorFrame_h
18 #define GNEInspectorFrame_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include "GNEFrame.h"
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
33 class GNEInspectorFrame : public GNEFrame {
35  FXDECLARE(GNEInspectorFrame)
36 
37 public:
38  // ===========================================================================
39  // class NeteditAttributesEditor
40  // ===========================================================================
41 
42  class NeteditAttributesEditor : private FXGroupBox {
45 
46  public:
48  NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
49 
52 
55 
58 
60  void refreshNeteditAttributesEditor(bool forceRefresh);
61 
65  long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*);
66 
68  long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*);
70 
71  protected:
73 
74  private:
77 
80 
83 
86 
88  FXHorizontalFrame* myHorizontalFrameBlockMovement;
89 
92 
94  FXCheckButton* myCheckBoxBlockMovement;
95 
97  FXHorizontalFrame* myHorizontalFrameBlockShape;
98 
101 
103  FXCheckButton* myCheckBoxBlockShape;
104 
106  FXHorizontalFrame* myHorizontalFrameCloseShape;
107 
110 
112  FXCheckButton* myCheckBoxCloseShape;
113 
115  FXButton* myHelpButton;
116  };
117 
118  // ===========================================================================
119  // class GEOAttributesEditor
120  // ===========================================================================
121 
122  class GEOAttributesEditor : private FXGroupBox {
125 
126  public:
128  GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
129 
132 
135 
138 
140  void refreshGEOAttributesEditor(bool forceRefresh);
141 
144 
146  long onCmdSetGEOAttribute(FXObject*, FXSelector, void*);
147 
149  long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*);
151 
152  protected:
154 
155  private:
158 
160  FXHorizontalFrame* myGEOAttributeFrame;
161 
164 
167 
169  FXHorizontalFrame* myUseGEOFrame;
170 
172  FXLabel* myUseGEOLabel;
173 
175  FXCheckButton* myUseGEOCheckButton;
176 
178  FXButton* myHelpButton;
179  };
180 
181  // ===========================================================================
182  // class TemplateEditor
183  // ===========================================================================
184 
185  class TemplateEditor : private FXGroupBox {
188 
189  public:
191  TemplateEditor(GNEInspectorFrame* inspectorFrameParent);
192 
194  ~TemplateEditor();
195 
197  void showTemplateEditor();
198 
200  void hideTemplateEditor();
201 
203  GNEEdge* getEdgeTemplate() const;
204 
206  void setTemplate();
207 
209  void copyTemplate();
210 
212  void clearTemplate();
213 
216 
218  long onCmdSetTemplate(FXObject*, FXSelector, void*);
219 
221  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
222 
224  long onCmdClearTemplate(FXObject*, FXSelector, void*);
226 
227  protected:
229 
230 
231  void setEdgeTemplate(GNEEdge* tpl);
232 
234  void updateButtons();
235 
236  private:
239 
242 
245 
248 
251  };
252 
257  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
258 
261 
263  void show();
264 
266  void hide();
267 
273  bool processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
274 
280  bool processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
281 
284 
286  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
287 
289  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
290 
292  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
293 
295  void clearInspectedAC();
296 
299 
302 
305 
308 
310  long onCmdGoBack(FXObject*, FXSelector, void*);
312 
315 
318 
319 protected:
321 
322 
323  void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition);
324 
326  void attributeUpdated();
327 
328 private:
331 
334 
337 
340 
343 
346 
349 
351  FXButton* myBackButton;
352 
355 
358 
361 };
362 
363 
364 #endif
365 
366 /****************************************************************************/
367 
GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
Definition: GNEInspectorFrame.cpp:978
GNEInspectorFrame::inspectMultisection
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
Definition: GNEInspectorFrame.cpp:226
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameCloseShape
FXHorizontalFrame * myHorizontalFrameCloseShape
@frame horizontal frame for close shape
Definition: GNEInspectorFrame.h:106
GNEInspectorFrame::GEOAttributesEditor::myGEOAttributeLabel
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
Definition: GNEInspectorFrame.h:163
GNEInspectorFrame::NeteditAttributesEditor::hideNeteditAttributesEditor
void hideNeteditAttributesEditor()
hide netedit attributes editor
Definition: GNEInspectorFrame.cpp:543
GNEInspectorFrame::clearInspectedAC
void clearInspectedAC()
Clear all current inspected ACs.
Definition: GNEInspectorFrame.cpp:319
GNEInspectorFrame::GNEInspectorFrame
GNEInspectorFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEInspectorFrame.cpp:74
GNEInspectorFrame::GEOAttributesEditor::~GEOAttributesEditor
~GEOAttributesEditor()
destructor
Definition: GNEInspectorFrame.cpp:708
GNEInspectorFrame::myBackButton
FXButton * myBackButton
back Button
Definition: GNEInspectorFrame.h:351
GNEInspectorFrame::TemplateEditor::myEdgeTemplate
GNEEdge * myEdgeTemplate
pointer to edge template
Definition: GNEInspectorFrame.h:250
GNEInspectorFrame::inspectSingleElement
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
Definition: GNEInspectorFrame.cpp:202
GNEInspectorFrame::onCmdGoBack
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
Definition: GNEInspectorFrame.cpp:348
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameBlockMovement
FXHorizontalFrame * myHorizontalFrameBlockMovement
@frame horizontal frame for block movement
Definition: GNEInspectorFrame.h:88
GNEInspectorFrame::NeteditAttributesEditor::myLabelParentAdditional
FXLabel * myLabelParentAdditional
Label for parent additional.
Definition: GNEInspectorFrame.h:82
GNEFrameModuls::OverlappedInspection
Definition: GNEFrameModuls.h:520
GNEInspectorFrame::TemplateEditor::updateButtons
void updateButtons()
update buttons
Definition: GNEInspectorFrame.cpp:1027
GNEInspectorFrame::myAttributeCarrierHierarchy
GNEFrameModuls::AttributeCarrierHierarchy * myAttributeCarrierHierarchy
Attribute Carrier Hierarchy.
Definition: GNEInspectorFrame.h:348
GNEInspectorFrame::myPreviousElementInspect
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
Definition: GNEInspectorFrame.h:354
GNEInspectorFrame::NeteditAttributesEditor::refreshNeteditAttributesEditor
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
Definition: GNEInspectorFrame.cpp:555
GNEInspectorFrame::inspectClickedElement
void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
Definition: GNEInspectorFrame.cpp:388
GNEFrame
Definition: GNEFrame.h:34
GNEInspectorFrame::myPreviousElementDelete
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
Definition: GNEInspectorFrame.h:357
GNEViewNet
Definition: GNEViewNet.h:42
GNEInspectorFrame::GEOAttributesEditor::myUseGEOLabel
FXLabel * myUseGEOLabel
Label for use GEO.
Definition: GNEInspectorFrame.h:172
GNEInspectorFrame::TemplateEditor::copyTemplate
void copyTemplate()
copy template (used by shortcut)
Definition: GNEInspectorFrame.cpp:944
GNEInspectorFrame::myGEOAttributesEditor
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
Definition: GNEInspectorFrame.h:339
GNEInspectorFrame::GEOAttributesEditor::refreshGEOAttributesEditor
void refreshGEOAttributesEditor(bool forceRefresh)
refresh GEO attributes editor
Definition: GNEInspectorFrame.cpp:792
GNEInspectorFrame::NeteditAttributesEditor::myCheckBoxCloseShape
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
Definition: GNEInspectorFrame.h:112
GNEInspectorFrame::NeteditAttributesEditor::myLabelCloseShape
FXLabel * myLabelCloseShape
Label for close shape.
Definition: GNEInspectorFrame.h:109
GNEInspectorFrame::TemplateEditor::~TemplateEditor
~TemplateEditor()
destructor
Definition: GNEInspectorFrame.cpp:890
GNEInspectorFrame::attributeUpdated
void attributeUpdated()
function called after set a valid attribute in AttributeEditor
Definition: GNEInspectorFrame.cpp:403
GNEInspectorFrame::inspectFromDeleteFrame
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
Definition: GNEInspectorFrame.cpp:304
GNEInspectorFrame::GEOAttributesEditor::showGEOAttributesEditor
void showGEOAttributesEditor()
show GEO attributes editor
Definition: GNEInspectorFrame.cpp:712
GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Definition: GNEInspectorFrame.cpp:616
GNEFrameAttributesModuls::AttributesEditor
Definition: GNEFrameAttributesModuls.h:374
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEInspectorFrame::GEOAttributesEditor::myGEOAttributeTextField
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
Definition: GNEInspectorFrame.h:166
GNEInspectorFrame::TemplateEditor::mySetTemplateButton
FXButton * mySetTemplateButton
set template button
Definition: GNEInspectorFrame.h:241
GNEInspectorFrame::GEOAttributesEditor::GEOAttributesEditor
GEOAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEInspectorFrame.cpp:689
GNEInspectorFrame::NeteditAttributesEditor::myLabelBlockMovement
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
Definition: GNEInspectorFrame.h:91
GNEInspectorFrame::NeteditAttributesEditor::showNeteditAttributesEditor
void showNeteditAttributesEditor()
show netedit attributes editor
Definition: GNEInspectorFrame.cpp:446
GNEInspectorFrame::~GNEInspectorFrame
~GNEInspectorFrame()
Destructor.
Definition: GNEInspectorFrame.cpp:107
GNEInspectorFrame::TemplateEditor::getEdgeTemplate
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
Definition: GNEInspectorFrame.cpp:929
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameBlockShape
FXHorizontalFrame * myHorizontalFrameBlockShape
@frame horizontal frame for block shape
Definition: GNEInspectorFrame.h:97
GNEInspectorFrame::GEOAttributesEditor::myInspectorFrameParent
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
Definition: GNEInspectorFrame.h:157
GNEInspectorFrame::selectedOverlappedElement
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open AttributesCreator extended dialog (can be reimplemented in frame children)
Definition: GNEInspectorFrame.cpp:375
GNEInspectorFrame::NeteditAttributesEditor::myLabelBlockShape
FXLabel * myLabelBlockShape
Label for Check blocked shape.
Definition: GNEInspectorFrame.h:100
GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEInspectorFrame.cpp:681
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:148
GNEInspectorFrame::NeteditAttributesEditor::myCheckBoxBlockMovement
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
Definition: GNEInspectorFrame.h:94
GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEInspectorFrame.cpp:855
GNEInspectorFrame::TemplateEditor::showTemplateEditor
void showTemplateEditor()
show template editor
Definition: GNEInspectorFrame.cpp:904
FOX_CONSTRUCTOR
#define FOX_CONSTRUCTOR(classname)
Definition: config.h:13
GNEInspectorFrame::updateFrameAfterUndoRedo
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
Definition: GNEInspectorFrame.cpp:364
GNEInspectorFrame::getTemplateEditor
TemplateEditor * getTemplateEditor() const
get template editor
Definition: GNEInspectorFrame.cpp:336
GNEInspectorFrame::myTemplateEditor
TemplateEditor * myTemplateEditor
Template editor.
Definition: GNEInspectorFrame.h:345
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEInspectorFrame::GEOAttributesEditor
Definition: GNEInspectorFrame.h:122
GNEFrameModuls::AttributeCarrierHierarchy
Definition: GNEFrameModuls.h:287
GNEInspectorFrame::myAttributesEditor
GNEFrameAttributesModuls::AttributesEditor * myAttributesEditor
Attribute editor.
Definition: GNEInspectorFrame.h:333
GNEInspectorFrame::getOverlappedInspection
GNEFrameModuls::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
Definition: GNEInspectorFrame.cpp:342
GNEInspectorFrame::NeteditAttributesEditor::~NeteditAttributesEditor
~NeteditAttributesEditor()
destructor
Definition: GNEInspectorFrame.cpp:442
GNEInspectorFrame::NeteditAttributesEditor::myHelpButton
FXButton * myHelpButton
button for help
Definition: GNEInspectorFrame.h:115
GNEInspectorFrame::myParametersEditor
GNEFrameAttributesModuls::ParametersEditor * myParametersEditor
parameters editor
Definition: GNEInspectorFrame.h:342
GNEInspectorFrame::GEOAttributesEditor::myUseGEOFrame
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
Definition: GNEInspectorFrame.h:169
GNEInspectorFrame::myOverlappedInspection
GNEFrameModuls::OverlappedInspection * myOverlappedInspection
Overlapped Inspection.
Definition: GNEInspectorFrame.h:330
GNEFrameAttributesModuls::ParametersEditor
Definition: GNEFrameAttributesModuls.h:554
GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
Definition: GNEInspectorFrame.cpp:808
GNEInspectorFrame::TemplateEditor::clearTemplate
void clearTemplate()
clear template (used by shortcut)
Definition: GNEInspectorFrame.cpp:953
GNEInspectorFrame::getAttributesEditor
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
Definition: GNEInspectorFrame.cpp:330
GNEInspectorFrame::myNeteditAttributesEditor
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
Definition: GNEInspectorFrame.h:336
GNEInspectorFrame::NeteditAttributesEditor::myInspectorFrameParent
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
Definition: GNEInspectorFrame.h:76
GNEInspectorFrame::GEOAttributesEditor::myHelpButton
FXButton * myHelpButton
button for help
Definition: GNEInspectorFrame.h:178
GNEInspectorFrame::TemplateEditor::setEdgeTemplate
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
Definition: GNEInspectorFrame.cpp:1003
GNEInspectorFrame::NeteditAttributesEditor::myCheckBoxBlockShape
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
Definition: GNEInspectorFrame.h:103
GNEInspectorFrame::NeteditAttributesEditor
FOX-declaration.
Definition: GNEInspectorFrame.h:42
GNEInspectorFrame::TemplateEditor::onCmdClearTemplate
long onCmdClearTemplate(FXObject *, FXSelector, void *)
clear current edge template
Definition: GNEInspectorFrame.cpp:994
GNEInspectorFrame::inspectChild
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
Definition: GNEInspectorFrame.cpp:290
GNEInspectorFrame::hide
void hide()
hide inspector frame
Definition: GNEInspectorFrame.cpp:119
GNEInspectorFrame::TemplateEditor::hideTemplateEditor
void hideTemplateEditor()
hide template editor
Definition: GNEInspectorFrame.cpp:922
GNEInspectorFrame::TemplateEditor
Definition: GNEInspectorFrame.h:185
GNEInspectorFrame::TemplateEditor::myClearTemplateButton
FXButton * myClearTemplateButton
clear template button
Definition: GNEInspectorFrame.h:247
GNEInspectorFrame::myPreviousElementDeleteWasMarked
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
Definition: GNEInspectorFrame.h:360
GNEInspectorFrame::TemplateEditor::myInspectorFrameParent
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
Definition: GNEInspectorFrame.h:238
GNEInspectorFrame::processDemandSupermodeClick
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
Definition: GNEInspectorFrame.cpp:166
GNEInspectorFrame::GEOAttributesEditor::myUseGEOCheckButton
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
Definition: GNEInspectorFrame.h:175
GNEInspectorFrame::TemplateEditor::onCmdSetTemplate
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
Definition: GNEInspectorFrame.cpp:962
GNEInspectorFrame::GEOAttributesEditor::hideGEOAttributesEditor
void hideGEOAttributesEditor()
hide GEO attributes editor
Definition: GNEInspectorFrame.cpp:782
GNEFrame.h
GNEInspectorFrame::TemplateEditor::myCopyTemplateButton
FXButton * myCopyTemplateButton
copy template button
Definition: GNEInspectorFrame.h:244
GNEInspectorFrame::TemplateEditor::TemplateEditor
TemplateEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEInspectorFrame.cpp:877
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameParentAdditional
FXHorizontalFrame * myHorizontalFrameParentAdditional
@frame horizontal frame for replace the parent additional
Definition: GNEInspectorFrame.h:79
GNEInspectorFrame
Definition: GNEInspectorFrame.h:33
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNEInspectorFrame::GEOAttributesEditor::myGEOAttributeFrame
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
Definition: GNEInspectorFrame.h:160
GNEInspectorFrame::NeteditAttributesEditor::myTextFieldParentAdditional
FXTextField * myTextFieldParentAdditional
pointer for replace the parent additional
Definition: GNEInspectorFrame.h:85
GNEInspectorFrame::processNetworkSupermodeClick
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
Definition: GNEInspectorFrame.cpp:126
GNEInspectorFrame::TemplateEditor::setTemplate
void setTemplate()
set template (used by shortcut)
Definition: GNEInspectorFrame.cpp:935
GNEInspectorFrame::show
void show()
show inspector frame
Definition: GNEInspectorFrame.cpp:111
GNEInspectorFrame::NeteditAttributesEditor::NeteditAttributesEditor
NeteditAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEInspectorFrame.cpp:413