115 myAttributesCreatorParent(AttributesCreatorParent),
116 myAttrProperties(attrProperties) {
119 myAttributeLabel->hide();
121 myEnableAttributeCheckButton->hide();
123 myAttributeButton->hide();
126 myValueTextField->hide();
128 myValueCheckButton->hide();
130 myValueComboBox->hide();
132 if (getParent()->
id()) {
134 FXHorizontalFrame::create();
146 if (getParent()->
id()) {
147 FXHorizontalFrame::destroy();
154 return myAttrProperties;
160 if (myAttrProperties.isBool()) {
161 return (myValueCheckButton->getCheck() == 1) ?
"1" :
"0";
162 }
else if (myAttrProperties.isDiscrete()) {
163 return myValueComboBox->getText().text();
165 return myValueTextField->getText().text();
173 return myEnableAttributeCheckButton->getCheck() == TRUE;
184 myEnableAttributeCheckButton->setCheck(value);
187 if (myAttrProperties.isBool()) {
188 myValueCheckButton->enable();
189 }
else if (myAttrProperties.isDiscrete()) {
190 myValueComboBox->enable();
192 myValueTextField->enable();
195 if (myAttrProperties.isBool()) {
196 myValueCheckButton->disable();
197 }
else if (myAttrProperties.isDiscrete()) {
198 myValueComboBox->disable();
200 myValueTextField->disable();
209 if (myAttrProperties.isBool()) {
210 return myValueCheckButton->enable();
211 }
else if (myAttrProperties.isDiscrete()) {
212 myValueComboBox->enable();
214 return myValueTextField->enable();
221 if (myAttrProperties.isBool()) {
222 return myValueCheckButton->disable();
223 }
else if (myAttrProperties.isDiscrete()) {
224 myValueComboBox->disable();
226 return myValueTextField->disable();
235 }
else if (myAttrProperties.isBool()) {
236 return myValueCheckButton->isEnabled();
237 }
else if (myAttrProperties.isDiscrete()) {
238 return myValueComboBox->isEnabled();
240 return myValueTextField->isEnabled();
248 myInvalidValue.clear();
250 if ((myAttrProperties.getAttr() ==
SUMO_ATTR_ID) && myAttrProperties.hasAutomaticID()) {
252 myEnableAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
253 myEnableAttributeCheckButton->setCheck(
false);
254 myEnableAttributeCheckButton->show();
256 myValueTextField->setTextColor(FXRGB(0, 0, 0));
257 myValueTextField->disable();
259 myValueTextField->setText(generateID().c_str());
261 myValueTextField->show();
266 myAttributeButton->setTextColor(FXRGB(0, 0, 0));
267 myAttributeButton->setText(myAttrProperties.getAttrStr().c_str());
268 myAttributeButton->show();
269 }
else if (myAttrProperties.isActivatable()) {
271 myEnableAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
272 myEnableAttributeCheckButton->show();
274 if (myAttributesCreatorParent->getCurrentTemplateAC()->isAttributeEnabled(myAttrProperties.getAttr())) {
275 myEnableAttributeCheckButton->setCheck(TRUE);
277 myEnableAttributeCheckButton->setCheck(FALSE);
281 myAttributeLabel->setText(myAttrProperties.getAttrStr().c_str());
282 myAttributeLabel->show();
285 if (myAttrProperties.isBool()) {
286 if (GNEAttributeCarrier::parse<bool>(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()))) {
287 myValueCheckButton->setCheck(
true);
288 myValueCheckButton->setText(
"true");
290 myValueCheckButton->setCheck(
false);
291 myValueCheckButton->setText(
"false");
293 myValueCheckButton->show();
295 if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) {
296 myValueCheckButton->disable();
298 }
else if (myAttrProperties.isDiscrete()) {
300 myValueComboBox->clearItems();
301 for (
const auto& item : myAttrProperties.getDiscreteValues()) {
302 myValueComboBox->appendItem(item.c_str());
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();
309 if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) {
310 myValueComboBox->disable();
313 myValueTextField->setTextColor(FXRGB(0, 0, 0));
314 myValueTextField->setText(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()).c_str());
315 myValueTextField->show();
317 if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) {
318 myValueTextField->disable();
327 myAttributeLabel->disable();
328 myEnableAttributeCheckButton->disable();
329 myAttributeButton->disable();
330 myValueTextField->disable();
331 myValueComboBox->disable();
332 myValueCheckButton->disable();
338 return (myValueTextField->getTextColor() != FXRGB(255, 0, 0) &&
339 myValueComboBox->getTextColor() != FXRGB(255, 0, 0));
345 return myAttributesCreatorParent;
352 if (obj == myEnableAttributeCheckButton) {
353 if (myEnableAttributeCheckButton->getCheck()) {
355 if (myValueTextField->shown()) {
356 myValueTextField->enable();
359 if (myValueComboBox->shown()) {
360 myValueComboBox->enable();
363 if (myValueCheckButton->shown()) {
364 myValueCheckButton->enable();
366 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(myAttrProperties.getAttr(),
true, -1);
369 if (myValueTextField->shown()) {
370 myValueTextField->disable();
373 if (myValueComboBox->shown()) {
374 myValueComboBox->disable();
377 if (myValueCheckButton->shown()) {
378 myValueCheckButton->disable();
380 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(myAttrProperties.getAttr(),
false, -1);
382 }
else if (obj == myValueCheckButton) {
383 if (myValueCheckButton->getCheck()) {
384 myValueCheckButton->setText(
"true");
385 myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(),
"true");
387 myValueCheckButton->setText(
"false");
388 myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(),
"false");
390 }
else if (obj == myValueComboBox) {
392 if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(myAttrProperties.getAttr(), myValueComboBox->getText().text())) {
394 if (myAttrProperties.hasDefaultValue() && (myAttrProperties.getDefaultValue() == myValueComboBox->getText().text())) {
395 myValueComboBox->setTextColor(FXRGB(128, 128, 128));
397 myValueComboBox->setTextColor(FXRGB(0, 0, 0));
399 myValueComboBox->killFocus();
400 myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), myValueComboBox->getText().text());
403 myValueComboBox->setTextColor(FXRGB(255, 0, 0));
405 }
else if (obj == myValueTextField) {
407 if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(myAttrProperties.getAttr(), myValueTextField->getText().text())) {
409 if (myAttrProperties.hasDefaultValue() && (myAttrProperties.getDefaultValue() == myValueTextField->getText().text())) {
410 myValueTextField->setTextColor(FXRGB(128, 128, 128));
412 myValueTextField->setTextColor(FXRGB(0, 0, 0));
414 myValueTextField->killFocus();
415 myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), myValueTextField->getText().text());
418 myValueTextField->setTextColor(FXRGB(255, 0, 0));
432 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
433 colordialog.setTarget(
this);
435 if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
436 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myValueTextField->getText().text())));
438 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myAttrProperties.getDefaultValue())));
441 if (colordialog.execute()) {
446 std::string allow = myValueTextField->getText().text();
448 bool acceptChanges =
false;
450 GNEAllowDisallow(myAttributesCreatorParent->getFrameParent()->getViewNet(), &allow, &acceptChanges).execute();
454 myValueTextField->setText(allow.c_str(), TRUE);
464 const auto& GNEAttributeCarriers = myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
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());
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);
497 myFrameParent(frameParent),
498 myTemplateAC(nullptr) {
516 for (
auto& row : myAttributesCreatorRows) {
518 if (row !=
nullptr) {
526 myTemplateAC = templateAC;
527 myHiddenAttributes = hiddenAttributes;
531 myResetButton->enable();
535 throw ProcessError(
"invalid templateAC in showAttributesCreatorModule");
543 myAttributesCreatorFlow->hideAttributesCreatorFlowModule();
551 return myFrameParent;
558 for (
const auto& row : myAttributesCreatorRows) {
560 const auto& attrProperties = row->getAttrProperties();
562 const bool rowEnabled = row->isAttributesCreatorRowEnabled();
564 const bool hasDefaultStaticValue = !attrProperties.hasDefaultValue() || (attrProperties.getDefaultValue() != row->getValue());
566 const bool isFlowDefinitionAttribute = attrProperties.isFlowDefinition();
568 const bool isActivatableAttribute = attrProperties.isActivatable() && row->getAttributeCheckButtonCheck();
570 if (rowEnabled && (includeAll || hasDefaultStaticValue || isFlowDefinitionAttribute || isActivatableAttribute)) {
572 if (attrProperties.isInt()) {
573 const int intValue = GNEAttributeCarrier::canParse<int>(row->getValue()) ? GNEAttributeCarrier::parse<int>(row->getValue()) : GNEAttributeCarrier::parse<int>(attrProperties.getDefaultValue());
575 }
else if (attrProperties.isFloat()) {
576 const double doubleValue = GNEAttributeCarrier::canParse<double>(row->getValue()) ? GNEAttributeCarrier::parse<double>(row->getValue()) : GNEAttributeCarrier::parse<double>(attrProperties.getDefaultValue());
578 }
else if (attrProperties.isBool()) {
579 const bool boolValue = GNEAttributeCarrier::canParse<bool>(row->getValue()) ? GNEAttributeCarrier::parse<bool>(row->getValue()) : GNEAttributeCarrier::parse<bool>(attrProperties.getDefaultValue());
581 }
else if (attrProperties.isposition()) {
582 const Position positionValue = GNEAttributeCarrier::canParse<Position>(row->getValue()) ? GNEAttributeCarrier::parse<Position>(row->getValue()) : GNEAttributeCarrier::parse<Position>(attrProperties.getDefaultValue());
584 }
else if (attrProperties.isSUMOTime()) {
585 const SUMOTime timeValue = GNEAttributeCarrier::canParse<SUMOTime>(row->getValue()) ? GNEAttributeCarrier::parse<SUMOTime>(row->getValue()) : GNEAttributeCarrier::parse<SUMOTime>(attrProperties.getDefaultValue());
587 }
else if (attrProperties.isColor()) {
588 const RGBColor colorValue = GNEAttributeCarrier::canParse<RGBColor>(row->getValue()) ? GNEAttributeCarrier::parse<RGBColor>(row->getValue()) : GNEAttributeCarrier::parse<RGBColor>(attrProperties.getDefaultValue());
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());
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());
605 if (myAttributesCreatorFlow->shownAttributesCreatorFlowModule()) {
606 myAttributesCreatorFlow->setFlowParameters(baseObject);
619 std::string errorMessage;
621 if (extra.size() == 0) {
622 errorMessage =
"Invalid input parameter of " + myTemplateAC->getTagProperty().getTagStr();
624 errorMessage =
"Invalid input parameter of " + myTemplateAC->getTagProperty().getTagStr() +
": " + extra;
627 myFrameParent->myViewNet->setStatusBarText(errorMessage);
636 if (shown() && myTemplateAC) {
645 for (
const auto& row : myAttributesCreatorRows) {
651 myResetButton->disable();
658 for (
const auto& attribute : myTemplateAC->getTagProperty()) {
660 if (myAttributesCreatorRows.at(attribute.getPositionListed()) && !myAttributesCreatorRows.at(attribute.getPositionListed())->isAttributeValid()) {
671 myTemplateAC->resetDefaultValues();
681 myFrameParent->openHelpAttributesDialog(myTemplateAC);
689 bool showFlowEditor =
false;
691 for (
const auto& attribute : myTemplateAC->getTagProperty()) {
693 bool showAttribute =
true;
695 if (attribute.isUnique() && (attribute.getAttr() !=
SUMO_ATTR_ID)) {
696 showAttribute =
false;
699 if (std::find(myHiddenAttributes.begin(), myHiddenAttributes.end(), attribute.getAttr()) != myHiddenAttributes.end()) {
700 showAttribute =
false;
703 if (attribute.isFlowDefinition()) {
704 showAttribute =
false;
705 showFlowEditor =
true;
709 showAttribute =
false;
712 if ((attribute.getAttr() ==
SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) &&
714 showAttribute =
false;
720 myAttributesCreatorRows.at(attribute.getPositionListed()) =
new AttributesCreatorRow(
this, attribute);
722 myAttributesCreatorRows.at(attribute.getPositionListed())->refreshRow();
727 myFrameButtons->reparent(getCollapsableFrame());
731 if (showFlowEditor) {
732 myAttributesCreatorFlow->showAttributesCreatorFlowModule();
734 myAttributesCreatorFlow->hideAttributesCreatorFlowModule();
743 FXGroupBoxModule(attributesCreatorParent->getFrameParent()->myContentFrame,
"Flow attributes"),
744 myAttributesCreatorParent(attributesCreatorParent) {
746 FXHorizontalFrame* auxiliarHorizontalFrame =
nullptr;
784 refreshAttributesCreatorFlow();
804 const auto flow = myAttributesCreatorParent->getCurrentTemplateAC();
806 myValueEndTextField->setText(flow->getAttribute(
SUMO_ATTR_END).c_str());
808 myAttributeEndRadioButton->setCheck(
true);
809 myValueEndTextField->enable();
811 myAttributeEndRadioButton->setCheck(
false);
812 myValueEndTextField->disable();
815 myValueNumberTextField->setText(flow->getAttribute(
SUMO_ATTR_NUMBER).c_str());
817 myAttributeNumberRadioButton->setCheck(
true);
818 myValueNumberTextField->enable();
820 myAttributeNumberRadioButton->setCheck(
false);
821 myValueNumberTextField->disable();
824 myAttributeVehsPerHourRadioButton->setText(
toString(myPerHourAttr).c_str());
825 myValueVehsPerHourTextField->setText(flow->getAttribute(myPerHourAttr).c_str());
826 if (flow->isAttributeEnabled(myPerHourAttr)) {
827 myAttributeVehsPerHourRadioButton->setCheck(
true);
828 myValueVehsPerHourTextField->enable();
830 myAttributeVehsPerHourRadioButton->setCheck(
false);
831 myValueVehsPerHourTextField->disable();
834 myValuePeriodTextField->setText(flow->getAttribute(
SUMO_ATTR_PERIOD).c_str());
836 myAttributePeriodRadioButton->setCheck(
true);
837 myValuePeriodTextField->enable();
839 myAttributePeriodRadioButton->setCheck(
false);
840 myValuePeriodTextField->disable();
843 myValueProbabilityTextField->setText(flow->getAttribute(
SUMO_ATTR_PROB).c_str());
845 myAttributeProbabilityRadioButton->setCheck(
true);
846 myValueProbabilityTextField->enable();
848 myAttributeProbabilityRadioButton->setCheck(
false);
849 myValueProbabilityTextField->disable();
857 if (myValueEndTextField->isEnabled()) {
861 if (myValueNumberTextField->isEnabled()) {
865 if (myValueVehsPerHourTextField->isEnabled()) {
866 baseObject->
addIntAttribute(myPerHourAttr, GNEAttributeCarrier::parse<int>(myValueNumberTextField->getText().text()));
868 if (myValuePeriodTextField->isEnabled()) {
871 if (myValueProbabilityTextField->isEnabled()) {
879 std::string errorMessage;
881 if (extra.size() == 0) {
882 errorMessage =
"Invalid input parameter of " + myAttributesCreatorParent->getCurrentTemplateAC()->getTagProperty().getTagStr();
884 errorMessage =
"Invalid input parameter of " + myAttributesCreatorParent->getCurrentTemplateAC()->getTagProperty().getTagStr() +
": " + extra;
887 myAttributesCreatorParent->getFrameParent()->myViewNet->setStatusBarText(errorMessage);
896 if (myValueEndTextField->isEnabled() && (myValueEndTextField->getTextColor() == FXRGB(255, 0, 0))) {
899 if (myValueNumberTextField->isEnabled() && (myValueNumberTextField->getTextColor() == FXRGB(255, 0, 0))) {
902 if (myValueVehsPerHourTextField->isEnabled() && (myValueVehsPerHourTextField->getTextColor() == FXRGB(255, 0, 0))) {
905 if (myValuePeriodTextField->isEnabled() && (myValuePeriodTextField->getTextColor() == FXRGB(255, 0, 0))) {
908 if (myValueProbabilityTextField->isEnabled() && (myValueProbabilityTextField->getTextColor() == FXRGB(255, 0, 0))) {
918 FXTextField* textField =
nullptr;
921 if (obj == myValueEndTextField) {
922 textField = myValueEndTextField;
924 }
else if (obj == myValueNumberTextField) {
925 textField = myValueNumberTextField;
927 }
else if (obj == myValueVehsPerHourTextField) {
928 textField = myValueVehsPerHourTextField;
929 attr = myPerHourAttr;
930 }
else if (obj == myValuePeriodTextField) {
931 textField = myValuePeriodTextField;
933 }
else if (obj == myValueProbabilityTextField) {
934 textField = myValueProbabilityTextField;
940 if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(attr, textField->getText().text())) {
941 textField->setTextColor(FXRGB(0, 0, 0));
943 textField->setTextColor(FXRGB(255, 0, 0));
945 textField->killFocus();
953 const int previousParameters = GNEAttributeCarrier::parse<int>(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(
GNE_ATTR_FLOWPARAMETERS));
955 if (obj == myAttributeEndRadioButton) {
956 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(
SUMO_ATTR_END,
true, previousParameters);
957 }
else if (obj == myAttributeNumberRadioButton) {
958 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(
SUMO_ATTR_NUMBER,
true, previousParameters);
959 }
else if (obj == myAttributeVehsPerHourRadioButton) {
960 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(
SUMO_ATTR_VEHSPERHOUR,
true, previousParameters);
961 }
else if (obj == myAttributePeriodRadioButton) {
962 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(
SUMO_ATTR_PERIOD,
true, previousParameters);
963 }
else if (obj == myAttributeProbabilityRadioButton) {
964 myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(
SUMO_ATTR_PROB,
true, previousParameters);
969 refreshAttributesCreatorFlow();
978 const std::string& value,
const bool attributeEnabled,
const bool computed) :
980 myAttributesEditorParent(attributeEditorParent),
1005 if (getParent()->
id()) {
1007 FXHorizontalFrame::create();
1009 if (attributeEnabled ==
false) {
1056 if (attributeEnabled) {
1069 bool allBooleanValuesEqual =
true;
1071 std::vector<bool> booleanVector;
1074 booleanVector = GNEAttributeCarrier::parse<std::vector<bool> >(value);
1077 for (
const auto& booleanValue : booleanVector) {
1078 if (booleanValue != booleanVector.front()) {
1079 allBooleanValuesEqual =
false;
1083 if (allBooleanValuesEqual) {
1085 if ((booleanVector.size() > 0) && booleanVector.front()) {
1169 if (getParent()->
id()) {
1170 FXHorizontalFrame::destroy();
1177 const bool forceRefresh,
const bool attributeEnabled,
const bool computed) {
1179 if (attributeEnabled ==
false) {
1180 myValueTextField->disable();
1181 myValueComboBoxChoices->disable();
1182 myValueCheckButton->disable();
1184 myValueTextField->enable();
1185 myValueComboBoxChoices->enable();
1186 myValueCheckButton->enable();
1190 if (
isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) {
1191 myAttributeButtonCombinableChoices->enable();
1192 myAttributeColorButton->enable();
1193 myAttributeCheckButton->enable();
1195 myAttributeColorButton->disable();
1196 myAttributeCheckButton->disable();
1197 myValueTextField->disable();
1198 myValueComboBoxChoices->disable();
1199 myValueCheckButton->disable();
1200 myAttributeButtonCombinableChoices->disable();
1204 if (myAttributeCheckButton->shown()) {
1205 myAttributeCheckButton->setCheck(attributeEnabled);
1207 if (myValueTextField->shown()) {
1209 if (myValueTextField->getTextColor() == FXRGB(0, 0, 0) || myValueTextField->getTextColor() == FXRGB(0, 0, 255) || forceRefresh) {
1210 myValueTextField->setText(value.c_str());
1213 myValueTextField->setTextColor(FXRGB(0, 0, 255));
1215 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1218 }
else if (myValueComboBoxChoices->shown()) {
1220 myValueComboBoxChoices->clearItems();
1221 for (
const auto& discreteValue : myACAttr.getDiscreteValues()) {
1222 myValueComboBoxChoices->appendItem(discreteValue.c_str());
1225 myValueComboBoxChoices->setNumVisible((
int)myACAttr.getDiscreteValues().size());
1226 myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str()));
1229 myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255));
1231 myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1233 myValueComboBoxChoices->show();
1234 }
else if (myValueCheckButton->shown()) {
1235 if (GNEAttributeCarrier::canParse<bool>(value)) {
1236 myValueCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(value));
1238 myValueCheckButton->setCheck(
false);
1246 return ((myValueTextField->getTextColor() == FXRGB(0, 0, 0)) || (myValueTextField->getTextColor() == FXRGB(0, 0, 255))) &&
1247 ((myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 0)) || (myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 255)));
1253 const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1254 if (obj == myAttributeColorButton) {
1256 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
1257 colordialog.setTarget(
this);
1259 if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
1260 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myValueTextField->getText().text())));
1261 }
else if (!myACAttr.getDefaultValue().empty()) {
1262 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myACAttr.getDefaultValue())));
1267 if (colordialog.execute()) {
1269 myValueTextField->setText(newValue.c_str());
1270 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(myACAttr.getAttr(), newValue)) {
1272 if (ACs.size() > 1) {
1273 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(),
"Change multiple attributes");
1276 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1277 inspectedAC->setAttribute(myACAttr.getAttr(), newValue, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1280 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1281 myValueTextField->killFocus();
1285 }
else if (obj == myAttributeButtonCombinableChoices) {
1287 if (ACs.size() > 1) {
1288 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(),
"Change multiple attributes");
1293 bool acceptChanges =
false;
1295 GNEAllowDisallow(myAttributesEditorParent->getFrameParent()->myViewNet, myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(), modifiedAttr, &acceptChanges).execute();
1297 if (acceptChanges) {
1298 std::string allowed = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(modifiedAttr);
1300 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1301 inspectedAC->setAttribute(modifiedAttr, allowed, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1304 if (ACs.size() > 1) {
1308 myAttributesEditorParent->getFrameParent()->attributeUpdated();
1312 throw ProcessError(
"Invalid call to onCmdOpenAttributeDialog");
1322 if (myACAttr.isBool()) {
1324 if (myValueCheckButton->shown()) {
1326 if (myValueCheckButton->getCheck()) {
1327 myValueCheckButton->setText(
"true");
1330 myValueCheckButton->setText(
"false");
1335 newVal = myValueTextField->getText().text();
1337 }
else if (myACAttr.isDiscrete()) {
1339 if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) {
1341 newVal = myValueTextField->getText().text();
1342 }
else if (!myMultiple) {
1344 newVal = myValueComboBoxChoices->getText().text();
1347 newVal = myValueTextField->getText().text();
1351 if (myValueTextField->getText().empty() && myACAttr.hasDefaultValue()) {
1352 newVal = myACAttr.getDefaultValue();
1353 myValueTextField->setText(newVal.c_str());
1354 }
else if (myACAttr.isInt() && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1356 double doubleValue = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1358 if ((doubleValue - (
int)doubleValue) == 0) {
1359 newVal =
toString((
int)doubleValue);
1360 myValueTextField->setText(newVal.c_str(), FALSE);
1362 }
else if ((myACAttr.getAttr() ==
SUMO_ATTR_ANGLE) && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1364 double angle = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1366 if ((angle < 0) || (angle > 360)) {
1368 angle = fmod(angle, 360);
1373 myValueTextField->setText(newVal.c_str(), FALSE);
1376 newVal = myValueTextField->getText().text();
1381 newVal = stripWhitespaceAfterComma(newVal);
1384 const auto& inspectedACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1386 if ((inspectedACs.size() > 0) && inspectedACs.front()->isValid(myACAttr.getAttr(), newVal)) {
1388 if (!mergeJunction(myACAttr.getAttr(), inspectedACs, newVal)) {
1390 if (inspectedACs.size() > 1) {
1391 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(),
"Change multiple attributes");
1394 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(),
"change " + myACAttr.getTagPropertyParent().getTagStr() +
" attribute");
1397 for (
const auto& inspectedAC : inspectedACs) {
1398 inspectedAC->setAttribute(myACAttr.getAttr(), newVal, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1401 if (inspectedACs.size() > 1) {
1402 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end();
1404 myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end();
1407 if (myACAttr.isVClasses()) {
1408 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1409 myValueTextField->killFocus();
1411 myAttributesEditorParent->refreshAttributeEditor(
false,
false);
1412 }
else if (myACAttr.isDiscrete()) {
1413 myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1414 myValueComboBoxChoices->killFocus();
1415 }
else if (myValueTextField !=
nullptr) {
1416 myValueTextField->setTextColor(FXRGB(0, 0, 0));
1417 myValueTextField->killFocus();
1420 myAttributesEditorParent->getFrameParent()->attributeUpdated();
1424 if (myACAttr.isVClasses()) {
1425 myValueTextField->setTextColor(FXRGB(255, 0, 0));
1426 myValueTextField->killFocus();
1427 }
else if (myACAttr.isDiscrete()) {
1428 myValueComboBoxChoices->setTextColor(FXRGB(255, 0, 0));
1429 myValueComboBoxChoices->killFocus();
1430 }
else if (myValueTextField !=
nullptr) {
1431 myValueTextField->setTextColor(FXRGB(255, 0, 0));
1434 WRITE_DEBUG(
"Value '" + newVal +
"' for attribute " + myACAttr.getAttrStr() +
" of " + myACAttr.getTagPropertyParent().getTagStr() +
" isn't valid");
1442 const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1444 GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1446 if (myAttributeCheckButton->getCheck()) {
1448 myValueCheckButton->enable();
1449 myValueTextField->enable();
1451 undoList->
begin(ACs.front()->getTagProperty().getGUIIcon(),
"enable attribute '" + myACAttr.getAttrStr() +
"'");
1452 ACs.front()->enableAttribute(myACAttr.getAttr(), undoList);
1456 myValueCheckButton->disable();
1457 myValueTextField->disable();
1459 undoList->
begin(ACs.front()->getTagProperty().getGUIIcon(),
"disable attribute '" + myACAttr.getAttrStr() +
"'");
1460 ACs.front()->disableAttribute(myACAttr.getAttr(), undoList);
1468 myAttributesEditorParent(nullptr),
1475 std::string result(stringValue);
1476 while (result.find(
", ") != std::string::npos) {
1490 const Position newPosition = GNEAttributeCarrier::parse<Position>(newVal);
1492 for (
const auto& junction : myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) {
1494 if ((junction.second->getPositionInView().distanceTo2D(newPosition) < POSITION_EPS) &&
1495 myAttributesEditorParent->getFrameParent()->getViewNet()->mergeJunctions(movedJunction, junction.second)) {
1510 myFrameParent(FrameParent),
1511 myIncludeExtended(true) {
1525 myIncludeExtended = includeExtended;
1527 for (
auto& row : myAttributesEditorRows) {
1529 if (row !=
nullptr) {
1536 const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers();
1538 bool showFlowEditor =
false;
1539 if (ACs.size() > 0) {
1541 for (
const auto& attrProperty : ACs.front()->getTagProperty()) {
1543 bool editAttribute =
true;
1545 if ((ACs.size() > 1) && attrProperty.isUnique()) {
1546 editAttribute =
false;
1549 if (attrProperty.isExtended() && !includeExtended) {
1550 editAttribute =
false;
1553 if (attrProperty.isFlowDefinition()) {
1554 editAttribute =
false;
1555 showFlowEditor =
true;
1558 if (editAttribute) {
1560 std::set<std::string> occuringValues;
1562 for (
const auto& inspectedAC : ACs) {
1563 occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr()));
1566 std::ostringstream oss;
1567 for (
auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1568 if (values != occuringValues.begin()) {
1574 std::string value = oss.str();
1576 bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr());
1578 if (attributeEnabled ==
false) {
1579 value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr());
1582 if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) {
1584 attributeEnabled =
false;
1586 attributeEnabled =
false;
1590 if (forceAttributeEnabled && (attrProperty.getAttr() !=
SUMO_ATTR_ID)) {
1591 attributeEnabled =
true;
1594 const bool computed = (ACs.size() > 1) ?
false : ACs.front()->isAttributeComputed(attrProperty.getAttr());
1596 myAttributesEditorRows[attrProperty.getPositionListed()] =
new AttributesEditorRow(
this, attrProperty, value, attributeEnabled, computed);
1600 if (showFlowEditor) {
1601 myAttributesEditorFlow->showAttributeEditorFlowModule();
1603 myAttributesEditorFlow->hideAttributesEditorFlowModule();
1608 myAttributesEditorFlow->hideAttributesEditorFlowModule();
1611 myHelpButton->reparent(
this);
1618 myAttributesEditorFlow->hideAttributesEditorFlowModule();
1627 const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers();
1629 if (ACs.size() > 0) {
1631 for (
const auto& attrProperty : ACs.front()->getTagProperty()) {
1633 bool editAttribute =
true;
1635 if ((ACs.size() > 1) && attrProperty.isUnique()) {
1636 editAttribute =
false;
1639 if (attrProperty.isExtended() && !myIncludeExtended) {
1640 editAttribute =
false;
1643 if (attrProperty.isFlowDefinition()) {
1644 editAttribute =
false;
1647 if (editAttribute) {
1649 std::set<std::string> occuringValues;
1651 for (
const auto& inspectedAC : ACs) {
1652 occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr()));
1655 std::ostringstream oss;
1656 for (
auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1657 if (values != occuringValues.begin()) {
1663 std::string value = oss.str();
1665 bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr());
1667 if (attributeEnabled ==
false) {
1668 value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr());
1671 if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) {
1673 attributeEnabled =
false;
1675 attributeEnabled =
false;
1679 const bool computed = (ACs.size() > 1) ?
false : ACs.front()->isAttributeComputed(attrProperty.getAttr());
1681 if ((attrProperty.getAttr() ==
SUMO_ATTR_SHAPE) && forceRefreshShape) {
1682 myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value,
true, attributeEnabled, computed);
1685 myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value,
true, attributeEnabled, computed);
1688 myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value,
false, attributeEnabled, computed);
1693 if (myAttributesEditorFlow->isAttributesEditorFlowModuleShown()) {
1694 myAttributesEditorFlow->refreshAttributeEditorFlow();
1702 return myFrameParent;
1709 if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1711 myFrameParent->openHelpAttributesDialog(myFrameParent->getViewNet()->getInspectedAttributeCarriers().front());
1721 FXGroupBoxModule(attributesEditorParent->getFrameParent()->myContentFrame,
"Flow attributes"),
1722 myAttributesEditorParent(attributesEditorParent) {
1724 FXHorizontalFrame* auxiliarHorizontalFrame =
nullptr;
1750 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1752 refreshAttributeEditorFlow();
1776 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1780 refreshVehsPerHour();
1782 refreshProbability();
1789 const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1791 GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1795 if (obj == myValueEndTextField) {
1797 value = myValueEndTextField->getText().text();
1798 }
else if (obj == myValueNumberTextField) {
1800 value = myValueNumberTextField->getText().text();
1801 }
else if (obj == myValueVehsPerHourTextField) {
1808 value = myValueVehsPerHourTextField->getText().text();
1809 }
else if (obj == myValuePeriodTextField) {
1811 value = myValuePeriodTextField->getText().text();
1812 }
else if (obj == myValueProbabilityTextField) {
1814 value = myValueProbabilityTextField->getText().text();
1821 if (ACs.size() > 1) {
1822 undoList->
begin(ACs.front()->getTagProperty().getGUIIcon(),
"Change multiple " +
toString(attr) +
" attributes");
1825 for (
const auto& inspectedAC : ACs) {
1826 inspectedAC->setAttribute(attr, value, undoList);
1829 if (ACs.size() > 1) {
1833 refreshAttributeEditorFlow();
1840 const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
1842 GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1845 if (obj == myAttributeEndRadioButton) {
1847 }
else if (obj == myAttributeNumberRadioButton) {
1849 }
else if (obj == myAttributeVehsPerHourRadioButton) {
1851 }
else if (obj == myAttributePeriodRadioButton) {
1853 }
else if (obj == myAttributeProbabilityRadioButton) {
1861 if (ACs.size() > 1) {
1862 undoList->
begin(ACs.front()->getTagProperty().getGUIIcon(),
"enable multiple " +
toString(attr) +
" attributes");
1864 undoList->
begin(ACs.front()->getTagProperty().getGUIIcon(),
"enable attribute '" +
toString(attr) +
"'");
1867 for (
const auto& inspectedAC : ACs) {
1868 inspectedAC->enableAttribute(attr, undoList);
1873 refreshAttributeEditorFlow();
1881 int allAttributesEnabledOrDisabled = 0;
1882 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1883 allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(
SUMO_ATTR_END);
1885 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1887 std::set<std::string> occuringValues;
1888 for (
const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1892 std::ostringstream endValue;
1893 for (
const auto& occuringValue : occuringValues) {
1894 if (occuringValue != *occuringValues.begin()) {
1897 endValue << occuringValue;
1900 myValueEndTextField->enable();
1901 myValueEndTextField->setText(endValue.str().c_str());
1902 myAttributeEndRadioButton->setCheck(TRUE);
1905 myValueEndTextField->disable();
1907 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1908 myValueEndTextField->setText(
"Different flow attributes");
1909 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1910 myValueEndTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_END).c_str());
1912 myValueEndTextField->setText(
"");
1914 myAttributeEndRadioButton->setCheck(FALSE);
1922 int allAttributesEnabledOrDisabled = 0;
1923 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1924 allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(
SUMO_ATTR_NUMBER);
1926 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1928 std::set<std::string> occuringValues;
1929 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1933 std::ostringstream numberValues;
1934 for (
const auto& occuringValue : occuringValues) {
1935 if (occuringValue != *occuringValues.begin()) {
1936 numberValues <<
" ";
1938 numberValues << occuringValue;
1941 myValueNumberTextField->enable();
1942 myValueNumberTextField->setText(numberValues.str().c_str());
1943 myAttributeNumberRadioButton->setCheck(TRUE);
1946 myValueNumberTextField->disable();
1948 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1949 myValueNumberTextField->setText(
"Different flow attributes");
1950 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1951 myValueNumberTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_NUMBER).c_str());
1953 myValueNumberTextField->setText(
"");
1955 myAttributeNumberRadioButton->setCheck(FALSE);
1965 if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasAttribute(
SUMO_ATTR_PERSONSPERHOUR)) {
1969 myAttributeVehsPerHourRadioButton->setText(
toString(attr).c_str());
1971 int allAttributesEnabledOrDisabled = 0;
1972 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1973 allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(attr);
1975 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
1977 std::set<std::string> occuringValues;
1978 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1979 occuringValues.insert(inspectedAC->getAttribute(attr));
1982 std::ostringstream vehsPerHourValues;
1983 for (
const auto& occuringValue : occuringValues) {
1984 if (occuringValue != *occuringValues.begin()) {
1985 vehsPerHourValues <<
" ";
1987 vehsPerHourValues << occuringValue;
1990 myValueVehsPerHourTextField->enable();
1991 myValueVehsPerHourTextField->setText(vehsPerHourValues.str().c_str());
1992 myAttributeVehsPerHourRadioButton->setCheck(TRUE);
1995 myValueVehsPerHourTextField->disable();
1997 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
1998 myValueVehsPerHourTextField->setText(
"Different flow attributes");
1999 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2000 myValueVehsPerHourTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(attr).c_str());
2002 myValueVehsPerHourTextField->setText(
"");
2004 myAttributeVehsPerHourRadioButton->setCheck(FALSE);
2012 int allAttributesEnabledOrDisabled = 0;
2013 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2014 allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(
SUMO_ATTR_PERIOD);
2016 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
2018 std::set<std::string> occuringValues;
2019 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2023 std::ostringstream periodValues;
2024 for (
const auto& occuringValue : occuringValues) {
2025 if (occuringValue != *occuringValues.begin()) {
2026 periodValues <<
" ";
2028 periodValues << occuringValue;
2031 myValuePeriodTextField->enable();
2032 myValuePeriodTextField->setText(periodValues.str().c_str());
2033 myAttributePeriodRadioButton->setCheck(TRUE);
2036 myValuePeriodTextField->disable();
2038 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2039 myValuePeriodTextField->setText(
"Different flow attributes");
2040 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2041 myValuePeriodTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_PERIOD).c_str());
2043 myValuePeriodTextField->setText(
"");
2045 myAttributePeriodRadioButton->setCheck(FALSE);
2053 int allAttributesEnabledOrDisabled = 0;
2054 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2055 allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(
SUMO_ATTR_PROB);
2057 if (allAttributesEnabledOrDisabled == (
int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) {
2059 std::set<std::string> occuringValues;
2060 for (
const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
2061 occuringValues.insert(inspectedAC->getAttribute(
SUMO_ATTR_PROB));
2064 std::ostringstream probabilityValues;
2065 for (
const auto& occuringValue : occuringValues) {
2066 if (occuringValue != *occuringValues.begin()) {
2067 probabilityValues <<
" ";
2069 probabilityValues << occuringValue;
2072 myValueProbabilityTextField->enable();
2073 myValueProbabilityTextField->setText(probabilityValues.str().c_str());
2074 myAttributeProbabilityRadioButton->enable();
2075 myAttributeProbabilityRadioButton->setCheck(TRUE);
2078 myValueProbabilityTextField->disable();
2080 if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) {
2081 myValueProbabilityTextField->setText(
"Different flow attributes");
2082 }
else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
2083 myValueProbabilityTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(
SUMO_ATTR_PROB).c_str());
2085 myValueProbabilityTextField->setText(
"");
2087 myAttributeProbabilityRadioButton->setCheck(FALSE);
2097 myFrameParent(frameParent) {
2121 myFrameParent->attributesEditorExtendedDialogOpened();
2131 myFrameParent(frameParent) {
2144 refreshGenericDataAttributes();
2159 myTextFieldParameters->setText(getParametersStr().c_str());
2160 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2164 const std::map<std::string, std::string>&
2166 return myParameters;
2174 for (
const auto& parameter : myParameters) {
2175 result += parameter.first +
"=" + parameter.second +
"|";
2178 if (!result.empty()) {
2185 std::vector<std::pair<std::string, std::string> >
2187 std::vector<std::pair<std::string, std::string> > result;
2189 for (
const auto& parameter : myParameters) {
2190 result.push_back(std::make_pair(parameter.first, parameter.second));
2201 for (
const auto& parameter : parameters) {
2202 result += parameter.first +
"=" + parameter.second +
"|";
2205 if (!result.empty()) {
2209 myTextFieldParameters->setText(result.c_str(), TRUE);
2215 return myFrameParent;
2227 refreshGenericDataAttributes();
2239 myParameters.clear();
2243 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2244 myTextFieldParameters->killFocus();
2246 std::vector<std::string> parameters =
StringTokenizer(myTextFieldParameters->getText().text(),
"|",
true).
getVector();
2248 for (
const auto& parameter : parameters) {
2252 myParameters[keyParam.front()] = keyParam.back();
2255 myTextFieldParameters->setText(getParametersStr().c_str(), FALSE);
2257 myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
2268 myFrameParent(frameParent),
2269 myDeleteLastCreatedPoint(false) {
2275 std::ostringstream information;
2277 <<
"- 'Start drawing' or ENTER\n"
2278 <<
" draws shape boundary.\n"
2279 <<
"- 'Stop drawing' or ENTER\n"
2280 <<
" creates shape.\n"
2281 <<
"- 'Shift + Click'removes\n"
2282 <<
" last created point.\n"
2283 <<
"- 'Abort drawing' or ESC\n"
2284 <<
" removes drawed shape.";
2299 FXGroupBoxModule::show();
2307 FXGroupBoxModule::hide();
2316 myStartDrawingButton->disable();
2317 myStopDrawingButton->enable();
2318 myAbortDrawingButton->enable();
2326 if (myFrameParent->shapeDrawed()) {
2328 myTemporalShapeShape.clear();
2329 myFrameParent->myViewNet->updateViewNet();
2331 myStartDrawingButton->enable();
2332 myStopDrawingButton->disable();
2333 myAbortDrawingButton->disable();
2344 myTemporalShapeShape.clear();
2345 myFrameParent->myViewNet->updateViewNet();
2347 myStartDrawingButton->enable();
2348 myStopDrawingButton->disable();
2349 myAbortDrawingButton->disable();
2355 if (myStopDrawingButton->isEnabled()) {
2356 myTemporalShapeShape.push_back(P);
2358 throw ProcessError(
"A new point cannot be added if drawing wasn't started");
2371 return myTemporalShapeShape;
2377 return myStopDrawingButton->isEnabled();
2383 myDeleteLastCreatedPoint = value;
2389 return myDeleteLastCreatedPoint;
2419 myFrameParent(frameParent),
2420 myCurrentLengthValid(true),
2454 bool showFrame =
false;
2457 myLengthFrame->show();
2458 myReferencePointMatchBox->show();
2461 myLengthFrame->hide();
2462 myReferencePointMatchBox->hide();
2466 myCloseShapeFrame->show();
2469 myCloseShapeFrame->hide();
2473 myCenterViewAfterCreationFrame->show();
2476 myCenterViewAfterCreationFrame->hide();
2497 if (myReferencePointMatchBox->shown()) {
2499 if (lane ==
nullptr) {
2501 }
else if (myCurrentLengthValid) {
2505 if (myActualAdditionalReferencePoint == AdditionalReferencePoint::INVALID) {
2506 std::string errorMessage =
"Current selected reference point isn't valid";
2507 myFrameParent->myViewNet->setStatusBarText(errorMessage);
2513 double length = GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text());
2523 if (myCloseShapeCheckButton->shown()) {
2527 if (myCenterViewAfterCreationButton->shown()) {
2537 if (obj == myCloseShapeCheckButton) {
2538 if (myCloseShapeCheckButton->getCheck()) {
2539 myCloseShapeCheckButton->setText(
"true");
2541 myCloseShapeCheckButton->setText(
"false");
2543 }
else if (obj == myCenterViewAfterCreationButton) {
2544 if (myCenterViewAfterCreationButton->getCheck()) {
2545 myCenterViewAfterCreationButton->setText(
"true");
2547 myCenterViewAfterCreationButton->setText(
"false");
2549 }
else if (obj == myLengthTextField) {
2551 if (GNEAttributeCarrier::canParse<double>(myLengthTextField->getText().text()) &&
2552 GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text()) > 0) {
2553 myLengthTextField->setTextColor(FXRGB(0, 0, 0));
2554 myLengthTextField->killFocus();
2555 myCurrentLengthValid =
true;
2557 myLengthTextField->setTextColor(FXRGB(255, 0, 0));
2558 myCurrentLengthValid =
false;
2562 }
else if (obj == myReferencePointMatchBox) {
2564 if (myReferencePointMatchBox->getText() ==
"reference left") {
2565 myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2566 myActualAdditionalReferencePoint = AdditionalReferencePoint::LEFT;
2567 myLengthTextField->enable();
2568 }
else if (myReferencePointMatchBox->getText() ==
"reference right") {
2569 myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2570 myActualAdditionalReferencePoint = AdditionalReferencePoint::RIGHT;
2571 myLengthTextField->enable();
2572 }
else if (myReferencePointMatchBox->getText() ==
"reference center") {
2573 myLengthTextField->enable();
2574 myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2575 myActualAdditionalReferencePoint = AdditionalReferencePoint::CENTER;
2576 myLengthTextField->enable();
2578 myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0));
2579 myActualAdditionalReferencePoint = AdditionalReferencePoint::INVALID;
2580 myLengthTextField->disable();
2591 FXDialogBox* additionalNeteditAttributesHelpDialog =
new FXDialogBox(getCollapsableFrame(),
"Netedit Parameters Help",
GUIDesignDialogBox);
2594 std::ostringstream help;
2596 <<
"- Referece point: Mark the initial position of the additional element.\n"
2597 <<
" Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n"
2598 <<
" - Reference Left will create it with startPos = 70 and endPos = 100.\n"
2599 <<
" - Reference Right will create it with startPos = 100 and endPos = 130.\n"
2600 <<
" - Reference Center will create it with startPos = 85 and endPos = 115.\n"
2602 <<
"- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n"
2603 <<
" the mouse. This option can be modified inspecting element.\n"
2604 <<
"- Center view: if is enabled, view will be center over created element.";
2616 WRITE_DEBUG(
"Opening NeteditAttributes help dialog");
2618 additionalNeteditAttributesHelpDialog->create();
2620 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
2622 getApp()->refresh();
2624 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
2626 WRITE_DEBUG(
"Closing NeteditAttributes help dialog");
2645 switch (myActualAdditionalReferencePoint) {
2646 case AdditionalReferencePoint::LEFT:
2647 return positionOfTheMouseOverLane;
2648 case AdditionalReferencePoint::RIGHT:
2649 return positionOfTheMouseOverLane - lengthOfAdditional;
2650 case AdditionalReferencePoint::CENTER:
2651 return positionOfTheMouseOverLane - lengthOfAdditional / 2;
2660 switch (myActualAdditionalReferencePoint) {
2661 case AdditionalReferencePoint::LEFT:
2662 return positionOfTheMouseOverLane + lengthOfAdditional;
2663 case AdditionalReferencePoint::RIGHT:
2664 return positionOfTheMouseOverLane;
2665 case AdditionalReferencePoint::CENTER:
2666 return positionOfTheMouseOverLane + lengthOfAdditional / 2;
FXDEFMAP(GNEFrameAttributeModules::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
@ MID_GNE_RESET
reset element
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
#define GUIDesignButtonIcon
button only with icon
#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 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...
@ LEFT
At the leftmost side of the lane.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ 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
@ GNE_ATTR_FLOWPARAMETERS
flow parameters (integer for mask end, number, etc...)
@ SUMO_ATTR_CONTAINERSPERHOUR
@ 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
@ SUMO_ATTR_EXPECTED_CONTAINERS
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_NOTHING
invalid attribute
@ SUMO_ATTR_PERSONSPERHOUR
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void addIntAttribute(const SumoXMLAttr attr, const int value)
add int attribute into current SumoBaseObject node
void addPositionVectorAttribute(const SumoXMLAttr attr, const PositionVector &value)
add PositionVector attribute into current SumoBaseObject node
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addPositionAttribute(const SumoXMLAttr attr, const Position &value)
add Position attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
FXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
Dialog for edit rerouters.
GNEViewNet * myViewNet
FOX need this.
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
GNENet * getNet() const
get pointer to net
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
AttributesCreatorFlow(AttributesCreator *attributesCreatorParent)
FOX-declaration.
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
FXTextField * myValueEndTextField
textField for 'end' attribute
bool areValuesValid() const
check if parameters of attributes are valid
void setFlowParameters(CommonXMLStructure::SumoBaseObject *baseObject)
set parameters
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
void hideAttributesCreatorFlowModule()
hide group box
FXTextField * myValuePeriodTextField
textField for 'period' attribute
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
~AttributesCreatorFlow()
destructor
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
void showAttributesCreatorFlowModule()
show AttributesCreatorFlow modul
bool shownAttributesCreatorFlowModule() const
shown AttributesCreatorFlow modul
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
FXTextField * myValueNumberTextField
textField for 'number' attribute
void refreshAttributesCreatorFlow()
refresh AttributesCreatorFlow
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
FXButton * myResetButton
reset button
AttributesCreator(GNEFrame *frameParent)
constructor
~AttributesCreator()
destructor
GNEAttributeCarrier * getCurrentTemplateAC() const
get current template AC
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
AttributesCreatorFlow * myAttributesCreatorFlow
pointer to myAttributesCreatorFlow
bool areValuesValid() const
check if parameters of attributes are valid
void refreshAttributesCreator()
refresh attribute creator
void showAttributesCreatorModule(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
GNEFrame * getFrameParent() const
return frame parent
void disableAttributesCreator()
disable AttributesCreator
std::vector< AttributesCreatorRow * > myAttributesCreatorRows
vector with the AttributesCreatorRow
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
FXHorizontalFrame * myFrameButtons
frame buttons
void refreshRows(const bool createRows)
refresh rows
long onCmdReset(FXObject *, FXSelector, void *)
void hideAttributesCreatorModule()
hide group box
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
called when user press the open dialog button
bool isAttributesCreatorRowEnabled() const
check if row is enabled
void enableAttributesCreatorRow()
enable row
const GNEAttributeProperties & getAttrProperties() const
return Attr
long onCmdSetAttribute(FXObject *, FXSelector, void *)
AttributesCreator * getAttributesCreatorParent() const
get AttributesCreator parent
void refreshRow()
refresh row
void disableRow()
disable Rows
void setAttributeCheckButtonCheck(bool value)
enable or disable label checkbox button for optional attributes
void destroy()
destroy AttributesCreatorRow (but don't delete)
std::string getValue() const
return value
bool isAttributeValid() const
check if current attribute is valid
bool isValidID() const
check if current ID placed in myValueTextField is valid
void disableAttributesCreatorRow()
disable row
bool getAttributeCheckButtonCheck() const
return status of label checkbox button
std::string generateID() const
generate ID
void hideAttributesEditorExtendedModule()
hide group box
void showAttributesEditorExtendedModule()
show AttributesEditorExtended modul
~AttributesEditorExtended()
destructor
AttributesEditorExtended(GNEFrame *frameParent)
FOX-declaration.
long onCmdOpenDialog(FXObject *, FXSelector, void *)
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
FXTextField * myValueEndTextField
textField for 'end' attribute
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
void refreshNumber()
refresh parameter number
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
void refreshProbability()
refresh parameter Probability
AttributesEditorFlow(AttributesEditor *attributesEditorParent)
FOX-declaration.
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
void showAttributeEditorFlowModule()
show attributes editor Flow Module
void refreshEnd()
refresh end
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
void refreshVehsPerHour()
refresh parameter VehsPerHour
FXTextField * myValueNumberTextField
textField for 'number' attribute
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
FXTextField * myValuePeriodTextField
textField for 'period' attribute
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
void refreshAttributeEditorFlow()
refresh attribute EditorFlow (only the valid values will be refresh)
void refreshPeriod()
refresh parameter Period
void hideAttributesEditorFlowModule()
hide attribute EditorFlow
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
bool isAttributesEditorFlowModuleShown() const
check if attribute editor flow modul is shown
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
void showAttributeEditorModule(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
FXButton * myHelpButton
button for help
AttributesEditorFlow * myAttributesEditorFlow
pointer to attributesEditorFlow
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
std::vector< AttributesEditorRow * > myAttributesEditorRows
list of Attribute editor rows
AttributesEditor(GNEFrame *inspectorFrameParent)
FOX-declaration.
void hideAttributesEditorModule()
hide attribute editor
FXTextField * myValueTextField
textField to modify the value of string attributes
bool mergeJunction(SumoXMLAttr attr, const std::vector< GNEAttributeCarrier * > &inspectedACs, const std::string &newVal) const
check junction merging
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
const GNEAttributeProperties myACAttr
current AC Attribute
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
bool isAttributesEditorRowValid() const
check if current attribute of TextField/ComboBox is valid
AttributesEditorRow()
default constructor
void destroy()
destroy AttributesCreatorRow (but don't delete)
FXCheckButton * myValueCheckButton
pointer to menu check
const bool myMultiple
flag to check if input element contains multiple values
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
FXButton * myAttributeColorButton
Button for open color editor.
FXButton * myAttributeButtonCombinableChoices
pointer to buttonCombinableChoices
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent
FXComboBox * myValueComboBoxChoices
pointer to combo box choices
void refreshAttributesEditorRow(const std::string &value, const bool forceRefresh, const bool attributeEnabled, const bool computed)
refresh current row
FXCheckButton * myAttributeCheckButton
pointer to attribute menu check
FXLabel * myAttributeLabel
pointer to attribute label
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
FXButton * myStartDrawingButton
button for start drawing
void stopDrawing()
stop drawing and check if shape can be created
~DrawingShape()
destructor
DrawingShape(GNEFrame *frameParent)
FOX-declaration.
long onCmdStartDrawing(FXObject *, FXSelector, void *)
void abortDrawing()
abort drawing
const PositionVector & getTemporalShape() const
get Temporal shape
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
void removeLastPoint()
remove last added point
void startDrawing()
start drawing
FXButton * myStopDrawingButton
button for stop drawing
void addNewPoint(const Position &P)
add new point to temporal shape
void showDrawingShape()
show Drawing mode
bool isDrawing() const
return true if currently a shape is drawed
FXButton * myAbortDrawingButton
button for abort drawing
void hideDrawingShape()
hide Drawing mode
bool getDeleteLastCreatedPoint()
get flag delete last created point
FXLabel * myInformationLabel
Label with information.
~GenericDataAttributes()
destructor
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
const std::map< std::string, std::string > & getParametersMap() const
get parameters as map
void refreshGenericDataAttributes()
refresh netedit attributes
FXTextField * myTextFieldParameters
text field for write parameters
void showGenericDataAttributes()
show netedit attributes EditorCreator
long onCmdEditParameters(FXObject *, FXSelector, void *)
GNEFrame * getFrameParent() const
pointer to frame parent
std::vector< std::pair< std::string, std::string > > getParameters() const
get parameters as vector of strings
std::string getParametersStr() const
get parameters as string
GenericDataAttributes(GNEFrame *frameParent)
FOX-declaration.
void hideGenericDataAttributes()
hide netedit attributes EditorCreator
void setParameters(const std::vector< std::pair< std::string, std::string > > ¶meters)
set parameters
FXButton * helpReferencePoint
Button for help about the reference point.
double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the End position values of StoppingPlaces and E2 detector over the lane
void hideNeteditAttributesModule()
hide Netedit attributes modul
FXHorizontalFrame * myCenterViewAfterCreationFrame
horizontal frame for center view after creation frame
NeteditAttributes(GNEFrame *frameParent)
FOX-declaration.
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
FXHorizontalFrame * myCloseShapeFrame
horizontal frame for close polygon
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
void showNeteditAttributesModule(const GNETagProperties &tagValue)
show Netedit attributes modul
FXHorizontalFrame * myLengthFrame
horizontal frame for length
~NeteditAttributes()
destructor
double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the Start position values of StoppingPlaces and E2 detector over the lane
FXComboBox * myReferencePointMatchBox
match box with the list of reference points
FXCheckButton * myCenterViewAfterCreationButton
checkbox to enable/disable center element after creation
FXTextField * myLengthTextField
textField for length
AdditionalReferencePoint
list of the reference points
FXCheckButton * myCloseShapeCheckButton
checkbox to enable/disable close polygon
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
get elements shape
double getLengthGeometryFactor() const
get length geometry factor
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Dialog for edit parameters.
bool isShape() const
return true if tag correspond to a shape
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 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
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
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...
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 FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
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|....
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 const RGBColor BLACK
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