SUMO - Simulation of Urban MObility
GNEFrame.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Abstract class for lateral frames in NetEdit
18 /****************************************************************************/
19 #ifndef GNEFrame_h
20 #define GNEFrame_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <fx.h>
32 #include <netbuild/NBEdge.h>
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class GNEViewNet;
43 class GNEUndoList;
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
49 
54 class GNEFrame : public FXVerticalFrame {
55 
56 public:
57 
58  // ===========================================================================
59  // class NeteditAttributes
60  // ===========================================================================
61 
62  class NeteditAttributes : private FXGroupBox {
65 
66  public:
68  NeteditAttributes(GNEFrame* frameParent);
69 
72 
74  void showNeteditAttributes(bool shapeEditing);
75 
77  void hideNeteditAttributes();
78 
80  bool isBlockMovementEnabled() const;
81 
83  bool isBlockShapeEnabled() const;
84 
86  bool isCloseShapeEnabled() const;
87 
91  long onCmdSetBlockMovement(FXObject*, FXSelector, void*);
92 
94  long onCmdSetBlockShape(FXObject*, FXSelector, void*);
95 
97  long onCmdsetClosingShape(FXObject*, FXSelector, void*);
99 
100  protected:
103 
104  private:
107 
110 
113 
115  FXHorizontalFrame* myBlockShapeFrame;
116 
119 
121  FXCheckButton* myBlockShapeCheckButton;
122 
124  FXHorizontalFrame* myClosePolygonFrame;
125 
128 
131  };
132 
133  // ===========================================================================
134  // class GEOAttributes
135  // ===========================================================================
136 
137  class GEOAttributes : private FXGroupBox {
139  FXDECLARE(GNEFrame::GEOAttributes)
140 
141  public:
143  GEOAttributes(GNEFrame* frameParent);
144 
146  ~GEOAttributes();
147 
149  void showGEOAttributes(const std::vector<GNEAttributeCarrier*>& ACs);
150 
152  void hideGEOAttributes();
153 
155  void refreshGEOAttributes();
156 
158  std::map<SumoXMLAttr, std::string> getGEOAttributes() const;
159 
162 
164  long onCmdSetGEOAttribute(FXObject*, FXSelector, void*);
165 
167  long onCmdUseGEOParameters(FXObject*, FXSelector, void*);
168 
170  long onCmdHelp(FXObject*, FXSelector, void*);
172 
173  protected:
176 
177  private:
180 
183 
185  std::vector<GNEAttributeCarrier*> myACs;
186 
188  FXHorizontalFrame* myGEOAttributeFrame;
189 
192 
195 
197  FXHorizontalFrame* myUseGEOFrame;
198 
200  FXLabel* myUseGEOLabel;
201 
203  FXCheckButton* myUseGEOCheckButton;
204 
206  FXButton* myHelpButton;
207  };
208 
209  // ===========================================================================
210  // class DrawingMode
211  // ===========================================================================
212 
213  class DrawingMode : private FXGroupBox {
215  FXDECLARE(GNEFrame::DrawingMode)
216 
217  public:
219  DrawingMode(GNEFrame* frameParent);
220 
222  ~DrawingMode();
223 
225  void showDrawingMode();
226 
228  void hideDrawingMode();
229 
231  void startDrawing();
232 
234  void stopDrawing();
235 
237  void abortDrawing();
238 
240  void addNewPoint(const Position& P);
241 
243  void removeLastPoint();
244 
246  const PositionVector& getTemporalShape() const;
247 
249  bool isDrawing() const;
250 
254  long onCmdStartDrawing(FXObject*, FXSelector, void*);
255 
257  long onCmdStopDrawing(FXObject*, FXSelector, void*);
258 
260  long onCmdAbortDrawing(FXObject*, FXSelector, void*);
262 
263  protected:
266 
267  private:
270 
273 
276 
279 
282 
285  };
286 
287 
293  GNEFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, const std::string& frameLabel);
294 
296  ~GNEFrame();
297 
299  void focusUpperElement();
300 
304  virtual void show();
305 
309  virtual void hide();
310 
312  void setFrameWidth(int newWidth);
313 
315  GNEViewNet* getViewNet() const;
316 
318  FXLabel* getFrameHeaderLabel() const;
319 
321  FXFont* getFrameHeaderFont() const;
322 
325 
328 
331 
332 protected:
334  GNEFrame() {}
335 
338 
340  FXVerticalFrame* myContentFrame;
341 
343  FXHorizontalFrame* myHeaderFrame;
344 
346  FXHorizontalFrame* myHeaderLeftFrame;
347 
349  FXHorizontalFrame* myHeaderRightFrame;
350 
353 
356 
359 
360 private:
362  FXScrollWindow* myScrollWindowsContents;
363 
366 
369 
371  GNEFrame(const GNEFrame&) = delete;
372 
374  GNEFrame& operator=(const GNEFrame&) = delete;
375 };
376 
377 
378 #endif
379 
380 /****************************************************************************/
GNEFrame()
FOX needs this.
Definition: GNEFrame.h:334
FXLabel * myUseGEOLabel
Label for use GEO.
Definition: GNEFrame.h:200
std::vector< GNEAttributeCarrier * > myACs
current edited ACs
Definition: GNEFrame.h:185
SumoXMLAttr myGEOAttribute
type of GEO Attribute
Definition: GNEFrame.h:182
GNEFrame::GEOAttributes * myGEOAttributes
GEO Parameters.
Definition: GNEFrame.h:355
FXButton * myHelpButton
button for help
Definition: GNEFrame.h:206
GNEFrame & operator=(const GNEFrame &)=delete
Invalidated assignment operator.
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:577
FXLabel * myBlockShapeLabel
Label for block shape.
Definition: GNEFrame.h:118
bool isCloseShapeEnabled() const
check if clse shape is enabled
Definition: GNEFrame.cpp:140
FXFont * myFrameHeaderFont
Font for the Header.
Definition: GNEFrame.h:365
GNEFrame * myFrameParent
frame frame parent
Definition: GNEFrame.h:269
FXHorizontalFrame * myHeaderRightFrame
fame for right header elements
Definition: GNEFrame.h:349
long onCmdSetBlockShape(FXObject *, FXSelector, void *)
Called when user changes the checkbox "set blocking shape".
Definition: GNEFrame.cpp:157
FXHorizontalFrame * myBlockShapeFrame
frame for Block shape
Definition: GNEFrame.h:115
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
Definition: GNEFrame.h:194
GNEFrame::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEFrame.h:352
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
Definition: GNEFrame.h:362
FXFont * getFrameHeaderFont() const
get font of the header&#39;s frame
Definition: GNEFrame.cpp:583
FXHorizontalFrame * myHeaderFrame
fame for header elements
Definition: GNEFrame.h:343
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXCheckButton * myBlockMovementCheckButton
checkBox for block movement
Definition: GNEFrame.h:112
FXLabel * myInformationLabel
Label with information.
Definition: GNEFrame.h:281
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
Definition: GNEFrame.h:203
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:571
long onCmdSetBlockMovement(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:146
PositionVector myTemporalShapeShape
current drawed shape
Definition: GNEFrame.h:284
DrawingMode()
FOX needs this.
Definition: GNEFrame.h:265
GEOAttributes()
FOX needs this.
Definition: GNEFrame.h:175
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:337
GNEFrame::DrawingMode * myDrawingMode
drawing mode
Definition: GNEFrame.h:358
FXCheckButton * myBlockShapeCheckButton
checkBox for block shape
Definition: GNEFrame.h:121
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:340
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
A list of positions.
FXLabel * myFrameHeaderLabel
the label for the frame&#39;s header
Definition: GNEFrame.h:368
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
Definition: GNEFrame.h:191
bool isBlockShapeEnabled() const
check if block shape is enabled
Definition: GNEFrame.cpp:134
GNEFrame * myFrameParent
current GNEFrame parent
Definition: GNEFrame.h:179
FXButton * myAbortDrawingButton
button for abort drawing
Definition: GNEFrame.h:278
FXButton * myStopDrawingButton
button for stop drawing
Definition: GNEFrame.h:275
void setFrameWidth(int newWidth)
set width of GNEFrame
Definition: GNEFrame.cpp:564
FXLabel * myBlockMovementLabel
Label for block movement.
Definition: GNEFrame.h:109
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:540
GNEFrame::DrawingMode * getDrawingMode() const
get drawing mode editor
Definition: GNEFrame.cpp:609
long onCmdsetClosingShape(FXObject *, FXSelector, void *)
Called when the user change checkbox for open/closed polygon.
Definition: GNEFrame.cpp:168
~GNEFrame()
destructor
Definition: GNEFrame.cpp:534
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
Definition: GNEFrame.h:197
~NeteditAttributes()
destructor
Definition: GNEFrame.cpp:104
virtual void show()
show Frame
Definition: GNEFrame.cpp:546
GNEFrame::GEOAttributes * getGEOAttributes() const
get GEO Parameters editor
Definition: GNEFrame.cpp:599
GNEFrame * myFrameParent
GNEFrame parent.
Definition: GNEFrame.h:106
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
Definition: GNEFrame.h:188
FXLabel * myClosePolygonLabel
Label for open/close polygon.
Definition: GNEFrame.h:127
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:555
void hideNeteditAttributes()
hide NeteditAttributes
Definition: GNEFrame.cpp:122
GNEFrame::NeteditAttributes * getNeteditAttributes() const
get netedit attributes editor
Definition: GNEFrame.cpp:589
void showNeteditAttributes(bool shapeEditing)
show NeteditAttributes
Definition: GNEFrame.cpp:108
FXButton * myStartDrawingButton
button for start drawing
Definition: GNEFrame.h:272
FXCheckButton * myClosePolygonCheckButton
checkbox to enable/disable closing polygon
Definition: GNEFrame.h:130
FXHorizontalFrame * myClosePolygonFrame
Frame for open/close polygon.
Definition: GNEFrame.h:124
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:346
NeteditAttributes()
FOX needs this.
Definition: GNEFrame.h:102
bool isBlockMovementEnabled() const
check if block movement is enabled
Definition: GNEFrame.cpp:128