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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // The Widget for modifying network-element attributes (i.e. lane speed)
20 /****************************************************************************/
21 #pragma once
22 
24 
25 // ===========================================================================
26 // class definitions
27 // ===========================================================================
32 class GNEInspectorFrame : public GNEFrame {
34  FXDECLARE(GNEInspectorFrame)
35 
36 public:
37  // ===========================================================================
38  // class NeteditAttributesEditor
39  // ===========================================================================
40 
41  class NeteditAttributesEditor : private FXGroupBox {
44 
45  public:
47  NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
48 
51 
54 
57 
59  void refreshNeteditAttributesEditor(bool forceRefresh);
60 
64  long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*);
65 
67  long onCmdMarkFrontElement(FXObject*, FXSelector, void*);
68 
70  long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*);
72 
73  protected:
74  FOX_CONSTRUCTOR(NeteditAttributesEditor)
75 
76  private:
79 
82 
85 
88 
90  FXHorizontalFrame* myHorizontalFrameBlockMovement;
91 
94 
96  FXCheckButton* myCheckBoxBlockMovement;
97 
99  FXHorizontalFrame* myHorizontalFrameBlockShape;
100 
103 
105  FXCheckButton* myCheckBoxBlockShape;
106 
108  FXHorizontalFrame* myHorizontalFrameCloseShape;
109 
112 
114  FXCheckButton* myCheckBoxCloseShape;
115 
118 
120  FXButton* myHelpButton;
121  };
122 
123  // ===========================================================================
124  // class GEOAttributesEditor
125  // ===========================================================================
126 
127  class GEOAttributesEditor : private FXGroupBox {
130 
131  public:
133  GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent);
134 
137 
140 
143 
145  void refreshGEOAttributesEditor(bool forceRefresh);
146 
149 
151  long onCmdSetGEOAttribute(FXObject*, FXSelector, void*);
152 
154  long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*);
156 
157  protected:
158  FOX_CONSTRUCTOR(GEOAttributesEditor)
159 
160  private:
163 
165  FXHorizontalFrame* myGEOAttributeFrame;
166 
169 
172 
174  FXHorizontalFrame* myUseGEOFrame;
175 
177  FXLabel* myUseGEOLabel;
178 
180  FXCheckButton* myUseGEOCheckButton;
181 
183  FXButton* myHelpButton;
184  };
185 
186  // ===========================================================================
187  // class TemplateEditor
188  // ===========================================================================
189 
190  class TemplateEditor : private FXGroupBox {
193 
194  public:
196  struct EdgeTemplate {
198  EdgeTemplate();
199 
201  EdgeTemplate(GNEEdge* edge);
202 
204  std::map<SumoXMLAttr, std::string> edgeParameters;
205 
207  std::vector<std::map<SumoXMLAttr, std::string> > laneParameters;
208  };
209 
211  TemplateEditor(GNEInspectorFrame* inspectorFrameParent);
212 
214  ~TemplateEditor();
215 
217  void showTemplateEditor();
218 
220  void hideTemplateEditor();
221 
223  bool hasTemplate() const;
224 
227 
229  void setTemplate();
230 
232  void copyTemplate();
233 
235  void clearTemplate();
236 
240  long onCmdSetTemplate(FXObject*, FXSelector, void*);
241 
243  long onCmdCopyTemplate(FXObject*, FXSelector, void*);
244 
246  long onCmdClearTemplate(FXObject*, FXSelector, void*);
248 
249  protected:
251  FOX_CONSTRUCTOR(TemplateEditor)
252 
253 
254  void setEdgeTemplate(GNEEdge* edgeTemplate);
255 
257  void updateButtons();
258 
259  private:
262 
265 
268 
271 
274 
277  };
278 
279  // ===========================================================================
280  // class ParametersEditorInspector
281  // ===========================================================================
282 
283  class ParametersEditorInspector : private FXGroupBox {
286 
287  public:
289  ParametersEditorInspector(GNEInspectorFrame* inspectorFrameParent);
290 
293 
296 
299 
302 
305 
309  long onCmdEditParameters(FXObject*, FXSelector, void*);
310 
312  long onCmdSetParameters(FXObject*, FXSelector, void*);
314 
315  protected:
316  FOX_CONSTRUCTOR(ParametersEditorInspector)
317 
318  private:
321 
323  FXTextField* myTextFieldParameters;
324 
327  };
328 
333  GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
334 
337 
339  void show();
340 
342  void hide();
343 
349  bool processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
350 
356  bool processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
357 
363  bool processDataSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
364 
367 
369  void inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs);
370 
372  void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement);
373 
375  void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);
376 
378  void clearInspectedAC();
379 
382 
385 
388 
391 
394 
397 
399  long onCmdGoBack(FXObject*, FXSelector, void*);
401 
404 
407 
408 protected:
409  FOX_CONSTRUCTOR(GNEInspectorFrame)
410 
411 
412  void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition);
413 
415  void attributeUpdated();
416 
417 private:
420 
423 
426 
429 
432 
435 
438 
440  FXButton* myBackButton;
441 
444 
447 
450 };
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXButton * myHelpButton
button for help
void showGEOAttributesEditor()
show GEO attributes editor
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
FXLabel * myUseGEOLabel
Label for use GEO.
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
GEOAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
void refreshGEOAttributesEditor(bool forceRefresh)
refresh GEO attributes editor
void hideGEOAttributesEditor()
hide GEO attributes editor
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
FXHorizontalFrame * myHorizontalFrameBlockShape
@frame horizontal frame for block shape
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
FXLabel * myLabelParentAdditional
Label for parent additional.
FXHorizontalFrame * myHorizontalFrameBlockMovement
@frame horizontal frame for block movement
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXHorizontalFrame * myHorizontalFrameCloseShape
@frame horizontal frame for close shape
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
long onCmdMarkFrontElement(FXObject *, FXSelector, void *)
Called when user press button "Mark front element".
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
void hideNeteditAttributesEditor()
hide netedit attributes editor
GNEInspectorFrame * myInspectorFrameParent
pointer to inspector frame parent
FXLabel * myLabelCloseShape
Label for close shape.
FXHorizontalFrame * myHorizontalFrameParentAdditional
@frame horizontal frame for replace the parent additional
NeteditAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
FXTextField * myTextFieldParentAdditional
pointer for replace the parent additional
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
FXButton * myMarkFrontElementButton
button for set element as front button
void showNeteditAttributesEditor()
show netedit attributes editor
FXLabel * myLabelBlockShape
Label for Check blocked shape.
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
long onCmdEditParameters(FXObject *, FXSelector, void *)
void showParametersEditorInspector()
show netedit attributes EditorInspector
void refreshParametersEditorInspector()
refresh netedit attributes
FXTextField * myTextFieldParameters
text field for write parameters
GNEInspectorFrame * getInspectorFrameParent() const
get inspector frame parent
ParametersEditorInspector(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
void hideParametersEditorInspector()
hide netedit attributes EditorInspector
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
void hideTemplateEditor()
hide template editor
GNEInspectorFrame * myInspectorFrameParent
current GNEInspectorFrame parent
void clearTemplate()
clear template (used by shortcut)
TemplateEditor::EdgeTemplate myEdgeTemplate
map with edge template
FXButton * myClearTemplateButton
clear template button
bool myHasEdgeTemplate
flag for edge template
FXButton * mySetTemplateButton
set template button
const TemplateEditor::EdgeTemplate & getEdgeTemplate() const
get the template edge (to copy attributes from)
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
bool hasTemplate() const
there is a template
void setTemplate()
set template (used by shortcut)
TemplateEditor(GNEInspectorFrame *inspectorFrameParent)
constructor
FXButton * myCopyTemplateButton
copy template button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
void copyTemplate()
copy template (used by shortcut)
void setEdgeTemplate(GNEEdge *edgeTemplate)
FOX need this.
void showTemplateEditor()
show template editor
long onCmdClearTemplate(FXObject *, FXSelector, void *)
clear current edge template
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
GNEInspectorFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open AttributesCreator extended dialog (can be reimplemented in frame children)
TemplateEditor * getTemplateEditor() const
get template editor
GNEFrameAttributesModuls::AttributesEditor * myAttributesEditor
Attribute editor.
void clearInspectedAC()
Clear all current inspected ACs.
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Data
void show()
show inspector frame
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
GNEFrameModuls::HierarchicalElementTree * myHierarchicalElementTree
Attribute Carrier Hierarchy.
GNEFrameModuls::HierarchicalElementTree * getHierarchicalElementTree() const
get HierarchicalElementTree modul
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
void attributeUpdated()
function called after set a valid attribute in AttributeEditor
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
ParametersEditorInspector * myParametersEditorInspector
parameters editor inspector
void hide()
hide inspector frame
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
FXButton * myBackButton
back Button
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
~GNEInspectorFrame()
Destructor.
TemplateEditor * myTemplateEditor
Template editor.
GNEFrameModuls::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
GNEFrameModuls::OverlappedInspection * myOverlappedInspection
Overlapped Inspection.
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
class used to group all variables related with objects under cursor after a click over view
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
std::map< SumoXMLAttr, std::string > edgeParameters
edge parameters
std::vector< std::map< SumoXMLAttr, std::string > > laneParameters
lane parameters