Eclipse SUMO - Simulation of Urban MObility
GNEFrameAttributesModuls.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-2021 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Auxiliar class for GNEFrame Moduls (only for attributes edition)
19 /****************************************************************************/
20 #include <config.h>
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
33 
34 #include "GNEFrame.h"
36 
37 
38 // ===========================================================================
39 // FOX callback mapping
40 // ===========================================================================
41 
45 };
46 
47 FXDEFMAP(GNEFrameAttributesModuls::AttributesCreator) AttributesCreatorMap[] = {
50 };
51 
52 FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorFlow) AttributesCreatorFlowMap[] = {
55 };
56 
57 FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorRow) AttributesEditorRowMap[] = {
61 };
62 
65 };
66 
67 FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorFlow) AttributesEditorFlowMap[] = {
70 };
71 
72 FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorExtended) AttributesEditorExtendedMap[] = {
74 };
75 
76 FXDEFMAP(GNEFrameAttributesModuls::ParametersEditorCreator) ParametersEditorCreatorMap[] = {
79 };
80 
85 };
86 
87 FXDEFMAP(GNEFrameAttributesModuls::NeteditAttributes) NeteditAttributesMap[] = {
90 };
91 
92 // Object implementation
93 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreatorRow, FXHorizontalFrame, RowCreatorMap, ARRAYNUMBER(RowCreatorMap))
94 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreator, FXGroupBoxModule, AttributesCreatorMap, ARRAYNUMBER(AttributesCreatorMap))
95 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreatorFlow, FXGroupBoxModule, AttributesCreatorFlowMap, ARRAYNUMBER(AttributesCreatorFlowMap))
96 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorRow, FXHorizontalFrame, AttributesEditorRowMap, ARRAYNUMBER(AttributesEditorRowMap))
97 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditor, FXGroupBoxModule, AttributesEditorMap, ARRAYNUMBER(AttributesEditorMap))
98 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorFlow, FXGroupBoxModule, AttributesEditorFlowMap, ARRAYNUMBER(AttributesEditorFlowMap))
99 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorExtended, FXGroupBoxModule, AttributesEditorExtendedMap, ARRAYNUMBER(AttributesEditorExtendedMap))
100 FXIMPLEMENT(GNEFrameAttributesModuls::ParametersEditorCreator, FXGroupBoxModule, ParametersEditorCreatorMap, ARRAYNUMBER(ParametersEditorCreatorMap))
101 FXIMPLEMENT(GNEFrameAttributesModuls::DrawingShape, FXGroupBoxModule, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap))
102 FXIMPLEMENT(GNEFrameAttributesModuls::NeteditAttributes, FXGroupBoxModule, NeteditAttributesMap, ARRAYNUMBER(NeteditAttributesMap))
103 
104 
105 // ===========================================================================
106 // method definitions
107 // ===========================================================================
108 
109 // ---------------------------------------------------------------------------
110 // GNEFrameAttributesModuls::AttributesCreatorRow - methods
111 // ---------------------------------------------------------------------------
112 
114  FXHorizontalFrame(AttributesCreatorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame),
115  myAttributesCreatorParent(AttributesCreatorParent),
116  myAttrProperties(attrProperties) {
117  // Create left visual elements
118  myAttributeLabel = new FXLabel(this, "name", nullptr, GUIDesignLabelAttribute);
119  myAttributeLabel->hide();
120  myEnableAttributeCheckButton = new FXCheckButton(this, "name", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
121  myEnableAttributeCheckButton->hide();
122  myAttributeButton = new FXButton(this, "button", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
123  myAttributeButton->hide();
124  // Create right visual elements
125  myValueTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
126  myValueTextField->hide();
127  myValueCheckButton = new FXCheckButton(this, "Disabled", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
128  myValueCheckButton->hide();
129  myValueComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxAttribute);
130  myValueComboBox->hide();
131  // only create if parent was created
132  if (getParent()->id()) {
133  // create AttributesCreatorRow
134  FXHorizontalFrame::create();
135  // refresh row
136  refreshRow();
137  // show AttributesCreatorRow
138  show();
139  }
140 }
141 
142 
143 void
145  // only destroy if parent was created
146  if (getParent()->id()) {
147  FXHorizontalFrame::destroy();
148  }
149 }
150 
151 
154  return myAttrProperties;
155 }
156 
157 
158 std::string
160  if (myAttrProperties.isBool()) {
161  return (myValueCheckButton->getCheck() == 1) ? "1" : "0";
162  } else if (myAttrProperties.isDiscrete()) {
163  return myValueComboBox->getText().text();
164  } else {
165  return myValueTextField->getText().text();
166  }
167 }
168 
169 
170 bool
172  if (shown()) {
173  return myEnableAttributeCheckButton->getCheck() == TRUE;
174  } else {
175  return false;
176  }
177 }
178 
179 
180 void
182  if (shown()) {
183  // set radio button
184  myEnableAttributeCheckButton->setCheck(value);
185  // enable or disable input fields
186  if (value) {
187  if (myAttrProperties.isBool()) {
188  myValueCheckButton->enable();
189  } else if (myAttrProperties.isDiscrete()) {
190  myValueComboBox->enable();
191  } else {
192  myValueTextField->enable();
193  }
194  } else {
195  if (myAttrProperties.isBool()) {
196  myValueCheckButton->disable();
197  } else if (myAttrProperties.isDiscrete()) {
198  myValueComboBox->disable();
199  } else {
200  myValueTextField->disable();
201  }
202  }
203  }
204 }
205 
206 
207 void
209  if (myAttrProperties.isBool()) {
210  return myValueCheckButton->enable();
211  } else if (myAttrProperties.isDiscrete()) {
212  myValueComboBox->enable();
213  } else {
214  return myValueTextField->enable();
215  }
216 }
217 
218 
219 void
221  if (myAttrProperties.isBool()) {
222  return myValueCheckButton->disable();
223  } else if (myAttrProperties.isDiscrete()) {
224  myValueComboBox->disable();
225  } else {
226  return myValueTextField->disable();
227  }
228 }
229 
230 
231 bool
233  if (!shown()) {
234  return false;
235  } else if (myAttrProperties.isBool()) {
236  return myValueCheckButton->isEnabled();
237  } else if (myAttrProperties.isDiscrete()) {
238  myValueComboBox->isEnabled();
239  } else {
240  return myValueTextField->isEnabled();
241  }
242 }
243 
244 
245 void
247  // reset invalid value
248  myInvalidValue.clear();
249  // special case for attribute ID
250  if ((myAttrProperties.getAttr() == SUMO_ATTR_ID) && myAttrProperties.hasAutomaticID()) {
251  // show check button and disable it
252  myEnableAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
253  myEnableAttributeCheckButton->setCheck(false);
254  myEnableAttributeCheckButton->show();
255  // show text field and disable it
256  myValueTextField->setTextColor(FXRGB(0, 0, 0));
257  myValueTextField->disable();
258  // generate ID
259  myValueTextField->setText(generateID().c_str());
260  // show textField
261  myValueTextField->show();
262  } else {
263  // left
264  if (myAttrProperties.isColor() || (myAttrProperties.getAttr() == SUMO_ATTR_ALLOW) || (myAttrProperties.getAttr() == SUMO_ATTR_DISALLOW)) {
265  // show color button
266  myAttributeButton->setTextColor(FXRGB(0, 0, 0));
267  myAttributeButton->setText(myAttrProperties.getAttrStr().c_str());
268  myAttributeButton->show();
269  } else if (myAttrProperties.isActivatable()) {
270  // show check button
271  myEnableAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
272  myEnableAttributeCheckButton->show();
273  // enable or disable depending of template AC
274  if (myAttributesCreatorParent->getCurrentTemplateAC()->isAttributeEnabled(myAttrProperties.getAttr())) {
275  myEnableAttributeCheckButton->setCheck(TRUE);
276  } else {
277  myEnableAttributeCheckButton->setCheck(FALSE);
278  }
279  } else {
280  // show label
281  myAttributeLabel->setText(myAttrProperties.getAttrStr().c_str());
282  myAttributeLabel->show();
283  }
284  // right
285  if (myAttrProperties.isBool()) {
286  if (GNEAttributeCarrier::parse<bool>(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()))) {
287  myValueCheckButton->setCheck(true);
288  myValueCheckButton->setText("true");
289  } else {
290  myValueCheckButton->setCheck(false);
291  myValueCheckButton->setText("false");
292  }
293  myValueCheckButton->show();
294  // if it's associated to a label button and is disabled, then disable myValueCheckButton
295  if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) {
296  myValueCheckButton->disable();
297  }
298  } else if (myAttrProperties.isDiscrete()) {
299  // fill textField
300  myValueComboBox->clearItems();
301  for (const auto &item : myAttrProperties.getDiscreteValues()) {
302  myValueComboBox->appendItem(item.c_str());
303  }
304  myValueComboBox->setNumVisible(myValueComboBox->getNumItems());
305  myValueComboBox->setTextColor(FXRGB(0, 0, 0));
306  myValueComboBox->setText(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()).c_str());
307  myValueComboBox->show();
308  // if it's associated to a label button and is disabled, then disable myValueTextField
309  if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) {
310  myValueComboBox->disable();
311  }
312  } else {
313  myValueTextField->setTextColor(FXRGB(0, 0, 0));
314  myValueTextField->setText(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()).c_str());
315  myValueTextField->show();
316  // if it's associated to a label button and is disabled, then disable myValueTextField
317  if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) {
318  myValueTextField->disable();
319  }
320  }
321  }
322 }
323 
324 
325 void
327  myAttributeLabel->disable();
328  myEnableAttributeCheckButton->disable();
329  myAttributeButton->disable();
330  myValueTextField->disable();
331  myValueComboBox->disable();
332  myValueCheckButton->disable();
333 }
334 
335 
336 bool
338  return (myValueTextField->getTextColor() != FXRGB(255, 0, 0) &&
339  myValueComboBox->getTextColor() != FXRGB(255, 0, 0));
340 }
341 
342 
345  return myAttributesCreatorParent;
346 }
347 
348 
349 long
351  // check what object was called
352  if (obj == myEnableAttributeCheckButton) {
353  if (myEnableAttributeCheckButton->getCheck()) {
354  // enable text field
355  if (myValueTextField->shown()) {
356  myValueTextField->enable();
357  }
358  // enable comboBox
359  if (myValueComboBox->shown()) {
360  myValueComboBox->enable();
361  }
362  // enable check button
363  if (myValueCheckButton->shown()) {
364  myValueCheckButton->enable();
365  }
366  myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(myAttrProperties.getAttr(), true, -1);
367  } else {
368  // disable text field
369  if (myValueTextField->shown()) {
370  myValueTextField->disable();
371  }
372  // disable text field
373  if (myValueComboBox->shown()) {
374  myValueComboBox->disable();
375  }
376  // disable check button
377  if (myValueCheckButton->shown()) {
378  myValueCheckButton->disable();
379  }
380  myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(myAttrProperties.getAttr(), false, -1);
381  }
382  } else if (obj == myValueCheckButton) {
383  if (myValueCheckButton->getCheck()) {
384  myValueCheckButton->setText("true");
385  myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), "true");
386  } else {
387  myValueCheckButton->setText("false");
388  myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), "false");
389  }
390  } else if (obj == myValueComboBox) {
391  // change color of text field depending of myCurrentValueValid
392  if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(myAttrProperties.getAttr(), myValueComboBox->getText().text())) {
393  // check color depending if is a default value
394  if (myAttrProperties.hasDefaultValue() && (myAttrProperties.getDefaultValue() == myValueComboBox->getText().text())) {
395  myValueComboBox->setTextColor(FXRGB(128, 128, 128));
396  } else {
397  myValueComboBox->setTextColor(FXRGB(0, 0, 0));
398  }
399  myValueComboBox->killFocus();
400  myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), myValueComboBox->getText().text());
401  } else {
402  // if value of TextField isn't valid, change their color to Red
403  myValueComboBox->setTextColor(FXRGB(255, 0, 0));
404  }
405  } else if (obj == myValueTextField) {
406  // change color of text field depending of myCurrentValueValid
407  if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(myAttrProperties.getAttr(), myValueTextField->getText().text())) {
408  // check color depending if is a default value
409  if (myAttrProperties.hasDefaultValue() && (myAttrProperties.getDefaultValue() == myValueTextField->getText().text())) {
410  myValueTextField->setTextColor(FXRGB(128, 128, 128));
411  } else {
412  myValueTextField->setTextColor(FXRGB(0, 0, 0));
413  }
414  myValueTextField->killFocus();
415  myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), myValueTextField->getText().text());
416  } else {
417  // if value of TextField isn't valid, change their color to Red
418  myValueTextField->setTextColor(FXRGB(255, 0, 0));
419  }
420  }
421  // Update aditional frame
422  update();
423  return 1;
424 }
425 
426 
427 long
429  // continue depending of attribute
430  if (myAttrProperties.getAttr() == SUMO_ATTR_COLOR) {
431  // create FXColorDialog
432  FXColorDialog colordialog(this, tr("Color Dialog"));
433  colordialog.setTarget(this);
434  // If previous attribute wasn't correct, set black as default color
435  if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
436  colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myValueTextField->getText().text())));
437  } else {
438  colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myAttrProperties.getDefaultValue())));
439  }
440  // execute dialog to get a new color
441  if (colordialog.execute()) {
442  myValueTextField->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str(), TRUE);
443  }
444  } else if ((myAttrProperties.getAttr() == SUMO_ATTR_ALLOW) || (myAttrProperties.getAttr() == SUMO_ATTR_DISALLOW)) {
445  // get allow string
446  std::string allow = myValueTextField->getText().text();
447  // get accept changes
448  bool acceptChanges = false;
449  // opena allowDisallow dialog
450  GNEAllowDisallow(myAttributesCreatorParent->getFrameParent()->getViewNet(), &allow, &acceptChanges).execute();
451  // continue depending of acceptChanges
452  if (acceptChanges) {
454  myValueTextField->setText(allow.c_str(), TRUE);
455  }
456  }
457  return 0;
458 }
459 
460 
461 std::string
463  // get attribute carriers
464  const auto& GNEAttributeCarriers = myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
465  // continue depending of type
466  if (myAttrProperties.getTagPropertyParent().isShape()) {
467  return GNEAttributeCarriers->generateShapeID(myAttrProperties.getTagPropertyParent().getXMLTag());
468  } else if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) {
469  return GNEAttributeCarriers->generateAdditionalID(myAttrProperties.getTagPropertyParent().getTag());
470  } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) {
471  return GNEAttributeCarriers->generateDemandElementID(myAttrProperties.getTagPropertyParent().getTag());
472  } else {
473  return "";
474  }
475 }
476 
477 
478 bool
480  if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) {
481  return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional(
482  myAttrProperties.getTagPropertyParent().getTag(), myValueTextField->getText().text(), false) == nullptr);
483  } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) {
484  return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional(
485  myAttrProperties.getTagPropertyParent().getTag(), myValueTextField->getText().text(), false) == nullptr);
486  } else {
487  throw ProcessError("Unsuported additional ID");
488  }
489 }
490 
491 // ---------------------------------------------------------------------------
492 // GNEFrameAttributesModuls::AttributesCreator - methods
493 // ---------------------------------------------------------------------------
494 
496  FXGroupBoxModule(frameParent->myContentFrame, "Internal attributes"),
497  myFrameParent(frameParent),
498  myTemplateAC(nullptr) {
499  // resize myAttributesCreatorRows
501  // create myAttributesCreatorFlow
503  // create reset and help button
506  new FXButton(myFrameButtons, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
507 }
508 
509 
511 
512 
513 void
514 GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul(GNEAttributeCarrier *templateAC, const std::vector<SumoXMLAttr>& hiddenAttributes) {
515  // destroy all rows
516  for (auto& row : myAttributesCreatorRows) {
517  // destroy and delete all rows
518  if (row != nullptr) {
519  row->destroy();
520  delete row;
521  row = nullptr;
522  }
523  }
524  if (templateAC) {
525  // set current template AC and hidden attributes
526  myTemplateAC = templateAC;
527  myHiddenAttributes = hiddenAttributes;
528  // refresh rows (new rows will be created)
529  refreshRows(true);
530  // enable reset
531  myResetButton->enable();
532  // show
533  show();
534  } else {
535  throw ProcessError("invalid templateAC in showAttributesCreatorModul");
536  }
537 }
538 
539 
540 void
542  // hide attributes creator flow
543  myAttributesCreatorFlow->hideAttributesCreatorFlowModul();
544  // hide modul
545  hide();
546 }
547 
548 
549 GNEFrame*
551  return myFrameParent;
552 }
553 
554 
555 void
557  // get standard parameters
558  for (const auto& row : myAttributesCreatorRows) {
559  if (row && row->getAttrProperties().getAttr() != SUMO_ATTR_NOTHING) {
560  const auto& attrProperties = row->getAttrProperties();
561  // flag for row enabled
562  bool rowEnabled = row->isAttributesCreatorRowEnabled();
563  // flag for default attributes
564  bool hasDefaultStaticValue = !attrProperties.hasDefaultValue() || (attrProperties.getDefaultValue() != row->getValue());
565  // flag for enablitables attributes
566  bool isFlowDefinitionAttribute = attrProperties.isFlowDefinition();
567  // flag for optional attributes
568  bool isActivatableAttribute = attrProperties.isActivatable() && row->getAttributeCheckButtonCheck();
569  // check if flags configuration allow to include values
570  if (rowEnabled && (includeAll || hasDefaultStaticValue || isFlowDefinitionAttribute || isActivatableAttribute)) {
571  // add attribute depending of type
572  if (attrProperties.isInt()) {
573  const int intValue = GNEAttributeCarrier::canParse<int>(row->getValue())? GNEAttributeCarrier::parse<int>(row->getValue()) : GNEAttributeCarrier::parse<int>(attrProperties.getDefaultValue());
574  baseObject->addIntAttribute(attrProperties.getAttr(), intValue);
575  } else if (attrProperties.isFloat()) {
576  const double doubleValue = GNEAttributeCarrier::canParse<double>(row->getValue())? GNEAttributeCarrier::parse<double>(row->getValue()) : GNEAttributeCarrier::parse<double>(attrProperties.getDefaultValue());
577  baseObject->addDoubleAttribute(attrProperties.getAttr(), doubleValue);
578  } else if (attrProperties.isBool()) {
579  const bool boolValue = GNEAttributeCarrier::canParse<bool>(row->getValue())? GNEAttributeCarrier::parse<bool>(row->getValue()) : GNEAttributeCarrier::parse<bool>(attrProperties.getDefaultValue());
580  baseObject->addBoolAttribute(attrProperties.getAttr(), boolValue);
581  } else if (attrProperties.isposition()) {
582  const Position positionValue = GNEAttributeCarrier::canParse<Position>(row->getValue())? GNEAttributeCarrier::parse<Position>(row->getValue()) : GNEAttributeCarrier::parse<Position>(attrProperties.getDefaultValue());
583  baseObject->addPositionAttribute(attrProperties.getAttr(), positionValue);
584  } else if (attrProperties.isSUMOTime()) {
585  const SUMOTime timeValue = GNEAttributeCarrier::canParse<SUMOTime>(row->getValue())? GNEAttributeCarrier::parse<SUMOTime>(row->getValue()) : GNEAttributeCarrier::parse<SUMOTime>(attrProperties.getDefaultValue());
586  baseObject->addTimeAttribute(attrProperties.getAttr(), timeValue);
587  } else if (attrProperties.isColor()) {
588  const RGBColor colorValue = GNEAttributeCarrier::canParse<RGBColor>(row->getValue())? GNEAttributeCarrier::parse<RGBColor>(row->getValue()) : GNEAttributeCarrier::parse<RGBColor>(attrProperties.getDefaultValue());
589  baseObject->addColorAttribute(attrProperties.getAttr(), colorValue);
590  } else if (attrProperties.isList()) {
591  if (attrProperties.isposition()) {
592  const PositionVector positionVectorValue = GNEAttributeCarrier::canParse<PositionVector>(row->getValue())? GNEAttributeCarrier::parse<PositionVector>(row->getValue()) : GNEAttributeCarrier::parse<PositionVector>(attrProperties.getDefaultValue());
593  baseObject->addPositionVectorAttribute(attrProperties.getAttr(), positionVectorValue);
594  } else {
595  const std::vector<std::string> stringVectorValue = GNEAttributeCarrier::canParse<std::vector<std::string> >(row->getValue())? GNEAttributeCarrier::parse<std::vector<std::string> >(row->getValue()) : GNEAttributeCarrier::parse<std::vector<std::string> >(attrProperties.getDefaultValue());
596  baseObject->addStringListAttribute(attrProperties.getAttr(), stringVectorValue);
597  }
598  } else {
599  baseObject->addStringAttribute(attrProperties.getAttr(), row->getValue());
600  }
601  }
602  }
603  }
604  // add extra flow attributes (only will updated if myAttributesCreatorFlow is shown)
605  myAttributesCreatorFlow->setFlowParameters(baseObject);
606 }
607 
608 
611  return myTemplateAC;
612 }
613 
614 
615 void
617  std::string errorMessage;
618  // show warning box if input parameters aren't invalid
619  if (extra.size() == 0) {
620  errorMessage = "Invalid input parameter of " + myTemplateAC->getTagProperty().getTagStr();
621  } else {
622  errorMessage = "Invalid input parameter of " + myTemplateAC->getTagProperty().getTagStr() + ": " + extra;
623  }
624  // set message in status bar
625  myFrameParent->myViewNet->setStatusBarText(errorMessage);
626  // Write Warning in console if we're in testing mode
627  WRITE_DEBUG(errorMessage);
628 }
629 
630 
631 void
633  // just refresh row without creating new rows
634  if (shown() && myTemplateAC) {
635  refreshRows(false);
636  }
637 }
638 
639 
640 void
642  // disable all rows
643  for (const auto &row : myAttributesCreatorRows) {
644  if (row) {
645  row->disableRow();
646  }
647  }
648  // also disable reset
649  myResetButton->disable();
650 }
651 
652 
653 bool
655  // iterate over standar parameters
656  for (const auto& attribute : myTemplateAC->getTagProperty()) {
657  // Return false if error message of attriuve isn't empty
658  if (myAttributesCreatorRows.at(attribute.getPositionListed()) && !myAttributesCreatorRows.at(attribute.getPositionListed())->isAttributeValid()) {
659  return false;
660  }
661  }
662  return true;
663 }
664 
665 
666 long
668  if (myTemplateAC) {
669  myTemplateAC->resetDefaultValues();
670  refreshRows(false);
671  }
672  return 1;
673 }
674 
675 
676 long
678  // open Help attributes dialog
679  myFrameParent->openHelpAttributesDialog(myTemplateAC);
680  return 1;
681 }
682 
683 
684 void
686  // declare a flag to show Flow editor
687  bool showFlowEditor = false;
688  // iterate over tag attributes and create AttributesCreatorRows for every attribute
689  for (const auto& attribute : myTemplateAC->getTagProperty()) {
690  // declare falg to check conditions for show attribute
691  bool showAttribute = true;
692  // check that only non-unique attributes (except ID) are created (And depending of includeExtendedAttributes)
693  if (attribute.isUnique() && (attribute.getAttr() != SUMO_ATTR_ID)) {
694  showAttribute = false;
695  }
696  // check if attribute must stay hidden
697  if (std::find(myHiddenAttributes.begin(), myHiddenAttributes.end(), attribute.getAttr()) != myHiddenAttributes.end()) {
698  showAttribute = false;
699  }
700  // check if attribute is a flow definitionattribute
701  if (attribute.isFlowDefinition()) {
702  showAttribute = false;
703  showFlowEditor = true;
704  }
705  // check special case for vaporizer IDs
706  if ((attribute.getAttr() == SUMO_ATTR_ID) && (attribute.getTagPropertyParent().getTag() == SUMO_TAG_VAPORIZER)) {
707  showAttribute = false;
708  }
709  // check special case for VType IDs in vehicle Frame
710  if ((attribute.getAttr() == SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) &&
711  (myFrameParent->getViewNet()->getEditModes().demandEditMode == DemandEditMode::DEMAND_VEHICLE)) {
712  showAttribute = false;
713  }
714  // show attribute depending of showAttribute flag
715  if (showAttribute) {
716  // check if we have to create a new row
717  if (createRows) {
718  myAttributesCreatorRows.at(attribute.getPositionListed()) = new AttributesCreatorRow(this, attribute);
719  } else {
720  myAttributesCreatorRows.at(attribute.getPositionListed())->refreshRow();
721  }
722  }
723  }
724  // reparent help button (to place it at bottom)
725  myFrameButtons->reparent(getCollapsableFrame());
726  // recalc
727  recalc();
728  // check if flow editor has to be shown
729  if (showFlowEditor) {
730  myAttributesCreatorFlow->showAttributesCreatorFlowModul(
731  myTemplateAC->getTagProperty().hasAttribute(SUMO_ATTR_VEHSPERHOUR) ||
732  myTemplateAC->getTagProperty().hasAttribute(SUMO_ATTR_PERSONSPERHOUR) ||
733  myTemplateAC->getTagProperty().hasAttribute(SUMO_ATTR_CONTAINERSPERHOUR));
734  } else {
735  myAttributesCreatorFlow->hideAttributesCreatorFlowModul();
736  }
737 }
738 
739 // ---------------------------------------------------------------------------
740 // GNEFrameAttributesModuls::AttributesCreatorFlow - methods
741 // ---------------------------------------------------------------------------
742 
744  FXGroupBoxModule(attributesCreatorParent->getFrameParent()->myContentFrame, "Flow attributes"),
745  myAttributesCreatorParent(attributesCreatorParent),
746  myFlowParameters(VEHPARS_END_SET | VEHPARS_NUMBER_SET) {
747  // declare auxiliar horizontal frame
748  FXHorizontalFrame* auxiliarHorizontalFrame = nullptr;
749  // create elements for end attribute
750  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
751  myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
752  myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
753  // create elements for number attribute
754  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
755  myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
756  myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
757  // create elements for vehsPerHour attribute
758  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
760  myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
761  // create elements for period attribute
762  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
763  myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
764  myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
765  // create elements for Probability attribute
766  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
767  myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
768  myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
769  // set default values
770  myValueEndTextField->setText("3600");
771  myValueNumberTextField->setText("1800");
772  myValueVehsPerHourTextField->setText("1800");
773  myValuePeriodTextField->setText("2");
774  myValueProbabilityTextField->setText("0.5");
775  // refresh attributes
777 }
778 
779 
781 
782 
783 void
785  if (persons) {
786  myAttributeVehsPerHourRadioButton->setText(toString(SUMO_ATTR_PERSONSPERHOUR).c_str());
787  } else {
788  myAttributeVehsPerHourRadioButton->setText(toString(SUMO_ATTR_VEHSPERHOUR).c_str());
789  }
790  // show
791  show();
792 }
793 
794 
795 void
797  hide();
798 }
799 
800 
801 void
803  if (myFlowParameters & VEHPARS_END_SET) {
804  myAttributeEndRadioButton->setCheck(TRUE);
805  myValueEndTextField->enable();
806  } else {
807  myAttributeEndRadioButton->setCheck(FALSE);
808  myValueEndTextField->disable();
809  }
810  if (myFlowParameters & VEHPARS_NUMBER_SET) {
811  myAttributeNumberRadioButton->setCheck(TRUE);
812  myValueNumberTextField->enable();
813  } else {
814  myAttributeNumberRadioButton->setCheck(FALSE);
815  myValueNumberTextField->disable();
816  }
817  if (myFlowParameters & VEHPARS_VPH_SET) {
818  myAttributeVehsPerHourRadioButton->setCheck(TRUE);
819  myValueVehsPerHourTextField->enable();
820  } else {
821  myAttributeVehsPerHourRadioButton->setCheck(FALSE);
822  myValueVehsPerHourTextField->disable();
823  }
824  if (myFlowParameters & VEHPARS_PERIOD_SET) {
825  myAttributePeriodRadioButton->setCheck(TRUE);
826  myValuePeriodTextField->enable();
827  } else {
828  myAttributePeriodRadioButton->setCheck(FALSE);
829  myValuePeriodTextField->disable();
830  }
831  if (myFlowParameters & VEHPARS_PROB_SET) {
832  myAttributeProbabilityRadioButton->setCheck(TRUE);
833  myValueProbabilityTextField->enable();
834  } else {
835  myAttributeProbabilityRadioButton->setCheck(FALSE);
836  myValueProbabilityTextField->disable();
837  }
838 }
839 
840 
841 void
843  if (myFlowParameters & VEHPARS_END_SET) {
844  baseObject->addDoubleAttribute(SUMO_ATTR_END, GNEAttributeCarrier::parse<double>(myValueEndTextField->getText().text()));
845  }
846  if (myFlowParameters & VEHPARS_NUMBER_SET) {
847  baseObject->addIntAttribute(SUMO_ATTR_NUMBER, GNEAttributeCarrier::parse<int>(myValueNumberTextField->getText().text()));
848  }
849  if (myFlowParameters & VEHPARS_VPH_SET) {
850  if (myAttributeVehsPerHourRadioButton->getText().text() == toString(SUMO_ATTR_VEHSPERHOUR)) {
851  baseObject->addDoubleAttribute(SUMO_ATTR_VEHSPERHOUR, GNEAttributeCarrier::parse<double>(myValueVehsPerHourTextField->getText().text()));
852  } else {
853  baseObject->addDoubleAttribute(SUMO_ATTR_PERSONSPERHOUR, GNEAttributeCarrier::parse<double>(myValueVehsPerHourTextField->getText().text()));
854  }
855  }
856  if (myFlowParameters & VEHPARS_PERIOD_SET) {
857  baseObject->addDoubleAttribute(SUMO_ATTR_PERIOD, GNEAttributeCarrier::parse<double>(myValuePeriodTextField->getText().text()));
858  }
859  if (myFlowParameters & VEHPARS_PROB_SET) {
860  baseObject->addDoubleAttribute(SUMO_ATTR_PROB, GNEAttributeCarrier::parse<double>(myValueProbabilityTextField->getText().text()));
861  }
862 }
863 
864 
865 void
867  std::string errorMessage;
868  /*
869  // iterate over standar parameters
870  for (const auto &i : myTagProperties) {
871  if (errorMessage.empty() && myAttributesCreatorRows.at(i.getPositionListed())) {
872  // Return string with the error if at least one of the parameter isn't valid
873  std::string attributeValue = myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid();
874  if (attributeValue.size() != 0) {
875  errorMessage = attributeValue;
876  }
877  }
878  }
879  // show warning box if input parameters aren't invalid
880  if (extra.size() == 0) {
881  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + errorMessage;
882  } else {
883  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + extra;
884  }
885  */
886  // set message in status bar
887  myAttributesCreatorParent->getFrameParent()->myViewNet->setStatusBarText(errorMessage);
888  // Write Warning in console if we're in testing mode
889  WRITE_DEBUG(errorMessage);
890 }
891 
892 
893 bool
895  // check every flow attribute
896  if (myFlowParameters & VEHPARS_END_SET) {
897  if (GNEAttributeCarrier::canParse<double>(myValueEndTextField->getText().text())) {
898  if (GNEAttributeCarrier::parse<double>(myValueEndTextField->getText().text()) < 0) {
899  return false;
900  }
901  } else {
902  return false;
903  }
904  }
905  if (myFlowParameters & VEHPARS_NUMBER_SET) {
906  if (GNEAttributeCarrier::canParse<int>(myValueNumberTextField->getText().text())) {
907  if (GNEAttributeCarrier::parse<int>(myValueNumberTextField->getText().text()) < 0) {
908  return false;
909  }
910  } else {
911  return false;
912  }
913  }
914  if (myFlowParameters & VEHPARS_VPH_SET) {
915  if (GNEAttributeCarrier::canParse<double>(myValueVehsPerHourTextField->getText().text())) {
916  if (GNEAttributeCarrier::parse<double>(myValueVehsPerHourTextField->getText().text()) < 0) {
917  return false;
918  }
919  } else {
920  return false;
921  }
922  }
923  if (myFlowParameters & VEHPARS_PERIOD_SET) {
924  if (GNEAttributeCarrier::canParse<double>(myValuePeriodTextField->getText().text())) {
925  if (GNEAttributeCarrier::parse<double>(myValuePeriodTextField->getText().text()) < 0) {
926  return false;
927  }
928  } else {
929  return false;
930  }
931  }
932  if (myFlowParameters & VEHPARS_PROB_SET) {
933  if (GNEAttributeCarrier::canParse<double>(myValueProbabilityTextField->getText().text())) {
934  if (GNEAttributeCarrier::parse<double>(myValueProbabilityTextField->getText().text()) < 0) {
935  return false;
936  }
937  } else {
938  return false;
939  }
940  }
941  return true;
942 }
943 
944 
945 long
947  // obtain clicked textfield
948  FXTextField* textField = nullptr;
949  // check what text field was pressed
950  if (obj == myValueEndTextField) {
951  textField = myValueEndTextField;
952  } else if (obj == myValueNumberTextField) {
953  textField = myValueNumberTextField;
954  } else if (obj == myValueVehsPerHourTextField) {
955  textField = myValueVehsPerHourTextField;
956  } else if (obj == myValuePeriodTextField) {
957  textField = myValuePeriodTextField;
958  } else if (obj == myValueProbabilityTextField) {
959  textField = myValueProbabilityTextField;
960  } else {
961  throw ProcessError("Invalid text field");
962  }
963  // check if value is valid
964  if (GNEAttributeCarrier::canParse<double>(textField->getText().text()) && (GNEAttributeCarrier::parse<double>(textField->getText().text()) >= 0)) {
965  textField->setTextColor(FXRGB(0, 0, 0));
966  } else {
967  textField->setTextColor(FXRGB(255, 0, 0));
968  }
969  textField->killFocus();
970  return 1;
971 }
972 
973 
974 long
976  // check what check button was pressed
977  if (obj == myAttributeEndRadioButton) {
979  } else if (obj == myAttributeNumberRadioButton) {
981  } else if (obj == myAttributeVehsPerHourRadioButton) {
982  if (myAttributeVehsPerHourRadioButton->getText().text() == toString(SUMO_ATTR_VEHSPERHOUR)) {
984  } else {
986  }
987  } else if (obj == myAttributePeriodRadioButton) {
989  } else if (obj == myAttributeProbabilityRadioButton) {
991  } else {
992  throw ProcessError("Invalid Radio Button");
993  }
994  // refresh attributes
995  refreshAttributesCreatorFlow();
996  return 1;
997 }
998 
999 // ---------------------------------------------------------------------------
1000 // GNEFrameAttributesModuls::AttributesEditorRow - methods
1001 // ---------------------------------------------------------------------------
1002 
1004  const std::string& value, const bool attributeEnabled, const bool computed) :
1005  FXHorizontalFrame(attributeEditorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame),
1006  myAttributesEditorParent(attributeEditorParent),
1007  myACAttr(ACAttr),
1008  myMultiple(GNEAttributeCarrier::parse<std::vector<std::string>>(value).size() > 1) {
1009  // Create and hide label
1010  myAttributeLabel = new FXLabel(this, "attributeLabel", nullptr, GUIDesignLabelAttribute);
1011  myAttributeLabel->hide();
1012  // Create and hide check button
1013  myAttributeCheckButton = new FXCheckButton(this, "attributeCheckButton", this, MID_GNE_SET_ATTRIBUTE_BOOL, GUIDesignCheckButtonAttribute);
1014  myAttributeCheckButton->hide();
1015  // Create and hide ButtonCombinableChoices
1016  myAttributeButtonCombinableChoices = new FXButton(this, "attributeButtonCombinableChoices", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
1018  // create and hidde color editor
1019  myAttributeColorButton = new FXButton(this, "attributeColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
1020  myAttributeColorButton->hide();
1021  // Create and hide textField for string attributes
1023  myValueTextField->hide();
1024  // Create and hide ComboBox
1026  myValueComboBoxChoices->hide();
1027  // Create and hide checkButton
1028  myValueCheckButton = new FXCheckButton(this, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
1029  myValueCheckButton->hide();
1030  // only create if parent was created
1031  if (getParent()->id()) {
1032  // create AttributesEditorRow
1033  FXHorizontalFrame::create();
1034  // start enabling all elements, depending if attribute is enabled
1035  if (attributeEnabled == false) {
1036  myValueTextField->disable();
1037  myValueComboBoxChoices->disable();
1038  myValueCheckButton->disable();
1039  } else {
1040  myValueTextField->enable();
1041  myValueComboBoxChoices->enable();
1042  myValueCheckButton->enable();
1043  }
1044  // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements
1045  if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) {
1048  myAttributeColorButton->enable();
1049  myAttributeCheckButton->enable();
1050  } else {
1051  myAttributeColorButton->disable();
1052  myAttributeCheckButton->disable();
1053  myValueTextField->disable();
1054  myValueComboBoxChoices->disable();
1055  myValueCheckButton->disable();
1057  }
1058  }
1059  // set left column
1060  if (myACAttr.isColor()) {
1061  // show color button and set color text depending of computed
1062  if (computed) {
1063  myAttributeColorButton->setTextColor(FXRGB(0, 0, 255));
1064  } else {
1065  myAttributeColorButton->setTextColor(FXRGB(0, 0, 0));
1066  }
1067  myAttributeColorButton->setText(myACAttr.getAttrStr().c_str());
1068  myAttributeColorButton->show();
1069  } else if (myACAttr.isActivatable()) {
1070  // show checkbox button and set color text depending of computed
1071  if (computed) {
1072  myAttributeCheckButton->setTextColor(FXRGB(0, 0, 255));
1073  } else {
1074  myAttributeCheckButton->setTextColor(FXRGB(0, 0, 0));
1075  }
1076  myAttributeCheckButton->setText(myACAttr.getAttrStr().c_str());
1077  myAttributeCheckButton->show();
1078  // check or uncheck depending of attributeEnabled
1079  if (attributeEnabled) {
1080  myAttributeCheckButton->setCheck(TRUE);
1081  } else {
1082  myAttributeCheckButton->setCheck(FALSE);
1083  }
1084  } else {
1085  // Show attribute Label
1086  myAttributeLabel->setText(myACAttr.getAttrStr().c_str());
1087  myAttributeLabel->show();
1088  }
1089  // Set field depending of the type of value
1090  if (myACAttr.isBool()) {
1091  // first we need to check if all boolean values are equal
1092  bool allBooleanValuesEqual = true;
1093  // declare boolean vector
1094  std::vector<bool> booleanVector;
1095  // check if value can be parsed to a boolean vector
1096  if (GNEAttributeCarrier::canParse<std::vector<bool> >(value)) {
1097  booleanVector = GNEAttributeCarrier::parse<std::vector<bool> >(value);
1098  }
1099  // iterate over pased booleans comparing all element with the first
1100  for (const auto& booleanValue : booleanVector) {
1101  if (booleanValue != booleanVector.front()) {
1102  allBooleanValuesEqual = false;
1103  }
1104  }
1105  // use checkbox or textfield depending if all booleans are equal
1106  if (allBooleanValuesEqual) {
1107  // set check button
1108  if ((booleanVector.size() > 0) && booleanVector.front()) {
1109  myValueCheckButton->setCheck(true);
1110  myValueCheckButton->setText("true");
1111  } else {
1112  myValueCheckButton->setCheck(false);
1113  myValueCheckButton->setText("false");
1114  }
1115  // show check button
1116  myValueCheckButton->show();
1117  } else {
1118  // show list of bools (0 1)
1119  myValueTextField->setText(value.c_str());
1120  // set text depending of computed
1121  if (computed) {
1122  myValueTextField->setTextColor(FXRGB(0, 0, 255));
1123  } else {
1124  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1125  }
1126  myValueTextField->show();
1127  }
1128  } else if (myACAttr.isDiscrete()) {
1129  // Check if are VClasses
1130  if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) {
1131  // hide label
1132  myAttributeLabel->hide();
1133  // Show button combinable choices
1136  // Show string with the values
1137  myValueTextField->setText(value.c_str());
1138  // set color depending of computed
1139  if (computed) {
1140  myValueTextField->setTextColor(FXRGB(0, 0, 255));
1141  } else {
1142  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1143  }
1144  myValueTextField->show();
1145  } else if (!myMultiple) {
1146  // fill comboBox
1147  myValueComboBoxChoices->clearItems();
1148  for (const auto& discreteValue : myACAttr.getDiscreteValues()) {
1149  myValueComboBoxChoices->appendItem(discreteValue.c_str());
1150  }
1151  // show combo box with values
1152  myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size());
1153  myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str()));
1154  // set color depending of computed
1155  if (computed) {
1156  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255));
1157  } else {
1158  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1159  }
1160  myValueComboBoxChoices->show();
1161  } else {
1162  // represent combinable choices in multiple selections always with a textfield instead with a comboBox
1163  myValueTextField->setText(value.c_str());
1164  // set color depending of computed
1165  if (computed) {
1166  myValueTextField->setTextColor(FXRGB(0, 0, 255));
1167  } else {
1168  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1169  }
1170  myValueTextField->show();
1171  }
1172  } else {
1173  // In any other case (String, list, etc.), show value as String
1174  myValueTextField->setText(value.c_str());
1175  // set color depending of computed
1176  if (computed) {
1177  myValueTextField->setTextColor(FXRGB(0, 0, 255));
1178  } else {
1179  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1180  }
1181  myValueTextField->show();
1182  }
1183  // Show AttributesEditorRow
1184  show();
1185  }
1186 }
1187 
1188 
1189 void
1191  // only destroy if parent was created
1192  if (getParent()->id()) {
1193  FXHorizontalFrame::destroy();
1194  }
1195 }
1196 
1197 
1198 void
1200  const bool forceRefresh, const bool attributeEnabled, const bool computed) {
1201  // start enabling all elements, depending if attribute is enabled
1202  if (attributeEnabled == false) {
1203  myValueTextField->disable();
1204  myValueComboBoxChoices->disable();
1205  myValueCheckButton->disable();
1206  } else {
1207  myValueTextField->enable();
1208  myValueComboBoxChoices->enable();
1209  myValueCheckButton->enable();
1210  }
1211  // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements
1212  if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) {
1213  if (isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) {
1214  myAttributeButtonCombinableChoices->enable();
1215  myAttributeColorButton->enable();
1216  myAttributeCheckButton->enable();
1217  } else {
1218  myAttributeColorButton->disable();
1219  myAttributeCheckButton->disable();
1220  myValueTextField->disable();
1221  myValueComboBoxChoices->disable();
1222  myValueCheckButton->disable();
1223  myAttributeButtonCombinableChoices->disable();
1224  }
1225  }
1226  // set check buton
1227  if (myAttributeCheckButton->shown()) {
1228  myAttributeCheckButton->setCheck(attributeEnabled);
1229  }
1230  if (myValueTextField->shown()) {
1231  // set last valid value and restore color if onlyValid is disabled
1232  if (myValueTextField->getTextColor() == FXRGB(0, 0, 0) || myValueTextField->getTextColor() == FXRGB(0, 0, 255) || forceRefresh) {
1233  myValueTextField->setText(value.c_str());
1234  // set blue color if is an computed value
1235  if (computed) {
1236  myValueTextField->setTextColor(FXRGB(0, 0, 255));
1237  } else {
1238  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1239  }
1240  }
1241  } else if (myValueComboBoxChoices->shown()) {
1242  // fill comboBox again
1243  myValueComboBoxChoices->clearItems();
1244  for (const auto& discreteValue : myACAttr.getDiscreteValues()) {
1245  myValueComboBoxChoices->appendItem(discreteValue.c_str());
1246  }
1247  // show combo box with values
1248  myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size());
1249  myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str()));
1250  // set blue color if is an computed value
1251  if (computed) {
1252  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255));
1253  } else {
1254  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1255  }
1256  myValueComboBoxChoices->show();
1257  } else if (myValueCheckButton->shown()) {
1258  if (GNEAttributeCarrier::canParse<bool>(value)) {
1259  myValueCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(value));
1260  } else {
1261  myValueCheckButton->setCheck(false);
1262  }
1263  }
1264 }
1265 
1266 
1267 bool
1269  return ((myValueTextField->getTextColor() == FXRGB(0, 0, 0)) || (myValueTextField->getTextColor() == FXRGB(0, 0, 255))) &&
1270  ((myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 0)) || (myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 255)));
1271 }
1272 
1273 
1274 long
1276  const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1277  if (obj == myAttributeColorButton) {
1278  // create FXColorDialog
1279  FXColorDialog colordialog(this, tr("Color Dialog"));
1280  colordialog.setTarget(this);
1281  // If previous attribute wasn't correct, set black as default color
1282  if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
1283  colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myValueTextField->getText().text())));
1284  } else if (!myACAttr.getDefaultValue().empty()) {
1285  colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myACAttr.getDefaultValue())));
1286  } else {
1287  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::BLACK));
1288  }
1289  // execute dialog to get a new color
1290  if (colordialog.execute()) {
1291  std::string newValue = toString(MFXUtils::getRGBColor(colordialog.getRGBA()));
1292  myValueTextField->setText(newValue.c_str());
1293  if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(myACAttr.getAttr(), newValue)) {
1294  // if its valid for the first AC than its valid for all (of the same type)
1295  if (ACs.size() > 1) {
1296  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes");
1297  }
1298  // Set new value of attribute in all selected ACs
1299  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1300  inspectedAC->setAttribute(myACAttr.getAttr(), newValue, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1301  }
1302  // If previously value was incorrect, change font color to black
1303  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1304  myValueTextField->killFocus();
1305  }
1306  }
1307  return 0;
1308  } else if (obj == myAttributeButtonCombinableChoices) {
1309  // if its valid for the first AC than its valid for all (of the same type)
1310  if (ACs.size() > 1) {
1311  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes");
1312  }
1313  // get attribute to modify
1314  SumoXMLAttr modifiedAttr = myACAttr.getAttr() == SUMO_ATTR_DISALLOW ? SUMO_ATTR_ALLOW : myACAttr.getAttr();
1315  // declare accept changes
1316  bool acceptChanges = false;
1317  // open GNEAllowDisallow (also used to modify SUMO_ATTR_CHANGE_LEFT etc
1318  GNEAllowDisallow(myAttributesEditorParent->getFrameParent()->myViewNet, myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(), modifiedAttr, &acceptChanges).execute();
1319  // continue depending of acceptChanges
1320  if (acceptChanges) {
1321  std::string allowed = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(modifiedAttr);
1322  // Set new value of attribute in all selected ACs
1323  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1324  inspectedAC->setAttribute(modifiedAttr, allowed, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1325  }
1326  // finish change multiple attributes
1327  if (ACs.size() > 1) {
1328  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end();
1329  }
1330  // update frame parent after attribute sucesfully set
1331  myAttributesEditorParent->getFrameParent()->attributeUpdated();
1332  }
1333  return 1;
1334  } else {
1335  throw ProcessError("Invalid call to onCmdOpenAttributeDialog");
1336  }
1337 }
1338 
1339 
1340 long
1342  // Declare changed value
1343  std::string newVal;
1344  // First, obtain the string value of the new attribute depending of their type
1345  if (myACAttr.isBool()) {
1346  // first check if we're editing boolean as a list of string or as a checkbox
1347  if (myValueCheckButton->shown()) {
1348  // Set true o false depending of the checkBox
1349  if (myValueCheckButton->getCheck()) {
1350  myValueCheckButton->setText("true");
1351  newVal = "true";
1352  } else {
1353  myValueCheckButton->setText("false");
1354  newVal = "false";
1355  }
1356  } else {
1357  // obtain boolean value of myValueTextField (because we're inspecting multiple attribute carriers with different values)
1358  newVal = myValueTextField->getText().text();
1359  }
1360  } else if (myACAttr.isDiscrete()) {
1361  // Check if are VClasses
1362  if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) {
1363  // Get value obtained using AttributesEditor
1364  newVal = myValueTextField->getText().text();
1365  } else if (!myMultiple) {
1366  // Get value of ComboBox
1367  newVal = myValueComboBoxChoices->getText().text();
1368  } else {
1369  // due this is a multiple selection, obtain value of myValueTextField instead of comboBox
1370  newVal = myValueTextField->getText().text();
1371  }
1372  } else {
1373  // Check if default value of attribute must be set
1374  if (myValueTextField->getText().empty() && myACAttr.hasDefaultValue()) {
1375  newVal = myACAttr.getDefaultValue();
1376  myValueTextField->setText(newVal.c_str());
1377  } else if (myACAttr.isInt() && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1378  // filter int attributes
1379  double doubleValue = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1380  // check if myValueTextField has to be updated
1381  if ((doubleValue - (int)doubleValue) == 0) {
1382  newVal = toString((int)doubleValue);
1383  myValueTextField->setText(newVal.c_str(), FALSE);
1384  }
1385  } else if ((myACAttr.getAttr() == SUMO_ATTR_ANGLE) && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1386  // filter angle
1387  double angle = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1388  // filter if angle isn't between [0,360]
1389  if ((angle < 0) || (angle > 360)) {
1390  // apply modul
1391  angle = fmod(angle, 360);
1392  }
1393  // set newVal
1394  newVal = toString(angle);
1395  // update Textfield
1396  myValueTextField->setText(newVal.c_str(), FALSE);
1397  } else {
1398  // obtain value of myValueTextField
1399  newVal = myValueTextField->getText().text();
1400  }
1401  }
1402  // we need a extra check for Position and Shape Values, due #2658
1403  if ((myACAttr.getAttr() == SUMO_ATTR_POSITION) || (myACAttr.getAttr() == SUMO_ATTR_SHAPE)) {
1404  newVal = stripWhitespaceAfterComma(newVal);
1405  }
1406  // get inspected ACs (for code cleaning)
1407  const auto& inspectedACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1408  // Check if attribute must be changed
1409  if ((inspectedACs.size() > 0) && inspectedACs.front()->isValid(myACAttr.getAttr(), newVal)) {
1410  // check if we're merging junction
1411  if (!mergeJunction(myACAttr.getAttr(), inspectedACs, newVal)) {
1412  // if its valid for the first AC than its valid for all (of the same type)
1413  if (inspectedACs.size() > 1) {
1414  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes");
1415  } else if (myACAttr.getAttr() == SUMO_ATTR_ID) {
1416  // IDs attribute has to be encapsulated
1417  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(), "change " + myACAttr.getTagPropertyParent().getTagStr() + " attribute");
1418  }
1419  // Set new value of attribute in all selected ACs
1420  for (const auto& inspectedAC : inspectedACs) {
1421  inspectedAC->setAttribute(myACAttr.getAttr(), newVal, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1422  }
1423  // finish change multiple attributes or ID Attributes
1424  if (inspectedACs.size() > 1) {
1425  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end();
1426  } else if (myACAttr.getAttr() == SUMO_ATTR_ID) {
1427  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end();
1428  }
1429  // If previously value was incorrect, change font color to black
1430  if (myACAttr.isVClasses()) {
1431  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1432  myValueTextField->killFocus();
1433  // in this case, we need to refresh the other values (For example, allow/Disallow objects)
1434  myAttributesEditorParent->refreshAttributeEditor(false, false);
1435  } else if (myACAttr.isDiscrete()) {
1436  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1437  myValueComboBoxChoices->killFocus();
1438  } else if (myValueTextField != nullptr) {
1439  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1440  myValueTextField->killFocus();
1441  }
1442  // update frame parent after attribute sucesfully set
1443  myAttributesEditorParent->getFrameParent()->attributeUpdated();
1444  }
1445  } else {
1446  // If value of TextField isn't valid, change color to Red depending of type
1447  if (myACAttr.isVClasses()) {
1448  myValueTextField->setTextColor(FXRGB(255, 0, 0));
1449  myValueTextField->killFocus();
1450  } else if (myACAttr.isDiscrete()) {
1451  myValueComboBoxChoices->setTextColor(FXRGB(255, 0, 0));
1452  myValueComboBoxChoices->killFocus();
1453  } else if (myValueTextField != nullptr) {
1454  myValueTextField->setTextColor(FXRGB(255, 0, 0));
1455  }
1456  // Write Warning in console if we're in testing mode
1457  WRITE_DEBUG("Value '" + newVal + "' for attribute " + myACAttr.getAttrStr() + " of " + myACAttr.getTagPropertyParent().getTagStr() + " isn't valid");
1458  }
1459  return 1;
1460 }
1461 
1462 
1463 long
1465  const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1466  // obtain undoList (To improve code legibly)
1467  GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1468  // check if we have to enable or disable
1469  if (myAttributeCheckButton->getCheck()) {
1470  // enable input values
1471  myValueCheckButton->enable();
1472  myValueTextField->enable();
1473  // enable attribute
1474  undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable attribute '" + myACAttr.getAttrStr() + "'");
1475  ACs.front()->enableAttribute(myACAttr.getAttr(), undoList);
1476  undoList->end();
1477  } else {
1478  // disable input values
1479  myValueCheckButton->disable();
1480  myValueTextField->disable();
1481  // disable attribute
1482  undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "disable attribute '" + myACAttr.getAttrStr() + "'");
1483  ACs.front()->disableAttribute(myACAttr.getAttr(), undoList);
1484  undoList->end();
1485  }
1486  return 0;
1487 }
1488 
1489 
1491  myAttributesEditorParent(nullptr),
1492  myMultiple(false) {
1493 }
1494 
1495 
1496 std::string
1498  std::string result(stringValue);
1499  while (result.find(", ") != std::string::npos) {
1500  result = StringUtils::replace(result, ", ", ",");
1501  }
1502  return result;
1503 }
1504 
1505 
1506 bool
1507 GNEFrameAttributesModuls::AttributesEditorRow::mergeJunction(SumoXMLAttr attr, const std::vector<GNEAttributeCarrier*>& inspectedACs, const std::string& newVal) const {
1508  // check if we're editing junction position
1509  if ((inspectedACs.size() == 1) && (inspectedACs.front()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) && (attr == SUMO_ATTR_POSITION)) {
1510  // retrieve original junction
1511  GNEJunction* movedJunction = myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveJunction(inspectedACs.front()->getID());
1512  // parse position
1513  const Position newPosition = GNEAttributeCarrier::parse<Position>(newVal);
1514  // iterate over network junction
1515  for (const auto& junction : myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) {
1516  // check distance position
1517  if ((junction.second->getPositionInView().distanceTo2D(newPosition) < POSITION_EPS) &&
1518  myAttributesEditorParent->getFrameParent()->getViewNet()->mergeJunctions(movedJunction, junction.second)) {
1519  return true;
1520  }
1521  }
1522  }
1523  // nothing to merge
1524  return false;
1525 }
1526 
1527 // ---------------------------------------------------------------------------
1528 // GNEFrameAttributesModuls::AttributesEditor - methods
1529 // ---------------------------------------------------------------------------
1530 
1532  FXGroupBoxModule(FrameParent->myContentFrame, "Internal attributes"),
1533  myFrameParent(FrameParent),
1534  myIncludeExtended(true) {
1535  // resize myAttributesEditorRows
1537  // create myAttributesFlowEditor
1539  // leave it hidden
1541  // Create help button
1542  myHelpButton = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
1543 }
1544 
1545 
1546 void
1547 GNEFrameAttributesModuls::AttributesEditor::showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled) {
1548  myIncludeExtended = includeExtended;
1549  // first remove all rows
1550  for (auto& row : myAttributesEditorRows) {
1551  // destroy and delete all rows
1552  if (row != nullptr) {
1553  row->destroy();
1554  delete row;
1555  row = nullptr;
1556  }
1557  }
1558  // get inspected ACs
1559  const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers();
1560  // declare flag to check if flow editor has to be shown
1561  bool showFlowEditor = false;
1562  if (ACs.size() > 0) {
1563  // Iterate over attributes
1564  for (const auto& attrProperty : ACs.front()->getTagProperty()) {
1565  // declare flag to show/hidde atribute
1566  bool editAttribute = true;
1567  // disable editing for unique attributes in case of multi-selection
1568  if ((ACs.size() > 1) && attrProperty.isUnique()) {
1569  editAttribute = false;
1570  }
1571  // disable editing of extended attributes if includeExtended isn't enabled
1572  if (attrProperty.isExtended() && !includeExtended) {
1573  editAttribute = false;
1574  }
1575  // disable editing of flow definition attributes, but enable flow editor
1576  if (attrProperty.isFlowDefinition()) {
1577  editAttribute = false;
1578  showFlowEditor = true;
1579  }
1580  // continue if attribute is editable
1581  if (editAttribute) {
1582  // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values)
1583  std::set<std::string> occuringValues;
1584  // iterate over edited attributes
1585  for (const auto& inspectedAC : ACs) {
1586  occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr()));
1587  }
1588  // get current value
1589  std::ostringstream oss;
1590  for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1591  if (values != occuringValues.begin()) {
1592  oss << " ";
1593  }
1594  oss << *values;
1595  }
1596  // obtain value to be shown in row
1597  std::string value = oss.str();
1598  // declare a flag for enabled attributes
1599  bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr());
1600  // overwritte value if attribute is disabled (used by LinkIndex)
1601  if (attributeEnabled == false) {
1602  value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr());
1603  }
1604  // extra check for Triggered and container Triggered
1605  if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) {
1606  if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) {
1607  attributeEnabled = false;
1608  } else if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) {
1609  attributeEnabled = false;
1610  }
1611  }
1612  // if forceEnablellAttribute is enable, force attributeEnabled (except for ID)
1613  if (forceAttributeEnabled && (attrProperty.getAttr() != SUMO_ATTR_ID)) {
1614  attributeEnabled = true;
1615  }
1616  // check if this attribute is computed
1617  const bool computed = (ACs.size() > 1) ? false : ACs.front()->isAttributeComputed(attrProperty.getAttr());
1618  // create attribute editor row
1619  myAttributesEditorRows[attrProperty.getPositionListed()] = new AttributesEditorRow(this, attrProperty, value, attributeEnabled, computed);
1620  }
1621  }
1622  // check if Flow editor has to be shown
1623  if (showFlowEditor) {
1624  myAttributesEditorFlow->showAttributeEditorFlowModul();
1625  } else {
1626  myAttributesEditorFlow->hideAttributesEditorFlowModul();
1627  }
1628  // show AttributesEditor
1629  show();
1630  } else {
1631  myAttributesEditorFlow->hideAttributesEditorFlowModul();
1632  }
1633  // reparent help button (to place it at bottom)
1634  myHelpButton->reparent(this);
1635 }
1636 
1637 
1638 void
1640  // hide AttributesEditorFlowModul
1641  myAttributesEditorFlow->hideAttributesEditorFlowModul();
1642  // hide also AttributesEditor
1643  hide();
1644 }
1645 
1646 
1647 void
1648 GNEFrameAttributesModuls::AttributesEditor::refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition) {
1649  // get inspected ACs
1650  const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers();
1651  // first check if there is inspected attribute carriers
1652  if (ACs.size() > 0) {
1653  // Iterate over inspected attribute carriers
1654  for (const auto& attrProperty : ACs.front()->getTagProperty()) {
1655  // declare flag to show/hidde atribute
1656  bool editAttribute = true;
1657  // disable editing for unique attributes in case of multi-selection
1658  if ((ACs.size() > 1) && attrProperty.isUnique()) {
1659  editAttribute = false;
1660  }
1661  // disable editing of extended attributes if includeExtended isn't enabled
1662  if (attrProperty.isExtended() && !myIncludeExtended) {
1663  editAttribute = false;
1664  }
1665  // disable editing of flow definition attributes, but enable flow editor
1666  if (attrProperty.isFlowDefinition()) {
1667  editAttribute = false;
1668  }
1669  // continue if attribute is editable
1670  if (editAttribute) {
1671  // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values)
1672  std::set<std::string> occuringValues;
1673  // iterate over edited attributes
1674  for (const auto& inspectedAC : ACs) {
1675  occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr()));
1676  }
1677  // get current value
1678  std::ostringstream oss;
1679  for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1680  if (values != occuringValues.begin()) {
1681  oss << " ";
1682  }
1683  oss << *values;
1684  }
1685  // obtain value to be shown in row
1686  std::string value = oss.str();
1687  // declare a flag for enabled attributes
1688  bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr());
1689  // overwritte value if attribute is disabled (used by LinkIndex)
1690  if (attributeEnabled == false) {
1691  value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr());
1692  }
1693  // extra check for Triggered and container Triggered
1694  if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) {
1695  if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) {
1696  attributeEnabled = false;
1697  } else if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) {
1698  attributeEnabled = false;
1699  }
1700  }
1701  // check if this attribute is computed
1702  const bool computed = (ACs.size() > 1) ? false : ACs.front()->isAttributeComputed(attrProperty.getAttr());
1703  // Check if Position or Shape refresh has to be forced
1704  if ((attrProperty.getAttr() == SUMO_ATTR_SHAPE) && forceRefreshShape) {
1705  myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled, computed);
1706  } else if ((attrProperty.getAttr() == SUMO_ATTR_POSITION) && forceRefreshPosition) {
1707  // Refresh attributes maintain invalid values
1708  myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled, computed);
1709  } else {
1710  // Refresh attributes maintain invalid values
1711  myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, false, attributeEnabled, computed);
1712  }
1713  }
1714  }
1715  // check if flow editor has to be update
1716  if (myAttributesEditorFlow->isAttributesEditorFlowModulShown()) {
1717  myAttributesEditorFlow->refreshAttributeEditorFlow();
1718  }
1719  }
1720 }
1721 
1722 
1723 GNEFrame*
1725  return myFrameParent;
1726 }
1727 
1728 
1729 long
1731  // open Help attributes dialog if there is inspected ACs
1732  if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1733  // open Help attributes dialog
1734  myFrameParent->openHelpAttributesDialog(myFrameParent->getViewNet()->getInspectedAttributeCarriers().front());
1735  }
1736  return 1;
1737 }
1738 
1739 // ---------------------------------------------------------------------------
1740 // GNEFrameAttributesModuls::AttributesEditorFlow - methods
1741 // ---------------------------------------------------------------------------
1742 
1744  FXGroupBoxModule(attributesEditorParent->getFrameParent()->myContentFrame, "Flow attributes"),
1745  myAttributesEditorParent(attributesEditorParent) {
1746  // declare auxiliar horizontal frame
1747  FXHorizontalFrame* auxiliarHorizontalFrame = nullptr;
1748  // create elements for end attribute
1749  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
1750  myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1751  myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1752  // create elements for number attribute
1753  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
1754  myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1755  myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1756  // create elements for vehsPerHour attribute
1757  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
1759  myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1760  // create elements for period attribute
1761  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
1762  myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1763  myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1764  // create elements for Probability attribute
1765  auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
1766  myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1767  myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1768 }
1769 
1770 
1771 void
1773  if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1774  // refresh attributeEditorFlowModul
1775  refreshAttributeEditorFlow();
1776  // show flow
1777  show();
1778  } else {
1779  hide();
1780  }
1781 }
1782 
1783 
1784 void
1786  // simply hide modul
1787  hide();
1788 }
1789 
1790 
1791 bool
1793  return shown();
1794 }
1795 
1796 
1797 void
1799  if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1800  // simply refresh every flow attribute
1801  refreshEnd();
1802  refreshNumber();
1803  refreshVehsPerHour();
1804  refreshPeriod();
1805  refreshProbability();
1806  }
1807 }
1808 
1809 
1810 long
1812  const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1813  // obtain undoList (To improve code legibly)
1814  GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1816  std::string value;
1817  // check what check button was pressed
1818  if (obj == myValueEndTextField) {
1819  attr = SUMO_ATTR_END;
1820  value = myValueEndTextField->getText().text();
1821  } else if (obj == myValueNumberTextField) {
1822  attr = SUMO_ATTR_NUMBER;
1823  value = myValueNumberTextField->getText().text();
1824  } else if (obj == myValueVehsPerHourTextField) {
1825  // check attribute
1826  if (ACs.front()->getTagProperty().hasAttribute(SUMO_ATTR_VEHSPERHOUR)) {
1827  attr = SUMO_ATTR_VEHSPERHOUR;
1828  } else {
1829  attr = SUMO_ATTR_PERSONSPERHOUR;
1830  }
1831  value = myValueVehsPerHourTextField->getText().text();
1832  } else if (obj == myValuePeriodTextField) {
1833  attr = SUMO_ATTR_PERIOD;
1834  value = myValuePeriodTextField->getText().text();
1835  } else if (obj == myValueProbabilityTextField) {
1836  attr = SUMO_ATTR_PROB;
1837  value = myValueProbabilityTextField->getText().text();
1838  } else {
1839  throw ProcessError("Invalid text field");
1840  }
1841  // write debug (for Netedit tests)
1842  WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'");
1843  // check if we're editing multiple attributes
1844  if (ACs.size() > 1) {
1845  undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple " + toString(attr) + " attributes");
1846  }
1847  // enable attribute with undo/redo
1848  for (const auto& inspectedAC : ACs) {
1849  inspectedAC->setAttribute(attr, value, undoList);
1850  }
1851  // check if we're editing multiple attributes
1852  if (ACs.size() > 1) {
1853  undoList->end();
1854  }
1855  // refresh Attributes edito parent
1856  refreshAttributeEditorFlow();
1857  return 1;
1858 }
1859 
1860 
1861 long
1863  const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1864  // obtain undoList (To improve code legibly)
1865  GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1867  // check what check button was pressed
1868  if (obj == myAttributeEndRadioButton) {
1869  attr = SUMO_ATTR_END;
1870  } else if (obj == myAttributeNumberRadioButton) {
1871  attr = SUMO_ATTR_NUMBER;
1872  } else if (obj == myAttributeVehsPerHourRadioButton) {
1873  attr = SUMO_ATTR_VEHSPERHOUR;
1874  } else if (obj == myAttributePeriodRadioButton) {
1875  attr = SUMO_ATTR_PERIOD;
1876  } else if (obj == myAttributeProbabilityRadioButton) {
1877  attr = SUMO_ATTR_PROB;
1878  } else {
1879  throw ProcessError("Invalid Radio Button");
1880  }
1881  // write debug (for Netedit tests)
1882  WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'");
1883  // begin undo list
1884  if (ACs.size() > 1) {
1885  undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable multiple " + toString(attr) + " attributes");
1886  } else {
1887  undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable attribute '" + toString(attr) + "'");
1888  }
1889  // enable attribute with undo/redo
1890  for (const auto& inspectedAC : ACs) {
1891  inspectedAC->enableAttribute(attr, undoList);
1892  }
1893  // end undoList
1894  undoList->end();
1895  // refresh Attributes edito parent
1896  refreshAttributeEditorFlow();
1897  return 1;
1898 }
1899 
1900 
1901 void
1903  // first we need to check if all attributes are enabled or disabled
1904  int allAttributesEnabledOrDisabled = 0;
1905  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1906  allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_END);
1907  }
1908  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1909  // Declare a set of occuring values and insert attribute's values of item
1910  std::set<std::string> occuringValues;
1911  for (const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1912  occuringValues.insert(values->getAttribute(SUMO_ATTR_END));
1913  }
1914  // get current value
1915  std::ostringstream endValue;
1916  for (const auto& occuringValue : occuringValues) {
1917  if (occuringValue != *occuringValues.begin()) {
1918  endValue << " ";
1919  }
1920  endValue << occuringValue;
1921  }
1922  // set radio button and text field
1923  myValueEndTextField->enable();
1924  myValueEndTextField->setText(endValue.str().c_str());
1925  myAttributeEndRadioButton->setCheck(TRUE);
1926  } else {
1927  // disable radio button and text field
1928  myValueEndTextField->disable();
1929  // check if we set an special value in textField
1930  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1931  myValueEndTextField->setText("Different flow attributes");
1932  } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1933  myValueEndTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_END).c_str());
1934  } else {
1935  myValueEndTextField->setText("");
1936  }
1937  myAttributeEndRadioButton->setCheck(FALSE);
1938  }
1939 }
1940 
1941 
1942 void
1944  // first we need to check if all attributes are enabled or disabled
1945  int allAttributesEnabledOrDisabled = 0;
1946  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1947  allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_NUMBER);
1948  }
1949  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1950  // Declare a set of occuring values and insert attribute's values of item
1951  std::set<std::string> occuringValues;
1952  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1953  occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_NUMBER));
1954  }
1955  // get current value
1956  std::ostringstream numberValues;
1957  for (const auto& occuringValue : occuringValues) {
1958  if (occuringValue != *occuringValues.begin()) {
1959  numberValues << " ";
1960  }
1961  numberValues << occuringValue;
1962  }
1963  // set radio button and text field
1964  myValueNumberTextField->enable();
1965  myValueNumberTextField->setText(numberValues.str().c_str());
1966  myAttributeNumberRadioButton->setCheck(TRUE);
1967  } else {
1968  // disable radio button
1969  myValueNumberTextField->disable();
1970  // check if we set an special value in textField
1971  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1972  myValueNumberTextField->setText("Different flow attributes");
1973  } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1974  myValueNumberTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_NUMBER).c_str());
1975  } else {
1976  myValueNumberTextField->setText("");
1977  }
1978  myAttributeNumberRadioButton->setCheck(FALSE);
1979  }
1980 }
1981 
1982 
1983 void
1985  // declare attribute
1987  // first change attribute
1988  if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasAttribute(SUMO_ATTR_PERSONSPERHOUR)) {
1989  attr = SUMO_ATTR_PERSONSPERHOUR;
1990  }
1991  // update radio button
1992  myAttributeVehsPerHourRadioButton->setText(toString(attr).c_str());
1993  // we need to check if all attributes are enabled or disabled
1994  int allAttributesEnabledOrDisabled = 0;
1995  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1996  allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(attr);
1997  }
1998  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1999  // Declare a set of occuring values and insert attribute's values of item
2000  std::set<std::string> occuringValues;
2001  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2002  occuringValues.insert(inspectedAC->getAttribute(attr));
2003  }
2004  // get current value
2005  std::ostringstream vehsPerHourValues;
2006  for (const auto& occuringValue : occuringValues) {
2007  if (occuringValue != *occuringValues.begin()) {
2008  vehsPerHourValues << " ";
2009  }
2010  vehsPerHourValues << occuringValue;
2011  }
2012  // set radio button and text field
2013  myValueVehsPerHourTextField->enable();
2014  myValueVehsPerHourTextField->setText(vehsPerHourValues.str().c_str());
2015  myAttributeVehsPerHourRadioButton->setCheck(TRUE);
2016  } else {
2017  // disable radio button
2018  myValueVehsPerHourTextField->disable();
2019  // check if we set an special value in textField
2020  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2021  myValueVehsPerHourTextField->setText("Different flow attributes");
2022  } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2023  myValueVehsPerHourTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(attr).c_str());
2024  } else {
2025  myValueVehsPerHourTextField->setText("");
2026  }
2027  myAttributeVehsPerHourRadioButton->setCheck(FALSE);
2028  }
2029 }
2030 
2031 
2032 void
2034  // first we need to check if all attributes are enabled or disabled
2035  int allAttributesEnabledOrDisabled = 0;
2036  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2037  allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_PERIOD);
2038  }
2039  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
2040  // Declare a set of occuring values and insert attribute's values of item
2041  std::set<std::string> occuringValues;
2042  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2043  occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_PERIOD));
2044  }
2045  // get current value
2046  std::ostringstream periodValues;
2047  for (const auto& occuringValue : occuringValues) {
2048  if (occuringValue != *occuringValues.begin()) {
2049  periodValues << " ";
2050  }
2051  periodValues << occuringValue;
2052  }
2053  // set radio button and text field
2054  myValuePeriodTextField->enable();
2055  myValuePeriodTextField->setText(periodValues.str().c_str());
2056  myAttributePeriodRadioButton->setCheck(TRUE);
2057  } else {
2058  // disable radio button and text field
2059  myValuePeriodTextField->disable();
2060  // check if we set an special value in textField
2061  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2062  myValuePeriodTextField->setText("Different flow attributes");
2063  } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2064  myValuePeriodTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PERIOD).c_str());
2065  } else {
2066  myValuePeriodTextField->setText("");
2067  }
2068  myAttributePeriodRadioButton->setCheck(FALSE);
2069  }
2070 }
2071 
2072 
2073 void
2075  // first we need to check if all attributes are enabled or disabled
2076  int allAttributesEnabledOrDisabled = 0;
2077  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2078  allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_PROB);
2079  }
2080  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
2081  // Declare a set of occuring values and insert attribute's values of item
2082  std::set<std::string> occuringValues;
2083  for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2084  occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_PROB));
2085  }
2086  // get current value
2087  std::ostringstream probabilityValues;
2088  for (const auto& occuringValue : occuringValues) {
2089  if (occuringValue != *occuringValues.begin()) {
2090  probabilityValues << " ";
2091  }
2092  probabilityValues << occuringValue;
2093  }
2094  // set radio button and text field
2095  myValueProbabilityTextField->enable();
2096  myValueProbabilityTextField->setText(probabilityValues.str().c_str());
2097  myAttributeProbabilityRadioButton->enable();
2098  myAttributeProbabilityRadioButton->setCheck(TRUE);
2099  } else {
2100  // disable radio button and text field
2101  myValueProbabilityTextField->disable();
2102  // check if we set an special value in textField
2103  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2104  myValueProbabilityTextField->setText("Different flow attributes");
2105  } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2106  myValueProbabilityTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PROB).c_str());
2107  } else {
2108  myValueProbabilityTextField->setText("");
2109  }
2110  myAttributeProbabilityRadioButton->setCheck(FALSE);
2111  }
2112 }
2113 
2114 // ---------------------------------------------------------------------------
2115 // GNEFrameAttributesModuls::AttributesEditorExtended- methods
2116 // ---------------------------------------------------------------------------
2117 
2119  FXGroupBoxModule(frameParent->myContentFrame, "Extended attributes"),
2120  myFrameParent(frameParent) {
2121  // Create open dialog button
2122  new FXButton(getCollapsableFrame(), "Open attributes editor", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton);
2123 }
2124 
2125 
2127 
2128 
2129 void
2131  show();
2132 }
2133 
2134 
2135 void
2137  hide();
2138 }
2139 
2140 
2141 long
2143  // open AttributesCreator extended dialog
2144  myFrameParent->attributesEditorExtendedDialogOpened();
2145  return 1;
2146 }
2147 
2148 // ---------------------------------------------------------------------------
2149 // GNEFrameAttributesModuls::ParametersEditorCreator - methods
2150 // ---------------------------------------------------------------------------
2151 
2153  FXGroupBoxModule(frameParent->myContentFrame, "Parameters"),
2154  myFrameParent(frameParent) {
2155  // create textfield and buttons
2157  myButtonEditParameters = new FXButton(getCollapsableFrame(), "Edit parameters", nullptr, this, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButton);
2158 }
2159 
2160 
2162 
2163 
2164 void
2166  // refresh ParametersEditorCreator
2167  refreshParametersEditorCreator();
2168  // show groupbox
2169  show();
2170 }
2171 
2172 
2173 void
2175  // hide groupbox
2176  hide();
2177 }
2178 
2179 
2180 void
2182  myTextFieldParameters->setText(getParametersStr().c_str());
2183  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2184 }
2185 
2186 
2187 const std::map<std::string, std::string>&
2189  return myParameters;
2190 }
2191 
2192 
2193 std::string
2195  std::string result;
2196  // Generate an string using the following structure: "key1=value1|key2=value2|...
2197  for (const auto& parameter : myParameters) {
2198  result += parameter.first + "=" + parameter.second + "|";
2199  }
2200  // remove the last "|"
2201  if (!result.empty()) {
2202  result.pop_back();
2203  }
2204  return result;
2205 }
2206 
2207 
2208 std::vector<std::pair<std::string, std::string> >
2210  std::vector<std::pair<std::string, std::string> > result;
2211  // Generate a vector string using the following structure: "<key1,value1>, <key2, value2>,...
2212  for (const auto& parameter : myParameters) {
2213  result.push_back(std::make_pair(parameter.first, parameter.second));
2214  }
2215  return result;
2216 }
2217 
2218 
2219 void
2220 GNEFrameAttributesModuls::ParametersEditorCreator::setParameters(const std::vector<std::pair<std::string, std::string> >& parameters) {
2221  // declare result string
2222  std::string result;
2223  // Generate an string using the following structure: "key1=value1|key2=value2|...
2224  for (const auto& parameter : parameters) {
2225  result += parameter.first + "=" + parameter.second + "|";
2226  }
2227  // remove the last "|"
2228  if (!result.empty()) {
2229  result.pop_back();
2230  }
2231  // set result in textField (and call onCmdEditParameters)
2232  myTextFieldParameters->setText(result.c_str(), TRUE);
2233 }
2234 
2235 
2236 GNEFrame*
2238  return myFrameParent;
2239 }
2240 
2241 
2242 long
2244  // write debug information
2245  WRITE_DEBUG("Open single parameters dialog");
2246  if (GNESingleParametersDialog(this).execute()) {
2247  // write debug information
2248  WRITE_DEBUG("Close single parameters dialog");
2249  // Refresh parameter EditorCreator
2250  refreshParametersEditorCreator();
2251  } else {
2252  // write debug information
2253  WRITE_DEBUG("Cancel single parameters dialog");
2254  }
2255  return 1;
2256 }
2257 
2258 
2259 long
2261  // clear current existent parameters
2262  myParameters.clear();
2263  // check if current given string is valid
2264  if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true)) {
2265  // parsed parameters ok, then set text field black and continue
2266  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2267  myTextFieldParameters->killFocus();
2268  // obtain parameters "key=value"
2269  std::vector<std::string> parameters = StringTokenizer(myTextFieldParameters->getText().text(), "|", true).getVector();
2270  // iterate over parameters
2271  for (const auto& parameter : parameters) {
2272  // obtain key, value
2273  std::vector<std::string> keyParam = StringTokenizer(parameter, "=", true).getVector();
2274  // save it in myParameters
2275  myParameters[keyParam.front()] = keyParam.back();
2276  }
2277  // overwritte myTextFieldParameters (to remove duplicated parameters
2278  myTextFieldParameters->setText(getParametersStr().c_str(), FALSE);
2279  } else {
2280  myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
2281  }
2282  return 1;
2283 }
2284 
2285 // ---------------------------------------------------------------------------
2286 // GNEFrameAttributesModuls::DrawingShape - methods
2287 // ---------------------------------------------------------------------------
2288 
2290  FXGroupBoxModule(frameParent->myContentFrame, "Drawing"),
2291  myFrameParent(frameParent),
2292  myDeleteLastCreatedPoint(false) {
2293  // create start and stop buttons
2294  myStartDrawingButton = new FXButton(getCollapsableFrame(), "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton);
2295  myStopDrawingButton = new FXButton(getCollapsableFrame(), "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton);
2296  myAbortDrawingButton = new FXButton(getCollapsableFrame(), "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton);
2297  // create information label
2298  std::ostringstream information;
2299  information
2300  << "- 'Start drawing' or ENTER\n"
2301  << " draws shape boundary.\n"
2302  << "- 'Stop drawing' or ENTER\n"
2303  << " creates shape.\n"
2304  << "- 'Shift + Click'removes\n"
2305  << " last created point.\n"
2306  << "- 'Abort drawing' or ESC\n"
2307  << " removes drawed shape.";
2308  myInformationLabel = new FXLabel(getCollapsableFrame(), information.str().c_str(), 0, GUIDesignLabelFrameInformation);
2309  // disable stop and abort functions as init
2310  myStopDrawingButton->disable();
2311  myAbortDrawingButton->disable();
2312 }
2313 
2314 
2316 
2317 
2319  // abort current drawing before show
2320  abortDrawing();
2321  // show FXGroupBoxModule
2322  FXGroupBoxModule::show();
2323 }
2324 
2325 
2327  // abort current drawing before hide
2328  abortDrawing();
2329  // show FXGroupBoxModule
2330  FXGroupBoxModule::hide();
2331 }
2332 
2333 
2334 void
2336  // Only start drawing if DrawingShape modul is shown
2337  if (shown()) {
2338  // change buttons
2339  myStartDrawingButton->disable();
2340  myStopDrawingButton->enable();
2341  myAbortDrawingButton->enable();
2342  }
2343 }
2344 
2345 
2346 void
2348  // try to build shape
2349  if (myFrameParent->shapeDrawed()) {
2350  // clear created points
2351  myTemporalShapeShape.clear();
2352  myFrameParent->myViewNet->updateViewNet();
2353  // change buttons
2354  myStartDrawingButton->enable();
2355  myStopDrawingButton->disable();
2356  myAbortDrawingButton->disable();
2357  } else {
2358  // abort drawing if shape cannot be created
2359  abortDrawing();
2360  }
2361 }
2362 
2363 
2364 void
2366  // clear created points
2367  myTemporalShapeShape.clear();
2368  myFrameParent->myViewNet->updateViewNet();
2369  // change buttons
2370  myStartDrawingButton->enable();
2371  myStopDrawingButton->disable();
2372  myAbortDrawingButton->disable();
2373 }
2374 
2375 
2376 void
2378  if (myStopDrawingButton->isEnabled()) {
2379  myTemporalShapeShape.push_back(P);
2380  } else {
2381  throw ProcessError("A new point cannot be added if drawing wasn't started");
2382  }
2383 }
2384 
2385 
2386 void
2388 
2389 }
2390 
2391 
2392 const PositionVector&
2394  return myTemporalShapeShape;
2395 }
2396 
2397 
2398 bool
2400  return myStopDrawingButton->isEnabled();
2401 }
2402 
2403 
2404 void
2406  myDeleteLastCreatedPoint = value;
2407 }
2408 
2409 
2410 bool
2412  return myDeleteLastCreatedPoint;
2413 }
2414 
2415 
2416 long
2418  startDrawing();
2419  return 0;
2420 }
2421 
2422 
2423 long
2425  stopDrawing();
2426  return 0;
2427 }
2428 
2429 
2430 long
2432  abortDrawing();
2433  return 0;
2434 }
2435 
2436 // ---------------------------------------------------------------------------
2437 // GNEFrameAttributesModuls::NeteditAttributes- methods
2438 // ---------------------------------------------------------------------------
2439 
2441  FXGroupBoxModule(frameParent->myContentFrame, "Netedit attributes"),
2442  myFrameParent(frameParent),
2443  myCurrentLengthValid(true),
2444  myActualAdditionalReferencePoint(AdditionalReferencePoint::LEFT) {
2445  // Create FXListBox for the reference points and fill it
2447  myReferencePointMatchBox->appendItem("reference left");
2448  myReferencePointMatchBox->appendItem("reference right");
2449  myReferencePointMatchBox->appendItem("reference center");
2450  // Create Frame for Length Label and textField
2454  myLengthTextField->setText("10");
2455  // Create Frame for block close polygon and checkBox (By default disabled)
2457  new FXLabel(myCloseShapeFrame, "Close shape", 0, GUIDesignLabelAttribute);
2459  // Create Frame for center element after creation (By default enabled)
2461  new FXLabel(myCenterViewAfterCreationFrame, "Center view", 0, GUIDesignLabelAttribute);
2463  myCenterViewAfterCreationButton->setCheck(true);
2464  // Create help button
2465  helpReferencePoint = new FXButton(getCollapsableFrame(), "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
2466  // Set visible items
2467  myReferencePointMatchBox->setNumVisible((int)myReferencePointMatchBox->getNumItems());
2468 }
2469 
2470 
2472 
2473 
2474 void
2476  // we assume that frame will not be show
2477  bool showFrame = false;
2478  // check if length text field has to be showed
2479  if (tagProperty.canMaskStartEndPos()) {
2480  myLengthFrame->show();
2481  myReferencePointMatchBox->show();
2482  showFrame = true;
2483  } else {
2484  myLengthFrame->hide();
2485  myReferencePointMatchBox->hide();
2486  }
2487  // check if close shape check button has to be show
2488  if (tagProperty.canCloseShape()) {
2489  myCloseShapeFrame->show();
2490  showFrame = true;
2491  } else {
2492  myCloseShapeFrame->hide();
2493  }
2494  // check if center camera after creation check button has to be show
2495  if (tagProperty.canCenterCameraAfterCreation()) {
2496  myCenterViewAfterCreationFrame->show();
2497  showFrame = true;
2498  } else {
2499  myCenterViewAfterCreationFrame->hide();
2500  }
2501  // if at least one element is show, show modul
2502  if (showFrame) {
2503  recalc();
2504  show();
2505  } else {
2506  hide();
2507  }
2508 }
2509 
2510 
2511 void
2513  hide();
2514 }
2515 
2516 
2517 bool
2519  // check if we need to obtain a start and end position over an edge
2520  if (myReferencePointMatchBox->shown()) {
2521  // we need a valid lane to calculate position over lane
2522  if (lane == nullptr) {
2523  return false;
2524  } else if (myCurrentLengthValid) {
2525  // Obtain position of the mouse over lane (limited over grid)
2526  double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->myViewNet->snapToActiveGrid(myFrameParent->myViewNet->getPositionInformation())) / lane->getLengthGeometryFactor();
2527  // check if current reference point is valid
2528  if (myActualAdditionalReferencePoint == AdditionalReferencePoint::INVALID) {
2529  std::string errorMessage = "Current selected reference point isn't valid";
2530  myFrameParent->myViewNet->setStatusBarText(errorMessage);
2531  // Write Warning in console if we're in testing mode
2532  WRITE_DEBUG(errorMessage);
2533  return false;
2534  } else {
2535  // obtain length
2536  double length = GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text());
2537  // set start and end position
2538  baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, setStartPosition(mousePositionOverLane, length));
2539  baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, setEndPosition(mousePositionOverLane, length));
2540  }
2541  } else {
2542  return false;
2543  }
2544  }
2545  // Save close shape value if shape's element can be closed
2546  if (myCloseShapeCheckButton->shown()) {
2547  baseObject->addBoolAttribute(GNE_ATTR_CLOSE_SHAPE, myCloseShapeCheckButton->getCheck() == 1);
2548  }
2549  // check center element after creation
2550  if (myCenterViewAfterCreationButton->shown()) {
2551  baseObject->addBoolAttribute(GNE_ATTR_CENTER_AFTER_CREATION, myCenterViewAfterCreationButton->getCheck() == 1);
2552  }
2553  // all ok, then return true to continue creating element
2554  return true;
2555 }
2556 
2557 
2558 long
2560  if (obj == myCloseShapeCheckButton) {
2561  if (myCloseShapeCheckButton->getCheck()) {
2562  myCloseShapeCheckButton->setText("true");
2563  } else {
2564  myCloseShapeCheckButton->setText("false");
2565  }
2566  } else if (obj == myCenterViewAfterCreationButton) {
2567  if (myCenterViewAfterCreationButton->getCheck()) {
2568  myCenterViewAfterCreationButton->setText("true");
2569  } else {
2570  myCenterViewAfterCreationButton->setText("false");
2571  }
2572  } else if (obj == myLengthTextField) {
2573  // change color of text field depending of the input length
2574  if (GNEAttributeCarrier::canParse<double>(myLengthTextField->getText().text()) &&
2575  GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text()) > 0) {
2576  myLengthTextField->setTextColor(FXRGB(0, 0, 0));
2577  myLengthTextField->killFocus();
2578  myCurrentLengthValid = true;
2579  } else {
2580  myLengthTextField->setTextColor(FXRGB(255, 0, 0));
2581  myCurrentLengthValid = false;
2582  }
2583  // Update aditional frame
2584  update();
2585  } else if (obj == myReferencePointMatchBox) {
2586  // Cast actual reference point type
2587  if (myReferencePointMatchBox->getText() == "reference left") {
2588  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2589  myActualAdditionalReferencePoint = AdditionalReferencePoint::LEFT;
2590  myLengthTextField->enable();
2591  } else if (myReferencePointMatchBox->getText() == "reference right") {
2592  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2593  myActualAdditionalReferencePoint = AdditionalReferencePoint::RIGHT;
2594  myLengthTextField->enable();
2595  } else if (myReferencePointMatchBox->getText() == "reference center") {
2596  myLengthTextField->enable();
2597  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2598  myActualAdditionalReferencePoint = AdditionalReferencePoint::CENTER;
2599  myLengthTextField->enable();
2600  } else {
2601  myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0));
2602  myActualAdditionalReferencePoint = AdditionalReferencePoint::INVALID;
2603  myLengthTextField->disable();
2604  }
2605  }
2606 
2607  return 1;
2608 }
2609 
2610 
2611 long
2613  // Create dialog box
2614  FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Parameters Help", GUIDesignDialogBox);
2615  additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
2616  // set help text
2617  std::ostringstream help;
2618  help
2619  << "- Referece point: Mark the initial position of the additional element.\n"
2620  << " Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n"
2621  << " - Reference Left will create it with startPos = 70 and endPos = 100.\n"
2622  << " - Reference Right will create it with startPos = 100 and endPos = 130.\n"
2623  << " - Reference Center will create it with startPos = 85 and endPos = 115.\n"
2624  << "\n"
2625  << "- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n"
2626  << " the mouse. This option can be modified inspecting element.\n"
2627  << "- Center view: if is enabled, view will be center over created element.";
2628  // Create label with the help text
2629  new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation);
2630  // Create horizontal separator
2631  new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
2632  // Create frame for OK Button
2633  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
2634  // Create Button Close (And two more horizontal frames to center it)
2635  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
2636  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
2637  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
2638  // Write Warning in console if we're in testing mode
2639  WRITE_DEBUG("Opening NeteditAttributes help dialog");
2640  // create Dialog
2641  additionalNeteditAttributesHelpDialog->create();
2642  // show in the given position
2643  additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
2644  // refresh APP
2645  getApp()->refresh();
2646  // open as modal dialog (will block all windows until stop() or stopModal() is called)
2647  getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
2648  // Write Warning in console if we're in testing mode
2649  WRITE_DEBUG("Closing NeteditAttributes help dialog");
2650  return 1;
2651  /**********
2652  help from PolygonFrame
2653  << "- Block movement: If enabled, the created polygon element will be blocked. i.e. cannot be moved with\n"
2654  << " the mouse. This option can be modified inspecting element.\n"
2655  << "\n"
2656  << "- Block shape: If enabled, the shape of created polygon element will be blocked. i.e. their geometry points\n"
2657  << " cannot be edited be moved with the mouse. This option can be modified inspecting element.\n"
2658  << "\n"
2659  << "- Close shape: If enabled, the created polygon element will be closed. i.e. the last created geometry point\n"
2660  << " will be connected with the first geometry point automatically. This option can be modified inspecting element.";
2661 
2662  ****************/
2663 }
2664 
2665 
2666 double
2667 GNEFrameAttributesModuls::NeteditAttributes::setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const {
2668  switch (myActualAdditionalReferencePoint) {
2669  case AdditionalReferencePoint::LEFT:
2670  return positionOfTheMouseOverLane;
2671  case AdditionalReferencePoint::RIGHT:
2672  return positionOfTheMouseOverLane - lengthOfAdditional;
2673  case AdditionalReferencePoint::CENTER:
2674  return positionOfTheMouseOverLane - lengthOfAdditional / 2;
2675  default:
2676  throw InvalidArgument("Reference Point invalid");
2677  }
2678 }
2679 
2680 
2681 double
2682 GNEFrameAttributesModuls::NeteditAttributes::setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const {
2683  switch (myActualAdditionalReferencePoint) {
2684  case AdditionalReferencePoint::LEFT:
2685  return positionOfTheMouseOverLane + lengthOfAdditional;
2686  case AdditionalReferencePoint::RIGHT:
2687  return positionOfTheMouseOverLane;
2688  case AdditionalReferencePoint::CENTER:
2689  return positionOfTheMouseOverLane + lengthOfAdditional / 2;
2690  default:
2691  throw InvalidArgument("Reference Point invalid");
2692  }
2693 }
2694 
2695 
2696 bool
2698  if (viewNet->getEditModes().isCurrentSupermodeNetwork() && (
2699  AC->getTagProperty().isNetworkElement() ||
2701  AC->getTagProperty().isShape() ||
2702  AC->getTagProperty().isTAZElement())) {
2703  return true;
2704  } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
2705  AC->getTagProperty().isDemandElement()) {
2706  return true;
2707  } else if (viewNet->getEditModes().isCurrentSupermodeData() &&
2708  AC->getTagProperty().isDataElement()) {
2709  return true;
2710  } else {
2711  return false;
2712  }
2713 }
2714 
2715 
2716 bool
2720  return (viewNet->getEditModes().isCurrentSupermodeNetwork());
2721  } else if (ACAttr.getTagPropertyParent().isDemandElement()) {
2722  return (viewNet->getEditModes().isCurrentSupermodeDemand());
2723  } else if (ACAttr.getTagPropertyParent().isDataElement()) {
2724  return (viewNet->getEditModes().isCurrentSupermodeData());
2725  } else {
2726  return false;
2727  }
2728 }
2729 
2730 /****************************************************************************/
GNEFrameAttributesModuls::AttributesEditorExtended::~AttributesEditorExtended
~AttributesEditorExtended()
destructor
Definition: GNEFrameAttributesModuls.cpp:2126
GNEFrameAttributesModuls::AttributesCreatorRow::disableRow
void disableRow()
disable Rows
Definition: GNEFrameAttributesModuls.cpp:326
GNEFrameAttributesModuls::AttributesEditorFlow::refreshEnd
void refreshEnd()
refresh end
Definition: GNEFrameAttributesModuls.cpp:1902
GNEFrameAttributesModuls::AttributesEditorRow
Definition: GNEFrameAttributesModuls.h:317
GNEFrameAttributesModuls::AttributesCreatorRow::getAttributesCreatorParent
AttributesCreator * getAttributesCreatorParent() const
get AttributesCreator parent
Definition: GNEFrameAttributesModuls.cpp:344
GNEFrameAttributesModuls::ParametersEditorCreator::onCmdSetParameters
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
Definition: GNEFrameAttributesModuls.cpp:2260
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeEndRadioButton
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
Definition: GNEFrameAttributesModuls.h:280
StringUtils::replace
static std::string replace(std::string str, const char *what, const char *by)
Definition: StringUtils.cpp:105
SUMO_ATTR_TYPE
@ SUMO_ATTR_TYPE
Definition: SUMOXMLDefinitions.h:498
GNEFrameAttributesModuls::NeteditAttributes::AdditionalReferencePoint
AdditionalReferencePoint
list of the reference points
Definition: GNEFrameAttributesModuls.h:751
GNEAllowDisallow::myViewNet
GNEViewNet * myViewNet
FOX need this.
Definition: GNEAllowDisallow.h:86
SUMO_ATTR_ANGLE
@ SUMO_ATTR_ANGLE
Definition: SUMOXMLDefinitions.h:497
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:334
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeVehsPerHourRadioButton
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
Definition: GNEFrameAttributesModuls.h:292
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeCheckButton
FXCheckButton * myAttributeCheckButton
pointer to attribute menu check
Definition: GNEFrameAttributesModuls.h:372
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeVehsPerHourRadioButton
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
Definition: GNEFrameAttributesModuls.h:509
GNEFrameAttributesModuls::AttributesEditorRow::mergeJunction
bool mergeJunction(SumoXMLAttr attr, const std::vector< GNEAttributeCarrier * > &inspectedACs, const std::string &newVal) const
check junction merging
Definition: GNEFrameAttributesModuls.cpp:1507
GUIIconSubSys::getIcon
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:768
GNEFrameAttributesModuls::NeteditAttributes::myCloseShapeFrame
FXHorizontalFrame * myCloseShapeFrame
horizontal frame for close polygon
Definition: GNEFrameAttributesModuls.h:777
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:60
GNEFrameAttributesModuls::AttributesEditorExtended::onCmdOpenDialog
long onCmdOpenDialog(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2142
GNEAttributeProperties::isDiscrete
bool isDiscrete() const
return true if atribute is discrete
Definition: GNEAttributeProperties.cpp:422
GNEFrameAttributesModuls::AttributesCreator::~AttributesCreator
~AttributesCreator()
destructor
Definition: GNEFrameAttributesModuls.cpp:510
SUMO_ATTR_DISALLOW
@ SUMO_ATTR_DISALLOW
Definition: SUMOXMLDefinitions.h:1047
GUIDesignLabelAttribute
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:211
GNETagProperties::canCloseShape
bool canCloseShape() const
return true if tag correspond to an element that can close their shape
Definition: GNETagProperties.cpp:445
GUIDesignRadioButtonAttribute
#define GUIDesignRadioButtonAttribute
design for radio button with fixed height
Definition: GUIDesigns.h:179
GNEFrameAttributesModuls::AttributesEditorRow::myValueTextField
FXTextField * myValueTextField
textField to modify the value of string attributes
Definition: GNEFrameAttributesModuls.h:381
GNEAttributeCarrier::getTagProperty
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
Definition: GNEAttributeCarrier.cpp:587
GNEFrameAttributesModuls::AttributesCreatorRow::onCmdOpenAttributeDialog
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
called when user press the open dialog button
Definition: GNEFrameAttributesModuls.cpp:428
SUMO_ATTR_LENGTH
@ SUMO_ATTR_LENGTH
Definition: SUMOXMLDefinitions.h:529
GNEFrameAttributesModuls::AttributesCreatorRow
Definition: GNEFrameAttributesModuls.h:55
GNEFrameAttributesModuls::AttributesEditorFlow
Definition: GNEFrameAttributesModuls.h:445
GNEFrameAttributesModuls::ParametersEditorCreator::getFrameParent
GNEFrame * getFrameParent() const
pointer to frame parent
Definition: GNEFrameAttributesModuls.cpp:2237
GNEAttributeProperties::getAttrStr
const std::string & getAttrStr() const
get XML Attribute
Definition: GNEAttributeProperties.cpp:165
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeNumberRadioButton
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
Definition: GNEFrameAttributesModuls.h:503
GNEFrameAttributesModuls::DrawingShape::addNewPoint
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrameAttributesModuls.cpp:2377
GNETagProperties::canMaskStartEndPos
bool canMaskStartEndPos() const
return true if tag correspond to an element that can mask the attributes "start" and "end" position a...
Definition: GNETagProperties.cpp:494
RGBColor::BLACK
static const RGBColor BLACK
Definition: RGBColor.h:190
GNEFrameAttributesModuls::ParametersEditorCreator::~ParametersEditorCreator
~ParametersEditorCreator()
destructor
Definition: GNEFrameAttributesModuls.cpp:2161
GNEAttributeProperties::getAttr
SumoXMLAttr getAttr() const
get XML Attribute
Definition: GNEAttributeProperties.cpp:159
SUMO_ATTR_CONTAINERSPERHOUR
@ SUMO_ATTR_CONTAINERSPERHOUR
Definition: SUMOXMLDefinitions.h:1054
GNEFrameAttributesModuls::NeteditAttributes::myCloseShapeCheckButton
FXCheckButton * myCloseShapeCheckButton
checkbox to enable/disable close polygon
Definition: GNEFrameAttributesModuls.h:780
GNENetHelper::AttributeCarriers::retrieveJunction
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
Definition: GNENetHelper.cpp:423
GUIIcon::RESET
@ RESET
GNEFrameAttributesModuls::AttributesEditorRow::onCmdSelectCheckButton
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
Definition: GNEFrameAttributesModuls.cpp:1464
GNEFrameAttributesModuls::ParametersEditorCreator
Definition: GNEFrameAttributesModuls.h:566
GNEFrameAttributesModuls::NeteditAttributes
Definition: GNEFrameAttributesModuls.h:717
GNEFrameAttributesModuls::DrawingShape::DrawingShape
DrawingShape(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2289
VEHPARS_NUMBER_SET
const int VEHPARS_NUMBER_SET
Definition: SUMOVehicleParameter.h:49
GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow
void refreshAttributesEditorRow(const std::string &value, const bool forceRefresh, const bool attributeEnabled, const bool computed)
refresh current row
Definition: GNEFrameAttributesModuls.cpp:1199
GNEFrameAttributesModuls::AttributesEditor::AttributesEditor
AttributesEditor(GNEFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:1531
GNETagProperties::isAdditionalElement
bool isAdditionalElement() const
return true if tag correspond to an additional element
Definition: GNETagProperties.cpp:276
GNEFrameAttributesModuls::AttributesCreatorRow::enableAttributesCreatorRow
void enableAttributesCreatorRow()
enable row
Definition: GNEFrameAttributesModuls.cpp:208
CommonXMLStructure::SumoBaseObject
SumoBaseObject.
Definition: CommonXMLStructure.h:39
GNEFrameAttributesModuls::AttributesCreator
Definition: GNEFrameAttributesModuls.h:150
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeButtonCombinableChoices
FXButton * myAttributeButtonCombinableChoices
pointer to buttonCombinableChoices
Definition: GNEFrameAttributesModuls.h:375
GNEFrameAttributesModuls::AttributesEditor::myAttributesEditorRows
std::vector< AttributesEditorRow * > myAttributesEditorRows
list of Attribute editor rows
Definition: GNEFrameAttributesModuls.h:432
SUMO_ATTR_PERIOD
@ SUMO_ATTR_PERIOD
Definition: SUMOXMLDefinitions.h:884
GNEFrameAttributesModuls::AttributesCreator::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributesModuls.cpp:654
MID_GNE_SET_ATTRIBUTE_BUTTON
@ MID_GNE_SET_ATTRIBUTE_BUTTON
attribute selected using button (radio button or checkbox)
Definition: GUIAppEnum.h:823
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeLabel
FXLabel * myAttributeLabel
pointer to attribute label
Definition: GNEFrameAttributesModuls.h:369
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:32
GUIDesignButtonOK
#define GUIDesignButtonOK
Definition: GUIDesigns.h:124
GNEFrameAttributesModuls::AttributesEditorRow::myValueComboBoxChoices
FXComboBox * myValueComboBoxChoices
pointer to combo box choices
Definition: GNEFrameAttributesModuls.h:384
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:197
GUIDesignComboBoxNCol
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:276
DepartPosLatDefinition::LEFT
@ LEFT
At the leftmost side of the lane.
SUMO_ATTR_PERSONSPERHOUR
@ SUMO_ATTR_PERSONSPERHOUR
Definition: SUMOXMLDefinitions.h:1053
GNEFrame
Definition: GNEFrame.h:33
SUMO_ATTR_COLOR
@ SUMO_ATTR_COLOR
A color information.
Definition: SUMOXMLDefinitions.h:952
GNEFrameAttributesModuls::AttributesEditorFlow::AttributesEditorFlow
AttributesEditorFlow(AttributesEditor *attributesEditorParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:1743
GNEFrameAttributesModuls::AttributesEditorFlow::myValuePeriodTextField
FXTextField * myValuePeriodTextField
textField for 'period' attribute
Definition: GNEFrameAttributesModuls.h:518
GNEFrameAttributesModuls::ParametersEditorCreator::getParametersStr
std::string getParametersStr() const
get parameters as string
Definition: GNEFrameAttributesModuls.cpp:2194
GNEViewNet
Definition: GNEViewNet.h:43
GUIIcon::ACCEPT
@ ACCEPT
MID_GNE_OPEN_PARAMETERS_DIALOG
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
Definition: GUIAppEnum.h:821
GNEFrameAttributesModuls::AttributesEditorRow::onCmdOpenAttributeDialog
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
Definition: GNEFrameAttributesModuls.cpp:1275
GNEFrameAttributesModuls::AttributesCreator::getFrameParent
GNEFrame * getFrameParent() const
return frame parent
Definition: GNEFrameAttributesModuls.cpp:550
GNEAttributeProperties::getTagPropertyParent
const GNETagProperties & getTagPropertyParent() const
get reference to tagProperty parent
Definition: GNEAttributeProperties.cpp:171
MID_GNE_SET_ATTRIBUTE_DIALOG
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trought dialog
Definition: GUIAppEnum.h:819
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:515
GNEFrameAttributesModuls::DrawingShape::isDrawing
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrameAttributesModuls.cpp:2399
GUIDesigns.h
GNEFrameAttributesModuls::DrawingShape::onCmdStartDrawing
long onCmdStartDrawing(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2417
MID_HELP
@ MID_HELP
help button
Definition: GUIAppEnum.h:598
GNEFrameAttributesModuls::NeteditAttributes::helpReferencePoint
FXButton * helpReferencePoint
Button for help about the reference point.
Definition: GNEFrameAttributesModuls.h:789
SUMO_ATTR_ENDPOS
@ SUMO_ATTR_ENDPOS
Definition: SUMOXMLDefinitions.h:1065
MID_GNE_SET_ATTRIBUTE_BOOL
@ MID_GNE_SET_ATTRIBUTE_BOOL
bool attribute edited
Definition: GUIAppEnum.h:817
GNEFrameAttributesModuls::DrawingShape::getTemporalShape
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrameAttributesModuls.cpp:2393
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:42
GNEFrameAttributesModuls::AttributesEditor::myAttributesEditorFlow
AttributesEditorFlow * myAttributesEditorFlow
pointer to attributesEditorFlow
Definition: GNEFrameAttributesModuls.h:429
CommonXMLStructure::SumoBaseObject::addTimeAttribute
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:377
GNENet::getAttributeCarriers
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
PositionVector
A list of positions.
Definition: PositionVector.h:43
GNE_ATTR_CENTER_AFTER_CREATION
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
Definition: SUMOXMLDefinitions.h:1276
DemandEditMode::DEMAND_VEHICLE
@ DEMAND_VEHICLE
Mode for editing vehicles.
GNEFrameAttributesModuls::AttributesCreatorRow::isValidID
bool isValidID() const
check if current ID placed in myValueTextField is valid
Definition: GNEFrameAttributesModuls.cpp:479
GNEFrameAttributesModuls::DrawingShape::myStopDrawingButton
FXButton * myStopDrawingButton
button for stop drawing
Definition: GNEFrameAttributesModuls.h:704
GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSetFlowAttribute
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:946
GNEFrameAttributesModuls::NeteditAttributes::~NeteditAttributes
~NeteditAttributes()
destructor
Definition: GNEFrameAttributesModuls.cpp:2471
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeProbabilityRadioButton
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
Definition: GNEFrameAttributesModuls.h:304
GNEFrameAttributesModuls::AttributesEditorFlow::refreshPeriod
void refreshPeriod()
refresh parameter Period
Definition: GNEFrameAttributesModuls.cpp:2033
GNEAttributeProperties
Definition: GNEAttributeProperties.h:42
GNEFrameAttributesModuls::AttributesEditorFlow::refreshNumber
void refreshNumber()
refresh parameter number
Definition: GNEFrameAttributesModuls.cpp:1943
VEHPARS_PROB_SET
const int VEHPARS_PROB_SET
Definition: SUMOVehicleParameter.h:52
GNETagProperties::isShape
bool isShape() const
return true if tag correspond to a shape
Definition: GNETagProperties.cpp:282
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:68
GNEAttributeProperties::isActivatable
bool isActivatable() const
return true if atribute is activatable
Definition: GNEAttributeProperties.cpp:446
GNEFrameAttributesModuls::AttributesCreator::myResetButton
FXButton * myResetButton
reset button
Definition: GNEFrameAttributesModuls.h:227
GNEFrameAttributesModuls::AttributesCreator::myAttributesCreatorFlow
AttributesCreatorFlow * myAttributesCreatorFlow
pointer to myAttributesCreatorFlow
Definition: GNEFrameAttributesModuls.h:212
MFXUtils::getRGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:106
GNEFrameAttributesModuls::AttributesEditor
Definition: GNEFrameAttributesModuls.h:394
GUIAppEnum.h
GNEFrameAttributesModuls::AttributesCreator::hideAttributesCreatorModul
void hideAttributesCreatorModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:541
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:235
GNEFrameAttributesModuls::AttributesEditorFlow::myValueProbabilityTextField
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
Definition: GNEFrameAttributesModuls.h:524
CommonXMLStructure::SumoBaseObject::addPositionAttribute
void addPositionAttribute(const SumoXMLAttr attr, const Position &value)
add Position attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:371
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:74
GNEFrameAttributesModuls::AttributesCreatorRow::getAttrProperties
const GNEAttributeProperties & getAttrProperties() const
return Attr
Definition: GNEFrameAttributesModuls.cpp:153
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeNumberRadioButton
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
Definition: GNEFrameAttributesModuls.h:286
GNEAllowDisallow.h
GNEFrameAttributesModuls::NeteditAttributes::setStartPosition
double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the Start position values of StoppingPlaces and E2 detector over the lane
Definition: GNEFrameAttributesModuls.cpp:2667
GNEFrameAttributesModuls::DrawingShape::myAbortDrawingButton
FXButton * myAbortDrawingButton
button for abort drawing
Definition: GNEFrameAttributesModuls.h:707
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:835
GNERouteHandler::setFlowParameters
static void setFlowParameters(const SumoXMLAttr attribute, int &parameters)
set flow parameters
Definition: GNERouteHandler.cpp:1517
GNEFrameAttributesModuls::AttributesCreatorRow::getAttributeCheckButtonCheck
bool getAttributeCheckButtonCheck() const
return status of label checkbox button
Definition: GNEFrameAttributesModuls.cpp:171
GNETagProperties::canCenterCameraAfterCreation
bool canCenterCameraAfterCreation() const
return true if tag correspond to an element that center camera after creation
Definition: GNETagProperties.cpp:500
RGBColor
Definition: RGBColor.h:38
GNEFrameAttributesModuls::AttributesCreator::myFrameButtons
FXHorizontalFrame * myFrameButtons
frame buttons
Definition: GNEFrameAttributesModuls.h:224
GNEAttributeProperties::isVClasses
bool isVClasses() const
return true if atribute is a list of VClasses
Definition: GNEAttributeProperties.cpp:428
MID_GNE_RESET
@ MID_GNE_RESET
reset element
Definition: GUIAppEnum.h:793
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueProbabilityTextField
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
Definition: GNEFrameAttributesModuls.h:307
GNEFrameAttributesModuls::AttributesEditorFlow::isAttributesEditorFlowModulShown
bool isAttributesEditorFlowModulShown() const
check if attribute editor flow modul is shown
Definition: GNEFrameAttributesModuls.cpp:1792
GNEFrameAttributesModuls::ParametersEditorCreator::myButtonEditParameters
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
Definition: GNEFrameAttributesModuls.h:624
GNEFrameAttributesModuls::AttributesEditorExtended
Definition: GNEFrameAttributesModuls.h:531
GNEFrameAttributesModuls::DrawingShape::removeLastPoint
void removeLastPoint()
remove last added point
Definition: GNEFrameAttributesModuls.cpp:2387
GNEFrameAttributesModuls.h
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeProbabilityRadioButton
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
Definition: GNEFrameAttributesModuls.h:521
SUMO_ATTR_PROB
@ SUMO_ATTR_PROB
Definition: SUMOXMLDefinitions.h:866
GNEFrameAttributesModuls::AttributesEditorRow::destroy
void destroy()
destroy AttributesCreatorRow (but don't delete)
Definition: GNEFrameAttributesModuls.cpp:1190
GNEFrameAttributesModuls::AttributesEditorFlow::refreshProbability
void refreshProbability()
refresh parameter Probability
Definition: GNEFrameAttributesModuls.cpp:2074
SUMO_ATTR_STARTPOS
@ SUMO_ATTR_STARTPOS
Definition: SUMOXMLDefinitions.h:1064
GNEFrameAttributesModuls::ParametersEditorCreator::onCmdEditParameters
long onCmdEditParameters(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2243
GUIDesignButtonIcon
#define GUIDesignButtonIcon
button only with icon
Definition: GUIDesigns.h:77
GNEAllowDisallow
Dialog for edit rerouters.
Definition: GNEAllowDisallow.h:40
MID_GNE_ABORTDRAWING
@ MID_GNE_ABORTDRAWING
abort drawing polygon
Definition: GUIAppEnum.h:851
GNEAttributeProperties::getDiscreteValues
const std::vector< std::string > & getDiscreteValues() const
get discrete values
Definition: GNEAttributeProperties.cpp:273
CommonXMLStructure::SumoBaseObject::addColorAttribute
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:383
GNEFrameAttributesModuls::AttributesCreator::getAttributesAndValues
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
Definition: GNEFrameAttributesModuls.cpp:556
GNEFrameAttributesModuls::ParametersEditorCreator::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
get parameters as map
Definition: GNEFrameAttributesModuls.cpp:2188
GNELane::getLaneShape
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:131
GNEFrameAttributesModuls::AttributesEditor::showAttributeEditorModul
void showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
Definition: GNEFrameAttributesModuls.cpp:1547
GNEFrameAttributesModuls::AttributesCreatorFlow::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributesModuls.cpp:894
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeColorButton
FXButton * myAttributeColorButton
Button for open color editor.
Definition: GNEFrameAttributesModuls.h:378
MID_GNE_STARTDRAWING
@ MID_GNE_STARTDRAWING
start drawing polygon
Definition: GUIAppEnum.h:847
GNEFrameAttributesModuls::ParametersEditorCreator::myTextFieldParameters
FXTextField * myTextFieldParameters
text field for write parameters
Definition: GNEFrameAttributesModuls.h:621
GNEAttributeProperties::isColor
bool isColor() const
return true if atribute is a color
Definition: GNEAttributeProperties.cpp:380
GNEFrameAttributesModuls::DrawingShape::hideDrawingShape
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrameAttributesModuls.cpp:2326
GUIDesignHorizontalSeparator
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:386
GNEFrameAttributesModuls::AttributesEditorRow::myMultiple
const bool myMultiple
flag to check if input element contains multiple values
Definition: GNEFrameAttributesModuls.h:366
GUITexturesHelper.h
StringTokenizer
Definition: StringTokenizer.h:59
GNEFrameAttributesModuls::NeteditAttributes::NeteditAttributes
NeteditAttributes(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2440
SUMO_ATTR_NOTHING
@ SUMO_ATTR_NOTHING
invalid attribute
Definition: SUMOXMLDefinitions.h:441
GNETagProperties::isDataElement
bool isDataElement() const
return true if tag correspond to a data element
Definition: GNETagProperties.cpp:300
GNEFrameAttributesModuls::AttributesEditor::myHelpButton
FXButton * myHelpButton
button for help
Definition: GNEFrameAttributesModuls.h:435
GNEViewNet.h
GNELane::getLengthGeometryFactor
double getLengthGeometryFactor() const
get length geometry factor
Definition: GNELane.cpp:1679
GNEFrameAttributesModuls::NeteditAttributes::myReferencePointMatchBox
FXComboBox * myReferencePointMatchBox
match box with the list of reference points
Definition: GNEFrameAttributesModuls.h:768
update
CommonXMLStructure::SumoBaseObject::addStringAttribute
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
Definition: CommonXMLStructure.cpp:347
GUIDesignComboBoxAttribute
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
Definition: GUIDesigns.h:267
GNEFrameAttributesModuls::DrawingShape::myInformationLabel
FXLabel * myInformationLabel
Label with information.
Definition: GNEFrameAttributesModuls.h:710
GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSelectFlowRadioButton
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
Definition: GNEFrameAttributesModuls.cpp:1862
GNEFrameAttributesModuls::AttributesCreatorRow::setAttributeCheckButtonCheck
void setAttributeCheckButtonCheck(bool value)
enable or disable label checkbox button for optional attributes
Definition: GNEFrameAttributesModuls.cpp:181
SUMO_ATTR_TRIGGERED
@ SUMO_ATTR_TRIGGERED
Definition: SUMOXMLDefinitions.h:1066
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributePeriodRadioButton
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
Definition: GNEFrameAttributesModuls.h:515
GNEFrameAttributesModuls::ParametersEditorCreator::getParameters
std::vector< std::pair< std::string, std::string > > getParameters() const
get parameters as vector of strings
Definition: GNEFrameAttributesModuls.cpp:2209
GNE_ATTR_CLOSE_SHAPE
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
Definition: SUMOXMLDefinitions.h:1250
GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul
void showAttributesCreatorModul(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
Definition: GNEFrameAttributesModuls.cpp:514
ProcessError
Definition: UtilExceptions.h:37
GNEFrameAttributesModuls::AttributesCreatorRow::getValue
std::string getValue() const
return value
Definition: GNEFrameAttributesModuls.cpp:159
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:145
GNEFrameAttributesModuls::ParametersEditorCreator::ParametersEditorCreator
ParametersEditorCreator(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2152
MID_GNE_STOPDRAWING
@ MID_GNE_STOPDRAWING
stop drawing polygon
Definition: GUIAppEnum.h:849
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
GNESingleParametersDialog.h
GNETagProperties::isTAZElement
bool isTAZElement() const
return true if tag correspond to a TAZ element
Definition: GNETagProperties.cpp:288
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:114
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1358
CommonXMLStructure::SumoBaseObject::addBoolAttribute
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:365
MID_GNE_SET_ATTRIBUTE
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:785
CommonXMLStructure::SumoBaseObject::addIntAttribute
void addIntAttribute(const SumoXMLAttr attr, const int value)
add int attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:353
GNEFrameAttributesModuls::NeteditAttributes::showNeteditAttributesModul
void showNeteditAttributesModul(const GNETagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2475
GNEFrameAttributesModuls::DrawingShape::abortDrawing
void abortDrawing()
abort drawing
Definition: GNEFrameAttributesModuls.cpp:2365
GNEFrameAttributesModuls::AttributesCreatorRow::refreshRow
void refreshRow()
refresh row
Definition: GNEFrameAttributesModuls.cpp:246
GNEFrameAttributesModuls::AttributesEditor::hideAttributesEditorModul
void hideAttributesEditorModul()
hide attribute editor
Definition: GNEFrameAttributesModuls.cpp:1639
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueVehsPerHourTextField
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
Definition: GNEFrameAttributesModuls.h:295
GNEFrameAttributesModuls::ParametersEditorCreator::refreshParametersEditorCreator
void refreshParametersEditorCreator()
refresh netedit attributes
Definition: GNEFrameAttributesModuls.cpp:2181
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributePeriodRadioButton
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
Definition: GNEFrameAttributesModuls.h:298
GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSetAttribute
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:350
GNEFrameAttributesModuls::AttributesEditorFlow::hideAttributesEditorFlowModul
void hideAttributesEditorFlowModul()
hide attribute EditorFlow
Definition: GNEFrameAttributesModuls.cpp:1785
GNEFrameAttributesModuls::ParametersEditorCreator::showParametersEditorCreator
void showParametersEditorCreator()
show netedit attributes EditorCreator
Definition: GNEFrameAttributesModuls.cpp:2165
GNEFrameAttributesModuls::DrawingShape::getDeleteLastCreatedPoint
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrameAttributesModuls.cpp:2411
GNEFrameAttributesModuls::DrawingShape::setDeleteLastCreatedPoint
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
Definition: GNEFrameAttributesModuls.cpp:2405
VEHPARS_VPH_SET
const int VEHPARS_VPH_SET
Definition: SUMOVehicleParameter.h:51
GNEAttributeCarrier::canParse
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
Definition: GNEAttributeCarrier.h:201
SUMO_ATTR_POSITION
@ SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:499
GNEFrameAttributesModuls::isSupermodeValid
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
Definition: GNEFrameAttributesModuls.cpp:2697
GNEFrameAttributesModuls::AttributesCreatorFlow::refreshAttributesCreatorFlow
void refreshAttributesCreatorFlow()
refresh AttributesCreatorFlow
Definition: GNEFrameAttributesModuls.cpp:802
GNEFrameAttributesModuls::AttributesEditorExtended::AttributesEditorExtended
AttributesEditorExtended(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2118
GNEFrameAttributesModuls::AttributesCreator::AttributesCreator
AttributesCreator(GNEFrame *frameParent)
constructor
Definition: GNEFrameAttributesModuls.cpp:495
GNEFrameAttributesModuls::AttributesEditorFlow::refreshVehsPerHour
void refreshVehsPerHour()
refresh parameter VehsPerHour
Definition: GNEFrameAttributesModuls.cpp:1984
GNEAttributeCarrier::parse
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueEndTextField
FXTextField * myValueEndTextField
textField for 'end' attribute
Definition: GNEFrameAttributesModuls.h:283
CommonXMLStructure::SumoBaseObject::addStringListAttribute
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:389
GNEUndoList::end
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:219
GNEFrameAttributesModuls::AttributesCreator::refreshAttributesCreator
void refreshAttributesCreator()
refresh attribute creator
Definition: GNEFrameAttributesModuls.cpp:632
GNETagProperties::isDemandElement
bool isDemandElement() const
return true if tag correspond to a demand element
Definition: GNETagProperties.cpp:294
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
GNEFrameAttributesModuls::NeteditAttributes::myLengthTextField
FXTextField * myLengthTextField
textField for length
Definition: GNEFrameAttributesModuls.h:774
GUIDesignCheckButtonAttribute
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:151
GNEFrameAttributesModuls::ParametersEditorCreator::setParameters
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
Definition: GNEFrameAttributesModuls.cpp:2220
GNEFrameAttributesModuls::AttributesCreator::onCmdHelp
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
Definition: GNEFrameAttributesModuls.cpp:677
GNEFrameAttributesModuls::AttributesCreatorFlow::AttributesCreatorFlow
AttributesCreatorFlow(AttributesCreator *attributesCreatorParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:743
GNEFrameAttributesModuls::NeteditAttributes::myCenterViewAfterCreationButton
FXCheckButton * myCenterViewAfterCreationButton
checkbox to enable/disable center element after creation
Definition: GNEFrameAttributesModuls.h:786
GNEFrameAttributesModuls::AttributesCreatorFlow
Definition: GNEFrameAttributesModuls.h:234
GNEFrameAttributesModuls::AttributesEditorRow::myValueCheckButton
FXCheckButton * myValueCheckButton
pointer to menu check
Definition: GNEFrameAttributesModuls.h:387
GNEFrameAttributesModuls::AttributesCreatorRow::isAttributesCreatorRowEnabled
bool isAttributesCreatorRowEnabled() const
check if row is enabled
Definition: GNEFrameAttributesModuls.cpp:232
GNEFrameAttributesModuls::AttributesCreatorRow::destroy
void destroy()
destroy AttributesCreatorRow (but don't delete)
Definition: GNEFrameAttributesModuls.cpp:144
GNEFrameAttributesModuls::AttributesCreator::onCmdReset
long onCmdReset(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:667
GNEFrameAttributesModuls::AttributesEditorExtended::showAttributesEditorExtendedModul
void showAttributesEditorExtendedModul()
show AttributesEditorExtended modul
Definition: GNEFrameAttributesModuls.cpp:2130
SUMO_ATTR_EXPECTED
@ SUMO_ATTR_EXPECTED
Definition: SUMOXMLDefinitions.h:1069
GNEMultipleParametersDialog.h
GNEFrameAttributesModuls::DrawingShape::startDrawing
void startDrawing()
start drawing
Definition: GNEFrameAttributesModuls.cpp:2335
GNEFrameAttributesModuls
Definition: GNEFrameAttributesModuls.h:39
GNEFrameAttributesModuls::AttributesEditorFlow::showAttributeEditorFlowModul
void showAttributeEditorFlowModul()
show attributes editor Flow Modul
Definition: GNEFrameAttributesModuls.cpp:1772
SUMO_ATTR_EXPECTED_CONTAINERS
@ SUMO_ATTR_EXPECTED_CONTAINERS
Definition: SUMOXMLDefinitions.h:1071
GNEFrameAttributesModuls::AttributesCreator::disableAttributesCreator
void disableAttributesCreator()
disable AttributesCreator
Definition: GNEFrameAttributesModuls.cpp:641
GNEFrameAttributesModuls::DrawingShape::~DrawingShape
~DrawingShape()
destructor
Definition: GNEFrameAttributesModuls.cpp:2315
InvalidArgument
Definition: UtilExceptions.h:54
SUMO_TAG_VAPORIZER
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
Definition: SUMOXMLDefinitions.h:131
GNEFrameAttributesModuls::AttributesEditorFlow::myValueNumberTextField
FXTextField * myValueNumberTextField
textField for 'number' attribute
Definition: GNEFrameAttributesModuls.h:506
SUMO_ATTR_CONTAINER_TRIGGERED
@ SUMO_ATTR_CONTAINER_TRIGGERED
Definition: SUMOXMLDefinitions.h:1067
GNEFrameAttributesModuls::AttributesEditor::refreshAttributeEditor
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
Definition: GNEFrameAttributesModuls.cpp:1648
GNEFrameAttributesModuls::AttributesCreatorFlow::myValuePeriodTextField
FXTextField * myValuePeriodTextField
textField for 'period' attribute
Definition: GNEFrameAttributesModuls.h:301
GNEFrameAttributesModuls::DrawingShape::onCmdStopDrawing
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
Definition: GNEFrameAttributesModuls.cpp:2424
GUIDesignComboBox
#define GUIDesignComboBox
Definition: GUIDesigns.h:258
GNEFrameAttributesModuls::AttributesCreatorFlow::~AttributesCreatorFlow
~AttributesCreatorFlow()
destructor
Definition: GNEFrameAttributesModuls.cpp:780
FXGroupBoxModule
FXGroupBoxModule (based on FXGroupBox)
Definition: FXGroupBoxModule.h:27
GNEFrameAttributesModuls::AttributesEditor::onCmdAttributesEditorHelp
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:1730
GNEViewNetHelper::EditModes::isCurrentSupermodeData
bool isCurrentSupermodeData() const
@check if current supermode is Data
Definition: GNEViewNetHelper.cpp:1929
GNEFrameAttributesModuls::AttributesCreator::refreshRows
void refreshRows(const bool createRows)
refresh rows
Definition: GNEFrameAttributesModuls.cpp:685
SUMO_ATTR_ALLOW
@ SUMO_ATTR_ALLOW
Definition: SUMOXMLDefinitions.h:1046
GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSelectFlowRadioButton
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
Definition: GNEFrameAttributesModuls.cpp:975
GNEFrameAttributesModuls::DrawingShape::onCmdAbortDrawing
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
Definition: GNEFrameAttributesModuls.cpp:2431
CommonXMLStructure::SumoBaseObject::addPositionVectorAttribute
void addPositionVectorAttribute(const SumoXMLAttr attr, const PositionVector &value)
add PositionVector attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:395
GNEFrameAttributesModuls::AttributesCreatorFlow::showAttributesCreatorFlowModul
void showAttributesCreatorFlowModul(const bool persons)
show AttributesCreatorFlow modul
Definition: GNEFrameAttributesModuls.cpp:784
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueNumberTextField
FXTextField * myValueNumberTextField
textField for 'number' attribute
Definition: GNEFrameAttributesModuls.h:289
GNEFrameAttributesModuls::DrawingShape::showDrawingShape
void showDrawingShape()
show Drawing mode
Definition: GNEFrameAttributesModuls.cpp:2318
GNEFrameAttributesModuls::NeteditAttributes::onCmdHelp
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEFrameAttributesModuls.cpp:2612
GNEFrameAttributesModuls::AttributesCreatorFlow::setFlowParameters
void setFlowParameters(CommonXMLStructure::SumoBaseObject *baseObject)
set parameters
Definition: GNEFrameAttributesModuls.cpp:842
GNEFrameAttributesModuls::AttributesEditorRow::myAttributesEditorParent
AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent
Definition: GNEFrameAttributesModuls.h:360
CommonXMLStructure::SumoBaseObject::addDoubleAttribute
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:359
FXDEFMAP
FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorRow) RowCreatorMap[]
GNEAttributeCarrier::getNet
GNENet * getNet() const
get pointer to net
Definition: GNEAttributeCarrier.cpp:60
FXGroupBoxModule::getCollapsableFrame
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
Definition: FXGroupBoxModule.cpp:73
GNEFrameAttributesModuls::DrawingShape::stopDrawing
void stopDrawing()
stop drawing and check if shape can be created
Definition: GNEFrameAttributesModuls.cpp:2347
GNEFrameAttributesModuls::AttributesEditorRow::myACAttr
const GNEAttributeProperties myACAttr
current AC Attribute
Definition: GNEFrameAttributesModuls.h:363
StringTokenizer::getVector
std::vector< std::string > getVector()
return vector of strings
Definition: StringTokenizer.cpp:190
GNETagProperties::isNetworkElement
bool isNetworkElement() const
return true if tag correspond to a network element
Definition: GNETagProperties.cpp:270
config.h
GNEFrameAttributesModuls::AttributesCreatorRow::generateID
std::string generateID() const
generate ID
Definition: GNEFrameAttributesModuls.cpp:462
GNEFrameAttributesModuls::AttributesEditorExtended::hideAttributesEditorExtendedModul
void hideAttributesEditorExtendedModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:2136
GNEFrameAttributesModuls::AttributesEditorFlow::myValueVehsPerHourTextField
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
Definition: GNEFrameAttributesModuls.h:512
GNEUndoList::begin
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
Definition: GNEUndoList.cpp:189
GNEFrameAttributesModuls::NeteditAttributes::myLengthFrame
FXHorizontalFrame * myLengthFrame
horizontal frame for length
Definition: GNEFrameAttributesModuls.h:771
GNEFrameAttributesModuls::AttributesEditorFlow::myValueEndTextField
FXTextField * myValueEndTextField
textField for 'end' attribute
Definition: GNEFrameAttributesModuls.h:500
StringTokenizer.h
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:513
SUMO_ATTR_END
@ SUMO_ATTR_END
weights: time range end
Definition: SUMOXMLDefinitions.h:924
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeEndRadioButton
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
Definition: GNEFrameAttributesModuls.h:497
VEHPARS_PERIOD_SET
const int VEHPARS_PERIOD_SET
Definition: SUMOVehicleParameter.h:50
GNEFrameAttributesModuls::AttributesEditorFlow::refreshAttributeEditorFlow
void refreshAttributeEditorFlow()
refresh attribute EditorFlow (only the valid values will be refresh)
Definition: GNEFrameAttributesModuls.cpp:1798
GNEViewNetHelper::EditModes::isCurrentSupermodeDemand
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
Definition: GNEViewNetHelper.cpp:1923
GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow
AttributesEditorRow()
default constructor
Definition: GNEFrameAttributesModuls.cpp:1490
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
GNEFrameAttributesModuls::NeteditAttributes::onCmdSetNeteditAttribute
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2559
GNEAttributeProperties::isBool
bool isBool() const
return true if atribute is boolean
Definition: GNEAttributeProperties.cpp:344
GNEUndoList
Definition: GNEUndoList.h:42
SUMO_ATTR_VEHSPERHOUR
@ SUMO_ATTR_VEHSPERHOUR
Definition: SUMOXMLDefinitions.h:1052
GNEFrameAttributesModuls::AttributesCreator::getCurrentTemplateAC
GNEAttributeCarrier * getCurrentTemplateAC() const
get current template AC
Definition: GNEFrameAttributesModuls.cpp:610
GUIDesignButtonAttribute
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
Definition: GUIDesigns.h:71
GNEJunction
Definition: GNEJunction.h:46
VEHPARS_END_SET
const int VEHPARS_END_SET
Definition: SUMOVehicleParameter.h:48
GNEFrameAttributesModuls::ParametersEditorCreator::hideParametersEditorCreator
void hideParametersEditorCreator()
hide netedit attributes EditorCreator
Definition: GNEFrameAttributesModuls.cpp:2174
GNEFrameAttributesModuls::AttributesEditorRow::onCmdSetAttribute
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
Definition: GNEFrameAttributesModuls.cpp:1341
GNEFrameAttributesModuls::NeteditAttributes::hideNeteditAttributesModul
void hideNeteditAttributesModul()
hide Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2512
GNEFrameAttributesModuls::NeteditAttributes::setEndPosition
double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the End position values of StoppingPlaces and E2 detector over the lane
Definition: GNEFrameAttributesModuls.cpp:2682
GNEFrameAttributesModuls::AttributesEditorRow::stripWhitespaceAfterComma
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
Definition: GNEFrameAttributesModuls.cpp:1497
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:439
GNEFrame.h
SUMO_ATTR_NUMBER
@ SUMO_ATTR_NUMBER
Definition: SUMOXMLDefinitions.h:907
SUMO_ATTR_SHAPE
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
Definition: SUMOXMLDefinitions.h:936
GNEFrameAttributesModuls::AttributesCreatorRow::disableAttributesCreatorRow
void disableAttributesCreatorRow()
disable row
Definition: GNEFrameAttributesModuls.cpp:220
GNEFrameAttributesModuls::AttributesEditor::getFrameParent
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
Definition: GNEFrameAttributesModuls.cpp:1724
POSITION_EPS
#define POSITION_EPS
Definition: config.h:172
GNEFrameAttributesModuls::DrawingShape::myStartDrawingButton
FXButton * myStartDrawingButton
button for start drawing
Definition: GNEFrameAttributesModuls.h:701
GNEViewNetHelper::EditModes::isCurrentSupermodeNetwork
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
Definition: GNEViewNetHelper.cpp:1917
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNESingleParametersDialog
Dialog for edit parameters.
Definition: GNESingleParametersDialog.h:45
GNEFrameAttributesModuls::AttributesCreatorRow::isAttributeValid
bool isAttributeValid() const
check if current attribute is valid
Definition: GNEFrameAttributesModuls.cpp:337
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:290
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:48
GNEFrameAttributesModuls::AttributesEditorRow::isAttributesEditorRowValid
bool isAttributesEditorRowValid() const
check if current attribute of TextField/ComboBox is valid
Definition: GNEFrameAttributesModuls.cpp:1268
GNEFrameAttributesModuls::AttributesCreator::showWarningMessage
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrameAttributesModuls.cpp:616
GNENet.h
GNEFrameAttributesModuls::AttributesCreator::myAttributesCreatorRows
std::vector< AttributesCreatorRow * > myAttributesCreatorRows
vector with the AttributesCreatorRow
Definition: GNEFrameAttributesModuls.h:221
GNEFrameAttributesModuls::AttributesCreatorFlow::hideAttributesCreatorFlowModul
void hideAttributesCreatorFlowModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:796
GNEFrameAttributesModuls::DrawingShape
Definition: GNEFrameAttributesModuls.h:631
GNERouteHandler.h
GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES
static const size_t MAXNUMBEROFATTRIBUTES
max number of attributes allowed for every tag
Definition: GNEAttributeCarrier.h:261
GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSetFlowAttribute
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:1811
GNEFrameAttributesModuls::AttributesCreatorFlow::showWarningMessage
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrameAttributesModuls.cpp:866
SUMO_TAG_JUNCTION
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
Definition: SUMOXMLDefinitions.h:57
GNEUndoList.h
GNEFrameAttributesModuls::NeteditAttributes::myCenterViewAfterCreationFrame
FXHorizontalFrame * myCenterViewAfterCreationFrame
horizontal frame for center view after creation frame
Definition: GNEFrameAttributesModuls.h:783
GUIDesignDialogBox
#define GUIDesignDialogBox
Definition: GUIDesigns.h:518
GNETagProperties
Definition: GNETagProperties.h:38
GUIIcon::MODEADDITIONAL
@ MODEADDITIONAL
GNEFrameAttributesModuls::NeteditAttributes::getNeteditAttributesAndValues
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
Definition: GNEFrameAttributesModuls.cpp:2518