SUMO - Simulation of Urban MObility
GNEPolygonFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for add polygons
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
41 #include <utils/gui/div/GLHelper.h>
43 
44 #include "GNEPolygonFrame.h"
45 #include "GNEViewNet.h"
46 #include "GNEViewParent.h"
47 #include "GNENet.h"
48 #include "GNEUndoList.h"
49 #include "GNEChange_Selection.h"
50 #include "GNEAttributeCarrier.h"
51 #include "GNEPoly.h"
52 #include "GNEPOI.h"
53 #include "GNEChange_Poly.h"
54 #include "GNEChange_POI.h"
55 
56 
57 
58 // ===========================================================================
59 // FOX callback mapping
60 // ===========================================================================
61 
62 FXDEFMAP(GNEPolygonFrame) GNEShapeMap[] = {
64 };
65 
66 FXDEFMAP(GNEPolygonFrame::ShapeAttributeSingle) GNESingleShapeParameterMap[] = {
70 };
71 
72 FXDEFMAP(GNEPolygonFrame::ShapeAttributes) GNEAdditionalParametersMap[] = {
74 };
75 
76 FXDEFMAP(GNEPolygonFrame::NeteditAttributes) GNEEditorParametersMap[] = {
80 };
81 
82 FXDEFMAP(GNEPolygonFrame::DrawingMode) GNEDrawingModeMap[] = {
86 };
87 
88 // Object implementation
89 FXIMPLEMENT(GNEPolygonFrame, FXVerticalFrame, GNEShapeMap, ARRAYNUMBER(GNEShapeMap))
90 FXIMPLEMENT(GNEPolygonFrame::ShapeAttributeSingle, FXHorizontalFrame, GNESingleShapeParameterMap, ARRAYNUMBER(GNESingleShapeParameterMap))
91 FXIMPLEMENT(GNEPolygonFrame::ShapeAttributes, FXGroupBox, GNEAdditionalParametersMap, ARRAYNUMBER(GNEAdditionalParametersMap))
92 FXIMPLEMENT(GNEPolygonFrame::NeteditAttributes, FXGroupBox, GNEEditorParametersMap, ARRAYNUMBER(GNEEditorParametersMap))
93 FXIMPLEMENT(GNEPolygonFrame::DrawingMode, FXGroupBox, GNEDrawingModeMap, ARRAYNUMBER(GNEDrawingModeMap))
94 
95 // ===========================================================================
96 // method definitions
97 // ===========================================================================
98 
99 GNEPolygonFrame::GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
100  GNEFrame(horizontalFrameParent, viewNet, "Shapes"),
101  myActualShapeType(SUMO_TAG_NOTHING) {
102 
103  // Create groupBox for myShapeMatchBox
104  myGroupBoxForMyShapeMatchBox = new FXGroupBox(myContentFrame, "Shape element", GUIDesignGroupBoxFrame);
105 
106  // Create FXListBox in myGroupBoxForMyShapeMatchBox
107  myShapeMatchBox = new FXComboBox(myGroupBoxForMyShapeMatchBox, GUIDesignComboBoxNCol, this, MID_GNE_MODE_ADDITIONAL_ITEM, GUIDesignComboBox);
108 
109  // Create additional parameters
110  myShapeAttributes = new GNEPolygonFrame::ShapeAttributes(myViewNet, myContentFrame);
111 
112  // Create Netedit parameter
113  myEditorParameters = new GNEPolygonFrame::NeteditAttributes(myContentFrame);
114 
115  // Create drawing controls
116  myDrawingMode = new GNEPolygonFrame::DrawingMode(this);
117 
118  // Add options to myShapeMatchBox
119  for (auto i : GNEAttributeCarrier::allowedShapeTags()) {
120  myShapeMatchBox->appendItem(toString(i).c_str());
121  }
122 
123  // Set visible items
124  myShapeMatchBox->setNumVisible((int)myShapeMatchBox->getNumItems());
125 
126  // If there are additionals
127  if (GNEAttributeCarrier::allowedShapeTags().size() > 0) {
128  // Set myActualShapeType and show
129  myActualShapeType = GNEAttributeCarrier::allowedShapeTags().front();
130  setParametersOfShape(myActualShapeType);
131  // show drawing controls if we're creating a polygon
132  if (myActualShapeType == SUMO_TAG_POLY) {
133  myDrawingMode->show();
134  } else {
135  myDrawingMode->hide();
136  }
137  }
138 }
139 
140 
143 }
144 
145 
147 GNEPolygonFrame::processClick(const Position& clickedPosition) {
148  // check if current selected additional is valid
150 
151  // show warning dialogbox and stop check if input parameters are valid
152  if (myShapeAttributes->areValuesValid() == false) {
154  return ADDSHAPE_INVALID;
155  }
156 
157  // Declare map to keep values
158  std::map<SumoXMLAttr, std::string> valuesOfElement = myShapeAttributes->getAttributesAndValues();
159 
160  // generate new ID
161  valuesOfElement[SUMO_ATTR_ID] = myViewNet->getNet()->generatePOIID();
162 
163  // obtain position
164  valuesOfElement[SUMO_ATTR_POSITION] = toString(clickedPosition);
165 
166  // obtain block movement value
168 
169  // return ADDSHAPE_SUCCESS if POI was sucesfully created
170  if (addPOI(valuesOfElement)) {
171  return ADDSHAPE_SUCCESS;
172  } else {
173  return ADDSHAPE_INVALID;
174  }
175  } else if (myActualShapeType == SUMO_TAG_POLY) {
176  if (myDrawingMode->isDrawing()) {
177  myDrawingMode->addNewPoint(clickedPosition);
178  return ADDSHAPE_NEWPOINT;
179  } else {
180  // return ADDSHAPE_NOTHING if is drawing isn't enabled
181  return ADDSHAPE_NOTHING;
182  }
183  } else {
184  myViewNet->setStatusBarText("Current selected shape isn't valid.");
185  return ADDSHAPE_INVALID;
186  }
187 }
188 
189 
190 bool
192  // show warning dialogbox and stop check if input parameters are valid
193  if (myShapeAttributes->areValuesValid() == false) {
195  return false;
196  } else {
197  // Declare map to keep values
198  std::map<SumoXMLAttr, std::string> valuesOfElement = myShapeAttributes->getAttributesAndValues();
199 
200  // generate new ID
201  valuesOfElement[SUMO_ATTR_ID] = myViewNet->getNet()->generatePolyID();
202 
203  // obtain position
204  valuesOfElement[SUMO_ATTR_SHAPE] = toString(drawedShape);
205 
206  // obtain block movement value
208 
209  // obtain block shape value
211 
212  // return ADDSHAPE_SUCCESS if POI was sucesfully created
213  return addPolygon(valuesOfElement);
214  }
215 }
216 
217 
220  return myEditorParameters;
221 }
222 
223 
226  return myDrawingMode;
227 }
228 
229 
230 long
231 GNEPolygonFrame::onCmdSelectShape(FXObject*, FXSelector, void*) {
232  // Flag to save if name is valid
233  bool additionalNameCorrect = false;
234  // set parameters of additional, if it's correct
235  for (auto i : GNEAttributeCarrier::allowedShapeTags()) {
236  if (toString(i) == myShapeMatchBox->getText().text()) {
237  myShapeMatchBox->setTextColor(FXRGB(0, 0, 0));
238  myShapeAttributes->show();
241  additionalNameCorrect = true;
242  }
243  }
244  // if additional name isn't correct, hidde all
245  if (additionalNameCorrect == false) {
247  myShapeMatchBox->setTextColor(FXRGB(255, 0, 0));
248  myShapeAttributes->hide();
250  myDrawingMode->hide();
251  } else {
252  // show drawing controls if we're creating a polygon
254  myDrawingMode->show();
255  } else {
256  myDrawingMode->hide();
257  }
258  }
259  return 1;
260 }
261 
262 
263 void
265  // Set new actualShapeType
266  myActualShapeType = actualShapeType;
267  // Clear internal attributes
269  // Iterate over attributes of myActualShapeType
273  }
274  }
275  // if there are parmeters, show and Recalc groupBox
278  } else {
280  }
281 }
282 
283 
284 bool
285 GNEPolygonFrame::addPolygon(const std::map<SumoXMLAttr, std::string>& polyValues) {
286  bool ok = true;
287  // parse attributes from polyValues
288  std::string id = polyValues.at(SUMO_ATTR_ID);
289  std::string type = polyValues.at(SUMO_ATTR_TYPE);
290  RGBColor color = RGBColor::parseColor(polyValues.at(SUMO_ATTR_COLOR));
291  double layer = GNEAttributeCarrier::parse<double>(polyValues.at(SUMO_ATTR_LAYER));
292  double angle = GNEAttributeCarrier::parse<double>(polyValues.at(SUMO_ATTR_ANGLE));
293  std::string imgFile = polyValues.at(SUMO_ATTR_IMGFILE);
294  PositionVector shape = GeomConvHelper::parseShapeReporting(polyValues.at(SUMO_ATTR_SHAPE), "user-supplied position", 0, ok, true);
295  bool fill = GNEAttributeCarrier::parse<bool>(polyValues.at(SUMO_ATTR_FILL));
296 
297  // create new Polygon only if number of shape points is greather than 2
299  if ((shape.size() > 0) && myViewNet->getNet()->addPolygon(id, type, color, layer, angle, imgFile, shape, fill)) {
300  // set manually attributes block movement and block shapes
301  GNEPoly* polygon = myViewNet->getNet()->retrievePolygon(id);
305  return true;
306  } else {
307  // abort creation
309  return false;
310  }
311 }
312 
313 
314 bool
315 GNEPolygonFrame::addPOI(const std::map<SumoXMLAttr, std::string>& POIValues) {
316  bool ok = true;
317  // parse attributes from POIValues
318  std::string id = POIValues.at(SUMO_ATTR_ID);
319  std::string type = POIValues.at(SUMO_ATTR_TYPE);
320  RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR));
321  double layer = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_LAYER));
322  double angle = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_ANGLE));
323  std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE);
324  Position pos = GeomConvHelper::parseShapeReporting(POIValues.at(SUMO_ATTR_POSITION), "netedit-given", 0, ok, false)[0];
325  double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_WIDTH));
326  double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_HEIGHT));
327 
328  // create new POI
330  if (myViewNet->getNet()->addPOI(id, type, color, layer, angle, imgFile, pos, widthPOI, heightPOI)) {
331  // Set manually the attribute block movement
332  GNEPOI* poi = myViewNet->getNet()->retrievePOI(id);
335  return true;
336  } else {
337  // abort creation
339  return false;
340  }
341 }
342 
343 // ---------------------------------------------------------------------------
344 // GNEPolygonFrame::DrawingMode - methods
345 // ---------------------------------------------------------------------------
346 
348  FXGroupBox(polygonFrameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame),
349  myPolygonFrameParent(polygonFrameParent) {
350  // create start and stop buttons
351  myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_MODE_POLYGON_START, GUIDesignButton);
352  myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_MODE_POLYGON_STOP, GUIDesignButton);
353  myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_MODE_POLYGON_ABORT, GUIDesignButton);
354 
355  // create information label
356  std::ostringstream information;
357  information
358  << "- 'Start drawing' or ENTER\n"
359  << " draws polygon boundary.\n"
360  << "- 'Stop drawing' or ENTER\n"
361  << " creates polygon.\n"
362  << "- 'Abort drawing' or ESC\n"
363  << " removes drawed polygon.";
364  myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelLeft);
365  // disable stop and abort functions as init
366  myStopDrawingButton->disable();
367  myAbortDrawingButton->disable();
368 }
369 
370 
372 
373 
375  // abort current drawing before show
376  abortDrawing();
377  // show FXGroupBox
378  FXGroupBox::show();
379 }
380 
381 
383  // abort current drawing before hide
384  abortDrawing();
385  // show FXGroupBox
386  FXGroupBox::hide();
387 }
388 
389 
390 void
392  // change buttons
393  myStartDrawingButton->disable();
394  myStopDrawingButton->enable();
395  myAbortDrawingButton->enable();
396 }
397 
398 
399 void
401  // check if shape has to be closed
404  }
405  // try to build polygon
407  // clear created points
408  myTemporalShapeShape.clear();
409  myPolygonFrameParent->getViewNet()->update();
410  // change buttons
411  myStartDrawingButton->enable();
412  myStopDrawingButton->disable();
413  myAbortDrawingButton->disable();
414  } else {
415  // abort drawing if poligion cannot be created
416  abortDrawing();
417  }
418 }
419 
420 
421 void
423  // clear created points
424  myTemporalShapeShape.clear();
425  myPolygonFrameParent->getViewNet()->update();
426  // change buttons
427  myStartDrawingButton->enable();
428  myStopDrawingButton->disable();
429  myAbortDrawingButton->disable();
430 }
431 
432 
433 void
435  if (myStopDrawingButton->isEnabled()) {
436  myTemporalShapeShape.push_back(P);
437  } else {
438  throw ProcessError("A new point cannot be added if drawing wasn't started");
439  }
440 }
441 
442 
443 void
445  if (myStopDrawingButton->isEnabled()) {
446  if (myTemporalShapeShape.size() > 0) {
447  myTemporalShapeShape.pop_back();
448  }
449  } else {
450  throw ProcessError("Last point cannot be removed if drawing wasn't started");
451  }
452 }
453 
454 
455 const PositionVector&
457  return myTemporalShapeShape;
458 }
459 
460 
461 bool
463  return myStopDrawingButton->isEnabled();
464 }
465 
466 
467 long
468 GNEPolygonFrame::DrawingMode::onCmdStartDrawing(FXObject*, FXSelector, void*) {
469  startDrawing();
470  return 0;
471 }
472 
473 
474 long
475 GNEPolygonFrame::DrawingMode::onCmdStopDrawing(FXObject*, FXSelector, void*) {
476  stopDrawing();
477  return 0;
478 }
479 
480 
481 long
482 GNEPolygonFrame::DrawingMode::onCmdAbortDrawing(FXObject*, FXSelector, void*) {
483  abortDrawing();
484  return 0;
485 }
486 
487 
488 void
490  // Show frame
491  GNEFrame::show();
492 }
493 
494 // ---------------------------------------------------------------------------
495 // GNEPolygonFrame::ShapeAttributeSingle - methods
496 // ---------------------------------------------------------------------------
497 
499  FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame),
500  myShapeTag(SUMO_TAG_NOTHING),
501  myShapeAttr(SUMO_ATTR_NOTHING) {
502  // Create visual elements
503  myLabel = new FXLabel(this, "name", 0, GUIDesignLabelAttribute);
504  mycolorEditor = new FXButton(this, "ColorButton", 0, this, MID_GNE_OPEN_ATTRIBUTE_EDITOR, GUIDesignButtonAttribute);
509  // Hide elements
510  hideParameter();
511 }
512 
513 
515 
516 
517 void
518 GNEPolygonFrame::ShapeAttributeSingle::showParameter(SumoXMLTag additionalTag, SumoXMLAttr additionalAttr, std::string value) {
519  myShapeTag = additionalTag;
520  myShapeAttr = additionalAttr;
521  myInvalidValue = "";
522  myLabel->setText(toString(myShapeAttr).c_str());
523  myLabel->show();
524  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
525  myTextFieldStrings->setText(value.c_str());
526  myTextFieldStrings->show();
527  show();
528 }
529 
530 
531 void
533  myShapeTag = additionalTag;
534  myShapeAttr = additionalAttr;
535  myInvalidValue = "";
536  myLabel->setText(toString(myShapeAttr).c_str());
537  myLabel->show();
538  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
539  myTextFieldInt->setText(toString(value).c_str());
540  myTextFieldInt->show();
541  show();
542 }
543 
544 
545 void
547  myShapeTag = additionalTag;
548  myShapeAttr = additionalAttr;
549  myInvalidValue = "";
550  myLabel->setText(toString(myShapeAttr).c_str());
551  myLabel->show();
552  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
553  myTextFieldReal->setText(toString(value).c_str());
554  myTextFieldReal->show();
555  show();
556 }
557 
558 
559 void
561  myShapeTag = additionalTag;
562  myShapeAttr = additionalAttr;
563  myInvalidValue = "";
564  myLabel->setText(toString(myShapeAttr).c_str());
565  myLabel->show();
566  if (value) {
567  myBoolCheckButton->setCheck(true);
568  myBoolCheckButton->setText("true");
569  } else {
570  myBoolCheckButton->setCheck(false);
571  myBoolCheckButton->setText("false");
572  }
573  myBoolCheckButton->show();
574  show();
575 }
576 
577 
578 void
580  myShapeTag = additionalTag;
581  myShapeAttr = additionalAttr;
582  myInvalidValue = "";
583  mycolorEditor->setText(toString(myShapeAttr).c_str());
584  mycolorEditor->show();
585  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
586  myTextFieldStrings->setText(toString(value).c_str());
587  myTextFieldStrings->show();
588  show();
589 }
590 
591 
592 void
596  myLabel->hide();
597  myTextFieldInt->hide();
598  myTextFieldReal->hide();
599  myTextFieldStrings->hide();
600  myBoolCheckButton->hide();
601  mycolorEditor->hide();
602  hide();
603 }
604 
605 
608  return myShapeTag;
609 }
610 
611 
614  return myShapeAttr;
615 }
616 
617 
618 std::string
621  return (myBoolCheckButton->getCheck() == 1) ? "true" : "false";
623  return myTextFieldInt->getText().text();
625  return myTextFieldReal->getText().text();
626  } else {
627  return myTextFieldStrings->getText().text();
628  }
629 }
630 
631 
632 const std::string&
634  return myInvalidValue;
635 }
636 
637 
638 long
640  // We assume that current value is valid
641  myInvalidValue = "";
642  // Check if format of current value of myTextField is correct
644  if (GNEAttributeCarrier::canParse<int>(myTextFieldInt->getText().text())) {
645  // convert string to int
646  int intValue = GNEAttributeCarrier::parse<int>(myTextFieldInt->getText().text());
647  // Check if int value must be positive
648  if (GNEAttributeCarrier::isPositive(myShapeTag, myShapeAttr) && (intValue < 0)) {
649  myInvalidValue = "'" + toString(myShapeAttr) + "' cannot be negative";
650  }
651  } else {
652  myInvalidValue = "'" + toString(myShapeAttr) + "' doesn't have a valid 'int' format";
653  }
655  // time attributes work as positive doubles
656  if (GNEAttributeCarrier::canParse<double>(myTextFieldReal->getText().text())) {
657  // convert string to double
658  double doubleValue = GNEAttributeCarrier::parse<double>(myTextFieldReal->getText().text());
659  // Check if parsed value is negative
660  if (doubleValue < 0) {
661  myInvalidValue = "'" + toString(myShapeAttr) + "' cannot be negative";
662  }
663  } else {
664  myInvalidValue = "'" + toString(myShapeAttr) + "' doesn't have a valid 'time' format";
665  }
667  if (GNEAttributeCarrier::canParse<double>(myTextFieldReal->getText().text())) {
668  // convert string to double
669  double doubleValue = GNEAttributeCarrier::parse<double>(myTextFieldReal->getText().text());
670  // Check if double value must be positive
671  if (GNEAttributeCarrier::isPositive(myShapeTag, myShapeAttr) && (doubleValue < 0)) {
672  myInvalidValue = "'" + toString(myShapeAttr) + "' cannot be negative";
673  // check if double value is a probability
674  } else if (GNEAttributeCarrier::isProbability(myShapeTag, myShapeAttr) && ((doubleValue < 0) || doubleValue > 1)) {
675  myInvalidValue = "'" + toString(myShapeAttr) + "' takes only values between 0 and 1";
676  }
677  } else {
678  myInvalidValue = "'" + toString(myShapeAttr) + "' doesn't have a valid 'float' format";
679  }
681  // check if filename format is valid
682  if (GNEAttributeCarrier::canParse<RGBColor>(myTextFieldStrings->getText().text()) == false) {
683  myInvalidValue = "'" + toString(myShapeAttr) + "' doesn't have a valid 'RBGColor' format";
684  }
686  std::string file = myTextFieldStrings->getText().text();
687  // check if filename format is valid
688  if (GNEAttributeCarrier::isValidFilename(file) == false) {
689  myInvalidValue = "input contains invalid characters for a filename";
690  } else if (myShapeAttr == SUMO_ATTR_IMGFILE) {
691  if(!file.empty()) {
692  // only load value if file isn't empty
693  if(GUITexturesHelper::getTextureID(file) == -1) {
694  myInvalidValue = "doesn't exist image '" + file + "'";
695  }
696  }
697  }
698  }
699  // change color of text field depending of myCurrentValueValid
700  if (myInvalidValue.size() == 0) {
701  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
702  myTextFieldInt->killFocus();
703  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
704  myTextFieldReal->killFocus();
705  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
706  myTextFieldStrings->killFocus();
707  } else {
708  // IF value of TextField isn't valid, change their color to Red
709  myTextFieldInt->setTextColor(FXRGB(255, 0, 0));
710  myTextFieldReal->setTextColor(FXRGB(255, 0, 0));
711  myTextFieldStrings->setTextColor(FXRGB(255, 0, 0));
712  }
713  // Update aditional frame
714  update();
715  return 1;
716 }
717 
718 
719 long
721  if (myBoolCheckButton->getCheck()) {
722  myBoolCheckButton->setText("true");
723  } else {
724  myBoolCheckButton->setText("false");
725  }
726  return 0;
727 }
728 
729 
731  // create FXColorDialog
732  FXColorDialog colordialog(this, tr("Color Dialog"));
733  colordialog.setTarget(this);
734  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myTextFieldStrings->getText().text())));
735  // execute dialog to get a new color
736  if (colordialog.execute()) {
737  myTextFieldStrings->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str());
738  }
739  return 0;
740 }
741 
742 // ---------------------------------------------------------------------------
743 // GNEPolygonFrame::NeteditAttributes- methods
744 // ---------------------------------------------------------------------------
745 
747  FXGroupBox(parent, "Internal attributes", GUIDesignGroupBoxFrame),
748  myViewNet(viewNet),
749  myIndexParameter(0),
750  myIndexParameterList(0),
751  maxNumberOfParameters(GNEAttributeCarrier::getHigherNumberOfAttributes()),
752  maxNumberOfListParameters(2) {
753 
754  // Create single parameters
755  for (int i = 0; i < maxNumberOfParameters; i++) {
757  }
758 
759  // Create help button
760  helpShape = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
761 }
762 
763 
765 }
766 
767 
768 void
770  // Hidde al fields
771  for (int i = 0; i < maxNumberOfParameters; i++) {
772  myVectorOfsingleShapeParameter.at(i)->hideParameter();
773  }
774 
775  // Reset indexs
777  myIndexParameter = 0;
778 }
779 
780 
781 void
783  // Set current additional
784  myShapeTag = additionalTag;
785 
787  // Check type of attribute list
788  if (GNEAttributeCarrier::isInt(myShapeTag, ShapeAttributeSingle)) {
789  myVectorOfsingleShapeParameter.at(myIndexParameter)->showParameter(myShapeTag, ShapeAttributeSingle, GNEAttributeCarrier::getDefaultValue<int>(myShapeTag, ShapeAttributeSingle));
790  } else if (GNEAttributeCarrier::isFloat(myShapeTag, ShapeAttributeSingle) || GNEAttributeCarrier::isTime(myShapeTag, ShapeAttributeSingle)) {
791  myVectorOfsingleShapeParameter.at(myIndexParameter)->showParameter(myShapeTag, ShapeAttributeSingle, GNEAttributeCarrier::getDefaultValue<double>(myShapeTag, ShapeAttributeSingle));
792  } else if (GNEAttributeCarrier::isBool(myShapeTag, ShapeAttributeSingle)) {
793  myVectorOfsingleShapeParameter.at(myIndexParameter)->showParameter(myShapeTag, ShapeAttributeSingle, GNEAttributeCarrier::getDefaultValue<bool>(myShapeTag, ShapeAttributeSingle));
794  } else if (GNEAttributeCarrier::isColor(myShapeTag, ShapeAttributeSingle)) {
795  myVectorOfsingleShapeParameter.at(myIndexParameter)->showParameter(myShapeTag, ShapeAttributeSingle, GNEAttributeCarrier::getDefaultValue<RGBColor>(myShapeTag, ShapeAttributeSingle));
796  } else if (GNEAttributeCarrier::isString(myShapeTag, ShapeAttributeSingle)) {
797  myVectorOfsingleShapeParameter.at(myIndexParameter)->showParameter(myShapeTag, ShapeAttributeSingle, GNEAttributeCarrier::getDefaultValue<std::string>(myShapeTag, ShapeAttributeSingle));
798  } else {
799  WRITE_WARNING("Attribute '" + toString(ShapeAttributeSingle) + "' doesn't have a defined type. Check definition in GNEAttributeCarrier");
800  }
801  // Update index parameter
803  } else {
804  WRITE_ERROR("Max number of attributes reached (" + toString(maxNumberOfParameters) + ").");
805  }
806 }
807 
808 
809 void
811  recalc();
812  show();
813 }
814 
815 
816 void
818  hide();
819 }
820 
821 
822 std::map<SumoXMLAttr, std::string>
824  std::map<SumoXMLAttr, std::string> values;
825  // get standar Parameters
826  for (int i = 0; i < myIndexParameter; i++) {
827  values[myVectorOfsingleShapeParameter.at(i)->getAttr()] = myVectorOfsingleShapeParameter.at(i)->getValue();
828  }
829  return values;
830 }
831 
832 
833 void
835  std::string errorMessage;
836  // iterate over standar parameters
837  for (int i = 0; (i < myIndexParameter) && errorMessage.empty(); i++) {
838  // Return string with the error if at least one of the parameter isn't valid
839  std::string attributeValue = myVectorOfsingleShapeParameter.at(i)->isAttributeValid();
840  if (attributeValue.size() != 0) {
841  errorMessage = attributeValue;
842  }
843  }
844  // show warning box if input parameters aren't invalid
845  if (extra.size() == 0) {
846  errorMessage = "Invalid input parameter of " + toString(myShapeTag) + ": " + errorMessage;
847  } else {
848  errorMessage = "Invalid input parameter of " + toString(myShapeTag) + ": " + extra;
849  }
850 
851  // set message in status bar
852  myViewNet->setStatusBarText(errorMessage);
853  // Write Warning in console if we're in testing mode
854  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
855  WRITE_WARNING(errorMessage);
856  }
857 }
858 
859 
860 bool
862  // iterate over standar parameters
863  for (int i = 0; i < myIndexParameter; i++) {
864  // Return false if error message of attriuve isn't empty
865  if (myVectorOfsingleShapeParameter.at(i)->isAttributeValid().size() != 0) {
866  return false;
867  }
868  }
869  return true;
870 }
871 
872 
873 int
876 }
877 
878 
879 long
880 GNEPolygonFrame::ShapeAttributes::onCmdHelp(FXObject*, FXSelector, void*) {
881  // Create help dialog
882  FXDialogBox* helpDialog = new FXDialogBox(this, ("Parameters of " + toString(myShapeTag)).c_str(), GUIDesignDialogBox);
883  // Create FXTable
884  FXTable* myTable = new FXTable(helpDialog, this, MID_TABLE, TABLE_READONLY);
885  myTable->setVisibleRows((FXint)(myIndexParameter + myIndexParameterList));
886  myTable->setVisibleColumns(3);
887  myTable->setTableSize((FXint)(myIndexParameter + myIndexParameterList), 3);
888  myTable->setBackColor(FXRGB(255, 255, 255));
889  myTable->setColumnText(0, "Name");
890  myTable->setColumnText(1, "Value");
891  myTable->setColumnText(2, "Definition");
892  myTable->getRowHeader()->setWidth(0);
893  FXHeader* header = myTable->getColumnHeader();
894  header->setItemJustify(0, JUSTIFY_CENTER_X);
895  header->setItemSize(0, 120);
896  header->setItemJustify(1, JUSTIFY_CENTER_X);
897  header->setItemSize(1, 80);
898  int maxSizeColumnDefinitions = 0;
899  // Iterate over vector of shape parameters
900  for (int i = 0; i < myIndexParameter; i++) {
901  SumoXMLTag shapeTag = myVectorOfsingleShapeParameter.at(i)->getTag();
902  SumoXMLAttr shapeAttr = myVectorOfsingleShapeParameter.at(i)->getAttr();
903  // Set name of attribute
904  myTable->setItem(i, 0, new FXTableItem(toString(shapeAttr).c_str()));
905  // Set type
906  FXTableItem* type = new FXTableItem("");
907  if (GNEAttributeCarrier::isInt(shapeTag, shapeAttr)) {
908  type->setText("int");
909  } else if (GNEAttributeCarrier::isFloat(shapeTag, shapeAttr)) {
910  type->setText("float");
911  } else if (GNEAttributeCarrier::isTime(shapeTag, shapeAttr)) {
912  type->setText("time");
913  } else if (GNEAttributeCarrier::isBool(shapeTag, shapeAttr)) {
914  type->setText("bool");
915  } else if (GNEAttributeCarrier::isColor(shapeTag, shapeAttr)) {
916  type->setText("color");
917  } else if (GNEAttributeCarrier::isString(shapeTag, shapeAttr)) {
918  type->setText("string");
919  }
920  type->setJustify(FXTableItem::CENTER_X);
921  myTable->setItem(i, 1, type);
922  // Set definition
923  FXTableItem* definition = new FXTableItem(GNEAttributeCarrier::getDefinition(shapeTag, shapeAttr).c_str());
924  definition->setJustify(FXTableItem::LEFT);
925  myTable->setItem(i, 2, definition);
926  if ((int)GNEAttributeCarrier::getDefinition(shapeTag, shapeAttr).size() > maxSizeColumnDefinitions) {
927  maxSizeColumnDefinitions = int(GNEAttributeCarrier::getDefinition(shapeTag, shapeAttr).size());
928  }
929  }
930  // Set size of column
931  header->setItemJustify(2, JUSTIFY_CENTER_X);
932  header->setItemSize(2, maxSizeColumnDefinitions * 6);
933  // Button Close
934  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
935  helpDialog->create();
936  helpDialog->show();
937  return 1;
938 }
939 
940 // ---------------------------------------------------------------------------
941 // GNEPolygonFrame::NeteditAttributes - methods
942 // ---------------------------------------------------------------------------
943 
945  FXGroupBox(parent, "Netedit attributes", GUIDesignGroupBoxFrame) {
946  // Create Frame for block movement label and checkBox (By default disabled)
947  FXHorizontalFrame* blockMovement = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
948  myBlockMovementLabel = new FXLabel(blockMovement, "block move", 0, GUIDesignLabelAttribute);
949  myBlockMovementCheckButton = new FXCheckButton(blockMovement, "false", this, MID_GNE_SET_BLOCKING_MOVEMENT, GUIDesignCheckButtonAttribute);
950  myBlockMovementCheckButton->setCheck(false);
951  // Create Frame for block shape label and checkBox (By default disabled)
952  myBlockShapeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
953  myBlockShapeLabel = new FXLabel(myBlockShapeFrame, "block shape", 0, GUIDesignLabelAttribute);
955  // Create Frame for block close polygon and checkBox (By default disabled)
956  myClosePolygonFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
957  myClosePolygonLabel = new FXLabel(myClosePolygonFrame, "Close shape", 0, GUIDesignLabelAttribute);
959  myBlockShapeCheckButton->setCheck(false);
960 }
961 
962 
964 
965 
966 void
968  // show block and closing sahpe depending of shapeEditing
969  if (shapeEditing) {
970  myBlockShapeFrame->show();
971  myClosePolygonFrame->show();
972  } else {
973  myBlockShapeFrame->hide();
974  myClosePolygonFrame->hide();
975  }
976  FXGroupBox::show();
977 }
978 
979 
980 void
982  FXGroupBox::hide();
983 }
984 
985 
986 bool
988  return myBlockMovementCheckButton->getCheck() == 1 ? true : false;
989 }
990 
991 
992 bool
994  return myBlockShapeCheckButton->getCheck() == 1 ? true : false;
995 }
996 
997 
998 bool
1000  return myClosePolygonCheckButton->getCheck() == 1 ? true : false;
1001 }
1002 
1003 
1004 long
1006  if (myBlockMovementCheckButton->getCheck()) {
1007  myBlockMovementCheckButton->setText("true");
1008  } else {
1009  myBlockMovementCheckButton->setText("false");
1010  }
1011  return 1;
1012 }
1013 
1014 
1015 long
1017  if (myBlockShapeCheckButton->getCheck()) {
1018  myBlockShapeCheckButton->setText("true");
1019  } else {
1020  myBlockShapeCheckButton->setText("false");
1021  }
1022  return 1;
1023 }
1024 
1025 
1026 long
1028  if (myClosePolygonCheckButton->getCheck()) {
1029  myClosePolygonCheckButton->setText("true");
1030  } else {
1031  myClosePolygonCheckButton->setText("false");
1032  }
1033  return 1;
1034 }
1035 
1036 
1037 std::string
1038 GNEPolygonFrame::getIdsSelected(const FXList* list) {
1039  // Obtain Id's of list
1040  std::string vectorOfIds;
1041  for (int i = 0; i < list->getNumItems(); i++) {
1042  if (list->isItemSelected(i)) {
1043  if (vectorOfIds.size() > 0) {
1044  vectorOfIds += " ";
1045  }
1046  vectorOfIds += (list->getItem(i)->getText()).text();
1047  }
1048  }
1049  return vectorOfIds;
1050 }
1051 
1052 /****************************************************************************/
std::string getValue() const
return value
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
void show()
show Drawing mode
SumoXMLTag
Numbers representing SUMO-XML - element names.
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:197
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:180
bool buildPoly(const PositionVector &drawedShape)
build Polygon using values of Fields and drawed shap return true if was sucesfully created ...
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:117
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
Definition: GUIDesigns.h:60
void setParametersOfShape(SumoXMLTag actualShapeType)
set parameters depending of the new additionalType
FXHorizontalFrame * myBlockShapeFrame
frame for Block shape
~GNEPolygonFrame()
Destructor.
FXTextField * myTextFieldInt
textField to modify the default value of int/float/string parameters
void stopDrawing()
stop drawing and create polygon or
SumoXMLTag myShapeTag
current XML attribute
block shape of a graphic element (Used mainly in GNEShapes)
GNEPolygonFrame::NeteditAttributes * getNetEditParameters() const
get editor parameters
AddShapeResult
FOX-declaration.
std::string generatePOIID() const
generate a POI ID
Definition: GNENet.cpp:2007
static const std::vector< SumoXMLTag > & allowedShapeTags()
get all editable for tag shape elements
A layer number.
Definition: GNEPOI.h:52
FXLabel * myClosePolygonLabel
Label for open/close polygon.
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const Position &pos, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
Definition: GNENet.cpp:1935
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:115
GNEPolygonFrame::NeteditAttributes * myEditorParameters
Netedit parameter.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEPOI.cpp:182
AddShapeResult processClick(const Position &clickedPosition)
process click over Viewnet
long onCmdHelp(FXObject *, FXSelector, void *)
void remove2Update()
Removes the dialog to be updated.
void addNewPoint(const Position &P)
add new point to temporal shape
void hideShapeParameters()
hide group box
long onCmdStartDrawing(FXObject *, FXSelector, void *)
static bool isPositive(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is only Positive (i.e. cannot take negative values)
long onCmdSetBooleanAttribute(FXObject *, FXSelector, void *)
called when user change the value of myBoolCheckButton
int myIndexParameter
Index for myVectorOfsingleShapeParameter.
GNEViewNet * myViewNet
pointer to viewNet
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:85
FXLabel * myInformationLabel
Label with information.
FXTextField * myTextFieldReal
textField to modify the default value of real/times parameters
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a polygon
GNEPolygonFrame::DrawingMode * getDrawingMode() const
get drawing mode
FXCheckButton * myBlockMovementCheckButton
checkBox for block movement
FXLabel * myBlockMovementLabel
Label for block movement.
bool isBlockShapeEnabled() const
check if block shape is enabled
FXButton * myStopDrawingButton
button for stop drawing
static bool isValidFilename(const std::string &value)
true if value is a valid file value
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
bool addPolygon(const std::map< SumoXMLAttr, std::string > &POIValues)
add Polygon
bool addPOI(const std::map< SumoXMLAttr, std::string > &POIValues)
add POI
bool isBlockMovementEnabled() const
check if block movement is enabled
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:65
attribute block shape
Definition: GUIAppEnum.h:590
FXHorizontalFrame * myClosePolygonFrame
Frame for open/close polygon.
GNEUndoList * getUndoList() const
get the undoList object
additional match box messages
Definition: GUIAppEnum.h:464
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
#define GUIDesignComboBox
Definition: GUIDesigns.h:187
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:95
void addAttribute(SumoXMLTag additionalTag, SumoXMLAttr ShapeAttributeSingle)
add attribute
long onCmdSetBlockMovement(FXObject *, FXSelector, void *)
void show(bool shapeEditing)
show NeteditAttributes
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
void removeLastPoint()
remove last added point
FXButton * helpShape
button for help
FXTextField * myTextFieldStrings
textField to modify the default value of string parameters
#define GUIDesignTextField
Definition: GUIDesigns.h:41
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:104
The Table.
Definition: GUIAppEnum.h:291
const std::string & isAttributeValid() const
returns a empty string if current value is valid, a string with information about invalid value in ot...
long onCmdsetClosingClosing(FXObject *, FXSelector, void *)
Called when the user change checkbox for open/closed polygon.
FXButton * mycolorEditor
Button for open color editor.
static bool isColor(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type color for a certain tag
PositionVector myTemporalShapeShape
current drawed shape
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:92
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
FXCheckButton * myClosePolygonCheckButton
checkbox to enable/disable closing polygon
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:244
A list of positions.
static bool isFilename(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a filename
void hideParameter()
hide all parameters
GNEPolygonFrame::DrawingMode * myDrawingMode
drawing mode
attribute block movement
Definition: GUIAppEnum.h:588
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:1911
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get attributes and their values
void clearAttributes()
clear attributes
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
block movement of a graphic element
invalid attribute
FXButton * myAbortDrawingButton
button for abort drawing
void hide()
hide NeteditAttributes
void showParameter(SumoXMLTag additionalTag, SumoXMLAttr additionalAttr, std::string value)
show name and value of attribute of type string
bool isDrawing() const
return true if currently a shape is drawed
long onCmdSetBlockShape(FXObject *, FXSelector, void *)
Called when user changes the checkbox "set blocking shape".
edge: the shape in xml-definition
std::string generatePolyID() const
generate PolyID
Definition: GNENet.cpp:1898
FXCheckButton * myBlockShapeCheckButton
checkBox for block shape
void startDrawing()
start drawing
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEPoly.cpp:535
const PositionVector & getTemporalShape() const
get Temporal shape
int getNumberOfAddedAttributes() const
get number of added attributes
void p_abort()
reverts and discards ALL active command groups
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
Definition: GUIDesigns.h:63
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:123
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const PositionVector &shape, bool fill, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
Definition: GNENet.cpp:1805
SumoXMLTag getTag() const
return tag
bool areValuesValid() const
check if parameters of attributes are valid
FXComboBox * myShapeMatchBox
combo box with the list of additional elements
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
void hide()
show Drawing mode
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:206
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don&#39;t have a default valu...
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:50
SumoXMLTag myActualShapeType
actual additional type selected in the match Box
SumoXMLTag myShapeTag
current additional tag
#define GUIDesignButton
Definition: GUIDesigns.h:57
virtual void show()
show Frame
Definition: GNEFrame.cpp:98
static bool isProbability(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is a probability (i.e. oly can values between [0, 1])
#define GUIDesignDialogBox
Definition: GUIDesigns.h:393
int maxNumberOfParameters
max number of parameters (Defined in constructor)
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:219
void show()
show additional frame and update use selected edges/lanes
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
bool isCloseShapeEnabled() const
check if clse shape is enabled
FXButton * myStartDrawingButton
button for start drawing
std::vector< ShapeAttributeSingle * > myVectorOfsingleShapeParameter
vector with the additional parameters
void abortDrawing()
abort drawing
FXLabel * myBlockShapeLabel
Label for block shape.
GNEPolygonFrame::ShapeAttributes * myShapeAttributes
additional internal attributes
static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr)
return definition of a certain SumoXMLAttr
GNENet * getNet() const
get the net object
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:44
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:107
void text()
Definition: gl2psTest.c:260
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
Definition: GUIDesigns.h:47
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:121
int myIndexParameterList
index for myIndexParameterList
#define GUIDesignButtonOK
Definition: GUIDesigns.h:98
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:298
SumoXMLAttr getAttr() const
return Attr
void showShapeParameters()
show group box
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:2020
SumoXMLAttr myShapeAttr
current XML attribute
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:144
FXDEFMAP(GNEPolygonFrame) GNEShapeMap[]
help button
Definition: GUIAppEnum.h:404
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:165
FXCheckButton * myBoolCheckButton
check button to enable/disable the value of boolean parameters
GNEPolygonFrame * myPolygonFrameParent
polygon frame parent
void closePolygon()
ensures that the last position equals the first
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
long onCmdSetAttribute(FXObject *, FXSelector, void *)
GUISelectedStorage gSelected
A global holder of selected objects.
A color information.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occured errors.
Fill the polygon.
begin/end of the description of a polygon
long onCmdSetColorAttribute(FXObject *, FXSelector, void *)
called when user press the "Color" button
std::string myInvalidValue
string which indicates the reason due current value is invalid
long onCmdSelectShape(FXObject *, FXSelector, void *)
FXLabel * myLabel
lael with the name of the parameter