115 myAttributesCreatorParent(AttributesCreatorParent),
116 myAttrProperties(attrProperties) {
119 myAttributeLabel->hide();
121 myAttributeCheckButton->hide();
123 myAttributeColorButton->hide();
126 myValueTextField->hide();
128 myValueCheckButton->hide();
130 if ((attrProperties.getTagPropertyParent().isStop() || attrProperties.getTagPropertyParent().isPersonStop()) && (attrProperties.getAttr() ==
SUMO_ATTR_UNTIL)) {
131 myAttributeCheckButton->setCheck(FALSE);
133 myAttributeCheckButton->setCheck(TRUE);
136 if (getParent()->
id()) {
138 FXHorizontalFrame::create();
144 myAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
145 myAttributeCheckButton->setCheck(
false);
146 myAttributeCheckButton->show();
148 myValueTextField->setTextColor(FXRGB(0, 0, 0));
149 myValueTextField->disable();
151 myValueTextField->setText(generateID().c_str());
153 myValueTextField->show();
156 if (myAttrProperties.isColor()) {
157 myAttributeColorButton->setTextColor(FXRGB(0, 0, 0));
158 myAttributeColorButton->setText(myAttrProperties.getAttrStr().c_str());
159 myAttributeColorButton->show();
160 }
else if (myAttrProperties.isActivatable()) {
161 myAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
162 myAttributeCheckButton->show();
164 if ((myAttrProperties.getTagPropertyParent().isStop() || myAttrProperties.getTagPropertyParent().isPersonStop()) &&
167 myAttributeCheckButton->setCheck(FALSE);
169 myAttributeCheckButton->setCheck(TRUE);
172 myAttributeLabel->setText(myAttrProperties.getAttrStr().c_str());
173 myAttributeLabel->show();
175 if (myAttrProperties.isBool()) {
176 if (GNEAttributeCarrier::parse<bool>(attrProperties.getDefaultValue())) {
177 myValueCheckButton->setCheck(
true);
178 myValueCheckButton->setText(
"true");
180 myValueCheckButton->setCheck(
false);
181 myValueCheckButton->setText(
"false");
183 myValueCheckButton->show();
185 if (myAttributeCheckButton->shown() && (myAttributeCheckButton->getCheck() == FALSE)) {
186 myValueCheckButton->disable();
189 myValueTextField->setTextColor(FXRGB(0, 0, 0));
190 myValueTextField->setText(attrProperties.getDefaultValue().c_str());
191 myValueTextField->show();
193 if (myAttributeCheckButton->shown() && (myAttributeCheckButton->getCheck() == FALSE)) {
194 myValueTextField->disable();
207 if (getParent()->
id()) {
208 FXHorizontalFrame::destroy();
215 return myAttrProperties;
221 if (myAttrProperties.isBool()) {
222 return (myValueCheckButton->getCheck() == 1) ?
"1" :
"0";
224 return myValueTextField->getText().text();
232 return myAttributeCheckButton->getCheck() == TRUE;
243 myAttributeCheckButton->setCheck(value);
246 if (myAttrProperties.isBool()) {
247 myValueCheckButton->enable();
249 myValueTextField->enable();
252 if (myAttrProperties.isBool()) {
253 myValueCheckButton->disable();
255 myValueTextField->disable();
264 if (myAttrProperties.isBool()) {
265 return myValueCheckButton->enable();
267 return myValueTextField->enable();
274 if (myAttrProperties.isBool()) {
275 return myValueCheckButton->disable();
277 return myValueTextField->disable();
286 }
else if (myAttrProperties.isBool()) {
287 return myValueCheckButton->isEnabled();
289 return myValueTextField->isEnabled();
298 myValueTextField->setText(generateID().c_str());
305 return myInvalidValue;
311 return myAttributesCreatorParent;
320 if (obj == myValueCheckButton) {
321 if (myValueCheckButton->getCheck()) {
322 myValueCheckButton->setText(
"true");
324 myValueCheckButton->setText(
"false");
326 }
else if (myAttrProperties.isComplex()) {
328 myInvalidValue = checkComplexAttribute(myValueTextField->getText().text());
329 }
else if (myAttrProperties.isInt()) {
331 if (GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
333 double parsedDouble = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
335 if ((parsedDouble - (
int)parsedDouble) == 0) {
336 myValueTextField->setText(
toString((
int)parsedDouble).c_str(), FALSE);
338 if (myAttrProperties.isPositive() && (parsedDouble < 0)) {
339 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' cannot be negative";
342 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid 'int' format";
345 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid 'int' format";
349 if (GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
351 double angle = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
353 if ((angle < 0) || (angle > 360)) {
355 angle = fmod(angle, 360);
358 myValueTextField->setText(
toString(angle).c_str(), FALSE);
360 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid 'float' format between [0, 360]";
362 }
else if (myAttrProperties.isSUMOTime()) {
364 if (!GNEAttributeCarrier::canParse<SUMOTime>(myValueTextField->getText().text())) {
365 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid SUMOTime format";
367 }
else if (myAttrProperties.isFloat()) {
368 if (GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
370 double doubleValue = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
372 if (myAttrProperties.isPositive() && (doubleValue < 0)) {
373 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' cannot be negative";
375 }
else if (myAttrProperties.isProbability() && ((doubleValue < 0) || doubleValue > 1)) {
376 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' takes only values between 0 and 1";
377 }
else if (myAttrProperties.hasAttrRange() && ((doubleValue < myAttrProperties.getMinimumRange()) || doubleValue > myAttrProperties.getMaximumRange())) {
378 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' takes only values between " +
toString(myAttrProperties.getMinimumRange()) +
" and " +
toString(myAttrProperties.getMaximumRange());
379 }
else if ((myAttributesCreatorParent->getCurrentTagProperties().getTag() ==
SUMO_TAG_E2DETECTOR) && (myAttrProperties.getAttr() ==
SUMO_ATTR_LENGTH) && (doubleValue == 0)) {
380 myInvalidValue =
"E2 length cannot be 0";
383 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid 'float' format";
385 }
else if (myAttrProperties.isColor()) {
387 if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text()) ==
false) {
388 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid 'RBGColor' format";
390 }
else if (myAttrProperties.isFilename()) {
391 const std::string file = myValueTextField->getText().text();
394 myInvalidValue =
"input contains invalid characters for a filename";
399 myInvalidValue =
"doesn't exist image '" + file +
"'";
404 const std::string name = myValueTextField->getText().text();
407 myInvalidValue =
"input contains invalid characters";
410 const std::string types = myValueTextField->getText().text();
413 myInvalidValue =
"list of IDs contains invalid characters";
417 const std::string index = myValueTextField->getText().text();
418 if ((index !=
"fit") && (index !=
"end") && !GNEAttributeCarrier::canParse<int>(index)) {
419 myInvalidValue =
"index isn't either 'fit' or 'end' or a valid positive int";
420 }
else if (GNEAttributeCarrier::canParse<int>(index) && (GNEAttributeCarrier::parse<int>(index) < 0)) {
421 myInvalidValue =
"index cannot be negative";
425 std::vector<std::string> vehicleIDs = GNEAttributeCarrier::parse<std::vector<std::string> >(myValueTextField->getText().text());
427 for (
const auto& i : vehicleIDs) {
429 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
434 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
436 }
else if (myAttrProperties.getAttr() ==
SUMO_ATTR_ID) {
439 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
441 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
443 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
445 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
447 myInvalidValue =
"invalid id used in " + myAttrProperties.getAttrStr();
449 }
else if ((myAttrProperties.getAttr() ==
SUMO_ATTR_FREQUENCY) && myAttrProperties.getTagPropertyParent().isDetector()) {
450 if (!myValueTextField->getText().empty()) {
451 if (!GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
452 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' doesn't have a valid 'float' or empty format";
453 }
else if (GNEAttributeCarrier::parse<double>(myValueTextField->getText().text()) < 0) {
454 myInvalidValue =
"'" + myAttrProperties.getAttrStr() +
"' cannot be negative";
459 if (myInvalidValue.size() == 0) {
460 myValueTextField->setTextColor(FXRGB(0, 0, 0));
461 myValueTextField->killFocus();
464 myValueTextField->setTextColor(FXRGB(255, 0, 0));
474 if (myAttributeCheckButton->getCheck()) {
476 myValueCheckButton->enable();
477 myValueTextField->enable();
482 myValueCheckButton->disable();
483 myValueTextField->disable();
492 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
493 colordialog.setTarget(
this);
495 if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
501 if (colordialog.execute()) {
503 onCmdSetAttribute(
nullptr, 0,
nullptr);
512 std::string errorMessage;
527 switch (myAttrProperties.getAttr()) {
569 if (myAttrProperties.getTagPropertyParent().isShape()) {
570 return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateShapeID(myAttrProperties.getTagPropertyParent().getTag());
571 }
else if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) {
572 return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateAdditionalID(myAttrProperties.getTagPropertyParent().getTag());
573 }
else if (myAttrProperties.getTagPropertyParent().isDemandElement()) {
574 return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateDemandElementID(myAttrProperties.getTagPropertyParent().getTag());
583 return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->retrieveAdditional(
584 myAttrProperties.getTagPropertyParent().getTag(),
585 myValueTextField->getText().text(),
false) ==
nullptr);
594 myFrameParent(frameParent) {
610 myTagProperties = tagProperties;
612 for (
int i = 0; i < (int)myAttributesCreatorRows.size(); i++) {
614 if (myAttributesCreatorRows.at(i) !=
nullptr) {
615 myAttributesCreatorRows.at(i)->destroy();
616 delete myAttributesCreatorRows.at(i);
617 myAttributesCreatorRows.at(i) =
nullptr;
621 bool showFlowEditor =
false;
623 for (
const auto& i : myTagProperties) {
625 bool showAttribute =
true;
628 showAttribute =
false;
631 if (std::find(hiddenAttributes.begin(), hiddenAttributes.end(), i.getAttr()) != hiddenAttributes.end()) {
632 showAttribute =
false;
635 if (i.isFlowDefinition()) {
636 showAttribute =
false;
637 showFlowEditor =
true;
641 showAttribute =
false;
644 if ((i.getAttr() ==
SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) &&
646 showAttribute =
false;
654 myHelpButton->reparent(
this);
658 if (showFlowEditor) {
661 myAttributesCreatorFlow->hideAttributesCreatorFlowModul();
671 myAttributesCreatorFlow->hideAttributesCreatorFlowModul();
679 return myFrameParent;
683 std::map<SumoXMLAttr, std::string>
685 std::map<SumoXMLAttr, std::string> values;
687 for (
int i = 0; i < (int)myAttributesCreatorRows.size(); i++) {
688 if (myAttributesCreatorRows.at(i) && myAttributesCreatorRows.at(i)->getAttrProperties().getAttr() !=
SUMO_ATTR_NOTHING) {
690 bool rowEnabled = myAttributesCreatorRows.at(i)->isAttributesCreatorRowEnabled();
692 bool hasDefaultStaticValue = !myAttributesCreatorRows.at(i)->getAttrProperties().hasStaticDefaultValue() || (myAttributesCreatorRows.at(i)->getAttrProperties().getDefaultValue() != myAttributesCreatorRows.at(i)->getValue());
694 bool isFlowDefinitionAttribute = myAttributesCreatorRows.at(i)->getAttrProperties().isFlowDefinition();
696 bool isActivatableAttribute = myAttributesCreatorRows.at(i)->getAttrProperties().isActivatable() && myAttributesCreatorRows.at(i)->getAttributeCheckButtonCheck();
698 if (rowEnabled && (includeAll || hasDefaultStaticValue || isFlowDefinitionAttribute || isActivatableAttribute)) {
699 values[myAttributesCreatorRows.at(i)->getAttrProperties().getAttr()] = myAttributesCreatorRows.at(i)->getValue();
704 myAttributesCreatorFlow->setFlowParameters(values);
712 return myTagProperties;
718 std::string errorMessage;
720 for (
const auto& i : myTagProperties) {
721 if (errorMessage.empty() && myAttributesCreatorRows.at(i.getPositionListed())) {
723 std::string attributeValue = myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid();
724 if (attributeValue.size() != 0) {
725 errorMessage = attributeValue;
730 if (extra.size() == 0) {
731 errorMessage =
"Invalid input parameter of " + myTagProperties.getTagStr() +
": " + errorMessage;
733 errorMessage =
"Invalid input parameter of " + myTagProperties.getTagStr() +
": " + extra;
737 myFrameParent->myViewNet->setStatusBarText(errorMessage);
746 for (
auto i : myTagProperties) {
748 if (myAttributesCreatorRows.at(i.getPositionListed()) && myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid().size() != 0) {
760 myAttributesCreatorRows[myTagProperties.getAttributeProperties(
SUMO_ATTR_ID).getPositionListed()]->refreshRow();
767 myFrameParent->openHelpAttributesDialog(myTagProperties);
776 FXGroupBox(attributesCreatorParent->getFrameParent()->myContentFrame,
"Flow attributes",
GUIDesignGroupBoxFrame),
777 myAttributesCreatorParent(attributesCreatorParent),
780 FXHorizontalFrame* auxiliarHorizontalFrame =
nullptr;
836 myAttributeEndRadioButton->setCheck(TRUE);
837 myValueEndTextField->enable();
839 myAttributeEndRadioButton->setCheck(FALSE);
840 myValueEndTextField->disable();
843 myAttributeNumberRadioButton->setCheck(TRUE);
844 myValueNumberTextField->enable();
846 myAttributeNumberRadioButton->setCheck(FALSE);
847 myValueNumberTextField->disable();
850 myAttributeVehsPerHourRadioButton->setCheck(TRUE);
851 myValueVehsPerHourTextField->enable();
853 myAttributeVehsPerHourRadioButton->setCheck(FALSE);
854 myValueVehsPerHourTextField->disable();
857 myAttributePeriodRadioButton->setCheck(TRUE);
858 myValuePeriodTextField->enable();
860 myAttributePeriodRadioButton->setCheck(FALSE);
861 myValuePeriodTextField->disable();
864 myAttributeProbabilityRadioButton->setCheck(TRUE);
865 myValueProbabilityTextField->enable();
867 myAttributeProbabilityRadioButton->setCheck(FALSE);
868 myValueProbabilityTextField->disable();
876 parameters[
SUMO_ATTR_END] = myValueEndTextField->getText().text();
892 parameters[
SUMO_ATTR_PROB] = myValueProbabilityTextField->getText().text();
899 std::string errorMessage;
919 myAttributesCreatorParent->getFrameParent()->myViewNet->setStatusBarText(errorMessage);
929 if (GNEAttributeCarrier::canParse<double>(myValueEndTextField->getText().text())) {
930 if (GNEAttributeCarrier::parse<double>(myValueEndTextField->getText().text()) < 0) {
938 if (GNEAttributeCarrier::canParse<double>(myValueNumberTextField->getText().text())) {
939 if (GNEAttributeCarrier::parse<double>(myValueNumberTextField->getText().text()) < 0) {
947 if (GNEAttributeCarrier::canParse<double>(myValueVehsPerHourTextField->getText().text())) {
948 if (GNEAttributeCarrier::parse<double>(myValueVehsPerHourTextField->getText().text()) < 0) {
956 if (GNEAttributeCarrier::canParse<double>(myValuePeriodTextField->getText().text())) {
957 if (GNEAttributeCarrier::parse<double>(myValuePeriodTextField->getText().text()) < 0) {
965 if (GNEAttributeCarrier::canParse<double>(myValueProbabilityTextField->getText().text())) {
966 if (GNEAttributeCarrier::parse<double>(myValueProbabilityTextField->getText().text()) < 0) {
980 FXTextField* textField =
nullptr;
982 if (obj == myValueEndTextField) {
983 textField = myValueEndTextField;
984 }
else if (obj == myValueNumberTextField) {
985 textField = myValueNumberTextField;
986 }
else if (obj == myValueVehsPerHourTextField) {
987 textField = myValueVehsPerHourTextField;
988 }
else if (obj == myValuePeriodTextField) {
989 textField = myValuePeriodTextField;
990 }
else if (obj == myValueProbabilityTextField) {
991 textField = myValueProbabilityTextField;
996 if (GNEAttributeCarrier::canParse<double>(textField->getText().text()) && (GNEAttributeCarrier::parse<double>(textField->getText().text()) >= 0)) {
997 textField->setTextColor(FXRGB(0, 0, 0));
999 textField->setTextColor(FXRGB(255, 0, 0));
1001 textField->killFocus();
1009 if (obj == myAttributeEndRadioButton) {
1011 }
else if (obj == myAttributeNumberRadioButton) {
1013 }
else if (obj == myAttributeVehsPerHourRadioButton) {
1019 }
else if (obj == myAttributePeriodRadioButton) {
1021 }
else if (obj == myAttributeProbabilityRadioButton) {
1027 refreshAttributesCreatorFlow();
1037 myAttributesEditorParent(attributeEditorParent),
1062 if (getParent()->
id()) {
1064 FXHorizontalFrame::create();
1066 if (attributeEnabled ==
false) {
1102 if (attributeEnabled) {
1115 bool allBooleanValuesEqual =
true;
1117 std::vector<bool> booleanVector;
1120 booleanVector = GNEAttributeCarrier::parse<std::vector<bool> >(value);
1123 for (
const auto i : booleanVector) {
1124 if (i != booleanVector.front()) {
1125 allBooleanValuesEqual =
false;
1129 if (allBooleanValuesEqual) {
1131 if ((booleanVector.size() > 0) && booleanVector.front()) {
1190 if (getParent()->
id()) {
1191 FXHorizontalFrame::destroy();
1199 if (attributeEnabled ==
false) {
1200 myValueTextField->disable();
1201 myValueComboBoxChoices->disable();
1202 myValueCheckButton->disable();
1204 myValueTextField->enable();
1205 myValueComboBoxChoices->enable();
1206 myValueCheckButton->enable();
1210 if (
isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) {
1211 myAttributeButtonCombinableChoices->enable();
1212 myAttributeColorButton->enable();
1213 myAttributeCheckButton->enable();
1215 myAttributeColorButton->disable();
1216 myAttributeCheckButton->disable();
1217 myValueTextField->disable();
1218 myValueComboBoxChoices->disable();
1219 myValueCheckButton->disable();
1220 myAttributeButtonCombinableChoices->disable();
1224 if (myAttributeCheckButton->shown()) {
1225 myAttributeCheckButton->setCheck(attributeEnabled);
1227 if (myValueTextField->shown()) {
1229 if (myValueTextField->getTextColor() == FXRGB(0, 0, 0) || forceRefresh) {
1230 myValueTextField->setText(value.c_str());
1231 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1233 }
else if (myValueComboBoxChoices->shown()) {
1235 myValueComboBoxChoices->clearItems();
1236 for (
const auto& it : myACAttr.getDiscreteValues()) {
1237 myValueComboBoxChoices->appendItem(it.c_str());
1240 myValueComboBoxChoices->setNumVisible((
int)myACAttr.getDiscreteValues().size());
1241 myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str()));
1242 myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1243 myValueComboBoxChoices->show();
1244 }
else if (myValueCheckButton->shown()) {
1245 if (GNEAttributeCarrier::canParse<bool>(value)) {
1246 myValueCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(value));
1248 myValueCheckButton->setCheck(
false);
1256 return ((myValueTextField->getTextColor() == FXRGB(0, 0, 0)) && (myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 0)));
1262 if (obj == myAttributeColorButton) {
1264 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
1265 colordialog.setTarget(
this);
1267 if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
1269 }
else if (!myACAttr.getDefaultValue().empty()) {
1275 if (colordialog.execute()) {
1277 myValueTextField->setText(newValue.c_str());
1278 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(myACAttr.getAttr(), newValue)) {
1280 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1281 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin(
"Change multiple attributes");
1284 for (
const auto& it_ac : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1285 it_ac->setAttribute(myACAttr.getAttr(), newValue, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1288 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1289 myValueTextField->killFocus();
1293 }
else if (obj == myAttributeButtonCombinableChoices) {
1295 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1296 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin(
"Change multiple attributes");
1299 GNEAllowDisallow(myAttributesEditorParent->getFrameParent()->myViewNet, myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()).execute();
1300 std::string allowed = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(
SUMO_ATTR_ALLOW);
1302 for (
const auto& it_ac : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1303 it_ac->setAttribute(
SUMO_ATTR_ALLOW, allowed, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1306 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1310 myAttributesEditorParent->getFrameParent()->attributeUpdated();
1313 throw ProcessError(
"Invalid call to onCmdOpenAttributeDialog");
1323 if (myACAttr.isBool()) {
1325 if (myValueCheckButton->shown()) {
1327 if (myValueCheckButton->getCheck()) {
1328 myValueCheckButton->setText(
"true");
1331 myValueCheckButton->setText(
"false");
1336 newVal = myValueTextField->getText().text();
1338 }
else if (myACAttr.isDiscrete()) {
1340 if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) {
1342 newVal = myValueTextField->getText().text();
1343 }
else if (!myMultiple) {
1345 newVal = myValueComboBoxChoices->getText().text();
1348 newVal = myValueTextField->getText().text();
1352 if (myValueTextField->getText().empty() && myACAttr.hasStaticDefaultValue()) {
1353 newVal = myACAttr.getDefaultValue();
1354 myValueTextField->setText(newVal.c_str());
1355 }
else if (myACAttr.isInt() && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1357 double doubleValue = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1359 if ((doubleValue - (
int)doubleValue) == 0) {
1360 newVal =
toString((
int)doubleValue);
1361 myValueTextField->setText(newVal.c_str(), FALSE);
1363 }
else if ((myACAttr.getAttr() ==
SUMO_ATTR_ANGLE) && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1365 double angle = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1367 if ((angle < 0) || (angle > 360)) {
1369 angle = fmod(angle, 360);
1374 myValueTextField->setText(newVal.c_str(), FALSE);
1377 newVal = myValueTextField->getText().text();
1382 newVal = stripWhitespaceAfterComma(newVal);
1385 if ((myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) && myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(myACAttr.getAttr(), newVal)) {
1387 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1388 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin(
"Change multiple attributes");
1391 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin(
"change " + myACAttr.getTagPropertyParent().getTagStr() +
" attribute");
1394 for (
const auto& it_ac : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1395 it_ac->setAttribute(myACAttr.getAttr(), newVal, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1398 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1399 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_end();
1401 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_end();
1404 if (myACAttr.isVClasses()) {
1405 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1406 myValueTextField->killFocus();
1408 myAttributesEditorParent->refreshAttributeEditor(
false,
false);
1409 }
else if (myACAttr.isDiscrete()) {
1410 myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1411 myValueComboBoxChoices->killFocus();
1412 }
else if (myValueTextField !=
nullptr) {
1413 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1414 myValueTextField->killFocus();
1417 myAttributesEditorParent->getFrameParent()->attributeUpdated();
1420 if (myACAttr.isVClasses()) {
1421 myValueTextField->setTextColor(FXRGB(255, 0, 0));
1422 myValueTextField->killFocus();
1423 }
else if (myACAttr.isDiscrete()) {
1424 myValueComboBoxChoices->setTextColor(FXRGB(255, 0, 0));
1425 myValueComboBoxChoices->killFocus();
1426 }
else if (myValueTextField !=
nullptr) {
1427 myValueTextField->setTextColor(FXRGB(255, 0, 0));
1430 WRITE_DEBUG(
"Value '" + newVal +
"' for attribute " + myACAttr.getAttrStr() +
" of " + myACAttr.getTagPropertyParent().getTagStr() +
" isn't valid");
1439 GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1441 if (myAttributeCheckButton->getCheck()) {
1443 myValueCheckButton->enable();
1444 myValueTextField->enable();
1446 undoList->
p_begin(
"enable attribute '" + myACAttr.getAttrStr() +
"'");
1447 myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->enableAttribute(myACAttr.getAttr(), undoList);
1451 myValueCheckButton->disable();
1452 myValueTextField->disable();
1454 undoList->
p_begin(
"disable attribute '" + myACAttr.getAttrStr() +
"'");
1455 myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->disableAttribute(myACAttr.getAttr(), undoList);
1469 std::string result(stringValue);
1470 while (result.find(
", ") != std::string::npos) {
1482 myFrameParent(FrameParent),
1483 myIncludeExtended(true) {
1497 myIncludeExtended = includeExtended;
1499 for (
int i = 0; i < (int)myAttributesEditorRows.size(); i++) {
1501 if (myAttributesEditorRows.at(i) !=
nullptr) {
1502 myAttributesEditorRows.at(i)->destroy();
1503 delete myAttributesEditorRows.at(i);
1504 myAttributesEditorRows.at(i) =
nullptr;
1508 bool showFlowEditor =
false;
1509 if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1511 for (
const auto& tagProperty : myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty()) {
1513 bool editAttribute =
true;
1515 if ((myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 1) && tagProperty.isUnique()) {
1516 editAttribute =
false;
1519 if (tagProperty.isExtended() && !includeExtended) {
1520 editAttribute =
false;
1523 if (tagProperty.isFlowDefinition()) {
1524 editAttribute =
false;
1525 showFlowEditor =
true;
1528 if (editAttribute) {
1530 std::set<std::string> occuringValues;
1532 for (
const auto& it_ac : myFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
1533 occuringValues.insert(it_ac->getAttribute(tagProperty.getAttr()));
1536 std::ostringstream oss;
1537 for (
auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1538 if (values != occuringValues.begin()) {
1544 std::string value = oss.str();
1546 bool attributeEnabled = myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->isAttributeEnabled(tagProperty.getAttr());
1548 if (attributeEnabled ==
false) {
1549 value = myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(tagProperty.getAttr());
1552 if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().isStop() ||
1553 myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().isPersonStop()) {
1555 attributeEnabled =
false;
1557 attributeEnabled =
false;
1561 if (forceAttributeEnabled && (tagProperty.getAttr() !=
SUMO_ATTR_ID)) {
1562 attributeEnabled =
true;
1565 myAttributesEditorRows[tagProperty.getPositionListed()] =
new AttributesEditorRow(
this, tagProperty, value, attributeEnabled);
1569 if (showFlowEditor) {
1570 myAttributesEditorFlow->showAttributeEditorFlowModul();
1572 myAttributesEditorFlow->hideAttributesEditorFlowModul();
1577 myAttributesEditorFlow->hideAttributesEditorFlowModul();
1580 myHelpButton->reparent(
this);
1587 myAttributesEditorFlow->hideAttributesEditorFlowModul();
1596 if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1598 for (
const auto& tagProperty : myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty()) {
1600 bool editAttribute =
true;
1602 if ((myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 1) && tagProperty.isUnique()) {
1603 editAttribute =
false;
1606 if (tagProperty.isExtended() && !myIncludeExtended) {
1607 editAttribute =
false;
1610 if (tagProperty.isFlowDefinition()) {
1611 editAttribute =
false;
1614 if (editAttribute) {
1616 std::set<std::string> occuringValues;
1618 for (
const auto& it_ac : myFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
1619 occuringValues.insert(it_ac->getAttribute(tagProperty.getAttr()));
1622 std::ostringstream oss;
1623 for (
auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1624 if (values != occuringValues.begin()) {
1630 std::string value = oss.str();
1632 bool attributeEnabled = myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->isAttributeEnabled(tagProperty.getAttr());
1634 if (attributeEnabled ==
false) {
1635 value = myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(tagProperty.getAttr());
1638 if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().isStop() ||
1639 myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().isPersonStop()) {
1641 attributeEnabled =
false;
1643 attributeEnabled =
false;
1653 if ((tagProperty.getAttr() ==
SUMO_ATTR_SHAPE) && forceRefreshShape) {
1654 myAttributesEditorRows[tagProperty.getPositionListed()]->refreshAttributesEditorRow(value,
true, attributeEnabled);
1657 myAttributesEditorRows[tagProperty.getPositionListed()]->refreshAttributesEditorRow(value,
true, attributeEnabled);
1660 myAttributesEditorRows[tagProperty.getPositionListed()]->refreshAttributesEditorRow(value,
false, attributeEnabled);
1665 if (myAttributesEditorFlow->isAttributesEditorFlowModulShown()) {
1666 myAttributesEditorFlow->refreshAttributeEditorFlow();
1674 return myFrameParent;
1681 if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1683 myFrameParent->openHelpAttributesDialog(myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty());
1693 FXGroupBox(attributesEditorParent->getFrameParent()->myContentFrame,
"Flow attributes",
GUIDesignGroupBoxFrame),
1694 myAttributesEditorParent(attributesEditorParent) {
1696 FXHorizontalFrame* auxiliarHorizontalFrame =
nullptr;
1722 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1724 refreshAttributeEditorFlow();
1748 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1752 refreshVehsPerHour();
1754 refreshProbability();
1762 GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1766 if (obj == myValueEndTextField) {
1768 value = myValueEndTextField->getText().text();
1769 }
else if (obj == myValueNumberTextField) {
1771 value = myValueNumberTextField->getText().text();
1772 }
else if (obj == myValueVehsPerHourTextField) {
1774 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasAttribute(
SUMO_ATTR_VEHSPERHOUR)) {
1779 value = myValueVehsPerHourTextField->getText().text();
1780 }
else if (obj == myValuePeriodTextField) {
1782 value = myValuePeriodTextField->getText().text();
1783 }
else if (obj == myValueProbabilityTextField) {
1785 value = myValueProbabilityTextField->getText().text();
1792 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1793 undoList->
p_begin(
"Change multiple " +
toString(attr) +
" attributes");
1796 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1797 i->setAttribute(attr, value, undoList);
1800 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1804 refreshAttributeEditorFlow();
1812 GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1815 if (obj == myAttributeEndRadioButton) {
1817 }
else if (obj == myAttributeNumberRadioButton) {
1819 }
else if (obj == myAttributeVehsPerHourRadioButton) {
1821 }
else if (obj == myAttributePeriodRadioButton) {
1823 }
else if (obj == myAttributeProbabilityRadioButton) {
1831 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1832 undoList->
p_begin(
"enable multiple " +
toString(attr) +
" attributes");
1837 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1838 i->enableAttribute(attr, undoList);
1843 refreshAttributeEditorFlow();
1851 int allAttributesEnabledOrDisabled = 0;
1852 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1853 allAttributesEnabledOrDisabled += i->isAttributeEnabled(
SUMO_ATTR_END);
1855 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1857 std::set<std::string> occuringValues;
1858 for (
const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1862 std::ostringstream endValue;
1863 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1864 if (it_val != occuringValues.begin()) {
1867 endValue << *it_val;
1870 myValueEndTextField->enable();
1871 myValueEndTextField->setText(endValue.str().c_str());
1872 myAttributeEndRadioButton->setCheck(TRUE);
1875 myValueEndTextField->disable();
1877 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1878 myValueEndTextField->setText(
"Different flow attributes");
1879 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1880 myValueEndTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_END).c_str());
1882 myValueEndTextField->setText(
"");
1884 myAttributeEndRadioButton->setCheck(FALSE);
1892 int allAttributesEnabledOrDisabled = 0;
1893 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1896 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1898 std::set<std::string> occuringValues;
1899 for (
const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1903 std::ostringstream numberValues;
1904 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1905 if (it_val != occuringValues.begin()) {
1906 numberValues <<
" ";
1908 numberValues << *it_val;
1911 myValueNumberTextField->enable();
1912 myValueNumberTextField->setText(numberValues.str().c_str());
1913 myAttributeNumberRadioButton->setCheck(TRUE);
1916 myValueNumberTextField->disable();
1918 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1919 myValueNumberTextField->setText(
"Different flow attributes");
1920 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1921 myValueNumberTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_NUMBER).c_str());
1923 myValueNumberTextField->setText(
"");
1925 myAttributeNumberRadioButton->setCheck(FALSE);
1935 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasAttribute(
SUMO_ATTR_PERSONSPERHOUR)) {
1939 myAttributeVehsPerHourRadioButton->setText(
toString(attr).c_str());
1941 int allAttributesEnabledOrDisabled = 0;
1942 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1943 allAttributesEnabledOrDisabled += i->isAttributeEnabled(attr);
1945 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1947 std::set<std::string> occuringValues;
1948 for (
const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1949 occuringValues.insert(values->getAttribute(attr));
1952 std::ostringstream vehsPerHourValues;
1953 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1954 if (it_val != occuringValues.begin()) {
1955 vehsPerHourValues <<
" ";
1957 vehsPerHourValues << *it_val;
1960 myValueVehsPerHourTextField->enable();
1961 myValueVehsPerHourTextField->setText(vehsPerHourValues.str().c_str());
1962 myAttributeVehsPerHourRadioButton->setCheck(TRUE);
1965 myValueVehsPerHourTextField->disable();
1967 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1968 myValueVehsPerHourTextField->setText(
"Different flow attributes");
1969 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1970 myValueVehsPerHourTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(attr).c_str());
1972 myValueVehsPerHourTextField->setText(
"");
1974 myAttributeVehsPerHourRadioButton->setCheck(FALSE);
1982 int allAttributesEnabledOrDisabled = 0;
1983 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1986 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1988 std::set<std::string> occuringValues;
1989 for (
const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1993 std::ostringstream periodValues;
1994 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1995 if (it_val != occuringValues.begin()) {
1996 periodValues <<
" ";
1998 periodValues << *it_val;
2001 myValuePeriodTextField->enable();
2002 myValuePeriodTextField->setText(periodValues.str().c_str());
2003 myAttributePeriodRadioButton->setCheck(TRUE);
2006 myValuePeriodTextField->disable();
2008 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2009 myValuePeriodTextField->setText(
"Different flow attributes");
2010 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2011 myValuePeriodTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_PERIOD).c_str());
2013 myValuePeriodTextField->setText(
"");
2015 myAttributePeriodRadioButton->setCheck(FALSE);
2023 int allAttributesEnabledOrDisabled = 0;
2024 for (
const auto& i : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2025 allAttributesEnabledOrDisabled += i->isAttributeEnabled(
SUMO_ATTR_PROB);
2027 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
2029 std::set<std::string> occuringValues;
2030 for (
const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2034 std::ostringstream probabilityValues;
2035 for (
auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
2036 if (it_val != occuringValues.begin()) {
2037 probabilityValues <<
" ";
2039 probabilityValues << *it_val;
2042 myValueProbabilityTextField->enable();
2043 myValueProbabilityTextField->setText(probabilityValues.str().c_str());
2044 myAttributeProbabilityRadioButton->enable();
2045 myAttributeProbabilityRadioButton->setCheck(TRUE);
2048 myValueProbabilityTextField->disable();
2050 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2051 myValueProbabilityTextField->setText(
"Different flow attributes");
2052 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2053 myValueProbabilityTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_PROB).c_str());
2055 myValueProbabilityTextField->setText(
"");
2057 myAttributeProbabilityRadioButton->setCheck(FALSE);
2067 myFrameParent(frameParent) {
2091 myFrameParent->attributesEditorExtendedDialogOpened();
2101 myFrameParent(frameParent),
2115 refreshParametersEditorCreator();
2130 myTextFieldParameters->setText(getParametersStr().c_str());
2131 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2135 const std::map<std::string, std::string>&
2137 return myParameters;
2145 for (
const auto& i : myParameters) {
2146 result += i.first +
"=" + i.second +
"|";
2149 if (!result.empty()) {
2156 std::vector<std::pair<std::string, std::string> >
2158 std::vector<std::pair<std::string, std::string> > result;
2160 for (
const auto& parameter : myParameters) {
2161 result.push_back(std::make_pair(parameter.first, parameter.second));
2172 for (
const auto& i : parameters) {
2173 result += i.first +
"=" + i.second +
"|";
2176 if (!result.empty()) {
2180 myTextFieldParameters->setText(result.c_str(), TRUE);
2186 return myFrameParent;
2204 refreshParametersEditorCreator();
2216 myParameters.clear();
2220 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2221 myTextFieldParameters->killFocus();
2223 std::vector<std::string> parameters =
StringTokenizer(myTextFieldParameters->getText().text(),
"|",
true).
getVector();
2225 for (
const auto& parameter : parameters) {
2229 myParameters[keyParam.front()] = keyParam.back();
2232 myTextFieldParameters->setText(getParametersStr().c_str(), FALSE);
2234 myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
2245 myFrameParent(frameParent),
2246 myDeleteLastCreatedPoint(false) {
2252 std::ostringstream information;
2254 <<
"- 'Start drawing' or ENTER\n"
2255 <<
" draws shape boundary.\n"
2256 <<
"- 'Stop drawing' or ENTER\n"
2257 <<
" creates shape.\n"
2258 <<
"- 'Shift + Click'removes\n"
2259 <<
" last created point.\n"
2260 <<
"- 'Abort drawing' or ESC\n"
2261 <<
" removes drawed shape.";
2293 myStartDrawingButton->disable();
2294 myStopDrawingButton->enable();
2295 myAbortDrawingButton->enable();
2303 if (myFrameParent->shapeDrawed()) {
2305 myTemporalShapeShape.clear();
2306 myFrameParent->myViewNet->updateViewNet();
2308 myStartDrawingButton->enable();
2309 myStopDrawingButton->disable();
2310 myAbortDrawingButton->disable();
2321 myTemporalShapeShape.clear();
2322 myFrameParent->myViewNet->updateViewNet();
2324 myStartDrawingButton->enable();
2325 myStopDrawingButton->disable();
2326 myAbortDrawingButton->disable();
2332 if (myStopDrawingButton->isEnabled()) {
2333 myTemporalShapeShape.push_back(P);
2335 throw ProcessError(
"A new point cannot be added if drawing wasn't started");
2348 return myTemporalShapeShape;
2354 return myStopDrawingButton->isEnabled();
2360 myDeleteLastCreatedPoint = value;
2366 return myDeleteLastCreatedPoint;
2396 myFrameParent(frameParent),
2397 myCurrentLengthValid(true),
2398 myActualAdditionalReferencePoint(GNE_ADDITIONALREFERENCEPOINT_LEFT) {
2441 bool showFrame =
false;
2444 myLengthFrame->show();
2445 myReferencePointMatchBox->show();
2448 myLengthFrame->hide();
2449 myReferencePointMatchBox->hide();
2453 myBlockMovementFrame->show();
2456 myBlockMovementFrame->hide();
2460 myBlockShapeFrame->show();
2463 myBlockShapeFrame->hide();
2467 myCloseShapeFrame->show();
2470 myCloseShapeFrame->hide();
2474 myCenterViewAfterCreationFrame->show();
2477 myCenterViewAfterCreationFrame->hide();
2498 if (myReferencePointMatchBox->shown()) {
2500 if (lane ==
nullptr) {
2502 }
else if (myCurrentLengthValid) {
2506 if (myActualAdditionalReferencePoint == GNE_ADDITIONALREFERENCEPOINT_INVALID) {
2507 std::string errorMessage =
"Current selected reference point isn't valid";
2508 myFrameParent->myViewNet->setStatusBarText(errorMessage);
2514 double length = GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text());
2524 if (myBlockMovementCheckButton->shown()) {
2525 if (myBlockMovementCheckButton->getCheck() == 1) {
2532 if (myBlockShapeCheckButton->shown()) {
2533 if (myBlockShapeCheckButton->getCheck() == 1) {
2540 if (myCloseShapeCheckButton->shown()) {
2541 if (myCloseShapeCheckButton->getCheck() == 1) {
2548 if (myCenterViewAfterCreationButton->shown() && (myCenterViewAfterCreationButton->getCheck() == 1)) {
2558 if (obj == myBlockMovementCheckButton) {
2559 if (myBlockMovementCheckButton->getCheck()) {
2560 myBlockMovementCheckButton->setText(
"true");
2562 myBlockMovementCheckButton->setText(
"false");
2564 }
else if (obj == myBlockShapeCheckButton) {
2565 if (myBlockShapeCheckButton->getCheck()) {
2566 myBlockShapeCheckButton->setText(
"true");
2568 myBlockShapeCheckButton->setText(
"false");
2570 }
else if (obj == myCloseShapeCheckButton) {
2571 if (myCloseShapeCheckButton->getCheck()) {
2572 myCloseShapeCheckButton->setText(
"true");
2574 myCloseShapeCheckButton->setText(
"false");
2576 }
else if (obj == myCenterViewAfterCreationButton) {
2577 if (myCenterViewAfterCreationButton->getCheck()) {
2578 myCenterViewAfterCreationButton->setText(
"true");
2580 myCenterViewAfterCreationButton->setText(
"false");
2582 }
else if (obj == myLengthTextField) {
2584 if (GNEAttributeCarrier::canParse<double>(myLengthTextField->getText().text()) &&
2585 GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text()) > 0) {
2586 myLengthTextField->setTextColor(FXRGB(0, 0, 0));
2587 myLengthTextField->killFocus();
2588 myCurrentLengthValid =
true;
2590 myLengthTextField->setTextColor(FXRGB(255, 0, 0));
2591 myCurrentLengthValid =
false;
2595 }
else if (obj == myReferencePointMatchBox) {
2597 if (myReferencePointMatchBox->getText() ==
"reference left") {
2598 myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2599 myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_LEFT;
2600 myLengthTextField->enable();
2601 }
else if (myReferencePointMatchBox->getText() ==
"reference right") {
2602 myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2603 myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_RIGHT;
2604 myLengthTextField->enable();
2605 }
else if (myReferencePointMatchBox->getText() ==
"reference center") {
2606 myLengthTextField->enable();
2607 myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2608 myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_CENTER;
2609 myLengthTextField->enable();
2611 myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0));
2612 myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_INVALID;
2613 myLengthTextField->disable();
2624 FXDialogBox* additionalNeteditAttributesHelpDialog =
new FXDialogBox(
this,
"Netedit Parameters Help",
GUIDesignDialogBox);
2627 std::ostringstream help;
2629 <<
"- Referece point: Mark the initial position of the additional element.\n"
2630 <<
" Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n"
2631 <<
" - Reference Left will create it with startPos = 70 and endPos = 100.\n"
2632 <<
" - Reference Right will create it with startPos = 100 and endPos = 130.\n"
2633 <<
" - Reference Center will create it with startPos = 85 and endPos = 115.\n"
2635 <<
"- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n"
2636 <<
" the mouse. This option can be modified inspecting element.\n"
2637 <<
"- Center view: if is enabled, view will be center over created element.";
2649 WRITE_DEBUG(
"Opening NeteditAttributes help dialog");
2651 additionalNeteditAttributesHelpDialog->create();
2653 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
2655 getApp()->refresh();
2657 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
2659 WRITE_DEBUG(
"Closing NeteditAttributes help dialog");
2678 switch (myActualAdditionalReferencePoint) {
2679 case GNE_ADDITIONALREFERENCEPOINT_LEFT:
2680 return positionOfTheMouseOverLane;
2681 case GNE_ADDITIONALREFERENCEPOINT_RIGHT:
2682 return positionOfTheMouseOverLane - lengthOfAdditional;
2683 case GNE_ADDITIONALREFERENCEPOINT_CENTER:
2684 return positionOfTheMouseOverLane - lengthOfAdditional / 2;
2693 switch (myActualAdditionalReferencePoint) {
2694 case GNE_ADDITIONALREFERENCEPOINT_LEFT:
2695 return positionOfTheMouseOverLane + lengthOfAdditional;
2696 case GNE_ADDITIONALREFERENCEPOINT_RIGHT:
2697 return positionOfTheMouseOverLane;
2698 case GNE_ADDITIONALREFERENCEPOINT_CENTER:
2699 return positionOfTheMouseOverLane + lengthOfAdditional / 2;
FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorRow) RowCreatorMap[]
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
@ MID_GNE_SET_ATTRIBUTE_BUTTON
attribute selected using button (radio button or checkbox)
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trought dialog
@ MID_GNE_STARTDRAWING
start drawing polygon
@ MID_GNE_ABORTDRAWING
abort drawing polygon
@ MID_GNE_STOPDRAWING
stop drawing polygon
@ MID_GNE_SET_ATTRIBUTE_BOOL
bool attribute edited
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
#define GUIDesignComboBox
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
#define GUIDesignDialogBox
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignButtonOK
#define GUIDesignRadioButtonAttribute
design for radio button with fixed height
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignHorizontalSeparator
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const int VEHPARS_PROB_SET
const int VEHPARS_VPH_SET
const int VEHPARS_END_SET
DepartLaneDefinition
Possible ways to choose a lane on depart.
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosDefinition
Possible ways to choose the departure position.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
DepartSpeedDefinition
Possible ways to choose the departure speed.
const int VEHPARS_NUMBER_SET
ArrivalPosDefinition
Possible ways to choose the arrival position.
const int VEHPARS_PERIOD_SET
ArrivalPosLatDefinition
Possible ways to choose the departure position.
DepartDefinition
Possible ways to depart.
@ SUMO_TAG_E2DETECTOR
an e2 detector
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_CONTAINER_TRIGGERED
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
@ SUMO_ATTR_DEPARTPOS_LAT
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
@ SUMO_ATTR_BEGIN
weights: time range begin
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_END
weights: time range end
@ GNE_ATTR_BLOCK_SHAPE
block shape of a graphic element (Used mainly in GNEShapes)
@ SUMO_ATTR_EXPECTED_CONTAINERS
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_NOTHING
invalid attribute
@ SUMO_ATTR_PERSONSPERHOUR
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Dialog for edit rerouters.
GNEViewNet * myViewNet
FOX need this.
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
static const size_t MAXNUMBEROFATTRIBUTES
max number of attributes allowed for every tag
bool isColor() const
return true if atribute is a color
bool isBool() const
return true if atribute is boolean
const std::string & getAttrStr() const
get XML Attribute
bool isDiscrete() const
return true if atribute is discrete
bool isVClasses() const
return true if atribute is a list of VClasses
bool isActivatable() const
return true if atribute is activatable
const std::vector< std::string > & getDiscreteValues() const
get discrete values
SumoXMLAttr getAttr() const
get XML Attribute
const GNETagProperties & getTagPropertyParent() const
get reference to tagProperty parent
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
FXTextField * myValuePeriodTextField
textField for 'period' attribute
void hideAttributesCreatorFlowModul()
hide group box
AttributesCreatorFlow(AttributesCreator *attributesCreatorParent)
FOX-declaration.
FXTextField * myValueEndTextField
textField for 'end' attribute
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
void setFlowParameters(std::map< SumoXMLAttr, std::string > ¶meters)
set parameters
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
void refreshAttributesCreatorFlow()
refresh AttributesCreatorFlow
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
FXTextField * myValueNumberTextField
textField for 'number' attribute
void showAttributesCreatorFlowModul(const bool persons)
show AttributesCreatorFlow modul
~AttributesCreatorFlow()
destructor
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
bool areValuesValid() const
check if parameters of attributes are valid
void hideAttributesCreatorModul()
hide group box
long onCmdHelp(FXObject *, FXSelector, void *)
GNEFrame * getFrameParent() const
return frame parent
void refreshRows()
refresh rows (called after creating an element)
void showAttributesCreatorModul(const GNETagProperties &tagProperties, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
std::vector< AttributesCreatorRow * > myAttributesCreatorRows
vector with the AttributesCreatorRow
AttributesCreatorFlow * myAttributesCreatorFlow
pointer to myAttributesCreatorFlow
bool areValuesValid() const
check if parameters of attributes are valid
~AttributesCreator()
destructor
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
FXButton * myHelpButton
help button
AttributesCreator(GNEFrame *frameParent)
constructor
GNETagProperties getCurrentTagProperties() const
get current edited Tag Properties
AttributesCreator * getAttributesCreatorParent() const
get AttributesCreator parent
void enableAttributesCreatorRow()
enable row
std::string generateID() const
generate ID
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
bool isAttributesCreatorRowEnabled() const
check if row is enabled
std::string getValue() const
return value
long onCmdSelectColorButton(FXObject *, FXSelector, void *)
called when user press the "Color" button
bool isValidID() const
check if current ID placed in myValueTextField is valid
void setAttributeCheckButtonCheck(bool value)
enable or disable label checkbox button for optional attributes
void refreshRow() const
refresh row
const std::string & isAttributeValid() const
returns a empty string if current value is valid, a string with information about invalid value in ot...
const GNEAttributeProperties & getAttrProperties() const
return Attr
long onCmdSetAttribute(FXObject *, FXSelector, void *)
std::string checkComplexAttribute(const std::string &value)
check if given complex attribute is valid
void destroy()
destroy AttributesCreatorRow (but don't delete)
void disableAttributesCreatorRow()
disable row
bool getAttributeCheckButtonCheck() const
return status of label checkbox button
AttributesEditorExtended(GNEFrame *frameParent)
FOX-declaration.
long onCmdOpenDialog(FXObject *, FXSelector, void *)
~AttributesEditorExtended()
destructor
void showAttributesEditorExtendedModul()
show AttributesEditorExtended modul
void hideAttributesEditorExtendedModul()
hide group box
FXTextField * myValueEndTextField
textField for 'end' attribute
FXTextField * myValuePeriodTextField
textField for 'period' attribute
void hideAttributesEditorFlowModul()
hide attribute EditorFlow
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
void refreshNumber()
refresh parameter number
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
void refreshEnd()
refresh end
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
void refreshVehsPerHour()
refresh parameter VehsPerHour
void refreshPeriod()
refresh parameter Period
void refreshProbability()
refresh parameter Probability
void refreshAttributeEditorFlow()
refresh attribute EditorFlow (only the valid values will be refresh)
AttributesEditorFlow(AttributesEditor *attributesEditorParent)
FOX-declaration.
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
bool isAttributesEditorFlowModulShown() const
check if attribute editor flow modul is shown
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
FXTextField * myValueNumberTextField
textField for 'number' attribute
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
void showAttributeEditorFlowModul()
show attributes editor Flow Modul
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
AttributesEditorFlow * myAttributesEditorFlow
pointer to attributesEditorFlow
void showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
std::vector< AttributesEditorRow * > myAttributesEditorRows
list of Attribute editor rows
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
FXButton * myHelpButton
button for help
AttributesEditor(GNEFrame *inspectorFrameParent)
FOX-declaration.
void hideAttributesEditorModul()
hide attribute editor
bool isAttributesEditorRowValid() const
check if current attribute of TextField/ComboBox is valid
FXCheckButton * myValueCheckButton
pointer to menu check
FXLabel * myAttributeLabel
pointer to attribute label
FXButton * myAttributeColorButton
Button for open color editor.
void destroy()
destroy AttributesCreatorRow (but don't delete)
FXTextField * myValueTextField
textField to modify the value of string attributes
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
void refreshAttributesEditorRow(const std::string &value, bool forceRefresh, bool attributeEnabled)
refresh current row
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
const GNEAttributeProperties myACAttr
current AC Attribute
FXButton * myAttributeButtonCombinableChoices
pointer to buttonCombinableChoices
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent
FXComboBox * myValueComboBoxChoices
pointer to combo box choices
const bool myMultiple
flag to check if input element contains multiple values
FXCheckButton * myAttributeCheckButton
pointer to attribute menu check
const PositionVector & getTemporalShape() const
get Temporal shape
void showDrawingShape()
show Drawing mode
void addNewPoint(const Position &P)
add new point to temporal shape
void hideDrawingShape()
hide Drawing mode
FXButton * myStartDrawingButton
button for start drawing
void startDrawing()
start drawing
bool getDeleteLastCreatedPoint()
get flag delete last created point
~DrawingShape()
destructor
FXLabel * myInformationLabel
Label with information.
void abortDrawing()
abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
bool isDrawing() const
return true if currently a shape is drawed
DrawingShape(GNEFrame *frameParent)
FOX-declaration.
FXButton * myAbortDrawingButton
button for abort drawing
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
long onCmdStartDrawing(FXObject *, FXSelector, void *)
void removeLastPoint()
remove last added point
FXButton * myStopDrawingButton
button for stop drawing
void showNeteditAttributesModul(const GNETagProperties &tagValue)
show Netedit attributes modul
FXCheckButton * myBlockShapeCheckButton
checkBox for block shape
FXTextField * myLengthTextField
textField for length
FXHorizontalFrame * myBlockShapeFrame
horizontal frame for block shape
FXCheckButton * myCenterViewAfterCreationButton
checkbox to enable/disable center element after creation
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
FXHorizontalFrame * myCenterViewAfterCreationFrame
horizontal frame for center view after creation frame
double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the End position values of StoppingPlaces and E2 detector over the lane
~NeteditAttributes()
destructor
FXHorizontalFrame * myBlockMovementFrame
horizontal frame for block movement
NeteditAttributes(GNEFrame *frameParent)
FOX-declaration.
FXCheckButton * myBlockMovementCheckButton
checkBox for block movement
FXHorizontalFrame * myLengthFrame
horizontal frame for length
FXComboBox * myReferencePointMatchBox
match box with the list of reference points
double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the Start position values of StoppingPlaces and E2 detector over the lane
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
void hideNeteditAttributesModul()
hide Netedit attributes modul
FXHorizontalFrame * myCloseShapeFrame
horizontal frame for close polygon
FXButton * helpReferencePoint
Button for help about the reference point.
FXCheckButton * myCloseShapeCheckButton
checkbox to enable/disable close polygon
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
~ParametersEditorCreator()
destructor
long onCmdEditParameters(FXObject *, FXSelector, void *)
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
std::string getParametersStr() const
get parameters as string
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
void setParameters(const std::vector< std::pair< std::string, std::string > > ¶meters)
set parameters
const std::map< std::string, std::string > & getParametersMap() const
get parameters as map
void showParametersEditorCreator()
show netedit attributes EditorCreator
void hideParametersEditorCreator()
hide netedit attributes EditorCreator
Parameterised::ParameterisedAttrType getAttrType() const
get current parameter type
ParametersEditorCreator(GNEFrame *frameParent)
FOX-declaration.
FXTextField * myTextFieldParameters
text field for write parameters
std::vector< std::pair< std::string, std::string > > getParameters() const
get parameters as vector of strings
void refreshParametersEditorCreator()
refresh netedit attributes
GNEFrame * getFrameParent() const
pointer to frame parent
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
GNEViewNet * myViewNet
View Net.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
double getLengthGeometryFactor() const
get length geometry factor
static void setFlowParameters(const SumoXMLAttr attribute, int ¶meters)
configure flow parameters
Dialog for edit parameters.
bool isShape() const
return true if tag correspond to a shape
bool canBlockMovement() const
return true if tag correspond to an element that can block their movement
bool isTAZElement() const
return true if tag correspond to a TAZ element
bool isNetworkElement() const
return true if tag correspond to a network element
bool isDataElement() const
return true if tag correspond to a data element
bool canBlockShape() const
return true if tag correspond to an element that can block their shape
bool canMaskStartEndPos() const
return true if tag correspond to an element that can mask the attributes "start" and "end" position a...
bool canCenterCameraAfterCreation() const
return true if tag correspond to an element that center camera after creation
bool canCloseShape() const
return true if tag correspond to an element that can close their shape
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEUndoList * getUndoList() const
get the undoList object
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
An upper class for objects with additional parameters.
ParameterisedAttrType
@brie enum for Parameterised type
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
A point in 2D or 3D with translation and scaling methods.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
static RGBColor parseColor(std::string coldef)
Parses a color information.
static const RGBColor BLACK
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
static bool parsePersonModes(const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
Validates a given person modes value.
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidDetectorID(const std::string &value)
whether the given string is a valid id for an detector
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
std::vector< std::string > getVector()
return vector of strings
static std::string replace(std::string str, const char *what, const char *by)
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network