69 FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
81 GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
82 myPreviousElementInspect(
nullptr),
83 myPreviousElementDelete(
nullptr),
84 myPreviousElementDeleteWasMarked(false) {
88 myHeaderLeftFrame->hide();
243 std::vector<GNEAttributeCarrier*> itemsToInspect;
250 for (
const auto& i : selectedACs) {
253 itemsToInspect.push_back(i);
257 itemsToInspect.push_back(AC);
280 if (ACs.size() > 0) {
282 std::string headerString;
283 if (ACs.front()->getTagProperty().isNetworkElement()) {
284 headerString =
"Net: ";
285 }
else if (ACs.front()->getTagProperty().isAdditionalElement()) {
286 headerString =
"Additional: ";
287 }
else if (ACs.front()->getTagProperty().isShape()) {
288 headerString =
"Shape: ";
289 }
else if (ACs.front()->getTagProperty().isTAZElement()) {
290 headerString =
"TAZ: ";
291 }
else if (ACs.front()->getTagProperty().isVehicle()) {
292 headerString =
"Vehicle: ";
293 }
else if (ACs.front()->getTagProperty().isRoute()) {
294 headerString =
"Route: ";
295 }
else if (ACs.front()->getTagProperty().isPerson()) {
296 headerString =
"Person: ";
297 }
else if (ACs.front()->getTagProperty().isPersonPlan()) {
298 headerString =
"PersonPlan: ";
299 }
else if (ACs.front()->getTagProperty().isStop()) {
300 headerString =
"Stop: ";
301 }
else if (ACs.front()->getTagProperty().isDataElement()) {
302 headerString =
"Data: ";
304 if (ACs.size() > 1) {
305 headerString +=
toString(ACs.size()) +
" ";
307 headerString += ACs.front()->getTagStr();
308 if (ACs.size() > 1) {
330 if (ACs.size() == 1) {
478 myInspectorFrameParent(inspectorFrameParent) {
514 if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
516 myTextFieldParentAdditional->enable();
517 myCheckBoxBlockMovement->enable();
518 myCheckBoxBlockShape->enable();
519 myCheckBoxCloseShape->enable();
521 const auto& tagValue = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
523 if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
527 myMarkFrontElementButton->show();
529 if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()) {
530 myMarkFrontElementButton->disable();
532 myMarkFrontElementButton->enable();
536 if (tagValue.canBlockMovement()) {
541 for (
const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
545 myHorizontalFrameBlockMovement->show();
547 myHelpButton->show();
550 myCheckBoxBlockMovement->setCheck(
true);
551 myCheckBoxBlockMovement->setText(
"true");
553 myCheckBoxBlockMovement->setCheck(
false);
554 myCheckBoxBlockMovement->setText(
"false");
558 if (tagValue.canBlockShape()) {
563 for (
const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
567 myHorizontalFrameBlockShape->show();
569 myHelpButton->show();
572 myCheckBoxBlockShape->setCheck(
true);
573 myCheckBoxBlockShape->setText(
"true");
575 myCheckBoxBlockShape->setCheck(
false);
576 myCheckBoxBlockShape->setText(
"false");
580 if (tagValue.canCloseShape()) {
585 for (
const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
589 myHorizontalFrameCloseShape->show();
591 myHelpButton->show();
594 myCheckBoxCloseShape->setCheck(
true);
595 myCheckBoxCloseShape->setText(
"true");
597 myCheckBoxCloseShape->setCheck(
false);
598 myCheckBoxCloseShape->setText(
"false");
602 if (tagValue.isSlave() && tagValue.canBeReparent()) {
606 std::set<std::string> parents;
607 for (
const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
611 myHorizontalFrameParentAdditional->show();
613 myHelpButton->show();
615 myLabelParentAdditional->setText((
toString(myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().isSlave()) +
" parent").c_str());
616 myTextFieldParentAdditional->setText(
toString(parents).c_str());
620 myTextFieldParentAdditional->disable();
621 myCheckBoxBlockMovement->disable();
622 myCheckBoxBlockShape->disable();
623 myCheckBoxCloseShape->disable();
632 myHorizontalFrameParentAdditional->hide();
633 myHorizontalFrameBlockMovement->hide();
634 myHorizontalFrameBlockShape->hide();
635 myHorizontalFrameCloseShape->hide();
636 myMarkFrontElementButton->hide();
637 myHelpButton->hide();
645 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
647 if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) {
648 myMarkFrontElementButton->disable();
650 myMarkFrontElementButton->enable();
653 if (myHorizontalFrameBlockMovement->shown()) {
656 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
661 myCheckBoxBlockMovement->setCheck(
true);
662 myCheckBoxBlockMovement->setText(
"true");
664 myCheckBoxBlockMovement->setCheck(
false);
665 myCheckBoxBlockMovement->setText(
"false");
669 if (myHorizontalFrameBlockShape->shown()) {
672 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
677 myCheckBoxBlockShape->setCheck(
true);
678 myCheckBoxBlockShape->setText(
"true");
680 myCheckBoxBlockShape->setCheck(
false);
681 myCheckBoxBlockShape->setText(
"false");
685 if (myHorizontalFrameCloseShape->shown()) {
688 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
693 myCheckBoxCloseShape->setCheck(
true);
694 myCheckBoxCloseShape->setText(
"true");
696 myCheckBoxCloseShape->setCheck(
false);
697 myCheckBoxCloseShape->setText(
"false");
701 if (myHorizontalFrameParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
703 myLabelParentAdditional->setText((
toString(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getMasterTags().front()) +
" parent").c_str());
704 myTextFieldParentAdditional->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(
GNE_ATTR_PARENT).c_str());
713 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
715 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
716 myInspectorFrameParent->myViewNet->getUndoList()->p_begin(
"Change multiple attributes");
718 if (obj == myCheckBoxBlockMovement) {
720 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
721 if (myCheckBoxBlockMovement->getCheck() == 1) {
723 myCheckBoxBlockMovement->setText(
"true");
726 myCheckBoxBlockMovement->setText(
"false");
729 }
else if (obj == myCheckBoxBlockShape) {
731 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
732 if (myCheckBoxBlockShape->getCheck() == 1) {
733 i->setAttribute(
GNE_ATTR_BLOCK_SHAPE,
"true", myInspectorFrameParent->myViewNet->getUndoList());
734 myCheckBoxBlockShape->setText(
"true");
736 i->setAttribute(
GNE_ATTR_BLOCK_SHAPE,
"false", myInspectorFrameParent->myViewNet->getUndoList());
737 myCheckBoxBlockShape->setText(
"false");
740 }
else if (obj == myCheckBoxCloseShape) {
742 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
743 if (myCheckBoxCloseShape->getCheck() == 1) {
744 i->setAttribute(
GNE_ATTR_CLOSE_SHAPE,
"true", myInspectorFrameParent->myViewNet->getUndoList());
745 myCheckBoxCloseShape->setText(
"true");
747 i->setAttribute(
GNE_ATTR_CLOSE_SHAPE,
"false", myInspectorFrameParent->myViewNet->getUndoList());
748 myCheckBoxCloseShape->setText(
"false");
751 }
else if (obj == myTextFieldParentAdditional) {
752 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(
GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) {
754 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
755 i->setAttribute(
GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
757 myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0));
758 myTextFieldParentAdditional->killFocus();
760 myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0));
764 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
765 myInspectorFrameParent->myViewNet->getUndoList()->p_end();
768 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(
true,
true);
769 myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(
true);
778 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
780 myInspectorFrameParent->getViewNet()->setFrontAttributeCarrier(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front());
782 myMarkFrontElementButton->disable();
791 FXDialogBox* additionalNeteditAttributesHelpDialog =
new FXDialogBox(
this,
"Netedit Attributes Help",
GUIDesignDialogBox);
794 std::ostringstream help;
796 <<
"- Mark as front element: Mark element as front element (Will be drawn over all other elements)\n"
797 <<
"- Block movement: disable movement in move mode\n"
798 <<
"- Block shape: Disable moving of shape's vertices and edges. Entire shape can be moved'.\n"
799 <<
"- Close shape: Add or remove the last vertex with the same position of first edge'.";
811 WRITE_DEBUG(
"Opening NeteditAttributesEditor help dialog");
813 additionalNeteditAttributesHelpDialog->create();
815 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
819 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
821 WRITE_DEBUG(
"Closing NeteditAttributesEditor help dialog");
831 myInspectorFrameParent(inspectorFrameParent) {
854 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
856 myGEOAttributeTextField->enable();
857 myUseGEOCheckButton->enable();
859 const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
861 if (tagProperty.hasGEOPosition() || tagProperty.hasGEOShape()) {
866 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
867 value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(
SUMO_ATTR_GEO));
870 myUseGEOFrame->show();
873 myUseGEOCheckButton->enable();
875 myUseGEOCheckButton->setCheck(
true);
876 myUseGEOCheckButton->setText(
"true");
878 myUseGEOCheckButton->setCheck(
false);
879 myUseGEOCheckButton->setText(
"false");
882 myUseGEOCheckButton->disable();
885 if (tagProperty.hasGEOPosition() && myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
886 myGEOAttributeFrame->show();
888 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
891 myGEOAttributeTextField->enable();
892 myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(
SUMO_ATTR_GEOPOSITION).c_str());
894 myGEOAttributeTextField->disable();
895 myGEOAttributeTextField->setText(
"No geo-conversion defined");
897 }
else if (tagProperty.hasGEOShape() && myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
898 myGEOAttributeFrame->show();
900 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
903 myGEOAttributeTextField->enable();
904 myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(
SUMO_ATTR_GEOSHAPE).c_str());
906 myGEOAttributeTextField->disable();
907 myGEOAttributeTextField->setText(
"No geo-conversion defined");
912 if (
GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) ==
false) {
913 myGEOAttributeTextField->disable();
914 myUseGEOCheckButton->disable();
923 myGEOAttributeFrame->hide();
924 myUseGEOFrame->hide();
933 const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
935 if ((
GeoConvHelper::getFinal().getProjString() !=
"!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
936 if (tagProperty.hasGEOPosition()) {
937 myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(
SUMO_ATTR_GEOPOSITION).c_str());
938 }
else if (tagProperty.hasGEOShape()) {
939 myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(
SUMO_ATTR_GEOSHAPE).c_str());
941 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
949 if ((
GeoConvHelper::getFinal().getProjString() !=
"!") && (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0)) {
950 if (obj == myGEOAttributeTextField) {
952 const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
954 if (tagProperty.hasGEOPosition()) {
955 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(
SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text())) {
956 myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->setAttribute(
SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
957 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
958 myGEOAttributeTextField->killFocus();
960 myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
962 }
else if (tagProperty.hasGEOShape()) {
963 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(
SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) {
964 myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->setAttribute(
SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
965 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
966 myGEOAttributeTextField->killFocus();
968 myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
971 throw ProcessError(
"myGEOAttributeTextField must be hidden becaurse there isn't GEO Attribute to edit");
973 }
else if (obj == myUseGEOCheckButton) {
975 for (
const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
976 if (myUseGEOCheckButton->getCheck() == 1) {
977 i->setAttribute(
SUMO_ATTR_GEO,
"true", myInspectorFrameParent->myViewNet->getUndoList());
978 myUseGEOCheckButton->setText(
"true");
980 i->setAttribute(
SUMO_ATTR_GEO,
"false", myInspectorFrameParent->myViewNet->getUndoList());
981 myUseGEOCheckButton->setText(
"false");
986 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(
true,
true);
987 myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(
true);
995 FXDialogBox* helpDialog =
new FXDialogBox(
this,
"GEO attributes Help",
GUIDesignDialogBox);
996 std::ostringstream help;
998 <<
" SUMO uses the World Geodetic System 84 (WGS84/UTM).\n"
999 <<
" For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n"
1000 <<
" in decimal degrees without extra symbols. (N,W..)\n"
1001 <<
" - Longitude: East-west position of a point on the Earth's surface.\n"
1002 <<
" - Latitude: North-south position of a point on the Earth's surface.\n"
1003 <<
" - CheckBox 'geo' enables or disables saving position in GEO coordinates\n";
1007 helpDialog->create();
1036 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
1037 std::map<SumoXMLAttr, std::string> laneParameter;
1044 laneParameters.push_back(laneParameter);
1054 myInspectorFrameParent(inspectorFrameParent),
1055 myHasEdgeTemplate(false) {
1072 if ((myInspectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) &&
1073 (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getTag() ==
SUMO_TAG_EDGE)) {
1075 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1076 mySetTemplateButton->show();
1077 mySetTemplateButton->setText((
"Set edge '" + myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID() +
"' as Template").c_str());
1096 return myHasEdgeTemplate;
1102 return myEdgeTemplate;
1109 if (shown() && mySetTemplateButton->isEnabled()) {
1110 onCmdSetTemplate(
nullptr, 0,
nullptr);
1118 if (shown() && myCopyTemplateButton->isEnabled()) {
1119 onCmdCopyTemplate(
nullptr, 0,
nullptr);
1127 if (shown() && myClearTemplateButton->isEnabled()) {
1128 onCmdClearTemplate(
nullptr, 0,
nullptr);
1136 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() != 1) {
1140 GNEEdge* edge = myInspectorFrameParent->myViewNet->
getNet()->
retrieveEdge(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID());
1142 setEdgeTemplate(edge);
1152 if (myHasEdgeTemplate) {
1154 myInspectorFrameParent->myViewNet->getUndoList()->p_begin(
"copy edge template");
1156 for (
const auto& inspectedAC : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1158 myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(inspectedAC->getID())->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList());
1161 myInspectorFrameParent->myViewNet->getUndoList()->p_end();
1163 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(
true,
true);
1165 myInspectorFrameParent->myViewNet->updateViewNet();
1174 myHasEdgeTemplate =
false;
1184 myHasEdgeTemplate =
true;
1193 if (myHasEdgeTemplate) {
1195 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1196 myCopyTemplateButton->setText((
"Copy '" + myEdgeTemplate.edgeParameters.at(
SUMO_ATTR_ID) +
"' into edge '" + myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID() +
"'").c_str());
1198 myCopyTemplateButton->setText((
"Copy '" + myEdgeTemplate.edgeParameters.at(
SUMO_ATTR_ID) +
"' into " +
toString(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) +
" selected edges").c_str());
1201 myCopyTemplateButton->enable();
1202 myClearTemplateButton->enable();
1205 myCopyTemplateButton->setText(
"No edge Template Set");
1207 myCopyTemplateButton->disable();
1208 myClearTemplateButton->disable();
1218 myInspectorFrameParent(inspectorFrameParent) {
1231 if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1233 refreshParametersEditorInspector();
1252 const GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() :
nullptr;
1256 if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1259 }
else if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1262 for (
const auto& AC : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
1264 parameters =
"different parameters";
1268 myTextFieldParameters->setText(parameters.c_str());
1271 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
1274 myTextFieldParameters->enable();
1275 myButtonEditParameters->enable();
1277 myTextFieldParameters->disable();
1278 myButtonEditParameters->disable();
1286 return myInspectorFrameParent;
1293 const GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() :
nullptr;
1296 if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1304 myInspectorFrameParent->attributeUpdated();
1306 refreshParametersEditorInspector();
1318 myInspectorFrameParent->attributeUpdated();
1320 refreshParametersEditorInspector();
1334 GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() :
nullptr;
1348 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
1349 myTextFieldParameters->killFocus();
1351 if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1353 myInspectorFrameParent->myViewNet->getUndoList()->p_begin(
"change parameters");
1355 frontAC->
setACParameters(myTextFieldParameters->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
1357 myInspectorFrameParent->myViewNet->getUndoList()->p_end();
1358 }
else if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1360 myInspectorFrameParent->myViewNet->getUndoList()->p_begin(
"change multiple parameters");
1362 for (
const auto& inspectedAC : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
1363 inspectedAC->setACParameters(myTextFieldParameters->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
1366 myInspectorFrameParent->myViewNet->getUndoList()->p_end();
1369 myInspectorFrameParent->attributeUpdated();
1371 myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
@ MID_GNE_INSPECTORFRAME_GOBACK
go back to the previous element
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
@ MID_GNE_MARKFRONTELEMENT
mark item as front element
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
#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 GUIDesignButtonIconRectangular
button only with icon
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignButtonOK
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignHorizontalSeparator
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ GNE_ATTR_BLOCK_SHAPE
block shape of a graphic element (Used mainly in GNEShapes)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void setACParameters(const std::string ¶meters, GNEUndoList *undoList)
set parameters (string)
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GNENet * getNet() const
get pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
void show()
show delete frame
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
std::string getAttribute(SumoXMLAttr key) const
void showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
void hideAttributesEditorModul()
hide attribute editor
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
void focusUpperElement()
focus upper element of frame
GNEViewNet * getViewNet() const
get view net
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
GNEViewNet * myViewNet
View Net.
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
virtual void show()
show Frame
virtual void hide()
hide Frame
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
void refreshHierarchicalElementTree()
refresh HierarchicalElementTree
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show HierarchicalElementTree
void hideHierarchicalElementTree()
hide HierarchicalElementTree
void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
show template editor
bool nextElement(const Position &clickedPosition)
try to go to next element if clicked position is near to saved position
bool previousElement(const Position &clickedPosition)
try to go to previous element if clicked position is near to saved position
void hideOverlappedInspection()
hide template editor
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXButton * myHelpButton
button for help
void showGEOAttributesEditor()
show GEO attributes editor
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
FXLabel * myUseGEOLabel
Label for use GEO.
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
GEOAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
~GEOAttributesEditor()
destructor
void refreshGEOAttributesEditor(bool forceRefresh)
refresh GEO attributes editor
void hideGEOAttributesEditor()
hide GEO attributes editor
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
FXHorizontalFrame * myHorizontalFrameBlockShape
@frame horizontal frame for block shape
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
FXButton * myHelpButton
button for help
FXLabel * myLabelParentAdditional
Label for parent additional.
FXHorizontalFrame * myHorizontalFrameBlockMovement
@frame horizontal frame for block movement
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXHorizontalFrame * myHorizontalFrameCloseShape
@frame horizontal frame for close shape
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
long onCmdMarkFrontElement(FXObject *, FXSelector, void *)
Called when user press button "Mark front element".
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
void hideNeteditAttributesEditor()
hide netedit attributes editor
FXLabel * myLabelCloseShape
Label for close shape.
FXHorizontalFrame * myHorizontalFrameParentAdditional
@frame horizontal frame for replace the parent additional
NeteditAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
FXTextField * myTextFieldParentAdditional
pointer for replace the parent additional
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
FXButton * myMarkFrontElementButton
button for set element as front button
void showNeteditAttributesEditor()
show netedit attributes editor
~NeteditAttributesEditor()
destructor
FXLabel * myLabelBlockShape
Label for Check blocked shape.
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
long onCmdEditParameters(FXObject *, FXSelector, void *)
void showParametersEditorInspector()
show netedit attributes EditorInspector
void refreshParametersEditorInspector()
refresh netedit attributes
~ParametersEditorInspector()
destructor
FXTextField * myTextFieldParameters
text field for write parameters
GNEInspectorFrame * getInspectorFrameParent() const
get inspector frame parent
ParametersEditorInspector(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
void hideParametersEditorInspector()
hide netedit attributes EditorInspector
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
void updateButtons()
update buttons
void hideTemplateEditor()
hide template editor
void clearTemplate()
clear template (used by shortcut)
~TemplateEditor()
destructor
FXButton * myClearTemplateButton
clear template button
FXButton * mySetTemplateButton
set template button
const TemplateEditor::EdgeTemplate & getEdgeTemplate() const
get the template edge (to copy attributes from)
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
bool hasTemplate() const
there is a template
void setTemplate()
set template (used by shortcut)
TemplateEditor(GNEInspectorFrame *inspectorFrameParent)
constructor
FXButton * myCopyTemplateButton
copy template button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
void copyTemplate()
copy template (used by shortcut)
void setEdgeTemplate(GNEEdge *edgeTemplate)
FOX need this.
void showTemplateEditor()
show template editor
long onCmdClearTemplate(FXObject *, FXSelector, void *)
clear current edge template
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open AttributesCreator extended dialog (can be reimplemented in frame children)
TemplateEditor * getTemplateEditor() const
get template editor
GNEFrameAttributesModuls::AttributesEditor * myAttributesEditor
Attribute editor.
void clearInspectedAC()
Clear all current inspected ACs.
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Data
void show()
show inspector frame
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
GNEFrameModuls::HierarchicalElementTree * myHierarchicalElementTree
Attribute Carrier Hierarchy.
GNEFrameModuls::HierarchicalElementTree * getHierarchicalElementTree() const
get HierarchicalElementTree modul
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
void attributeUpdated()
function called after set a valid attribute in AttributeEditor
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
ParametersEditorInspector * myParametersEditorInspector
parameters editor inspector
void hide()
hide inspector frame
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
FXButton * myBackButton
back Button
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
~GNEInspectorFrame()
Destructor.
TemplateEditor * myTemplateEditor
Template editor.
GNEFrameModuls::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
GNEFrameModuls::OverlappedInspection * myOverlappedInspection
Overlapped Inspection.
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Dialog for edit parameters.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
Dialog for edit parameters.
bool hasDoubleParameters() const
return true if Tag correspond to an element that supports double parameters "key1=double1|key2=double...
bool hasParameters() const
return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|....
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
class used to group all variables related with objects under cursor after a click over view
GNEGenericData * getGenericDataElementFront() const
get generic data element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
GNENet * getNet() const
get the net object
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
ParameterisedAttrType
@brie enum for Parameterised type
@ STRING
Parameterised accept strings.
@ DOUBLE
Parameterised only accept doubles.
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.
EdgeTemplate()
default constructor
bool selectEdges() const
check if select edges checkbox is enabled