SUMO - Simulation of Urban MObility
GNEFrame.cpp
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 // The Widget for add additional elements
18 /****************************************************************************/
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
40 
41 #include "GNEFrame.h"
42 #include "GNEViewParent.h"
43 #include "GNEViewNet.h"
44 #include "GNEAttributeCarrier.h"
45 #include "GNEInspectorFrame.h"
46 #include "GNEPolygonFrame.h"
47 
48 // ===========================================================================
49 // FOX callback mapping
50 // ===========================================================================
51 
52 FXDEFMAP(GNEFrame::NeteditAttributes) GNEFrameNeteditAttributesMap[] = {
56 };
57 
58 FXDEFMAP(GNEFrame::GEOAttributes) GNEFrameGEOAttributes[] = {
61  FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrame::GEOAttributes::onCmdHelp),
62 };
63 
64 FXDEFMAP(GNEFrame::DrawingMode) GNEFrameDrawingModeMap[] = {
68 };
69 
70 // Object implementation
71 FXIMPLEMENT(GNEFrame::NeteditAttributes, FXGroupBox, GNEFrameNeteditAttributesMap, ARRAYNUMBER(GNEFrameNeteditAttributesMap))
72 FXIMPLEMENT(GNEFrame::GEOAttributes, FXGroupBox, GNEFrameGEOAttributes, ARRAYNUMBER(GNEFrameGEOAttributes))
73 FXIMPLEMENT(GNEFrame::DrawingMode, FXGroupBox, GNEFrameDrawingModeMap, ARRAYNUMBER(GNEFrameDrawingModeMap))
74 
75 
76 // ===========================================================================
77 // method definitions
78 // ===========================================================================
79 
80 // ---------------------------------------------------------------------------
81 // GNEFrame::NeteditAttributes - methods
82 // ---------------------------------------------------------------------------
83 
85  FXGroupBox(frameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame),
86  myFrameParent(frameParent) {
87  // Create Frame for block movement label and checkBox (By default disabled)
88  FXHorizontalFrame* blockMovement = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
89  myBlockMovementLabel = new FXLabel(blockMovement, "block move", 0, GUIDesignLabelAttribute);
90  myBlockMovementCheckButton = new FXCheckButton(blockMovement, "false", this, MID_GNE_ADDITIONALFRAME_BLOCKMOVEMENT, GUIDesignCheckButtonAttribute);
91  myBlockMovementCheckButton->setCheck(false);
92  // Create Frame for block shape label and checkBox (By default disabled)
93  myBlockShapeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
94  myBlockShapeLabel = new FXLabel(myBlockShapeFrame, "block shape", 0, GUIDesignLabelAttribute);
95  myBlockShapeCheckButton = new FXCheckButton(myBlockShapeFrame, "false", this, MID_GNE_SET_BLOCKING_SHAPE, GUIDesignCheckButtonAttribute);
96  // Create Frame for block close polygon and checkBox (By default disabled)
97  myClosePolygonFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
98  myClosePolygonLabel = new FXLabel(myClosePolygonFrame, "Close shape", 0, GUIDesignLabelAttribute);
99  myClosePolygonCheckButton = new FXCheckButton(myClosePolygonFrame, "false", this, MID_GNE_POLYGONFRAME_CLOSE, GUIDesignCheckButtonAttribute);
100  myBlockShapeCheckButton->setCheck(false);
101 }
102 
103 
105 
106 
107 void
109  // show block and closing sahpe depending of shapeEditing
110  if (shapeEditing) {
111  myBlockShapeFrame->show();
112  myClosePolygonFrame->show();
113  } else {
114  myBlockShapeFrame->hide();
115  myClosePolygonFrame->hide();
116  }
117  FXGroupBox::show();
118 }
119 
120 
121 void
123  FXGroupBox::hide();
124 }
125 
126 
127 bool
129  return myBlockMovementCheckButton->getCheck() == 1 ? true : false;
130 }
131 
132 
133 bool
135  return myBlockShapeCheckButton->getCheck() == 1 ? true : false;
136 }
137 
138 
139 bool
141  return myClosePolygonCheckButton->getCheck() == 1 ? true : false;
142 }
143 
144 
145 long
147  if (myBlockMovementCheckButton->getCheck()) {
148  myBlockMovementCheckButton->setText("true");
149  } else {
150  myBlockMovementCheckButton->setText("false");
151  }
152  return 1;
153 }
154 
155 
156 long
157 GNEFrame::NeteditAttributes::onCmdSetBlockShape(FXObject*, FXSelector, void*) {
158  if (myBlockShapeCheckButton->getCheck()) {
159  myBlockShapeCheckButton->setText("true");
160  } else {
161  myBlockShapeCheckButton->setText("false");
162  }
163  return 1;
164 }
165 
166 
167 long
169  if (myClosePolygonCheckButton->getCheck()) {
170  myClosePolygonCheckButton->setText("true");
171  } else {
172  myClosePolygonCheckButton->setText("false");
173  }
174  return 1;
175 }
176 
177 // ---------------------------------------------------------------------------
178 // GNEFrame::GEOAttributes - methods
179 // ---------------------------------------------------------------------------
180 
182  FXGroupBox(frameParent->myContentFrame, "GEO Attributes", GUIDesignGroupBoxFrame),
183  myFrameParent(frameParent) {
184 
185  // Create Frame for GEOAttribute
186  myGEOAttributeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
187  myGEOAttributeLabel = new FXLabel(myGEOAttributeFrame, "Undefined GEO Attribute", 0, GUIDesignLabelAttribute);
189 
190  // Create Frame for use GEO
191  myUseGEOFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
192  myUseGEOLabel = new FXLabel(myUseGEOFrame, "Use GEO", 0, GUIDesignLabelAttribute);
194 
195  // Create help button
196  myHelpButton = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
197 }
198 
199 
201 
202 
203 void
204 GNEFrame::GEOAttributes::showGEOAttributes(const std::vector<GNEAttributeCarrier*>& ACs) {
205  // make sure that ACs has elements
206  if (ACs.size() > 0) {
207  // set myACs with the inspected elements
208  myACs = ACs;
209  if (ACs.front()->getTag() == SUMO_TAG_POLY) {
211  // set label name
212  myGEOAttributeLabel->setText(toString(myGEOAttribute).c_str());
213  // fill attributes using refresh attributes
215  // show FXGroupBox
216  FXGroupBox::show();
217  } else if (ACs.front()->getTag() == SUMO_TAG_POI) {
219  // set label name
220  myGEOAttributeLabel->setText(toString(myGEOAttribute).c_str());
221  // fill attributes using refresh attributes
223  // show FXGroupBox
224  FXGroupBox::show();
225  } else {
226  // hide GEO Attributes
228  }
229  } else {
230  // hide GEO Attributes
232  }
233 }
234 
235 
236 void
238  myACs.clear();
240  // hide FXGroupBox
241  FXGroupBox::hide();
242 }
243 
244 
245 void
247  // only refresh element if myACs has elements
248  if (myACs.size() > 0) {
249  // hide GEOAttribute Frame
250  myGEOAttributeFrame->hide();
251  // check if we're handling a single or multiple selection
252  if (myACs.size() > 1) {
253  // only useGEO can be changed in multiple selections
254  bool useGEO = true;
255  for (auto i : myACs) {
256  useGEO &= GNEAttributeCarrier::parse<bool>(i->getAttribute(SUMO_ATTR_GEO));
257  }
258  myUseGEOCheckButton->setCheck(useGEO);
259  } else {
260  myUseGEOCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(myACs.front()->getAttribute(SUMO_ATTR_GEO)));
261  // show GEO Attribute (GNEShape or GNEPosition)
262  myGEOAttributeFrame->show();
263  myGEOAttributeTextField->setText(myACs.front()->getAttribute(myGEOAttribute).c_str());
264  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
265  }
266  // set text orf GEO button
267  if (myUseGEOCheckButton->getCheck()) {
268  myUseGEOCheckButton->setText("true");
269  } else {
270  myUseGEOCheckButton->setText("false");
271  }
272  }
273 }
274 
275 
276 std::map<SumoXMLAttr, std::string>
278  std::map<SumoXMLAttr, std::string> attributes;
279  // fill map with the GEO Attributes
280  attributes[myGEOAttribute] = myGEOAttributeTextField->getText().text();
281  attributes[SUMO_ATTR_GEO] = myUseGEOCheckButton->getCheck() ? "true" : "false";
282  return attributes;
283 }
284 
285 
286 long
287 GNEFrame::GEOAttributes::onCmdSetGEOAttribute(FXObject*, FXSelector, void*) {
288  if (myGEOAttributeTextField->getText().empty()) {
289  WRITE_WARNING("GEO Shapes cannot be empty.");
290  } else if (myACs.front()->isValid(myGEOAttribute, myGEOAttributeTextField->getText().text())) {
291  myACs.front()->setAttribute(myGEOAttribute, myGEOAttributeTextField->getText().text(), myFrameParent->getViewNet()->getUndoList());
292  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
293  } else {
294  myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
295  myGEOAttributeTextField->killFocus();
296  }
297  // refresh values of current inspected item (because attribute shape changes)
299  return 0;
300 }
301 
302 
303 long
304 GNEFrame::GEOAttributes::onCmdUseGEOParameters(FXObject*, FXSelector, void*) {
305  // change label of Check button depending of check
306  if (myUseGEOCheckButton->getCheck()) {
307  myUseGEOCheckButton->setText("true");
308  } else {
309  myUseGEOCheckButton->setText("false");
310  }
311  // update GEO Attribute of entire selection
312  for (auto i : myACs) {
313  i->setAttribute(SUMO_ATTR_GEO, myUseGEOCheckButton->getText().text(), myFrameParent->getViewNet()->getUndoList());
314  }
315  return 1;
316 }
317 
318 
319 long
320 GNEFrame::GEOAttributes::onCmdHelp(FXObject*, FXSelector, void*) {
321  FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox);
322  std::ostringstream help;
323  help
324  << " SUMO uses the World Geodetic System 84 (WGS84/UTM).\n"
325  << " For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n"
326  << " in decimal degrees without extra symbols. (N,W..)\n"
327  << " - Longitude: East-west position of a point on the Earth's surface.\n"
328  << " - Latitude: North-south position of a point on the Earth's surface.\n"
329  << " - CheckBox 'use GEO' enables or disables saving position in GEO coordinates\n";
330  new FXLabel(helpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation);
331  // "OK"
332  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
333  helpDialog->create();
334  helpDialog->show();
335  return 1;
336 }
337 
338 // ---------------------------------------------------------------------------
339 // GNEFrame::DrawingMode - methods
340 // ---------------------------------------------------------------------------
341 
343  FXGroupBox(frameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame),
344  myFrameParent(frameParent) {
345  // create start and stop buttons
346  myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_POLYGONFRAME_STARTDRAWING, GUIDesignButton);
347  myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_POLYGONFRAME_STOPDRAWING, GUIDesignButton);
348  myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_POLYGONFRAME_ABORTDRAWING, GUIDesignButton);
349 
350  // create information label
351  std::ostringstream information;
352  information
353  << "- 'Start drawing' or ENTER\n"
354  << " draws polygon boundary.\n"
355  << "- 'Stop drawing' or ENTER\n"
356  << " creates polygon.\n"
357  << "- 'Abort drawing' or ESC\n"
358  << " removes drawed polygon.";
359  myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation);
360  // disable stop and abort functions as init
361  myStopDrawingButton->disable();
362  myAbortDrawingButton->disable();
363 }
364 
365 
367 
368 
370  // abort current drawing before show
371  abortDrawing();
372  // show FXGroupBox
373  FXGroupBox::show();
374 }
375 
376 
378  // abort current drawing before hide
379  abortDrawing();
380  // show FXGroupBox
381  FXGroupBox::hide();
382 }
383 
384 
385 void
387  // Only start drawing if DrawingMode modul is shown
388  if (shown()) {
389  // change buttons
390  myStartDrawingButton->disable();
391  myStopDrawingButton->enable();
392  myAbortDrawingButton->enable();
393  }
394 }
395 
396 
397 void
399  // check if shape has to be closed
402  }
403  // try to build polygon
408  if (dynamic_cast<GNEPolygonFrame*>(myFrameParent)->buildPoly(myTemporalShapeShape)) {
409  // clear created points
410  myTemporalShapeShape.clear();
411  myFrameParent->getViewNet()->update();
412  // change buttons
413  myStartDrawingButton->enable();
414  myStopDrawingButton->disable();
415  myAbortDrawingButton->disable();
416  } else {
417  // abort drawing if polygon cannot be created
418  abortDrawing();
419  }
420 }
421 
422 
423 void
425  // clear created points
426  myTemporalShapeShape.clear();
427  myFrameParent->getViewNet()->update();
428  // change buttons
429  myStartDrawingButton->enable();
430  myStopDrawingButton->disable();
431  myAbortDrawingButton->disable();
432 }
433 
434 
435 void
437  if (myStopDrawingButton->isEnabled()) {
438  myTemporalShapeShape.push_back(P);
439  } else {
440  throw ProcessError("A new point cannot be added if drawing wasn't started");
441  }
442 }
443 
444 
445 void
447  if (myStopDrawingButton->isEnabled()) {
448  if (myTemporalShapeShape.size() > 0) {
449  myTemporalShapeShape.pop_back();
450  }
451  } else {
452  throw ProcessError("Last point cannot be removed if drawing wasn't started");
453  }
454 }
455 
456 
457 const PositionVector&
459  return myTemporalShapeShape;
460 }
461 
462 
463 bool
465  return myStopDrawingButton->isEnabled();
466 }
467 
468 
469 long
470 GNEFrame::DrawingMode::onCmdStartDrawing(FXObject*, FXSelector, void*) {
471  startDrawing();
472  return 0;
473 }
474 
475 
476 long
477 GNEFrame::DrawingMode::onCmdStopDrawing(FXObject*, FXSelector, void*) {
478  stopDrawing();
479  return 0;
480 }
481 
482 
483 long
484 GNEFrame::DrawingMode::onCmdAbortDrawing(FXObject*, FXSelector, void*) {
485  abortDrawing();
486  return 0;
487 }
488 
489 // ---------------------------------------------------------------------------
490 // GNEFrame - methods
491 // ---------------------------------------------------------------------------
492 
493 GNEFrame::GNEFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, const std::string& frameLabel) :
494  FXVerticalFrame(horizontalFrameParent, GUIDesignAuxiliarFrame),
495  myViewNet(viewNet),
496  myNeteditAttributes(NULL),
497  myGEOAttributes(NULL),
498  myDrawingMode(NULL) {
499 
500  // Create font
501  myFrameHeaderFont = new FXFont(getApp(), "Arial", 14, FXFont::Bold),
502 
503  // Create frame for header
504  myHeaderFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
505 
506  // Create frame for left elements of header (By default unused)
508  myHeaderLeftFrame->hide();
509 
510  // Create titel frame
511  myFrameHeaderLabel = new FXLabel(myHeaderFrame, frameLabel.c_str(), 0, GUIDesignLabelFrameInformation);
512 
513  // Create frame for right elements of header (By default unused)
515  myHeaderRightFrame->hide();
516 
517  // Add separator
518  new FXHorizontalSeparator(this, GUIDesignHorizontalSeparator);
519 
520  // Create frame for contents
521  myScrollWindowsContents = new FXScrollWindow(this, GUIDesignContentsScrollWindow);
522 
523  // Create frame for contents
525 
526  // Set font of header
528 
529  // Hide Frame
530  FXVerticalFrame::hide();
531 }
532 
533 
535  delete myFrameHeaderFont;
536 }
537 
538 
539 void
541  myFrameHeaderLabel->setFocus();
542 }
543 
544 
545 void
547  // show scroll window
548  FXVerticalFrame::show();
549  // Show and update Frame Area in which this GNEFrame is placed
551 }
552 
553 
554 void
556  // hide scroll window
557  FXVerticalFrame::hide();
558  // Hide Frame Area in which this GNEFrame is placed
560 }
561 
562 
563 void
564 GNEFrame::setFrameWidth(int newWidth) {
565  setWidth(newWidth);
566  myScrollWindowsContents->setWidth(newWidth);
567 }
568 
569 
570 GNEViewNet*
572  return myViewNet;
573 }
574 
575 
576 FXLabel*
578  return myFrameHeaderLabel;
579 }
580 
581 
582 FXFont*
584  return myFrameHeaderFont;
585 }
586 
587 
590  if (myNeteditAttributes) {
591  return myNeteditAttributes;
592  } else {
593  throw ProcessError("Netedit Attributes editor wasn't created");
594  }
595 }
596 
597 
600  if (myGEOAttributes) {
601  return myGEOAttributes;
602  } else {
603  throw ProcessError("GEO Attributes editor wasn't created");
604  }
605 }
606 
607 
610  if (myDrawingMode) {
611  return myDrawingMode;
612  } else {
613  throw ProcessError("Drawing Mode editor wasn't created");
614  }
615 }
616 
617 /****************************************************************************/
GNEFrame()
FOX needs this.
Definition: GNEFrame.h:334
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
Definition: GNEFrame.cpp:484
void showDrawingMode()
show Drawing mode
Definition: GNEFrame.cpp:369
long onCmdUseGEOParameters(FXObject *, FXSelector, void *)
Called when user enters a new length.
Definition: GNEFrame.cpp:304
FXLabel * myUseGEOLabel
Label for use GEO.
Definition: GNEFrame.h:200
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
std::vector< GNEAttributeCarrier * > myACs
current edited ACs
Definition: GNEFrame.h:185
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:116
void hideFramesArea()
hide frames area if all GNEFrames are hidden
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
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:577
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEFrame.cpp:320
bool isCloseShapeEnabled() const
check if clse shape is enabled
Definition: GNEFrame.cpp:140
void refreshValues()
Refresh inspected values (used when values can be changed externally by other modul) ...
FXFont * myFrameHeaderFont
Font for the Header.
Definition: GNEFrame.h:365
void stopDrawing()
stop drawing and create polygon or
Definition: GNEFrame.cpp:398
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
GNEViewParent * getViewParent() const
get the net object
void showFramesArea()
show frames area if at least a GNEFrame is showed
FXHorizontalFrame * myBlockShapeFrame
frame for Block shape
Definition: GNEFrame.h:115
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
Definition: GNEFrame.h:194
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
Definition: GUIDesigns.h:255
GNEFrame::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEFrame.h:352
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
Definition: GNEFrame.h:362
void abortDrawing()
abort drawing
Definition: GNEFrame.cpp:424
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
begin/end of the description of a Point of interest
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
Definition: GNEFrame.cpp:477
stop drawing polygon
Definition: GUIAppEnum.h:677
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
help button
Definition: GUIAppEnum.h:396
void removeLastPoint()
remove last added point
Definition: GNEFrame.cpp:446
void hideDrawingMode()
hide Drawing mode
Definition: GNEFrame.cpp:377
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:571
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
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
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrame.cpp:458
GEOAttributes()
FOX needs this.
Definition: GNEFrame.h:175
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:337
void refreshGEOAttributes()
refresh TextFields with the new GEO Attributes
Definition: GNEFrame.cpp:246
GNEFrame::DrawingMode * myDrawingMode
drawing mode
Definition: GNEFrame.h:358
long onCmdStartDrawing(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:470
GNEUndoList * getUndoList() const
get the undoList object
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:243
FXCheckButton * myBlockShapeCheckButton
checkBox for block shape
Definition: GNEFrame.h:121
set GEO Attribute
Definition: GUIAppEnum.h:519
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:283
#define GUIDesignTextField
Definition: GUIDesigns.h:40
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
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
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrame.cpp:436
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:246
#define GUIDesignContentsScrollWindow
design for the content frame of every frame
Definition: GUIDesigns.h:240
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
start drawing polygon
Definition: GUIAppEnum.h:675
invalid attribute
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
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:540
GNEFrame::DrawingMode * getDrawingMode() const
get drawing mode editor
Definition: GNEFrame.cpp:609
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:182
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
Definition: GUIDesigns.h:62
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
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:49
~NeteditAttributes()
destructor
Definition: GNEFrame.cpp:104
#define GUIDesignButton
Definition: GUIDesigns.h:56
virtual void show()
show Frame
Definition: GNEFrame.cpp:546
#define GUIDesignDialogBox
Definition: GUIDesigns.h:395
GNEFrame::GEOAttributes * getGEOAttributes() const
get GEO Parameters editor
Definition: GNEFrame.cpp:599
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:221
GNEFrame * myFrameParent
GNEFrame parent.
Definition: GNEFrame.h:106
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
Definition: GNEFrame.h:188
attribute block movement
Definition: GUIAppEnum.h:639
void hideGEOAttributes()
hide GEOAttributes
Definition: GNEFrame.cpp:237
~GEOAttributes()
destructor
Definition: GNEFrame.cpp:200
enable or disable use GEO
Definition: GUIAppEnum.h:521
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:555
attribute block shape
Definition: GUIAppEnum.h:528
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
#define GUIDesignButtonOK
Definition: GUIDesigns.h:97
~DrawingMode()
destructor
Definition: GNEFrame.cpp:366
void startDrawing()
start drawing
Definition: GNEFrame.cpp:386
std::map< SumoXMLAttr, std::string > getGEOAttributes() const
get GEO Attributes
Definition: GNEFrame.cpp:277
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:164
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrame.cpp:464
void closePolygon()
ensures that the last position equals the first
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXCheckButton * myClosePolygonCheckButton
checkbox to enable/disable closing polygon
Definition: GNEFrame.h:130
FXHorizontalFrame * myClosePolygonFrame
Frame for open/close polygon.
Definition: GNEFrame.h:124
FXDEFMAP(GNEFrame::NeteditAttributes) GNEFrameNeteditAttributesMap[]
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:346
enable or disable closing polygon after drawing
Definition: GUIAppEnum.h:681
bool isBlockMovementEnabled() const
check if block movement is enabled
Definition: GNEFrame.cpp:128
begin/end of the description of a polygon
void showGEOAttributes(const std::vector< GNEAttributeCarrier *> &ACs)
show GEOAttribute for the current AttributeCarriers
Definition: GNEFrame.cpp:204
abort drawing polygon
Definition: GUIAppEnum.h:679
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
Definition: GNEFrame.cpp:287