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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for add additional elements
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 
22 #include <config.h>
23 
39 #include <netedit/GNEUndoList.h>
40 #include <netedit/GNENet.h>
41 #include <netedit/GNEViewParent.h>
43 
44 #include "GNEFrame.h"
45 #include "GNEInspectorFrame.h"
46 #include "GNEFrame.h"
47 #include "GNEDeleteFrame.h"
48 
49 
50 // ===========================================================================
51 // FOX callback mapping
52 // ===========================================================================
53 
54 FXDEFMAP(GNEFrame::ItemSelector) ItemSelectorMap[] = {
56 };
57 
58 FXDEFMAP(GNEFrame::ACAttributeRow) ACAttributeRowMap[] = {
62 };
63 
64 FXDEFMAP(GNEFrame::ACAttributes) ACAttributesMap[] = {
65  FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrame::ACAttributes::onCmdHelp),
66 };
67 
68 FXDEFMAP(GNEFrame::ACHierarchy) ACHierarchyMap[] = {
73 };
74 
75 FXDEFMAP(GNEFrame::GenericParametersEditor) GenericParametersEditorMap[] = {
78 };
79 
80 FXDEFMAP(GNEFrame::DrawingShape) DrawingShapeMap[] = {
84 };
85 
86 FXDEFMAP(GNEFrame::NeteditAttributes) NeteditAttributesMap[] = {
88  FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrame::NeteditAttributes::onCmdHelp),
89 };
90 
91 // Object implementation
92 FXIMPLEMENT(GNEFrame::ItemSelector, FXGroupBox, ItemSelectorMap, ARRAYNUMBER(ItemSelectorMap))
93 FXIMPLEMENT(GNEFrame::ACAttributeRow, FXHorizontalFrame, ACAttributeRowMap, ARRAYNUMBER(ACAttributeRowMap))
94 FXIMPLEMENT(GNEFrame::ACAttributes, FXGroupBox, ACAttributesMap, ARRAYNUMBER(ACAttributesMap))
95 FXIMPLEMENT(GNEFrame::ACHierarchy, FXGroupBox, ACHierarchyMap, ARRAYNUMBER(ACHierarchyMap))
96 FXIMPLEMENT(GNEFrame::GenericParametersEditor, FXGroupBox, GenericParametersEditorMap, ARRAYNUMBER(GenericParametersEditorMap))
97 FXIMPLEMENT(GNEFrame::DrawingShape, FXGroupBox, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap))
98 FXIMPLEMENT(GNEFrame::NeteditAttributes, FXGroupBox, NeteditAttributesMap, ARRAYNUMBER(NeteditAttributesMap))
99 
100 
101 // ===========================================================================
102 // method definitions
103 // ===========================================================================
104 
105 // ---------------------------------------------------------------------------
106 // GNEFrame::ItemSelector - methods
107 // ---------------------------------------------------------------------------
108 
109 GNEFrame::ItemSelector::ItemSelector(GNEFrame* frameParent, GNEAttributeCarrier::TAGProperty type, bool onlyDrawables) :
110  FXGroupBox(frameParent->myContentFrame, "Element", GUIDesignGroupBoxFrame),
111  myFrameParent(frameParent) {
112  // first check that property is valid
113  switch (type) {
114  case GNEAttributeCarrier::TAGProperty::TAGPROPERTY_NETELEMENT:
115  setText("NetElement element");
116  break;
117  case GNEAttributeCarrier::TAGProperty::TAGPROPERTY_ADDITIONAL:
118  setText("Additional element");
119  break;
120  case GNEAttributeCarrier::TAGProperty::TAGPROPERTY_SHAPE:
121  setText("Shape element");
122  break;
123  case GNEAttributeCarrier::TAGProperty::TAGPROPERTY_TAZ:
124  setText("TAZ element");
125  break;
126  default:
127  throw ProcessError("invalid tag property");
128 
129  }
130  // fill myListOfTags
131  myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(type, onlyDrawables);
132  // Create FXComboBox
133  myTypeMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox);
134  // fill myTypeMatchBox with list of tags
135  for (const auto &i : myListOfTags) {
136  myTypeMatchBox->appendItem(toString(i).c_str());
137  }
138  // Set visible items
139  myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems());
140  // ItemSelector is always shown
141  show();
142 }
143 
144 
146 
147 
150  return myCurrentTagProperties;
151 }
152 
153 
154 void
156  // make sure that tag is in myTypeMatchBox
157  for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) {
158  if (myTypeMatchBox->getItem(i).text() == toString(typeTag)) {
159  myTypeMatchBox->setCurrentItem(i);
160  // Set new current type
162  }
163  }
164  // Check that typeTag type is valid
166  // show moduls if selected item is valid
168  } else {
169  // hide all moduls if selected item isn't valid
171  }
172 }
173 
174 
175 void
177  // simply call onCmdSelectItem (to avoid duplicated code)
178  onCmdSelectItem(0,0,0);
179 }
180 
181 
182 long
183 GNEFrame::ItemSelector::onCmdSelectItem(FXObject*, FXSelector, void*) {
184  // Check if value of myTypeMatchBox correspond of an allowed additional tags
185  for (const auto &i : myListOfTags) {
186  if (toString(i) == myTypeMatchBox->getText().text()) {
187  // set color of myTypeMatchBox to black (valid)
188  myTypeMatchBox->setTextColor(FXRGB(0, 0, 0));
189  // Set new current type
191  // show moduls if selected item is valid
193  // Write Warning in console if we're in testing mode
194  WRITE_DEBUG(("Selected item '" + myTypeMatchBox->getText() + "' in ItemSelector").text());
195  return 1;
196  }
197  }
198  // if additional name isn't correct, set SUMO_TAG_NOTHING as current type
200  // hide all moduls if selected item isn't valid
202  // set color of myTypeMatchBox to red (invalid)
203  myTypeMatchBox->setTextColor(FXRGB(255, 0, 0));
204  // Write Warning in console if we're in testing mode
205  WRITE_DEBUG("Selected invalid item in ItemSelector");
206  return 1;
207 }
208 
209 // ---------------------------------------------------------------------------
210 // GNEFrame::ACAttributeRow - methods
211 // ---------------------------------------------------------------------------
212 
214  FXHorizontalFrame(ACAttributesParent, GUIDesignAuxiliarHorizontalFrame),
215  myACAttributesParent(ACAttributesParent),
216  myXMLAttr(SUMO_ATTR_NOTHING) {
217  // Create visual elements
218  myLabel = new FXLabel(this, "name", nullptr, GUIDesignLabelAttribute);
219  myColorEditor = new FXButton(this, "ColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
223  myBoolCheckButton = new FXCheckButton(this, "Disabled", this, MID_GNE_SET_ATTRIBUTE_BOOL, GUIDesignCheckButtonAttribute);
224  // Hide elements
225  hideParameter();
226 }
227 
228 
230 
231 
232 void
233 GNEFrame::ACAttributeRow::showParameter(const SumoXMLAttr attr, const GNEAttributeCarrier::AttributeProperties &attrProperties, const std::string &value) {
234  myAttrProperties = attrProperties;
235  myXMLAttr = attr;
236  myInvalidValue = "";
237  // show label or button for edit colors
238  if (myAttrProperties.isColor()) {
239  myColorEditor->setTextColor(FXRGB(0, 0, 0));
240  myColorEditor->setText(toString(myXMLAttr).c_str());
241  myColorEditor->show();
242  } else {
243  myLabel->setText(toString(myXMLAttr).c_str());
244  myLabel->show();
245  }
246  if (myAttrProperties.isInt()) {
247  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
248  myTextFieldInt->setText(value.c_str());
249  myTextFieldInt->show();
250  } else if (myAttrProperties.isFloat()) {
251  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
252  myTextFieldReal->setText(value.c_str());
253  myTextFieldReal->show();
254  } else if (myAttrProperties.isBool()) {
255  if (GNEAttributeCarrier::parse<bool>(value)) {
256  myBoolCheckButton->setCheck(true);
257  myBoolCheckButton->setText("true");
258  } else {
259  myBoolCheckButton->setCheck(false);
260  myBoolCheckButton->setText("false");
261  }
262  myBoolCheckButton->show();
263  } else {
264  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
265  myTextFieldStrings->setText(value.c_str());
266  myTextFieldStrings->show();
267  }
268  show();
269 }
270 
271 
272 void
275  myLabel->hide();
276  myTextFieldInt->hide();
277  myTextFieldReal->hide();
278  myTextFieldStrings->hide();
279  myBoolCheckButton->hide();
280  myColorEditor->hide();
281  hide();
282 }
283 
284 
287  return myXMLAttr;
288 }
289 
290 
291 std::string
293  if (myAttrProperties.isBool()) {
294  return (myBoolCheckButton->getCheck() == 1) ? "true" : "false";
295  } else if (myAttrProperties.isInt()) {
296  return myTextFieldInt->getText().text();
297  } else if (myAttrProperties.isFloat() || myAttrProperties.isTime()) {
298  return myTextFieldReal->getText().text();
299  } else {
300  return myTextFieldStrings->getText().text();
301  }
302 }
303 
304 
305 const std::string&
307  return myInvalidValue;
308 }
309 
310 
313  return myACAttributesParent;
314 }
315 
316 
317 long
318 GNEFrame::ACAttributeRow::onCmdSetAttribute(FXObject*, FXSelector, void*) {
319  // We assume that current value is valid
320  myInvalidValue = "";
321  // Check if format of current value of myTextField is correct
322  if (myAttrProperties.isInt()) {
323  if (GNEAttributeCarrier::canParse<int>(myTextFieldInt->getText().text())) {
324  // convert string to int
325  int intValue = GNEAttributeCarrier::parse<int>(myTextFieldInt->getText().text());
326  // Check if int value must be positive
327  if (myAttrProperties.isPositive() && (intValue < 0)) {
328  myInvalidValue = "'" + toString(myXMLAttr) + "' cannot be negative";
329  }
330  } else {
331  myInvalidValue = "'" + toString(myXMLAttr) + "' doesn't have a valid 'int' format";
332  }
333  } else if (myAttrProperties.isTime()) {
334  // time attributes work as positive doubles
335  if (GNEAttributeCarrier::canParse<double>(myTextFieldReal->getText().text())) {
336  // convert string to double
337  double doubleValue = GNEAttributeCarrier::parse<double>(myTextFieldReal->getText().text());
338  // Check if parsed value is negative
339  if (doubleValue < 0) {
340  myInvalidValue = "'" + toString(myXMLAttr) + "' cannot be negative";
341  }
342  } else {
343  myInvalidValue = "'" + toString(myXMLAttr) + "' doesn't have a valid 'time' format";
344  }
345  } else if (myAttrProperties.isFloat()) {
346  if (GNEAttributeCarrier::canParse<double>(myTextFieldReal->getText().text())) {
347  // convert string to double
348  double doubleValue = GNEAttributeCarrier::parse<double>(myTextFieldReal->getText().text());
349  // Check if double value must be positive
350  if (myAttrProperties.isPositive() && (doubleValue < 0)) {
351  myInvalidValue = "'" + toString(myXMLAttr) + "' cannot be negative";
352  // check if double value is a probability
353  } else if (myAttrProperties.isProbability() && ((doubleValue < 0) || doubleValue > 1)) {
354  myInvalidValue = "'" + toString(myXMLAttr) + "' takes only values between 0 and 1";
355  } else if (myAttrProperties.hasAttrRange() && ((doubleValue < myAttrProperties.getMinimumRange()) || doubleValue > myAttrProperties.getMaximumRange())) {
356  myInvalidValue = "'" + toString(myXMLAttr) + "' takes only values between " + toString(myAttrProperties.getMinimumRange())+ " and " + toString(myAttrProperties.getMaximumRange());
357  } else if ((myACAttributesParent->myTagProperties.getTag() == SUMO_TAG_E2DETECTOR) && (myXMLAttr == SUMO_ATTR_LENGTH) && (doubleValue == 0)) {
358  myInvalidValue = "E2 length cannot be 0";
359  }
360  } else {
361  myInvalidValue = "'" + toString(myXMLAttr) + "' doesn't have a valid 'float' format";
362  }
363  } else if (myAttrProperties.isColor()) {
364  // check if filename format is valid
365  if (GNEAttributeCarrier::canParse<RGBColor>(myTextFieldStrings->getText().text()) == false) {
366  myInvalidValue = "'" + toString(myXMLAttr) + "' doesn't have a valid 'RBGColor' format";
367  }
368  } else if (myAttrProperties.isFilename()) {
369  std::string file = myTextFieldStrings->getText().text();
370  // check if filename format is valid
371  if (SUMOXMLDefinitions::isValidFilename(file) == false) {
372  myInvalidValue = "input contains invalid characters for a filename";
373  } else if (myXMLAttr == SUMO_ATTR_IMGFILE) {
374  if (!file.empty()) {
375  // only load value if file exist and can be loaded
376  if (GUITexturesHelper::getTextureID(file) == -1) {
377  myInvalidValue = "doesn't exist image '" + file + "'";
378  }
379  }
380  }
381  } else if (myXMLAttr == SUMO_ATTR_NAME) {
382  std::string name = myTextFieldStrings->getText().text();
383  // check if name format is valid
384  if (SUMOXMLDefinitions::isValidAttribute(name) == false) {
385  myInvalidValue = "input contains invalid characters";
386  }
387  } else if (myXMLAttr == SUMO_ATTR_VTYPES) {
388  std::string name = myTextFieldStrings->getText().text();
389  // if list of VTypes isn't empty, check that all characters are valid
390  if (!name.empty() && !SUMOXMLDefinitions::isValidListOfTypeID(name)) {
391  myInvalidValue = "list of IDs contains invalid characters";
392  }
393  }
394  // change color of text field depending of myCurrentValueValid
395  if (myInvalidValue.size() == 0) {
396  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
397  myTextFieldInt->killFocus();
398  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
399  myTextFieldReal->killFocus();
400  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
401  myTextFieldStrings->killFocus();
402  } else {
403  // IF value of TextField isn't valid, change their color to Red
404  myTextFieldInt->setTextColor(FXRGB(255, 0, 0));
405  myTextFieldReal->setTextColor(FXRGB(255, 0, 0));
406  myTextFieldStrings->setTextColor(FXRGB(255, 0, 0));
407  }
408  // Update aditional frame
409  update();
410  return 1;
411 }
412 
413 
414 long
416  if (myBoolCheckButton->getCheck()) {
417  myBoolCheckButton->setText("true");
418  } else {
419  myBoolCheckButton->setText("false");
420  }
421  return 0;
422 }
423 
424 
425 long GNEFrame::ACAttributeRow::onCmdSetColorAttribute(FXObject*, FXSelector, void*) {
426  // create FXColorDialog
427  FXColorDialog colordialog(this, tr("Color Dialog"));
428  colordialog.setTarget(this);
429  // If previous attribute wasn't correct, set black as default color
430  if (GNEAttributeCarrier::canParse<RGBColor>(myTextFieldStrings->getText().text())) {
431  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myTextFieldStrings->getText().text())));
432  } else {
434  }
435  // execute dialog to get a new color
436  if (colordialog.execute()) {
437  myTextFieldStrings->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str());
438  onCmdSetAttribute(nullptr, 0, nullptr);
439  }
440  return 0;
441 }
442 
443 // ---------------------------------------------------------------------------
444 // GNEFrame::NeteditAttributes- methods
445 // ---------------------------------------------------------------------------
446 
448  FXGroupBox(frameParent->myContentFrame, "Internal attributes", GUIDesignGroupBoxFrame),
449  myFrameParent(frameParent) {
450 
451  // Create single parameters
452  for (int i = 0; i < GNEAttributeCarrier::getHigherNumberOfAttributes(); i++) {
453  myACAttributeRows.push_back(new ACAttributeRow(this));
454  }
455 
456  // Create help button
457  new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
458 }
459 
460 
462 }
463 
464 
465 void
467  // get current tag Properties
468  myTagProperties = tagProperties;
469  // Hide all fields
470  for (int i = 0; i < (int)myACAttributeRows.size(); i++) {
471  myACAttributeRows.at(i)->hideParameter();
472  }
473  // iterate over tag attributes and show it
474  for (auto i : myTagProperties) {
475  // make sure that only non-unique attributes are shown
476  if (!i.second.isUnique()) {
477  myACAttributeRows.at(i.second.getPositionListed())->showParameter(i.first, i.second, i.second.getDefaultValue());
478  }
479  }
480  // recalc frame and show again
481  recalc();
482  show();
483 }
484 
485 
486 void
488  hide();
489 }
490 
491 
492 std::map<SumoXMLAttr, std::string>
494  std::map<SumoXMLAttr, std::string> values;
495  // get standard parameters
496  for (int i = 0; i < (int)myACAttributeRows.size(); i++) {
497  if (myACAttributeRows.at(i)->getAttr() != SUMO_ATTR_NOTHING) {
498  values[myACAttributeRows.at(i)->getAttr()] = myACAttributeRows.at(i)->getValue();
499  }
500  }
501  return values;
502 }
503 
504 
505 void
507  std::string errorMessage;
508  // iterate over standar parameters
509  for (auto i : myTagProperties) {
510  if (errorMessage.empty()) {
511  // Return string with the error if at least one of the parameter isn't valid
512  std::string attributeValue = myACAttributeRows.at(i.second.getPositionListed())->isAttributeValid();
513  if (attributeValue.size() != 0) {
514  errorMessage = attributeValue;
515  }
516  }
517  }
518  // show warning box if input parameters aren't invalid
519  if (extra.size() == 0) {
520  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + errorMessage;
521  } else {
522  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + extra;
523  }
524 
525  // set message in status bar
526  myFrameParent->getViewNet()->setStatusBarText(errorMessage);
527  // Write Warning in console if we're in testing mode
528  WRITE_DEBUG(errorMessage);
529 }
530 
531 
532 bool
534  // iterate over standar parameters
535  for (auto i : myTagProperties) {
536  // Return false if error message of attriuve isn't empty
537  if (myACAttributeRows.at(i.second.getPositionListed())->isAttributeValid().size() != 0) {
538  return false;
539  }
540  }
541  return true;
542 }
543 
544 
545 int
547  return (1);
548 }
549 
550 
551 long
552 GNEFrame::ACAttributes::onCmdHelp(FXObject*, FXSelector, void*) {
553  // open Help attributes dialog
555  return 1;
556 }
557 
558 // ---------------------------------------------------------------------------
559 // GNEFrame::ACHierarchy - methods
560 // ---------------------------------------------------------------------------
561 
563  FXGroupBox(frameParent->myContentFrame, "Hierarchy", GUIDesignGroupBoxFrame),
564  myFrameParent(frameParent),
565  myAC(nullptr) {
566  // Create three list
567  myTreelist = new FXTreeList(this, this, MID_GNE_DELETEFRAME_CHILDS, GUIDesignTreeListFrame);
568  hide();
569 }
570 
571 
573 
574 
575 void
577  myAC = AC;
578  // show ACHierarchy and refresh ACHierarchy
579  if (myAC) {
580  show();
582  }
583 }
584 
585 
586 void
588  myAC = nullptr;
589  hide();
590 }
591 
592 
593 void
595  // clear items
596  myTreelist->clearItems();
597  myTreeItemToACMap.clear();
598  myTreeItemsConnections.clear();
599  // show ACChilds of myAC
600  if (myAC) {
602  }
603 }
604 
605 
606 long
607 GNEFrame::ACHierarchy::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) {
608  // Obtain event
609  FXEvent* e = (FXEvent*)eventData;
610  // obtain FXTreeItem in the given position
611  FXTreeItem* item = myTreelist->getItemAt(e->win_x, e->win_y);
612  // open Pop-up if FXTreeItem has a Attribute Carrier vinculated
613  if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) {
614  createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]);
615  }
616  return 1;
617 }
618 
619 
620 long
621 GNEFrame::ACHierarchy::onCmdCenterItem(FXObject*, FXSelector, void*) {
622  GUIGlObject* glObject = dynamic_cast<GUIGlObject*>(myRightClickedAC);
623  if (glObject) {
624  myFrameParent->getViewNet()->centerTo(glObject->getGlID(), false);
625  myFrameParent->getViewNet()->update();
626  }
627  return 1;
628 }
629 
630 
631 long
632 GNEFrame::ACHierarchy::onCmdInspectItem(FXObject*, FXSelector, void*) {
633  if ((myAC != nullptr) && (myRightClickedAC != nullptr)) {
635  }
636  return 1;
637 }
638 
639 
640 long
641 GNEFrame::ACHierarchy::onCmdDeleteItem(FXObject*, FXSelector, void*) {
642  // check if Inspector frame was opened before removing
643  const std::vector<GNEAttributeCarrier*>& currentInspectedACs = myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getInspectedACs();
644  // Remove Attribute Carrier
647  // check if inspector frame has to be shown again
648  if (currentInspectedACs.size() == 1) {
649  if (currentInspectedACs.front() != myRightClickedAC) {
650  myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->inspectSingleElement(currentInspectedACs.front());
651  } else {
652  // inspect a nullprt element to reset inspector frame
654  }
655  }
656  return 1;
657 }
658 
659 
660 void
662  // create FXMenuPane
663  FXMenuPane* pane = new FXMenuPane(myTreelist);
664  // set current clicked AC
665  myRightClickedAC = ac;
666  // set name
668  new FXMenuSeparator(pane);
669  // Fill FXMenuCommand
670  new FXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_GNE_INSPECTORFRAME_CENTER);
671  new FXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(ICON_MODEINSPECT), this, MID_GNE_INSPECTORFRAME_INSPECT);
672  new FXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(ICON_MODEDELETE), this, MID_GNE_INSPECTORFRAME_DELETE);
673  // Center in the mouse position and create pane
674  pane->setX(X);
675  pane->setY(Y);
676  pane->create();
677  pane->show();
678 }
679 
680 
681 FXTreeItem*
683  // Switch gl type of ac
684  switch (myAC->getTagProperty().getTag()) {
685  case SUMO_TAG_EDGE: {
686  // obtain Edge
687  GNEEdge* edge = myFrameParent->getViewNet()->getNet()->retrieveEdge(myAC->getID(), false);
688  if (edge) {
689  // insert Junctions of edge in tree (Pararell because a edge has always two Junctions)
690  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
691  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
692  junctionDestinyItem->setExpanded(true);
693  // Save items in myTreeItemToACMap
694  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
695  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
696  // return junction destiny Item
697  return junctionDestinyItem;
698  } else {
699  return nullptr;
700  }
701  }
702  case SUMO_TAG_LANE: {
703  // obtain lane
704  GNELane* lane = myFrameParent->getViewNet()->getNet()->retrieveLane(myAC->getID(), false);
705  if (lane) {
706  // obtain edge parent
708  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
709  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
710  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
711  junctionDestinyItem->setExpanded(true);
712  // Create edge item
713  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
714  edgeItem->setExpanded(true);
715  // Save items in myTreeItemToACMap
716  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
717  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
718  myTreeItemToACMap[edgeItem] = edge;
719  // return edge item
720  return edgeItem;
721  } else {
722  return nullptr;
723  }
724  }
725  case SUMO_TAG_POILANE: {
726  // Obtain POILane
727  GNEPOI* POILane = myFrameParent->getViewNet()->getNet()->retrievePOI(myAC->getID(), false);
728  if (POILane) {
729  // obtain lane parent
730  GNELane* lane = myFrameParent->getViewNet()->getNet()->retrieveLane(POILane->getLane()->getID());
731  // obtain edge parent
733  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
734  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
735  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
736  junctionDestinyItem->setExpanded(true);
737  // Create edge item
738  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
739  edgeItem->setExpanded(true);
740  // Create lane item
741  FXTreeItem* laneItem = myTreelist->insertItem(nullptr, edgeItem, lane->getHierarchyName().c_str(), lane->getIcon(), lane->getIcon());
742  laneItem->setExpanded(true);
743  // Save items in myTreeItemToACMap
744  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
745  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
746  myTreeItemToACMap[edgeItem] = edge;
747  myTreeItemToACMap[laneItem] = lane;
748  // return Lane item
749  return laneItem;
750  } else {
751  return nullptr;
752  }
753  }
754  case SUMO_TAG_CROSSING: {
755  // obtain Crossing
756  GNECrossing* crossing = myFrameParent->getViewNet()->getNet()->retrieveCrossing(myAC->getID(), false);
757  if (crossing) {
758  // obtain junction
759  GNEJunction* junction = crossing->getParentJunction();
760  // create junction item
761  FXTreeItem* junctionItem = myTreelist->insertItem(nullptr, nullptr, junction->getHierarchyName().c_str(), junction->getIcon(), junction->getIcon());
762  junctionItem->setExpanded(true);
763  // Save items in myTreeItemToACMap
764  myTreeItemToACMap[junctionItem] = junction;
765  // return junction Item
766  return junctionItem;
767  } else {
768  return nullptr;
769  }
770  }
771  case SUMO_TAG_CONNECTION: {
772  // obtain Connection
773  GNEConnection* connection = myFrameParent->getViewNet()->getNet()->retrieveConnection(myAC->getID(), false);
774  if (connection) {
775  // create edge from item
776  FXTreeItem* edgeFromItem = myTreelist->insertItem(nullptr, nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getIcon(), connection->getEdgeFrom()->getIcon());
777  edgeFromItem->setExpanded(true);
778  // create edge to item
779  FXTreeItem* edgeToItem = myTreelist->insertItem(nullptr, nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getIcon(), connection->getEdgeTo()->getIcon());
780  edgeToItem->setExpanded(true);
781  // create connection item
782  FXTreeItem* connectionItem = myTreelist->insertItem(nullptr, edgeToItem, connection->getHierarchyName().c_str(), connection->getIcon(), connection->getIcon());
783  connectionItem->setExpanded(true);
784  // Save items in myTreeItemToACMap
785  myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom();
786  myTreeItemToACMap[edgeToItem] = connection->getEdgeTo();
787  myTreeItemToACMap[connectionItem] = connection;
788  // return connection item
789  return connectionItem;
790  } else {
791  return nullptr;
792  }
793  }
794  default: {
795  // obtain tag property (only for improve code legibility)
796  const auto& tagProperty = myAC->getTagProperty();
797  // check if is an additional or a TAZ, and in other case return nullptr
798  if (tagProperty.isAdditional() || tagProperty.isTAZ()) {
799  // Obtain Additional
801  if (additional) {
802  // first check if additional has another additional as parent (to add it into root)
803  if (tagProperty.hasParent() && tagProperty.getParentTag() != SUMO_TAG_LANE) {
804  GNEAdditional* additionalParent = myFrameParent->getViewNet()->getNet()->retrieveAdditional(tagProperty.getParentTag(), additional->getAttribute(GNE_ATTR_PARENT));
805  // create additional parent item
806  FXTreeItem* additionalParentItem = myTreelist->insertItem(nullptr, nullptr, additionalParent->getHierarchyName().c_str(), additionalParent->getIcon(), additionalParent->getIcon());
807  additionalParentItem->setExpanded(true);
808  // Save it in myTreeItemToACMap
809  myTreeItemToACMap[additionalParentItem] = additionalParent;
810  }
811  if (tagProperty.hasAttribute(SUMO_ATTR_EDGE)) {
812  // obtain edge parent
814  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
815  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
816  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
817  junctionDestinyItem->setExpanded(true);
818  // Create edge item
819  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
820  edgeItem->setExpanded(true);
821  // Save items in myTreeItemToACMap
822  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
823  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
824  myTreeItemToACMap[edgeItem] = edge;
825  // return edge item
826  return edgeItem;
827  } else if (tagProperty.hasAttribute(SUMO_ATTR_LANE)) {
828  // obtain lane parent
830  // obtain edge parent
832  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
833  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
834  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
835  junctionDestinyItem->setExpanded(true);
836  // Create edge item
837  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
838  edgeItem->setExpanded(true);
839  // Create lane item
840  FXTreeItem* laneItem = myTreelist->insertItem(nullptr, edgeItem, lane->getHierarchyName().c_str(), lane->getIcon(), lane->getIcon());
841  laneItem->setExpanded(true);
842  // Save items in myTreeItemToACMap
843  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
844  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
845  myTreeItemToACMap[edgeItem] = edge;
846  myTreeItemToACMap[laneItem] = lane;
847  // return lane item
848  return laneItem;
849  } else if (tagProperty.hasAttribute(SUMO_ATTR_LANES)) {
850  // obtain lane parent
851  std::vector<GNELane*> lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(myFrameParent->getViewNet()->getNet(), additional->getAttribute(SUMO_ATTR_LANES));
852  // obtain edge parent
853  GNEEdge* edge = myFrameParent->getViewNet()->getNet()->retrieveEdge(lanes.front()->getParentEdge().getID());
854  //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions)
855  FXTreeItem* junctionSourceItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " origin").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
856  FXTreeItem* junctionDestinyItem = myTreelist->insertItem(nullptr, nullptr, (edge->getGNEJunctionSource()->getHierarchyName() + " destiny").c_str(), edge->getGNEJunctionSource()->getIcon(), edge->getGNEJunctionSource()->getIcon());
857  junctionDestinyItem->setExpanded(true);
858  // Create edge item
859  FXTreeItem* edgeItem = myTreelist->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon());
860  edgeItem->setExpanded(true);
861  // Create lane item
862  FXTreeItem* laneItem = myTreelist->insertItem(nullptr, edgeItem, lanes.front()->getHierarchyName().c_str(), lanes.front()->getIcon(), lanes.front()->getIcon());
863  laneItem->setExpanded(true);
864  // Save items in myTreeItemToACMap
865  myTreeItemToACMap[junctionSourceItem] = edge->getGNEJunctionSource();
866  myTreeItemToACMap[junctionDestinyItem] = edge->getGNEJunctionDestiny();
867  myTreeItemToACMap[edgeItem] = edge;
868  myTreeItemToACMap[laneItem] = lanes.front();
869  // return lane item
870  return laneItem;
871  }
872  }
873  }
874  }
875  }
876  // there isn't parents
877  return nullptr;
878 }
879 
880 
881 void
883  // Switch gl type of ac
884  switch (AC->getTagProperty().getTag()) {
885  case SUMO_TAG_JUNCTION: {
886  // retrieve junction
887  GNEJunction* junction = myFrameParent->getViewNet()->getNet()->retrieveJunction(AC->getID(), false);
888  if (junction) {
889  // insert junction item
890  FXTreeItem* junctionItem = addACIntoList(AC, itemParent);
891  // insert edges
892  for (auto i : junction->getGNEEdges()) {
893  showAttributeCarrierChilds(i, junctionItem);
894  }
895  // insert crossings
896  for (auto i : junction->getGNECrossings()) {
897  showAttributeCarrierChilds(i, junctionItem);
898  }
899  }
900  break;
901  }
902  case SUMO_TAG_EDGE: {
903  // retrieve edge
904  GNEEdge* edge = myFrameParent->getViewNet()->getNet()->retrieveEdge(AC->getID(), false);
905  if (edge) {
906  // insert edge item
907  FXTreeItem* edgeItem = addACIntoList(AC, itemParent);
908  // insert lanes
909  for (int i = 0; i < (int)edge->getLanes().size(); i++) {
910  showAttributeCarrierChilds(edge->getLanes().at(i), edgeItem);
911  }
912  // insert additionals of edge
913  for (auto i : edge->getAdditionalChilds()) {
914  showAttributeCarrierChilds(i, edgeItem);
915  }
916  }
917  break;
918  }
919  case SUMO_TAG_LANE: {
920  // retrieve lane
921  GNELane* lane = myFrameParent->getViewNet()->getNet()->retrieveLane(AC->getID(), false);
922  if (lane) {
923  // insert lane item
924  FXTreeItem* laneItem = addACIntoList(AC, itemParent);
925  // insert additionals of lanes
926  for (auto i : lane->getAdditionalChilds()) {
927  showAttributeCarrierChilds(i, laneItem);
928  }
929  // insert incoming connections of lanes (by default isn't expanded)
930  if (lane->getGNEIncomingConnections().size() > 0) {
931  std::vector<GNEConnection*> incomingLaneConnections = lane->getGNEIncomingConnections();
932  FXTreeItem* incomingConnections = myTreelist->insertItem(nullptr, laneItem, "Incomings", incomingLaneConnections.front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
933  myTreeItemsConnections.insert(incomingConnections);
934  incomingConnections->setExpanded(false);
935  // insert incoming connections
936  for (auto i : incomingLaneConnections) {
937  showAttributeCarrierChilds(i, incomingConnections);
938  }
939  }
940  // insert outcoming connections of lanes (by default isn't expanded)
941  if (lane->getGNEOutcomingConnections().size() > 0) {
942  std::vector<GNEConnection*> outcomingLaneConnections = lane->getGNEOutcomingConnections();
943  FXTreeItem* outgoingConnections = myTreelist->insertItem(nullptr, laneItem, "Outcomings", outcomingLaneConnections.front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
944  myTreeItemsConnections.insert(outgoingConnections);
945  outgoingConnections->setExpanded(false);
946  // insert outcoming connections
947  for (auto i : outcomingLaneConnections) {
948  showAttributeCarrierChilds(i, outgoingConnections);
949  }
950  }
951  }
952  break;
953  }
954  case SUMO_TAG_POI:
955  case SUMO_TAG_POLY:
956  case SUMO_TAG_CROSSING:
957  case SUMO_TAG_CONNECTION: {
958  // insert connection item
959  addACIntoList(AC, itemParent);
960  break;
961  }
962  default: {
963  // check if is an additional or TAZ
964  if (AC->getTagProperty().isAdditional() || AC->getTagProperty().isTAZ()) {
965  // retrieve additional
966  GNEAdditional* additional = myFrameParent->getViewNet()->getNet()->retrieveAdditional(AC->getTagProperty().getTag(), AC->getID(), false);
967  if (additional) {
968  // insert additional item
969  FXTreeItem* additionalItem = addACIntoList(AC, itemParent);
970  // insert additionals childs
971  for (auto i : additional->getAdditionalChilds()) {
972  showAttributeCarrierChilds(i, additionalItem);
973  }
974  }
975  }
976  break;
977  }
978  }
979 }
980 
981 
982 FXTreeItem*
984  FXTreeItem* item = myTreelist->insertItem(nullptr, itemParent, AC->getHierarchyName().c_str(), AC->getIcon(), AC->getIcon());
985  myTreeItemToACMap[item] = AC;
986  item->setExpanded(true);
987  return item;
988 }
989 
990 // ---------------------------------------------------------------------------
991 // GNEFrame::GenericParametersEditor - methods
992 // ---------------------------------------------------------------------------
993 
995  FXGroupBox(inspectorFrameParent->myContentFrame, "Generic parameters", GUIDesignGroupBoxFrame),
996  myFrameParent(inspectorFrameParent),
997  myAC(nullptr),
998  myGenericParameters(nullptr) {
999  // create empty vector with generic parameters
1000  myGenericParameters = new std::vector<std::pair<std::string, std::string> >;
1001  // create textfield and buttons
1003  myEditGenericParameterButton = new FXButton(this, "Edit generic parameter", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton);
1004 }
1005 
1006 
1008  delete myGenericParameters;
1009 }
1010 
1011 
1012 void
1014  if (AC != nullptr) {
1015  myAC = AC;
1016  myACs.clear();
1017  // obtain a copy of generic parameters of AC
1018  if (myAC) {
1020  }
1021  // refresh GenericParametersEditor
1023  // show groupbox
1024  show();
1025  }
1026 }
1027 
1028 
1029 void
1031  if (ACs.size() > 0) {
1032  myAC = nullptr;
1033  myACs = ACs;
1034  // check if generic parameters are different
1035  bool differentsGenericParameters = false;
1036  std::string genericParameter = myACs.front()->getAttribute(GNE_ATTR_GENERIC);
1037  for (auto i : myACs) {
1038  if (genericParameter != i->getAttribute(GNE_ATTR_GENERIC)) {
1039  differentsGenericParameters = true;
1040  }
1041  }
1042  // set generic Parameters editor
1043  if (differentsGenericParameters) {
1044  myGenericParameters->clear();
1045  } else {
1046  *myGenericParameters = myACs.front()->getGenericParameters();
1047  }
1048  // refresh GenericParametersEditor
1050  // show groupbox
1051  show();
1052  }
1053 }
1054 
1055 
1056 void
1058  myAC = nullptr;
1059  // hide groupbox
1060  hide();
1061 }
1062 
1063 
1064 void
1066  // update text field depending of AC
1067  if (myAC) {
1069  myTextFieldGenericParameter->setTextColor(FXRGB(0, 0, 0));
1070  } else if (myACs.size()) {
1071  // check if generic parameters of all inspected ACs are different
1072  std::string genericParameter = myACs.front()->getAttribute(GNE_ATTR_GENERIC);
1073 
1074  for (auto i : myACs) {
1075  if (genericParameter != i->getAttribute(GNE_ATTR_GENERIC)) {
1076  genericParameter = "different generic attributes";
1077  }
1078  }
1079  myTextFieldGenericParameter->setText(genericParameter.c_str());
1080  myTextFieldGenericParameter->setTextColor(FXRGB(0, 0, 0));
1081  }
1082 }
1083 
1084 
1085 std::string
1087  std::string result;
1088  // Generate an string using the following structure: "key1=value1|key2=value2|...
1089  for (auto i = myGenericParameters->begin(); i != myGenericParameters->end(); i++) {
1090  result += i->first + "=" + i->second + "|";
1091  }
1092  // remove the last "|"
1093  if (!result.empty()) {
1094  result.pop_back();
1095  }
1096  return result;
1097 }
1098 
1099 
1100 long
1102  // edit generic parameters using dialog
1104  // set values edited in Parameter dialog in Edited AC
1105  if (myAC) {
1107  } else if (myACs.size() > 0) {
1108  myFrameParent->getViewNet()->getUndoList()->p_begin("Change multiple generic attributes");
1109  for (auto i : myACs) {
1111  }
1113  }
1114  // Refresh parameter editor
1116  }
1117  return 1;
1118 }
1119 
1120 
1121 long
1123  // separate value in a vector of string using | as separator
1124  std::vector<std::string> parsedValues;
1125  StringTokenizer st(myTextFieldGenericParameter->getText().text(), "|", true);
1126  while (st.hasNext()) {
1127  parsedValues.push_back(st.next());
1128  }
1129  // first check if parsed generic parameters are valid
1130  for (auto i : parsedValues) {
1132  WRITE_WARNING("Invalid format of Generic Parameter (" + i + ")");
1133  myTextFieldGenericParameter->setTextColor(FXRGB(255, 0, 0));
1134  return 1;
1135  }
1136  }
1137  // now check if there is duplicated parameters
1138  std::sort(parsedValues.begin(), parsedValues.end());
1139  for (auto i = parsedValues.begin(); i != parsedValues.end(); i++) {
1140  if (((i + 1) != parsedValues.end())) {
1141  std::vector<std::string> firstKey, secondKey;
1142  StringTokenizer stKey1(*i, "=", true);
1143  StringTokenizer stKey2(*(i + 1), "=", true);
1144  //parse both keys
1145  while (stKey1.hasNext()) {
1146  firstKey.push_back(stKey1.next());
1147  }
1148  while (stKey2.hasNext()) {
1149  secondKey.push_back(stKey2.next());
1150  }
1151  // compare both keys and stop if are equal
1152  if ((firstKey.size() != 2) || (secondKey.size() != 2) || (firstKey.front() == secondKey.front())) {
1153  WRITE_WARNING("Generic Parameters wit the same key aren't allowed (" + (*i) + "," + * (i + 1) + ")");
1154  myTextFieldGenericParameter->setTextColor(FXRGB(255, 0, 0));
1155  return 1;
1156  }
1157  }
1158  }
1159  // parsed generic parameters ok, then set text field black and continue
1160  myTextFieldGenericParameter->setTextColor(FXRGB(0, 0, 0));
1161  myTextFieldGenericParameter->killFocus();
1162  // clear current existent generic parameters and set parsed generic parameters
1163  myGenericParameters->clear();
1164  for (auto i : parsedValues) {
1165  std::vector<std::string> parsedParameters;
1166  StringTokenizer stParam(i, "=", true);
1167  while (stParam.hasNext()) {
1168  parsedParameters.push_back(stParam.next());
1169  }
1170  // Check that parsed parameters are exactly two and contains valid chracters
1171  if (parsedParameters.size() == 2 && SUMOXMLDefinitions::isValidGenericParameterKey(parsedParameters.front()) && SUMOXMLDefinitions::isValidGenericParameterValue(parsedParameters.back())) {
1172  myGenericParameters->push_back(std::make_pair(parsedParameters.front(), parsedParameters.back()));
1173  }
1174  }
1175  // if we're editing generic attributes of an AttributeCarrier, set it
1176  if (myAC) {
1178  } else if (myACs.size() > 0) {
1179  myFrameParent->getViewNet()->getUndoList()->p_begin("Change multiple generic attributes");
1180  for (auto i : myACs) {
1182  }
1184  }
1185  return 1;
1186 }
1187 
1188 // ---------------------------------------------------------------------------
1189 // GNEFrame::DrawingShape - methods
1190 // ---------------------------------------------------------------------------
1191 
1193  FXGroupBox(frameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame),
1194  myFrameParent(frameParent),
1195  myDeleteLastCreatedPoint(false) {
1196  // create start and stop buttons
1197  myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton);
1198  myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton);
1199  myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton);
1200 
1201  // create information label
1202  std::ostringstream information;
1203  information
1204  << "- 'Start drawing' or ENTER\n"
1205  << " draws shape boundary.\n"
1206  << "- 'Stop drawing' or ENTER\n"
1207  << " creates shape.\n"
1208  << "- 'Shift + Click'\n"
1209  << " removes last created point.\n"
1210  << "- 'Abort drawing' or ESC\n"
1211  << " removes drawed shape.";
1212  myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation);
1213  // disable stop and abort functions as init
1214  myStopDrawingButton->disable();
1215  myAbortDrawingButton->disable();
1216 }
1217 
1218 
1220 
1221 
1223  // abort current drawing before show
1224  abortDrawing();
1225  // show FXGroupBox
1226  FXGroupBox::show();
1227 }
1228 
1229 
1231  // abort current drawing before hide
1232  abortDrawing();
1233  // show FXGroupBox
1234  FXGroupBox::hide();
1235 }
1236 
1237 
1238 void
1240  // Only start drawing if DrawingShape modul is shown
1241  if (shown()) {
1242  // change buttons
1243  myStartDrawingButton->disable();
1244  myStopDrawingButton->enable();
1245  myAbortDrawingButton->enable();
1246  }
1247 }
1248 
1249 
1250 void
1252  // try to build shape
1253  if (myFrameParent->buildShape()) {
1254  // clear created points
1255  myTemporalShapeShape.clear();
1256  myFrameParent->getViewNet()->update();
1257  // change buttons
1258  myStartDrawingButton->enable();
1259  myStopDrawingButton->disable();
1260  myAbortDrawingButton->disable();
1261  } else {
1262  // abort drawing if shape cannot be created
1263  abortDrawing();
1264  }
1265 }
1266 
1267 
1268 void
1270  // clear created points
1271  myTemporalShapeShape.clear();
1272  myFrameParent->getViewNet()->update();
1273  // change buttons
1274  myStartDrawingButton->enable();
1275  myStopDrawingButton->disable();
1276  myAbortDrawingButton->disable();
1277 }
1278 
1279 
1280 void
1282  if (myStopDrawingButton->isEnabled()) {
1283  myTemporalShapeShape.push_back(P);
1284  } else {
1285  throw ProcessError("A new point cannot be added if drawing wasn't started");
1286  }
1287 }
1288 
1289 
1290 void
1292 
1293 }
1294 
1295 
1296 const PositionVector&
1298  return myTemporalShapeShape;
1299 }
1300 
1301 
1302 bool
1304  return myStopDrawingButton->isEnabled();
1305 }
1306 
1307 
1308 void
1310  myDeleteLastCreatedPoint = value;
1311 }
1312 
1313 
1314 bool
1316  return myDeleteLastCreatedPoint;
1317 }
1318 
1319 
1320 long
1321 GNEFrame::DrawingShape::onCmdStartDrawing(FXObject*, FXSelector, void*) {
1322  startDrawing();
1323  return 0;
1324 }
1325 
1326 
1327 long
1328 GNEFrame::DrawingShape::onCmdStopDrawing(FXObject*, FXSelector, void*) {
1329  stopDrawing();
1330  return 0;
1331 }
1332 
1333 
1334 long
1335 GNEFrame::DrawingShape::onCmdAbortDrawing(FXObject*, FXSelector, void*) {
1336  abortDrawing();
1337  return 0;
1338 }
1339 
1340 // ---------------------------------------------------------------------------
1341 // GNEFrame::NeteditAttributes- methods
1342 // ---------------------------------------------------------------------------
1343 
1345  FXGroupBox(frameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame),
1346  myFrameParent(frameParent),
1347  myCurrentLengthValid(true),
1348  myActualAdditionalReferencePoint(GNE_ADDITIONALREFERENCEPOINT_LEFT) {
1349  // Create FXListBox for the reference points and fill it
1351  myReferencePointMatchBox->appendItem("reference left");
1352  myReferencePointMatchBox->appendItem("reference right");
1353  myReferencePointMatchBox->appendItem("reference center");
1354  // Create Frame for Length Label and textField
1355  FXHorizontalFrame* lengthFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1356  myLengthLabel = new FXLabel(lengthFrame, toString(SUMO_ATTR_LENGTH).c_str(), 0, GUIDesignLabelAttribute);
1357  myLengthTextField = new FXTextField(lengthFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1358  myLengthTextField->setText("10");
1359  // Create Frame for block movement label and checkBox (By default disabled)
1360  FXHorizontalFrame* blockMovement = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1361  myBlockMovementLabel = new FXLabel(blockMovement, "block move", 0, GUIDesignLabelAttribute);
1362  myBlockMovementCheckButton = new FXCheckButton(blockMovement, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
1363  myBlockMovementCheckButton->setCheck(false);
1364  // Create Frame for block shape label and checkBox (By default disabled)
1365  FXHorizontalFrame* blockShapeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1366  myBlockShapeLabel = new FXLabel(blockShapeFrame, "block shape", 0, GUIDesignLabelAttribute);
1367  myBlockShapeCheckButton = new FXCheckButton(blockShapeFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
1368  // Create Frame for block close polygon and checkBox (By default disabled)
1369  FXHorizontalFrame *closePolygonFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1370  myClosePolygonLabel = new FXLabel(closePolygonFrame, "Close shape", 0, GUIDesignLabelAttribute);
1371  myCloseShapeCheckButton = new FXCheckButton(closePolygonFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
1372  myBlockShapeCheckButton->setCheck(false);
1373  // Create help button
1374  helpReferencePoint = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
1375  // Set visible items
1376  myReferencePointMatchBox->setNumVisible((int)myReferencePointMatchBox->getNumItems());
1377 }
1378 
1379 
1381 
1382 
1383 void
1385  // we assume that frame will not be show
1386  bool showFrame = false;
1387  // check if lenght text field has to be showed
1388  if(tagProperty.canMaskStartEndPos()) {
1389  myLengthLabel->show();
1390  myLengthTextField->show();
1391  myReferencePointMatchBox->show();
1392  showFrame = true;
1393  } else {
1394  myLengthLabel->hide();
1395  myLengthTextField->hide();
1396  myReferencePointMatchBox->hide();
1397  }
1398  // check if block movement check button has to be show
1399  if (tagProperty.canBlockMovement()) {
1400  myBlockMovementLabel->show();
1402  showFrame = true;
1403  } else {
1404  myBlockMovementLabel->hide();
1406  }
1407  // check if block shape check button has to be show
1408  if (tagProperty.canBlockShape()) {
1409  myBlockShapeLabel->show();
1410  myBlockShapeCheckButton->show();
1411  showFrame = true;
1412  } else {
1413  myBlockShapeLabel->hide();
1414  myBlockShapeCheckButton->hide();
1415  }
1416  // check if close shape check button has to be show
1417  if (tagProperty.canCloseShape()) {
1418  myClosePolygonLabel->show();
1419  myCloseShapeCheckButton->show();
1420  showFrame = true;
1421  } else {
1422  myClosePolygonLabel->hide();
1423  myCloseShapeCheckButton->hide();
1424  }
1425  // if at least one element is show, show modul
1426  if(showFrame) {
1427  show();
1428  } else {
1429  hide();
1430  }
1431 }
1432 
1433 
1434 void
1436  hide();
1437 }
1438 
1439 
1440 bool
1441 GNEFrame::NeteditAttributes::getNeteditAttributesAndValues(std::map<SumoXMLAttr, std::string> &valuesMap, GNELane *lane) const {
1442  // check if we need to obtain a start and end position over an edge
1443  if(myReferencePointMatchBox->shown()) {
1444  // we need a valid lane to calculate position over lane
1445  if(lane == nullptr) {
1446  return false;
1447  } else if (myCurrentLengthValid) {
1448  // Obtain position of the mouse over lane (limited over grid)
1450  // check if current reference point is valid
1452  std::string errorMessage = "Current selected reference point isn't valid";
1453  myFrameParent->myViewNet->setStatusBarText(errorMessage);
1454  // Write Warning in console if we're in testing mode
1455  WRITE_DEBUG(errorMessage);
1456  return false;
1457  } else {
1458  // obtain lenght
1459  double lenght = GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text());
1460  // set start and end position
1461  valuesMap[SUMO_ATTR_STARTPOS] = toString(setStartPosition(mousePositionOverLane, lenght));
1462  valuesMap[SUMO_ATTR_ENDPOS] = toString(setEndPosition(mousePositionOverLane, lenght));
1463  }
1464  } else {
1465  return false;
1466  }
1467  }
1468  // Save block value if element can be blocked
1469  if (myBlockMovementCheckButton->shown()) {
1470  if(myBlockMovementCheckButton->getCheck() == 1) {
1471  valuesMap[GNE_ATTR_BLOCK_MOVEMENT] = "true";
1472  } else {
1473  valuesMap[GNE_ATTR_BLOCK_MOVEMENT] = "false";
1474  }
1475  }
1476  // Save block shape value if shape's element can be blocked
1477  if (myBlockShapeCheckButton->shown()) {
1478  if(myBlockShapeCheckButton->getCheck() == 1) {
1479  valuesMap[GNE_ATTR_BLOCK_SHAPE] = "true";
1480  } else {
1481  valuesMap[GNE_ATTR_BLOCK_SHAPE] = "false";
1482  }
1483  }
1484  // Save close shape value if shape's element can be closed
1485  if (myCloseShapeCheckButton->shown()) {
1486  if(myCloseShapeCheckButton->getCheck() == 1) {
1487  valuesMap[GNE_ATTR_CLOSE_SHAPE] = "true";
1488  } else {
1489  valuesMap[GNE_ATTR_CLOSE_SHAPE] = "false";
1490  }
1491  }
1492  // all ok, then return true to continue creating element
1493  return true;
1494 }
1495 
1496 
1497 long
1499  if (obj == myBlockMovementCheckButton) {
1500  if (myBlockMovementCheckButton->getCheck()) {
1501  myBlockMovementCheckButton->setText("true");
1502  } else {
1503  myBlockMovementCheckButton->setText("false");
1504  }
1505  } else if (obj == myBlockShapeCheckButton) {
1506  if (myBlockShapeCheckButton->getCheck()) {
1507  myBlockShapeCheckButton->setText("true");
1508  } else {
1509  myBlockShapeCheckButton->setText("false");
1510  }
1511  } else if (obj == myCloseShapeCheckButton) {
1512  if (myCloseShapeCheckButton->getCheck()) {
1513  myCloseShapeCheckButton->setText("true");
1514  } else {
1515  myCloseShapeCheckButton->setText("false");
1516  }
1517  } else if (obj == myLengthTextField) {
1518  // change color of text field depending of the input length
1519  if (GNEAttributeCarrier::canParse<double>(myLengthTextField->getText().text()) &&
1520  GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text()) > 0) {
1521  myLengthTextField->setTextColor(FXRGB(0, 0, 0));
1522  myLengthTextField->killFocus();
1523  myCurrentLengthValid = true;
1524  } else {
1525  myLengthTextField->setTextColor(FXRGB(255, 0, 0));
1526  myCurrentLengthValid = false;
1527  }
1528  // Update aditional frame
1529  update();
1530  } else if (obj == myReferencePointMatchBox) {
1531  // Cast actual reference point type
1532  if (myReferencePointMatchBox->getText() == "reference left") {
1533  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
1535  myLengthTextField->enable();
1536  } else if (myReferencePointMatchBox->getText() == "reference right") {
1537  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
1539  myLengthTextField->enable();
1540  } else if (myReferencePointMatchBox->getText() == "reference center") {
1541  myLengthTextField->enable();
1542  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
1544  myLengthTextField->enable();
1545  } else {
1546  myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0));
1548  myLengthTextField->disable();
1549  }
1550  }
1551 
1552  return 1;
1553 }
1554 
1555 
1556 long
1557 GNEFrame::NeteditAttributes::onCmdHelp(FXObject*, FXSelector, void*) {
1558  // Create dialog box
1559  FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox);
1560  additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL));
1561  // set help text
1562  std::ostringstream help;
1563  help
1564  << "- Referece point: Mark the initial position of the additional element.\n"
1565  << " Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n"
1566  << " - Reference Left will create it with startPos = 70 and endPos = 100.\n"
1567  << " - Reference Right will create it with startPos = 100 and endPos = 130.\n"
1568  << " - Reference Center will create it with startPos = 85 and endPos = 115.\n"
1569  << "\n"
1570  << "- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n"
1571  << " the mouse. This option can be modified inspecting element.";
1572  // Create label with the help text
1573  new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation);
1574  // Create horizontal separator
1575  new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
1576  // Create frame for OK Button
1577  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
1578  // Create Button Close (And two more horizontal frames to center it)
1579  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
1580  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
1581  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
1582  // Write Warning in console if we're in testing mode
1583  WRITE_DEBUG("Opening NeteditAttributes help dialog");
1584  // create Dialog
1585  additionalNeteditAttributesHelpDialog->create();
1586  // show in the given position
1587  additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
1588  // refresh APP
1589  getApp()->refresh();
1590  // open as modal dialog (will block all windows until stop() or stopModal() is called)
1591  getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
1592  // Write Warning in console if we're in testing mode
1593  WRITE_DEBUG("Closing NeteditAttributes help dialog");
1594  return 1;
1595  /**********
1596  help from PolygonFrame
1597  << "- Block movement: If enabled, the created polygon element will be blocked. i.e. cannot be moved with\n"
1598  << " the mouse. This option can be modified inspecting element.\n"
1599  << "\n"
1600  << "- Block shape: If enabled, the shape of created polygon element will be blocked. i.e. their geometry points\n"
1601  << " cannot be edited be moved with the mouse. This option can be modified inspecting element.\n"
1602  << "\n"
1603  << "- Close shape: If enabled, the created polygon element will be closed. i.e. the last created geometry point\n"
1604  << " will be connected with the first geometry point automatically. This option can be modified inspecting element.";
1605 
1606  ****************/
1607 }
1608 
1609 
1610 double
1611 GNEFrame::NeteditAttributes::setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const {
1614  return positionOfTheMouseOverLane;
1616  return positionOfTheMouseOverLane - lengthOfAdditional;
1618  return positionOfTheMouseOverLane - lengthOfAdditional / 2;
1619  default:
1620  throw InvalidArgument("Reference Point invalid");
1621  }
1622 }
1623 
1624 
1625 double
1626 GNEFrame::NeteditAttributes::setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const{
1629  return positionOfTheMouseOverLane + lengthOfAdditional;
1631  return positionOfTheMouseOverLane;
1633  return positionOfTheMouseOverLane + lengthOfAdditional / 2;
1634  default:
1635  throw InvalidArgument("Reference Point invalid");
1636  }
1637 }
1638 
1639 // ---------------------------------------------------------------------------
1640 // GNEFrame - methods
1641 // ---------------------------------------------------------------------------
1642 
1643 GNEFrame::GNEFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, const std::string& frameLabel) :
1644  FXVerticalFrame(horizontalFrameParent, GUIDesignAuxiliarFrame),
1645  myViewNet(viewNet),
1646  myEdgeCandidateColor(RGBColor(0, 64, 0, 255)),
1648 
1649  // Create font
1650  myFrameHeaderFont = new FXFont(getApp(), "Arial", 14, FXFont::Bold),
1651 
1652  // Create frame for header
1653  myHeaderFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1654 
1655  // Create frame for left elements of header (By default unused)
1657  myHeaderLeftFrame->hide();
1658 
1659  // Create titel frame
1660  myFrameHeaderLabel = new FXLabel(myHeaderFrame, frameLabel.c_str(), nullptr, GUIDesignLabelFrameInformation);
1661 
1662  // Create frame for right elements of header (By default unused)
1664  myHeaderRightFrame->hide();
1665 
1666  // Add separator
1667  new FXHorizontalSeparator(this, GUIDesignHorizontalSeparator);
1668 
1669  // Create frame for contents
1670  myScrollWindowsContents = new FXScrollWindow(this, GUIDesignContentsScrollWindow);
1671 
1672  // Create frame for contents
1674 
1675  // Set font of header
1677 
1678  // Hide Frame
1679  FXVerticalFrame::hide();
1680 }
1681 
1682 
1684  delete myFrameHeaderFont;
1685 }
1686 
1687 
1688 void
1690  myFrameHeaderLabel->setFocus();
1691 }
1692 
1693 
1694 void
1696  // show scroll window
1697  FXVerticalFrame::show();
1698  // Show and update Frame Area in which this GNEFrame is placed
1700 }
1701 
1702 
1703 void
1705  // hide scroll window
1706  FXVerticalFrame::hide();
1707  // Hide Frame Area in which this GNEFrame is placed
1709 }
1710 
1711 
1712 void
1714  setWidth(newWidth);
1715  myScrollWindowsContents->setWidth(newWidth);
1716 }
1717 
1718 
1719 GNEViewNet*
1721  return myViewNet;
1722 }
1723 
1724 
1725 FXLabel*
1727  return myFrameHeaderLabel;
1728 }
1729 
1730 
1731 FXFont*
1733  return myFrameHeaderFont;
1734 }
1735 
1736 
1737 bool
1739  // this function has to be reimplemente in all child frames that needs to draw a polygon (for example, GNEFrame or GNETAZFrame)
1740  return false;
1741 }
1742 
1743 
1744 void
1746  // this function has to be reimplemente in all child frames that uses a ItemSelector modul
1747 }
1748 
1749 
1750 void
1752  // this function has to be reimplemente in all child frames that uses a ItemSelector modul
1753 }
1754 
1755 
1756 void
1758  FXDialogBox* attributesHelpDialog = new FXDialogBox(myScrollWindowsContents, ("Parameters of " + tagProperties.getTagStr()).c_str(), GUIDesignDialogBoxResizable, 0, 0, 0, 0, 10, 10, 10, 38, 4, 4);
1759  // Create FXTable
1760  FXTable* myTable = new FXTable(attributesHelpDialog, attributesHelpDialog, MID_TABLE, GUIDesignTableNotEditable);
1761  attributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEINSPECT));
1762  int sizeColumnDescription = 0;
1763  int sizeColumnDefinitions = 0;
1764  myTable->setVisibleRows((FXint)(tagProperties.getNumberOfAttributes()));
1765  myTable->setVisibleColumns(3);
1766  myTable->setTableSize((FXint)(tagProperties.getNumberOfAttributes()), 3);
1767  myTable->setBackColor(FXRGB(255, 255, 255));
1768  myTable->setColumnText(0, "Attribute");
1769  myTable->setColumnText(1, "Description");
1770  myTable->setColumnText(2, "Definition");
1771  myTable->getRowHeader()->setWidth(0);
1772  // Iterate over vector of additional parameters
1773  int itemIndex = 0;
1774  for (auto i : tagProperties) {
1775  // Set attribute
1776  FXTableItem* attribute = new FXTableItem(toString(i.first).c_str());
1777  attribute->setJustify(FXTableItem::CENTER_X);
1778  myTable->setItem(itemIndex, 0, attribute);
1779  // Set description of element
1780  FXTableItem* type = new FXTableItem("");
1781  type->setText(i.second.getDescription().c_str());
1782  sizeColumnDescription = MAX2(sizeColumnDescription, (int)i.second.getDescription().size());
1783  type->setJustify(FXTableItem::CENTER_X);
1784  myTable->setItem(itemIndex, 1, type);
1785  // Set definition
1786  FXTableItem* definition = new FXTableItem(i.second.getDefinition().c_str());
1787  definition->setJustify(FXTableItem::LEFT);
1788  myTable->setItem(itemIndex, 2, definition);
1789  sizeColumnDefinitions = MAX2(sizeColumnDefinitions, (int)i.second.getDefinition().size());
1790  itemIndex++;
1791  }
1792  // set header
1793  FXHeader* header = myTable->getColumnHeader();
1794  header->setItemJustify(0, JUSTIFY_CENTER_X);
1795  header->setItemSize(0, 120);
1796  header->setItemJustify(1, JUSTIFY_CENTER_X);
1797  header->setItemSize(1, sizeColumnDescription * 7);
1798  header->setItemJustify(2, JUSTIFY_CENTER_X);
1799  header->setItemSize(2, sizeColumnDefinitions * 6);
1800  // Create horizontal separator
1801  new FXHorizontalSeparator(attributesHelpDialog, GUIDesignHorizontalSeparator);
1802  // Create frame for OK Button
1803  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(attributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
1804  // Create Button Close (And two more horizontal frames to center it)
1805  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
1806  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), attributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
1807  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
1808  // Write Warning in console if we're in testing mode
1809  WRITE_DEBUG("Opening HelpAttributes dialog for tag '" + tagProperties.getTagStr() + "' showing " + toString(tagProperties.getNumberOfAttributes()) + " attributes");
1810  // create Dialog
1811  attributesHelpDialog->create();
1812  // show in the given position
1813  attributesHelpDialog->show(PLACEMENT_CURSOR);
1814  // refresh APP
1815  getApp()->refresh();
1816  // open as modal dialog (will block all windows until stop() or stopModal() is called)
1817  getApp()->runModalFor(attributesHelpDialog);
1818  // Write Warning in console if we're in testing mode
1819  WRITE_DEBUG("Closing HelpAttributes dialog for tag '" + tagProperties.getTagStr() + "'");
1820 }
1821 
1822 
1823 const RGBColor&
1825  return myEdgeCandidateColor;
1826 }
1827 
1828 
1829 const RGBColor&
1832 }
1833 
1834 /****************************************************************************/
void hideGenericParametersEditor()
hide netedit attributes editor
Definition: GNEFrame.cpp:1057
GNEFrame()
FOX needs this.
Definition: GNEFrame.h:588
bool hasAttrRange() const
return true if Attr correspond to an element that only accept a range of values
bool myDeleteLastCreatedPoint
flag to enable/disable delete point mode
Definition: GNEFrame.h:441
const RGBColor & getEdgeCandidateColor() const
get edge candidate color
Definition: GNEFrame.cpp:1824
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
void hideNeteditAttributesModul()
hide Netedit attributes modul
Definition: GNEFrame.cpp:1435
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
FXTextField * myLengthTextField
textField for length
Definition: GNEFrame.h:521
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:205
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:177
text attribute edited
Definition: GUIAppEnum.h:543
FXButton * myStartDrawingButton
button for start drawing
Definition: GNEFrame.h:447
virtual void enableModuls(const GNEAttributeCarrier::TagProperties &tagProperties)
enable moduls depending of item selected in ItemSelector (can be reimplemented in frame childs) ...
Definition: GNEFrame.cpp:1745
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:115
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:900
void hideFramesArea()
hide frames area if all GNEFrames are hidden
ACAttributes * getACAttributesParent() const
get ACAttributes parent
Definition: GNEFrame.cpp:312
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
Definition: GUIDesigns.h:57
stop drawing polygon
Definition: GUIAppEnum.h:567
void abortDrawing()
abort drawing
Definition: GNEFrame.cpp:1269
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get attributes and their values
Definition: GNEFrame.cpp:493
std::string next()
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name) ...
void hide()
hide delete frame
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren&#39;t allowed) ...
void showParameter(SumoXMLAttr const attr, const GNEAttributeCarrier::AttributeProperties &attrProperties, const std::string &value)
show name and value of attribute of type string
Definition: GNEFrame.cpp:233
begin/end of the description of a junction
begin/end of the description of a single lane
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:1726
FXLabel * myBlockShapeLabel
Label for block shape.
Definition: GNEFrame.h:530
block shape of a graphic element (Used mainly in GNEShapes)
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
Definition: GNEFrame.cpp:682
FXLabel * myLabel
lael with the name of the parameter
Definition: GNEFrame.h:156
FXFont * myFrameHeaderFont
Font for the Header.
Definition: GNEFrame.h:631
FXHorizontalFrame * myHeaderRightFrame
fame for right header elements
Definition: GNEFrame.h:624
void showACHierarchy(GNEAttributeCarrier *AC)
show ACHierarchy
Definition: GNEFrame.cpp:576
ACAttributes()
FOX needs this.
Definition: GNEFrame.h:221
long onCmdSetColorAttribute(FXObject *, FXSelector, void *)
called when user press the "Color" button
Definition: GNEFrame.cpp:425
Definition: GNEPOI.h:45
connectio between two lanes
void hideACHierarchy()
hide ACHierarchy
Definition: GNEFrame.cpp:587
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:108
In GNEINSPECTORFRAME, inspect element.
Definition: GUIAppEnum.h:593
GNEViewParent * getViewParent() const
get the net object
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
Definition: GNEFrame.h:300
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:959
struct with the attribute Properties
bool isFilename() const
return true if atribute is a filename
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
Definition: GNEFrame.cpp:641
void showFramesArea()
show frames area if at least a GNEFrame is showed
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
Definition: GNEFrame.cpp:1309
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
Definition: GUIDesigns.h:270
GNEFrame * myFrameParent
pointer to inspector frame parent
Definition: GNEFrame.h:354
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:946
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
Definition: GNEFrame.h:306
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
void removeLastPoint()
remove last added point
Definition: GNEFrame.cpp:1291
bool isPositive() const
return true if atribute is positive
const RGBColor & getEdgeCandidateSelectedColor() const
get selected color
Definition: GNEFrame.cpp:1830
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
Close shape of a polygon (Used by GNEPolys)
double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the Start position values of StoppingPlaces and E2 detector over the lane
Definition: GNEFrame.cpp:1611
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrame.cpp:1230
static std::vector< SumoXMLTag > allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables)
get tags of all editable element types using TagProperty Type (TAGPROPERTY_NETELEMENT, TAGPROPERTY_ADDITIONAL, etc.)
void refreshGenericParametersEditor()
refresh netedit attributes
Definition: GNEFrame.cpp:1065
bool canMaskStartEndPos() const
return true if tag correspond to an element that can mask the attributes "start" and "end" position a...
FXIcon * getIcon() const
get FXIcon associated to this AC
T MAX2(T a, T b)
Definition: StdDefs.h:76
FXComboBox * myTypeMatchBox
comboBox with the list of elements type
Definition: GNEFrame.h:81
FXCheckButton * myBoolCheckButton
check button to enable/disable the value of boolean parameters
Definition: GNEFrame.h:168
FXScrollWindow * myScrollWindowsContents
scroll windows that holds the content frame
Definition: GNEFrame.h:628
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
GNEFrame * myFrameParent
pointer to Frame Parent
Definition: GNEFrame.h:78
std::vector< ACAttributeRow * > myACAttributeRows
vector with the ACAttribute Rows
Definition: GNEFrame.h:231
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:73
FXFont * getFrameHeaderFont() const
get font of the header&#39;s frame
Definition: GNEFrame.cpp:1732
FXHorizontalFrame * myHeaderFrame
fame for header elements
Definition: GNEFrame.h:618
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
Definition: GUIDesigns.h:490
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
Definition: GNEFrame.cpp:176
GNELane * getLane() const
get GNELane
Definition: GNEPOI.cpp:149
RGBColor myEdgeCandidateSelectedColor
selected edge candidate color (used by some modulds to selected mark edges)
Definition: GNEFrame.h:640
FXCheckButton * myBlockMovementCheckButton
checkBox for block movement
Definition: GNEFrame.h:527
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
Definition: GNEFrame.cpp:1335
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEFrame.cpp:1557
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:1498
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
virtual std::vector< std::pair< std::string, std::string > > getGenericParameters() const =0
return generic parameters as vector of pairs format
GNEAttributeCarrier::TagProperties myTagProperties
current edited Tag Properties
Definition: GNEFrame.h:228
FXButton * myColorEditor
Button for open color editor.
Definition: GNEFrame.h:171
generic attribute
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:1720
bool isProbability() const
return true if atribute is a probability
GNEFrame * myFrameParent
Frame Parent.
Definition: GNEFrame.h:291
GNEAttributeCarrier::TagProperties myInvalidTagProperty
dummy tag properties used if user select an invalid tag
Definition: GNEFrame.h:90
virtual std::string getAttribute(SumoXMLAttr key) const =0
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:241
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
bool isInt() const
return true if atribute is an integer
FXTreeItem * addACIntoList(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
add item into list
Definition: GNEFrame.cpp:983
std::set< FXTreeItem * > myTreeItemsConnections
set used to save tree items without AC assigned, the Incoming/Outcoming connections ...
Definition: GNEFrame.h:303
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrame.cpp:1384
#define GUIDesignComboBox
Definition: GUIDesigns.h:195
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
Definition: GNEFrame.cpp:632
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:612
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
std::vector< GNEAttributeCarrier * > myACs
list of edited ACs
Definition: GNEFrame.h:360
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get current list of inspected ACs
bool isColor() const
return true if atribute is a color
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:1785
Dialog for edit generic parameters.
FXButton * myAbortDrawingButton
button for abort drawing
Definition: GNEFrame.h:453
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
std::string getGenericParametersStr() const
get generic parameters as string
Definition: GNEFrame.cpp:1086
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
Definition: GNEFrame.cpp:149
GNEUndoList * getUndoList() const
get the undoList object
GNEAttributeCarrier::AttributeProperties myAttrProperties
attribute properties
Definition: GNEFrame.h:150
bool canBlockMovement() const
return true if tag correspond to an element that can block their movement
FXCheckButton * myCloseShapeCheckButton
checkbox to enable/disable closing polygon
Definition: GNEFrame.h:539
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:258
double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the End position values of StoppingPlaces and E2 detector over the lane
Definition: GNEFrame.cpp:1626
FXCheckButton * myBlockShapeCheckButton
checkBox for block shape
Definition: GNEFrame.h:533
GNEAttributeCarrier * myAC
edited Attribute Carrier
Definition: GNEFrame.h:357
virtual std::string getPopUpID() const =0
get PopPup ID (Used in AC Hierarchy)
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
void stopDrawing()
stop drawing and check if shape can be created
Definition: GNEFrame.cpp:1251
void startDrawing()
start drawing
Definition: GNEFrame.cpp:1239
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:298
start drawing polygon
Definition: GUIAppEnum.h:565
#define GUIDesignTextField
Definition: GUIDesigns.h:34
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
double getMaximumRange() const
get maximum range
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:615
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1260
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
help button
Definition: GUIAppEnum.h:400
SumoXMLAttr myXMLAttr
current XML attribute
Definition: GNEFrame.h:153
void showAttributeCarrierChilds(GNEAttributeCarrier *AC, FXTreeItem *itemParent)
show child of current attributeCarrier
Definition: GNEFrame.cpp:882
int getNumberOfAttributes() const
get number of attributes
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
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:80
bool isBool() const
return true if atribute is boolean
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:887
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:261
#define GUIDesignContentsScrollWindow
design for the content frame of every frame
Definition: GUIDesigns.h:255
double getMinimumRange() const
get minimum range
A list of positions.
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
FXComboBox * myReferencePointMatchBox
match box with the list of reference points
Definition: GNEFrame.h:515
std::vector< SumoXMLTag > myListOfTags
list of tags that will be shown in Match Box
Definition: GNEFrame.h:87
FXLabel * myFrameHeaderLabel
the label for the frame&#39;s header
Definition: GNEFrame.h:634
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:318
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
bool canCloseShape() const
return true if tag correspond to an element that can close their shape
void showDrawingShape()
show Drawing mode
Definition: GNEFrame.cpp:1222
std::vector< std::pair< std::string, std::string > > * myGenericParameters
pointer to current vector of generic parameters
Definition: GNEFrame.h:363
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1266
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:464
void refreshACHierarchy()
refresh ACHierarchy
Definition: GNEFrame.cpp:594
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
void showACAttributesModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show ACAttributes modul
Definition: GNEFrame.cpp:466
invalid attribute
double getLengthGeometryFactor() const
get lenght geometry factor
Definition: GNELane.cpp:1317
FXFont * getBoldFont()
bool myCurrentLengthValid
Flag to check if current length is valid.
Definition: GNEFrame.h:545
FXButton * myStopDrawingButton
button for stop drawing
Definition: GNEFrame.h:450
attribute edited trought dialog
Definition: GUIAppEnum.h:547
GUIMainWindow * getGUIMainWindow() const
get GUIMainWindow App
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrame.cpp:506
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrame.cpp:1297
int getNumberOfAddedAttributes() const
get number of added attributes
Definition: GNEFrame.cpp:546
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
Definition: GNEFrame.cpp:607
bool isAdditional() const
return true if tag correspond to an additional
void setFrameWidth(int newWidth)
set width of GNEFrame
Definition: GNEFrame.cpp:1713
const std::string getID() const
function to support debugging
In GNEINSPECTORFRAME, delete element.
Definition: GUIAppEnum.h:595
bool isTAZ() const
return true if tag correspond to a TAZ
FXLabel * myBlockMovementLabel
Label for block movement.
Definition: GNEFrame.h:524
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
Definition: GNEFrame.cpp:661
#define GUIDesignDialogBoxResizable
design for standard dialog box (for example, about dialog)
Definition: GUIDesigns.h:419
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:248
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:1689
std::string getValue() const
return value
Definition: GNEFrame.cpp:292
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1287
GNEAttributeCarrier * myAC
Attribute carrier.
Definition: GNEFrame.h:294
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane) const
fill valuesMap with netedit attributes
Definition: GNEFrame.cpp:1441
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:184
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:458
~ACHierarchy()
destructor
Definition: GNEFrame.cpp:572
abort drawing polygon
Definition: GUIAppEnum.h:569
ACHierarchy()
FOX needs this.
Definition: GNEFrame.h:275
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
Definition: GUIDesigns.h:60
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrame.cpp:1281
RGBColor myEdgeCandidateColor
edge candidate color (used by some modulds to mark edges)
Definition: GNEFrame.h:637
~GNEFrame()
destructor
Definition: GNEFrame.cpp:1683
DrawingShape()
FOX needs this.
Definition: GNEFrame.h:434
long onCmdSetBooleanAttribute(FXObject *, FXSelector, void *)
called when user change the value of myBoolCheckButton
Definition: GNEFrame.cpp:415
begin/end of the description of an edge
GenericParametersEditor()
FOX needs this.
Definition: GNEFrame.h:350
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrame.cpp:1303
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
long onCmdStartDrawing(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:1321
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:46
~NeteditAttributes()
destructor
Definition: GNEFrame.cpp:1380
GNEFrame * myFrameParent
pointer to frame parent
Definition: GNEFrame.h:438
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:995
#define GUIDesignButton
Definition: GUIDesigns.h:54
FXButton * helpReferencePoint
Button for help about the reference point.
Definition: GNEFrame.h:542
const PositionVector & getShape() const
returns the shape of the lane
Definition: GNELane.cpp:669
~ItemSelector()
destructor
Definition: GNEFrame.cpp:145
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
Definition: GNEEdge.cpp:873
bool isFloat() const
return true if atribute is a float
virtual void show()
show Frame
Definition: GNEFrame.cpp:1695
FXTextField * myTextFieldStrings
textField to modify the default value of string parameters
Definition: GNEFrame.h:165
#define GUIDesignDialogBox
Definition: GUIDesigns.h:410
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:227
GNEFrame * myFrameParent
pointer to Polygon Frame Parent
Definition: GNEFrame.h:221
struct with the attribute Properties
GNEFrame * myFrameParent
pointer to frame parent
Definition: GNEFrame.h:512
FXLabel * myClosePolygonLabel
Label for open/close polygon.
Definition: GNEFrame.h:536
void showGenericParametersEditor(GNEAttributeCarrier *AC)
show netedit attributes editor (used for edit generic parameters of an existent AC) ...
Definition: GNEFrame.cpp:1013
long onCmdSetGenericParameter(FXObject *, FXSelector, void *)
Called when user udpate the generic parameter text field.
Definition: GNEFrame.cpp:1122
ACAttributeRow()
FOX needs this.
Definition: GNEFrame.h:143
crossing between edges for pedestrians
~DrawingShape()
destructor
Definition: GNEFrame.cpp:1219
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
Definition: GNEFrame.cpp:1328
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:37
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:1704
long onCmdSelectItem(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:183
~ACAttributeRow()
destructor
Definition: GNEFrame.cpp:229
void hideParameter()
hide all parameters
Definition: GNEFrame.cpp:273
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
FXTextField * myTextFieldGenericParameter
text field for write generic parameter
Definition: GNEFrame.h:366
GNENet * getNet() const
get the net object
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
Definition: GUIDesigns.h:40
~ACAttributes()
destructor
Definition: GNEFrame.cpp:461
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:114
FXLabel * myLengthLabel
Label for length.
Definition: GNEFrame.h:518
GUIGlID getGlID() const
Returns the numerical id of the object.
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
Definition: GNEFrame.cpp:621
attribute edited
Definition: GUIAppEnum.h:537
#define GUIDesignTableNotEditable
design for table extended over frame that cannot be edited
Definition: GUIDesigns.h:441
#define GUIDesignButtonOK
Definition: GUIDesigns.h:96
void removeAttributeCarrier(GNEAttributeCarrier *ac, bool ignoreOptions=false)
remove attribute carrier (element)
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:727
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
FXTextField * myTextFieldInt
textField to modify the default value of int/float/string parameters
Definition: GNEFrame.h:159
FXTreeList * myTreelist
tree list to show the childs of the element to erase
Definition: GNEFrame.h:297
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
const std::string & getDefaultValue() const
get default value
virtual bool buildShape()
build a shaped element using the drawed shape (can be reimplemented in frame childs) return true if w...
Definition: GNEFrame.cpp:1738
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
void openHelpAttributesDialog(const GNEAttributeCarrier::TagProperties &tagProperties) const
Open help attributes dialog.
Definition: GNEFrame.cpp:1757
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrame.cpp:533
bool isTime() const
return true if atribute is time
long onCmdHelp(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:552
parent of an additional element
used to select a type of element in a combo box
Definition: GUIAppEnum.h:541
GNEAttributeCarrier::TagProperties myCurrentTagProperties
current tag properties
Definition: GNEFrame.h:84
virtual void disableModuls()
disable moduls if element selected in itemSelector isn&#39;t valid (can be reimplemented in frame childs)...
Definition: GNEFrame.cpp:1751
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrame.cpp:1315
In GNEINSPECTORFRAME, center element.
Definition: GUIAppEnum.h:591
bool attribute edited
Definition: GUIAppEnum.h:545
FXTextField * myTextFieldReal
textField to modify the default value of real/times parameters
Definition: GNEFrame.h:162
begin/end of the description of a Point of interest over Lane (used by Netedit)
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:166
friend class ACAttributeRow
FOX-declaration.
Definition: GNEFrame.h:186
bool canBlockShape() const
return true if tag correspond to an element that can block their shape
SumoXMLAttr getAttr() const
return Attr
Definition: GNEFrame.cpp:286
const std::string & isAttributeValid() const
returns a empty string if current value is valid, a string with information about invalid value in ot...
Definition: GNEFrame.cpp:306
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
FXLabel * myInformationLabel
Label with information.
Definition: GNEFrame.h:456
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name) ...
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1059
FXDEFMAP(GNEFrame::ItemSelector) ItemSelectorMap[]
long onCmdEditGenericParameter(FXObject *, FXSelector, void *)
Definition: GNEFrame.cpp:1101
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void setCurrentTypeTag(SumoXMLTag typeTag)
set current type manually
Definition: GNEFrame.cpp:155
void hideACAttributesModul()
hide group box
Definition: GNEFrame.cpp:487
The Table.
Definition: GUIAppEnum.h:292
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:621
NeteditAttributes()
FOX needs this.
Definition: GNEFrame.h:494
FXButton * myEditGenericParameterButton
button for add generic parameter
Definition: GNEFrame.h:369
std::string myInvalidValue
string which indicates the reason due current value is invalid
Definition: GNEFrame.h:174
begin/end of the description of a polygon
AdditionalReferencePoint myActualAdditionalReferencePoint
actual additional reference point selected in the match Box
Definition: GNEFrame.h:548
GNEJunction * getParentJunction() const
get parent Junction
Definition: GNECrossing.cpp:79
ACAttributes * myACAttributesParent
pointer to ACAttributes
Definition: GNEFrame.h:147
PositionVector myTemporalShapeShape
current drawed shape
Definition: GNEFrame.h:444