104 myFrameParent(frameParent) {
107 case GNETagProperties::TagType::NETWORKELEMENT:
108 setText(
"network elements");
110 case GNETagProperties::TagType::ADDITIONALELEMENT:
111 setText(
"Additional elements");
113 case GNETagProperties::TagType::SHAPE:
114 setText(
"Shape elements");
116 case GNETagProperties::TagType::TAZELEMENT:
117 setText(
"TAZ elements");
119 case GNETagProperties::TagType::VEHICLE:
122 case GNETagProperties::TagType::STOP:
125 case GNETagProperties::TagType::PERSON:
128 case GNETagProperties::TagType::PERSONPLAN:
129 setText(
"Person plans");
131 myListOfTagTypes.push_back(std::make_pair(
"person trips", GNETagProperties::TagType::PERSONTRIP));
132 myListOfTagTypes.push_back(std::make_pair(
"walks", GNETagProperties::TagType::WALK));
133 myListOfTagTypes.push_back(std::make_pair(
"rides", GNETagProperties::TagType::RIDE));
134 myListOfTagTypes.push_back(std::make_pair(
"stops", GNETagProperties::TagType::PERSONSTOP));
136 case GNETagProperties::TagType::PERSONTRIP:
137 setText(
"Person trips");
139 case GNETagProperties::TagType::WALK:
142 case GNETagProperties::TagType::RIDE:
145 case GNETagProperties::TagType::PERSONSTOP:
146 setText(
"Person stops");
157 if (myListOfTagTypes.size() > 0) {
159 for (
const auto& i : myListOfTagTypes) {
160 myTagTypesMatchBox->appendItem(i.first.c_str());
163 myTagTypesMatchBox->setNumVisible((
int)myTagTypesMatchBox->getNumItems());
167 myTagTypesMatchBox->hide();
172 for (
const auto& tag : myListOfTags) {
173 myTagsMatchBox->appendItem(tag.second.c_str());
176 myTagsMatchBox->setNumVisible((
int)myTagsMatchBox->getNumItems());
199 return myCurrentTagProperties;
208 for (
int i = 0; i < (int)myTagsMatchBox->getNumItems(); i++) {
209 if (myTagsMatchBox->getItem(i).text() ==
toString(tagType)) {
210 myTagsMatchBox->setCurrentItem(i);
214 myTagsMatchBox->clearItems();
216 for (
const auto& tag : myListOfTags) {
217 myTagsMatchBox->appendItem(tag.second.c_str());
220 myTagsMatchBox->setNumVisible((
int)myTagsMatchBox->getNumItems());
224 myFrameParent->tagSelected();
233 for (
int i = 0; i < (int)myTagsMatchBox->getNumItems(); i++) {
234 if (myTagsMatchBox->getItem(i).text() ==
toString(newTag)) {
235 myTagsMatchBox->setCurrentItem(i);
241 myFrameParent->tagSelected();
248 onCmdSelectTag(0, 0, 0);
254 for (
const auto& i : myListOfTagTypes) {
255 if (i.first == myTagTypesMatchBox->getText().text()) {
257 myTagTypesMatchBox->setTextColor(FXRGB(0, 0, 0));
261 myTagsMatchBox->show();
262 myTagsMatchBox->clearItems();
264 for (
const auto& tag : myListOfTags) {
265 myTagsMatchBox->appendItem(tag.second.c_str());
268 myTagsMatchBox->setNumVisible((
int)myTagsMatchBox->getNumItems());
270 WRITE_DEBUG((
"Selected item '" + myTagsMatchBox->getText() +
"' in TagTypeSelector").text());
272 return onCmdSelectTag(
nullptr, 0,
nullptr);
276 myTagsMatchBox->hide();
278 myCurrentTagProperties = myInvalidTagProperty;
280 myFrameParent->tagSelected();
282 myTagTypesMatchBox->setTextColor(FXRGB(255, 0, 0));
284 WRITE_DEBUG(
"Selected invalid item in TagTypeSelector");
292 for (
const auto& tag : myListOfTags) {
293 if (tag.second == myTagsMatchBox->getText().text()) {
295 myTagsMatchBox->setTextColor(FXRGB(0, 0, 0));
299 myFrameParent->tagSelected();
301 WRITE_DEBUG((
"Selected item '" + myTagsMatchBox->getText() +
"' in TagSelector").text());
306 myCurrentTagProperties = myInvalidTagProperty;
308 myFrameParent->tagSelected();
310 myTagsMatchBox->setTextColor(FXRGB(255, 0, 0));
312 WRITE_DEBUG(
"Selected invalid item in TagSelector");
322 myFrameParent(frameParent),
323 myCurrentDemandElement(nullptr),
324 myDemandElementTags({demandElementTag}) {
328 refreshDemandElementSelector();
336 myFrameParent(frameParent),
337 myCurrentDemandElement(nullptr) {
339 for (
const auto& tagType : tagTypes) {
341 for (
const auto& tagByCategory : tagsByCategory) {
359 return myCurrentDemandElement;
363 const std::vector<SumoXMLTag>&
365 return myDemandElementTags;
372 if (std::find(myDemandElementTags.begin(), myDemandElementTags.end(), demandElement->
getTagProperty().
getTag()) != myDemandElementTags.end()) {
374 myDemandElementsMatchBox->setText(demandElement->
getID().c_str());
376 myCurrentDemandElement = demandElement;
378 myFrameParent->demandElementSelected();
386 refreshDemandElementSelector();
388 if (myCurrentDemandElement) {
389 myDemandElementsMatchBox->setText(myCurrentDemandElement->getID().c_str());
390 }
else if (myDemandElementTags.size() == 1) {
397 onCmdSelectDemandElement(
nullptr, 0,
nullptr);
417 myDemandElementsMatchBox->clearItems();
419 for (
const auto& i : myDemandElementTags) {
426 for (
const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) {
429 myDemandElementsMatchBox->appendItem(j.first.c_str());
436 for (
const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) {
439 myDemandElementsMatchBox->appendItem(j.first.c_str());
444 for (
const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) {
445 myDemandElementsMatchBox->appendItem(j.first.c_str());
450 if (myDemandElementsMatchBox->getNumItems() < 10) {
451 myDemandElementsMatchBox->setNumVisible((
int)myDemandElementsMatchBox->getNumItems());
453 myDemandElementsMatchBox->setNumVisible(10);
456 if (myDemandElementsMatchBox->getNumItems() == 0) {
457 myCurrentDemandElement =
nullptr;
458 }
else if (myCurrentDemandElement) {
459 for (
int i = 0; i < myDemandElementsMatchBox->getNumItems(); i++) {
460 if (myDemandElementsMatchBox->getItem(i).text() == myCurrentDemandElement->getID()) {
461 myDemandElementsMatchBox->setCurrentItem(i, FALSE);
467 myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(
SUMO_TAG_VTYPE).at(
DEFAULT_VTYPE_ID);
472 myCurrentDemandElement =
nullptr;
474 for (
auto i = myDemandElementTags.begin(); (i != myDemandElementTags.end()) && (myCurrentDemandElement ==
nullptr); i++) {
475 if (myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(*i).size() > 0) {
476 myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(*i).begin()->second;
486 if (myCurrentDemandElement ==
nullptr) {
489 if (!myCurrentDemandElement->getTagProperty().isPerson()) {
492 if (myCurrentDemandElement->getChildDemandElements().empty()) {
509 return lastPersonPlan->
getParentAdditionals().back()->getParentLanes().front()->getParentEdge();
521 for (
const auto& i : myDemandElementTags) {
522 for (
const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) {
523 if (j.first == myDemandElementsMatchBox->getText().text()) {
525 myDemandElementsMatchBox->setTextColor(FXRGB(0, 0, 0));
527 myCurrentDemandElement = j.second;
529 myFrameParent->demandElementSelected();
531 WRITE_DEBUG((
"Selected item '" + myDemandElementsMatchBox->getText() +
"' in DemandElementSelector").text());
537 myCurrentDemandElement =
nullptr;
539 myFrameParent->demandElementSelected();
541 myDemandElementsMatchBox->setTextColor(FXRGB(255, 0, 0));
543 WRITE_DEBUG(
"Selected invalid item in DemandElementSelector");
553 myFrameParent(frameParent),
555 myClickedAC(nullptr),
556 myClickedJunction(nullptr),
557 myClickedEdge(nullptr),
558 myClickedLane(nullptr),
559 myClickedCrossing(nullptr),
560 myClickedConnection(nullptr),
561 myClickedShape(nullptr),
562 myClickedTAZElement(nullptr),
563 myClickedAdditional(nullptr),
564 myClickedDemandElement(nullptr),
565 myClickedDataSet(nullptr),
566 myClickedDataInterval(nullptr),
567 myClickedGenericData(nullptr) {
583 refreshHierarchicalElementTree();
592 myClickedAC =
nullptr;
593 myClickedJunction =
nullptr;
594 myClickedEdge =
nullptr;
595 myClickedLane =
nullptr;
596 myClickedCrossing =
nullptr;
597 myClickedConnection =
nullptr;
598 myClickedShape =
nullptr;
599 myClickedTAZElement =
nullptr;
600 myClickedAdditional =
nullptr;
601 myClickedDemandElement =
nullptr;
602 myClickedDataSet =
nullptr;
603 myClickedDataInterval =
nullptr;
604 myClickedGenericData =
nullptr;
613 myTreelist->clearItems();
614 myTreeItemToACMap.clear();
615 myTreeItemsConnections.clear();
618 showHierarchicalElementChildren(myHE, showAttributeCarrierParents());
635 FXEvent* e = (FXEvent*)eventData;
637 FXTreeItem* item = myTreelist->getItemAt(e->win_x, e->win_y);
639 if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) {
640 createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]);
649 if (myClickedJunction) {
650 myFrameParent->myViewNet->centerTo(myClickedJunction->getGlID(),
true, -1);
651 }
else if (myClickedEdge) {
652 myFrameParent->myViewNet->centerTo(myClickedEdge->getGlID(),
true, -1);
653 }
else if (myClickedLane) {
654 myFrameParent->myViewNet->centerTo(myClickedLane->getGlID(),
true, -1);
655 }
else if (myClickedCrossing) {
656 myFrameParent->myViewNet->centerTo(myClickedCrossing->getGlID(),
true, -1);
657 }
else if (myClickedConnection) {
658 myFrameParent->myViewNet->centerTo(myClickedConnection->getGlID(),
true, -1);
659 }
else if (myClickedAdditional) {
660 myFrameParent->myViewNet->centerTo(myClickedAdditional->getGlID(),
true, -1);
661 }
else if (myClickedShape) {
662 myFrameParent->myViewNet->centerTo(myClickedShape->getGlID(),
true, -1);
663 }
else if (myClickedTAZElement) {
664 myFrameParent->myViewNet->centerTo(myClickedTAZElement->getGlID(),
true, -1);
665 }
else if (myClickedDemandElement) {
666 myFrameParent->myViewNet->centerTo(myClickedDemandElement->getGlID(),
true, -1);
667 }
else if (myClickedGenericData) {
668 myFrameParent->myViewNet->centerTo(myClickedGenericData->getGlID(),
true, -1);
671 myFrameParent->myViewNet->updateViewNet();
678 if ((myHE !=
nullptr) && (myClickedAC !=
nullptr)) {
679 myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectChild(myClickedAC, myHE);
688 if (myClickedJunction) {
689 myFrameParent->myViewNet->getNet()->deleteJunction(myClickedJunction, myFrameParent->myViewNet->getUndoList());
690 }
else if (myClickedEdge) {
691 myFrameParent->myViewNet->getNet()->deleteEdge(myClickedEdge, myFrameParent->myViewNet->getUndoList(),
false);
692 }
else if (myClickedLane) {
693 myFrameParent->myViewNet->getNet()->deleteLane(myClickedLane, myFrameParent->myViewNet->getUndoList(),
false);
694 }
else if (myClickedCrossing) {
695 myFrameParent->myViewNet->getNet()->deleteCrossing(myClickedCrossing, myFrameParent->myViewNet->getUndoList());
696 }
else if (myClickedConnection) {
697 myFrameParent->myViewNet->getNet()->deleteConnection(myClickedConnection, myFrameParent->myViewNet->getUndoList());
698 }
else if (myClickedAdditional) {
699 myFrameParent->myViewNet->getNet()->deleteAdditional(myClickedAdditional, myFrameParent->myViewNet->getUndoList());
700 }
else if (myClickedShape) {
701 myFrameParent->myViewNet->getNet()->deleteShape(myClickedShape, myFrameParent->myViewNet->getUndoList());
702 }
else if (myClickedTAZElement) {
703 myFrameParent->myViewNet->getNet()->deleteTAZElement(myClickedTAZElement, myFrameParent->myViewNet->getUndoList());
704 }
else if (myClickedDemandElement) {
706 if ((myClickedDemandElement->getTagProperty().getTag() ==
SUMO_TAG_VTYPE) && (GNEAttributeCarrier::parse<bool>(myClickedDemandElement->getAttribute(
GNE_ATTR_DEFAULT_VTYPE)))) {
709 }
else if (myClickedDemandElement->getTagProperty().isPersonPlan() && (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().size() == 1)) {
711 myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement->getParentDemandElements().front(), myFrameParent->myViewNet->getUndoList());
713 myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement, myFrameParent->myViewNet->getUndoList());
715 }
else if (myClickedDataSet) {
716 myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedDataSet, myFrameParent->myViewNet->getUndoList());
717 }
else if (myClickedDataInterval) {
719 if (myClickedDataInterval->getDataSetParent()->getDataIntervalChildren().size() == 1) {
720 myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedDataInterval->getDataSetParent(), myFrameParent->myViewNet->getUndoList());
722 myFrameParent->myViewNet->getNet()->deleteDataInterval(myClickedDataInterval, myFrameParent->myViewNet->getUndoList());
724 }
else if (myClickedGenericData) {
726 if (myClickedGenericData->getDataIntervalParent()->getGenericDataChildren().size() == 1) {
728 if (myClickedGenericData->getDataIntervalParent()->getDataSetParent()->getDataIntervalChildren().size() == 1) {
729 myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedGenericData->getDataIntervalParent()->getDataSetParent(), myFrameParent->myViewNet->getUndoList());
731 myFrameParent->myViewNet->getNet()->deleteDataInterval(myClickedGenericData->getDataIntervalParent(), myFrameParent->myViewNet->getUndoList());
734 myFrameParent->myViewNet->getNet()->deleteGenericData(myClickedGenericData, myFrameParent->myViewNet->getUndoList());
738 myFrameParent->myViewNet->updateViewNet();
740 refreshHierarchicalElementTree();
742 if (myFrameParent->myViewNet->getInspectedAttributeCarriers().size() == 1) {
743 if (myFrameParent->myViewNet->getInspectedAttributeCarriers().front() != myClickedAC) {
744 myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(myFrameParent->myViewNet->getInspectedAttributeCarriers().front());
747 myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(
nullptr);
757 if (myClickedDemandElement) {
758 myFrameParent->myViewNet->getUndoList()->p_begin((
"moving up " + myClickedDemandElement->getTagStr()).c_str());
760 myFrameParent->myViewNet->getUndoList()->add(
new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement,
761 GNEChange_Children::Operation::MOVE_BACK),
true);
762 myFrameParent->myViewNet->getUndoList()->p_end();
765 refreshHierarchicalElementTree();
773 if (myClickedDemandElement) {
774 myFrameParent->myViewNet->getUndoList()->p_begin((
"moving down " + myClickedDemandElement->getTagStr()).c_str());
776 myFrameParent->myViewNet->getUndoList()->add(
new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement,
777 GNEChange_Children::Operation::MOVE_FRONT),
true);
778 myFrameParent->myViewNet->getUndoList()->p_end();
781 refreshHierarchicalElementTree();
791 myClickedAC = clickedAC;
793 myClickedJunction =
dynamic_cast<GNEJunction*
>(clickedAC);
794 myClickedEdge =
dynamic_cast<GNEEdge*
>(clickedAC);
795 myClickedLane =
dynamic_cast<GNELane*
>(clickedAC);
796 myClickedCrossing =
dynamic_cast<GNECrossing*
>(clickedAC);
797 myClickedConnection =
dynamic_cast<GNEConnection*
>(clickedAC);
798 myClickedShape =
dynamic_cast<GNEShape*
>(clickedAC);
799 myClickedTAZElement =
dynamic_cast<GNETAZElement*
>(clickedAC);
800 myClickedAdditional =
dynamic_cast<GNEAdditional*
>(clickedAC);
802 myClickedDataSet =
dynamic_cast<GNEDataSet*
>(clickedAC);
806 FXMenuPane* pane =
new FXMenuPane(myTreelist);
808 new MFXMenuHeader(pane, myFrameParent->myViewNet->getViewParent()->getGUIMainWindow()->getBoldFont(), myClickedAC->getPopUpID().c_str(), myClickedAC->getIcon());
810 new FXMenuSeparator(pane);
814 if (myClickedAC->getTagProperty().isVehicleType() || (myClickedAC->getTagProperty().getTag() ==
SUMO_TAG_DATASET) ||
816 centerMenuCommand->disable();
823 inspectMenuCommand->disable();
824 deleteMenuCommand->disable();
865 myClickedAC =
nullptr;
866 myClickedJunction =
nullptr;
867 myClickedEdge =
nullptr;
868 myClickedLane =
nullptr;
869 myClickedCrossing =
nullptr;
870 myClickedConnection =
nullptr;
871 myClickedShape =
nullptr;
872 myClickedTAZElement =
nullptr;
873 myClickedAdditional =
nullptr;
874 myClickedDemandElement =
nullptr;
875 myClickedDataSet =
nullptr;
876 myClickedDataInterval =
nullptr;
877 myClickedGenericData =
nullptr;
884 if (myHE->getTagProperty().isNetworkElement()) {
886 switch (myHE->getTagProperty().getTag()) {
894 junctionDestinyItem->setExpanded(
true);
899 return junctionDestinyItem;
913 junctionDestinyItem->setExpanded(
true);
916 edgeItem->setExpanded(
true);
920 myTreeItemToACMap[edgeItem] = edge;
934 FXTreeItem* junctionItem = myTreelist->insertItem(
nullptr,
nullptr, junction->
getHierarchyName().c_str(), junction->
getIcon(), junction->
getIcon());
935 junctionItem->setExpanded(
true);
937 myTreeItemToACMap[junctionItem] = junction;
950 edgeFromItem->setExpanded(
true);
953 edgeToItem->setExpanded(
true);
955 FXTreeItem* connectionItem = myTreelist->insertItem(
nullptr, edgeToItem, connection->
getHierarchyName().c_str(), connection->
getIcon(), connection->
getIcon());
956 connectionItem->setExpanded(
true);
958 myTreeItemToACMap[edgeFromItem] = connection->
getEdgeFrom();
959 myTreeItemToACMap[edgeToItem] = connection->
getEdgeTo();
960 myTreeItemToACMap[connectionItem] = connection;
962 return connectionItem;
981 junctionDestinyItem->setExpanded(
true);
984 edgeItem->setExpanded(
true);
987 laneItem->setExpanded(
true);
991 myTreeItemToACMap[edgeItem] = edge;
992 myTreeItemToACMap[laneItem] = lane;
998 }
else if (myHE->getTagProperty().isAdditionalElement()) {
1003 FXTreeItem* root =
nullptr;
1040 addListItem(
nullptr, (
"..." +
toString((
int)additional->
getParentEdges().size() - 2) +
" edges...").c_str(), 0,
false);
1054 addListItem(
nullptr, (
"..." +
toString((
int)additional->
getParentLanes().size() - 2) +
" lanes...").c_str(), 0,
false);
1063 }
else if (myHE->getTagProperty().isTAZElement()) {
1068 FXTreeItem* root =
nullptr;
1105 addListItem(
nullptr, (
"..." +
toString((
int)TAZElement->
getParentEdges().size() - 2) +
" edges...").c_str(), 0,
false);
1119 addListItem(
nullptr, (
"..." +
toString((
int)TAZElement->
getParentLanes().size() - 2) +
" lanes...").c_str(), 0,
false);
1128 }
else if (myHE->getTagProperty().isDemandElement()) {
1131 if (demandElement) {
1133 FXTreeItem* root =
nullptr;
1170 addListItem(
nullptr, (
"..." +
toString((
int)demandElement->
getParentEdges().size() - 2) +
" edges...").c_str(), 0,
false);
1184 addListItem(
nullptr, (
"..." +
toString((
int)demandElement->
getParentLanes().size() - 2) +
" lanes...").c_str(), 0,
false);
1194 }
else if (myHE->getTagProperty().isDataElement()) {
1199 return addListItem(myFrameParent->myViewNet->getNet()->retrieveDataSet(myHE->getID()));
1205 FXTreeItem* root =
nullptr;
1244 addListItem(dataElement->
getParentEdges().front(),
nullptr,
"from ");
1250 addListItem(
nullptr, (
"..." +
toString((
int)dataElement->
getParentEdges().size() - 2) +
" edges...").c_str(), 0,
false);
1255 addListItem(dataElement->
getParentEdges().back(),
nullptr,
"to ");
1268 addListItem(
nullptr, (
"..." +
toString((
int)dataElement->
getParentLanes().size() - 2) +
" lanes...").c_str(), 0,
false);
1294 FXTreeItem* junctionItem = addListItem(HE, itemParent);
1297 showHierarchicalElementChildren(i, junctionItem);
1301 showHierarchicalElementChildren(i, junctionItem);
1311 FXTreeItem* edgeItem = addListItem(HE, itemParent);
1313 for (
const auto& i : edge->
getLanes()) {
1314 showHierarchicalElementChildren(i, edgeItem);
1318 showHierarchicalElementChildren(i, edgeItem);
1322 showHierarchicalElementChildren(i, edgeItem);
1326 showHierarchicalElementChildren(i, edgeItem);
1330 showHierarchicalElementChildren(i, edgeItem);
1349 showHierarchicalElementChildren(i, edgeItem);
1359 FXTreeItem* laneItem = addListItem(HE, itemParent);
1362 showHierarchicalElementChildren(i, laneItem);
1366 showHierarchicalElementChildren(i, laneItem);
1370 showHierarchicalElementChildren(i, laneItem);
1374 showHierarchicalElementChildren(i, laneItem);
1380 FXTreeItem* incomingConnections = addListItem(laneItem,
"Incomings", incomingLaneConnections.front()->getIcon(),
false);
1382 for (
auto i : incomingLaneConnections) {
1383 showHierarchicalElementChildren(i, incomingConnections);
1390 FXTreeItem* outgoingConnections = addListItem(laneItem,
"Outgoing", outcomingLaneConnections.front()->getIcon(),
false);
1392 for (
auto i : outcomingLaneConnections) {
1393 showHierarchicalElementChildren(i, outgoingConnections);
1402 addListItem(HE, itemParent);
1410 FXTreeItem* treeItem = addListItem(HE, itemParent);
1413 showHierarchicalElementChildren(i, treeItem);
1417 showHierarchicalElementChildren(i, treeItem);
1421 showHierarchicalElementChildren(i, treeItem);
1425 showHierarchicalElementChildren(i, treeItem);
1429 showHierarchicalElementChildren(i, treeItem);
1433 showHierarchicalElementChildren(i, treeItem);
1437 FXTreeItem* dataElementItem = addListItem(HE, itemParent);
1443 showHierarchicalElementChildren(interval.second, dataElementItem);
1449 showHierarchicalElementChildren(genericData, dataElementItem);
1461 myTreeItemToACMap[item] = AC;
1463 item->setExpanded(
true);
1472 FXTreeItem* item = myTreelist->insertItem(
nullptr, itemParent, text.c_str(), icon, icon);
1474 item->setExpanded(expanded);
1485 myFrameParent(frameParent),
1486 myDeleteLastCreatedPoint(false) {
1492 std::ostringstream information;
1494 <<
"- 'Start drawing' or ENTER\n"
1495 <<
" to create shape.\n"
1496 <<
"- 'Stop drawing' or ESC to\n"
1497 <<
" abort shape creation.\n"
1498 <<
"- 'Shift + Click' to remove\n"
1499 <<
" last inserted point.";
1531 myStartDrawingButton->disable();
1532 myStopDrawingButton->enable();
1533 myAbortDrawingButton->enable();
1541 if (myFrameParent->shapeDrawed()) {
1543 myTemporalShape.clear();
1545 myStartDrawingButton->enable();
1546 myStopDrawingButton->disable();
1547 myAbortDrawingButton->disable();
1558 myTemporalShape.clear();
1560 myStartDrawingButton->enable();
1561 myStopDrawingButton->disable();
1562 myAbortDrawingButton->disable();
1568 if (myStopDrawingButton->isEnabled()) {
1569 myTemporalShape.push_back(P);
1571 throw ProcessError(
"A new point cannot be added if drawing wasn't started");
1578 if (myTemporalShape.size() > 1) {
1579 myTemporalShape.pop_back();
1586 return myTemporalShape;
1592 return myStopDrawingButton->isEnabled();
1598 myDeleteLastCreatedPoint = value;
1604 return myDeleteLastCreatedPoint;
1634 myFrameParent(frameParent),
1650 for (
int i = 0; i < myParentsList->getNumItems(); i++) {
1651 if (myParentsList->isItemSelected(i)) {
1652 return myParentsList->getItem(i)->getText().text();
1662 for (
int i = 0; i < myParentsList->getNumItems(); i++) {
1663 myParentsList->getItem(i)->setSelected(
false);
1666 for (
int i = 0; i < myParentsList->getNumItems(); i++) {
1667 if (myParentsList->getItem(i)->getText().text() ==
id) {
1668 myParentsList->getItem(i)->setSelected(
true);
1672 myParentsList->recalc();
1680 for (
const auto& tag : listOfTags) {
1681 if (tag.first == additionalType) {
1682 myParentTag = additionalType;
1683 myParentsLabel->setText((
"Parent type: " + tag.second).c_str());
1684 refreshSelectorParentModul();
1702 myParentsList->clearItems();
1705 for (
const auto& i : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getAdditionals().at(myParentTag)) {
1706 myParentsList->appendItem(i.first.c_str());
1717 myFrameParent(frameParent),
1727 myFrameParent(frameParent),
1728 myFilteredTag(filteredTag),
1741 myOverlappedACs.clear();
1748 if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData() &&
1749 !AC->getTagProperty().isGenericData()) {
1753 if ((myFilteredTag !=
SUMO_TAG_NOTHING) && (AC->getTagProperty().getTag() != myFilteredTag)) {
1757 myOverlappedACs.push_back(AC);
1760 mySavedClickedPosition = clickedPosition;
1764 myCurrentIndexButton->setText((
"1 / " +
toString(myOverlappedACs.size())).c_str());
1766 myOverlappedElementList->clearItems();
1767 for (
int i = 0; i < (int)myOverlappedACs.size(); i++) {
1768 myOverlappedElementList->insertItem(i, myOverlappedACs.at(i)->getID().c_str(), myOverlappedACs.at(i)->getIcon());
1771 myOverlappedElementList->getItem(0)->setSelected(TRUE);
1773 myOverlappedElementList->hide();
1794 return (
int)myOverlappedACs.size();
1800 return (mySavedClickedPosition.distanceSquaredTo2D(clickedPosition) < 0.25);
1809 if (checkSavedPosition(clickedPosition)) {
1811 onCmdNextElement(0, 0, 0);
1827 if (checkSavedPosition(clickedPosition)) {
1829 onCmdPreviousElement(0, 0, 0);
1843 if (myOverlappedElementList->getNumItems() > 0) {
1845 myOverlappedElementList->getItem((
int)myItemIndex)->setSelected(FALSE);
1847 if (myItemIndex > 0) {
1850 myItemIndex = (myOverlappedACs.size() - 1);
1853 myOverlappedElementList->getItem((
int)myItemIndex)->setSelected(TRUE);
1854 myOverlappedElementList->update();
1856 myCurrentIndexButton->setText((
toString(myItemIndex + 1) +
" / " +
toString(myOverlappedACs.size())).c_str());
1858 myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex));
1869 if (myOverlappedElementList->getNumItems() > 0) {
1871 myOverlappedElementList->getItem((
int)myItemIndex)->setSelected(FALSE);
1873 myItemIndex = (myItemIndex + 1) % myOverlappedACs.size();
1875 myOverlappedElementList->getItem((
int)myItemIndex)->setSelected(TRUE);
1876 myOverlappedElementList->update();
1878 myCurrentIndexButton->setText((
toString(myItemIndex + 1) +
" / " +
toString(myOverlappedACs.size())).c_str());
1880 myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex));
1891 if (myOverlappedElementList->shown()) {
1892 myOverlappedElementList->hide();
1894 myOverlappedElementList->show();
1896 if (myOverlappedElementList->getNumItems() <= 10) {
1897 myOverlappedElementList->setHeight(23 * myOverlappedElementList->getNumItems());
1899 myOverlappedElementList->setHeight(230);
1901 myOverlappedElementList->recalc();
1909 for (
int i = 0; i < myOverlappedElementList->getNumItems(); i++) {
1910 if (myOverlappedElementList->getItem(i)->isSelected()) {
1913 myCurrentIndexButton->setText((
toString(myItemIndex + 1) +
" / " +
toString(myOverlappedACs.size())).c_str());
1915 myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex));
1927 FXDialogBox* helpDialog =
new FXDialogBox(
this,
"GEO attributes Help",
GUIDesignDialogBox);
1928 std::ostringstream help;
1930 <<
" - Click in the same position\n"
1931 <<
" for inspect next element\n"
1932 <<
" - Shift + Click in the same\n"
1933 <<
" position for inspect\n"
1934 <<
" previous element";
1938 helpDialog->create();
1945 myFrameParent(nullptr),
1946 myPreviousElement(nullptr),
1947 myCurrentIndexButton(nullptr),
1948 myNextElement(nullptr),
1949 myOverlappedElementList(nullptr),
1950 myHelpButton(nullptr),
1968 myOverlappedElementList->hide();
1979 myFromBusStop(
nullptr),
1980 myToBusStop(
nullptr),
1981 myConflictVClass(
false),
1982 myConflictDisconnected(
false) {
1984 if (edge->getNBEdge()->getNumLanesThatAllow(vClass) == 0) {
1985 myConflictVClass =
true;
1991 myFromBusStop(nullptr),
1992 myToBusStop(nullptr),
1993 myConflictVClass(false),
1994 myConflictDisconnected(false) {
2010 const std::vector<GNEEdge*>&
2017 return myFromBusStop;
2028 return myConflictVClass;
2034 return myConflictDisconnected;
2039 myFromBusStop(nullptr),
2040 myToBusStop(nullptr),
2041 myConflictVClass(false),
2042 myConflictDisconnected(false) {
2070 "SHIFT-click: ignore vClass",
2074 "CTRL-click: add disconnected",
2078 "BACKSPACE: undo click",
2089 bool showPathCreator =
true;
2091 abortPathCreation();
2093 myFinishCreationButton->disable();
2094 myAbortCreationButton->disable();
2095 myRemoveLastInsertedElement->disable();
2100 myCreationMode |= REQUIERE_FIRSTELEMENT;
2104 myCreationMode |= CONSECUTIVE_EDGES;
2106 myCreationMode |= NONCONSECUTIVE_EDGES;
2113 myCreationMode |= SHOW_CANDIDATE_EDGES;
2114 myCreationMode |= START_EDGE;
2115 myCreationMode |= END_EDGE;
2121 myCreationMode |= SINGLE_ELEMENT;
2122 myCreationMode |=
ROUTE;
2128 myCreationMode |= SHOW_CANDIDATE_EDGES;
2129 myCreationMode |= START_EDGE;
2130 myCreationMode |= END_EDGE;
2134 myCreationMode |= SHOW_CANDIDATE_EDGES;
2135 myCreationMode |= START_EDGE;
2136 myCreationMode |= END_EDGE;
2142 myCreationMode |= SHOW_CANDIDATE_EDGES;
2143 myCreationMode |= ONLY_FROMTO;
2144 myCreationMode |= START_EDGE;
2145 myCreationMode |= END_EDGE;
2151 myCreationMode |= SHOW_CANDIDATE_EDGES;
2152 myCreationMode |= ONLY_FROMTO;
2153 myCreationMode |= START_BUSSTOP;
2154 myCreationMode |= END_BUSSTOP;
2160 myCreationMode |= SHOW_CANDIDATE_EDGES;
2161 myCreationMode |= ONLY_FROMTO;
2162 myCreationMode |= START_BUSSTOP;
2163 myCreationMode |= END_EDGE;
2169 myCreationMode |= ONLY_FROMTO;
2170 myCreationMode |= START_BUSSTOP;
2171 myCreationMode |= END_BUSSTOP;
2175 myCreationMode |= SINGLE_ELEMENT;
2176 myCreationMode |= START_BUSSTOP;
2179 myCreationMode |= SINGLE_ELEMENT;
2180 myCreationMode |= START_EDGE;
2184 myCreationMode |= ONLY_FROMTO;
2185 myCreationMode |= START_EDGE;
2186 myCreationMode |= END_EDGE;
2189 showPathCreator =
false;
2193 if (showPathCreator) {
2233 if (((myCreationMode & CONSECUTIVE_EDGES) + (myCreationMode & NONCONSECUTIVE_EDGES) +
2234 (myCreationMode & START_EDGE) + (myCreationMode & END_EDGE)) == 0) {
2238 if ((myCreationMode & SINGLE_ELEMENT) && (mySelectedEdges.size() == 1)) {
2242 if (mySelectedEdges.size() > 0) {
2244 if (mySelectedEdges.back() == edge) {
2251 if (myCreationMode & Mode::CONSECUTIVE_EDGES) {
2253 const auto& outgoingEdges = mySelectedEdges.back()->getParentJunctions().back()->getGNEOutgoingEdges();
2254 if (std::find(outgoingEdges.begin(), outgoingEdges.end(), edge) == outgoingEdges.end()) {
2263 if (mySelectedEdges.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) {
2272 if (!shiftKeyPressed) {
2274 WRITE_WARNING(
"Invalid edge (SHIFT + click to add an invalid vClass edge)");
2279 if (!controlKeyPressed) {
2281 WRITE_WARNING(
"Invalid edge (CONTROL + click to add a disconnected edge)");
2288 mySelectedEdges.push_back(edge);
2290 myAbortCreationButton->enable();
2292 myFinishCreationButton->enable();
2294 myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo(
"route creation");
2296 if (mySelectedEdges.size() > 1) {
2297 myRemoveLastInsertedElement->enable();
2299 myRemoveLastInsertedElement->disable();
2304 updateInfoRouteLabel();
2311 std::vector<GNEEdge*>
2313 return mySelectedEdges;
2320 if (((myCreationMode & START_BUSSTOP) + (myCreationMode & END_BUSSTOP)) == 0) {
2324 if ((myCreationMode & SINGLE_ELEMENT) && myFromStoppingPlace) {
2328 if (myCreationMode & START_BUSSTOP) {
2330 if (myFromStoppingPlace) {
2332 if ((myCreationMode & END_BUSSTOP) && myToStoppingPlace) {
2335 myToStoppingPlace = stoppingPlace;
2338 myFromStoppingPlace = stoppingPlace;
2340 }
else if (myCreationMode & END_BUSSTOP) {
2342 if (myToStoppingPlace) {
2345 myToStoppingPlace = stoppingPlace;
2349 myAbortCreationButton->enable();
2351 myFinishCreationButton->enable();
2353 myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo(
"route creation");
2355 if (myFromStoppingPlace || myToStoppingPlace) {
2356 myRemoveLastInsertedElement->enable();
2358 myRemoveLastInsertedElement->disable();
2363 updateInfoRouteLabel();
2372 if (myFromStoppingPlace && (myFromStoppingPlace->getTagProperty().getTag() == expectedTag)) {
2373 return myFromStoppingPlace;
2382 if (myToStoppingPlace && (myToStoppingPlace->getTagProperty().getTag() == expectedTag)) {
2383 return myToStoppingPlace;
2393 if ((myCreationMode &
ROUTE) == 0) {
2404 updateInfoRouteLabel();
2416 const std::vector<GNEFrameModuls::PathCreator::Path>&
2424 return (myShowCandidateEdges->getCheck() == TRUE);
2431 for (
const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
2432 edge.second->resetCandidateFlags();
2435 if (mySelectedEdges.size() > 0) {
2437 if ((myShowCandidateEdges->getCheck() == TRUE) && (myCreationMode & SHOW_CANDIDATE_EDGES)) {
2439 for (
const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
2440 edge.second->setConflictedCandidate(
true);
2443 setSpecialCandidates(mySelectedEdges.back());
2445 for (
const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
2446 edge.second->setConflictedCandidate(
true);
2449 setPossibleCandidates(mySelectedEdges.back(), myVClass);
2452 for (
const auto& edge : mySelectedEdges) {
2453 edge->resetCandidateFlags();
2454 edge->setSourceCandidate(
true);
2457 mySelectedEdges.back()->resetCandidateFlags();
2458 mySelectedEdges.back()->setTargetCandidate(
true);
2459 }
else if (myShowCandidateEdges->getCheck() == TRUE && (myCreationMode & SHOW_CANDIDATE_EDGES)) {
2461 for (
const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
2462 if (edge.second->getNBEdge()->getNumLanesThatAllow(myVClass) > 0) {
2463 edge.second->setPossibleCandidate(
true);
2465 edge.second->setSpecialCandidate(
true);
2470 myFrameParent->myViewNet->updateViewNet();
2474 #if defined(_MSC_VER) && _MSC_VER == 1800
2475 #pragma warning(push)
2476 #pragma warning(disable: 4100)
2480 if (myPath.size() > 0) {
2481 const double lineWidth = 0.35;
2482 const double lineWidthin = 0.25;
2486 glTranslated(0, 0,
GLO_MAX - 0.1);
2490 for (
int i = 0; i < (int)myPath.size(); i++) {
2494 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
2496 if (((i == 0) && (j == 0)) || (j > 0)) {
2500 if ((j + 1) < (
int)path.
getSubPath().size()) {
2510 glTranslated(0, 0, 0.1);
2512 for (
int i = 0; i < (int)myPath.size(); i++) {
2516 if ((myCreationMode & SHOW_CANDIDATE_EDGES) == 0) {
2526 for (
int j = 0; j < (int)path.
getSubPath().size(); j++) {
2528 if (((i == 0) && (j == 0)) || (j > 0)) {
2532 if ((j + 1) < (
int)path.
getSubPath().size()) {
2546 #if defined(_MSC_VER) && _MSC_VER == 1800
2547 #pragma warning(pop)
2554 myFrameParent->createPath();
2561 if ((mySelectedEdges.size() > 0) || myFromStoppingPlace || myToStoppingPlace || myRoute) {
2563 myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo();
2567 myFinishCreationButton->disable();
2568 myAbortCreationButton->disable();
2569 myRemoveLastInsertedElement->disable();
2571 updateInfoRouteLabel();
2575 myFrameParent->getViewNet()->updateViewNet();
2582 if (mySelectedEdges.size() > 1) {
2584 mySelectedEdges.back()->resetCandidateFlags();
2586 mySelectedEdges.pop_back();
2588 if ((mySelectedEdges.size() > 0) && mySelectedEdges.back()->isSourceCandidate()) {
2589 mySelectedEdges.back()->setSourceCandidate(
false);
2590 mySelectedEdges.back()->setTargetCandidate(
true);
2593 if (mySelectedEdges.size() > 1) {
2594 myRemoveLastInsertedElement->enable();
2596 myRemoveLastInsertedElement->disable();
2601 updateInfoRouteLabel();
2605 myFrameParent->myViewNet->updateViewNet();
2621 abortPathCreation();
2629 removeLastElement();
2637 if (myShowCandidateEdges->getCheck() == TRUE) {
2638 myShiftLabel->show();
2639 myControlLabel->show();
2641 myShiftLabel->hide();
2642 myControlLabel->hide();
2654 if (myPath.size() > 0) {
2659 for (
const auto& path : myPath) {
2660 for (
const auto& edge : path.getSubPath()) {
2661 length += edge->getNBEdge()->getLength();
2662 speed += edge->getNBEdge()->getSpeed();
2664 pathSize += (int)path.getSubPath().size();
2667 std::ostringstream information;
2669 <<
"- Selected edges: " <<
toString(mySelectedEdges.size()) <<
"\n"
2670 <<
"- Path edges: " <<
toString(pathSize) <<
"\n"
2671 <<
"- Length: " <<
toString(length) <<
"\n"
2672 <<
"- Average speed: " <<
toString(speed / pathSize);
2674 myInfoRouteLabel->setText(information.str().c_str());
2676 myInfoRouteLabel->setText(
"No edges selected");
2684 for (
const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
2685 edge.second->resetCandidateFlags();
2688 mySelectedEdges.clear();
2689 myFromStoppingPlace =
nullptr;
2690 myToStoppingPlace =
nullptr;
2695 updateInfoRouteLabel();
2704 std::vector<GNEEdge*> edges;
2707 edges = myRoute->getParentEdges();
2710 if (myFromStoppingPlace) {
2711 edges.push_back(myFromStoppingPlace->getParentLanes().front()->getParentEdge());
2714 for (
const auto& edge : mySelectedEdges) {
2715 edges.push_back(edge);
2718 if (myToStoppingPlace) {
2719 edges.push_back(myToStoppingPlace->getParentLanes().front()->getParentEdge());
2723 if (edges.size() == 1) {
2724 myPath.push_back(
Path(myVClass, edges.front()));
2727 for (
int i = 1; i < (int)edges.size(); i++) {
2728 myPath.push_back(
Path(myFrameParent->getViewNet(), myVClass, edges.at(i - 1), edges.at(i)));
2737 myFrameParent->getViewNet()->getNet()->getPathCalculator()->calculateReachability(
SVC_PEDESTRIAN, originEdge);
2739 for (
const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
2740 for (
const auto& lane : edge.second->getLanes()) {
2741 if (lane->getReachability() > 0) {
2742 lane->getParentEdge()->resetCandidateFlags();
2743 lane->getParentEdge()->setSpecialCandidate(
true);
2752 myFrameParent->getViewNet()->getNet()->getPathCalculator()->calculateReachability(vClass, originEdge);
2754 for (
const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
2755 for (
const auto& lane : edge.second->getLanes()) {
2756 if (lane->getReachability() > 0) {
2757 lane->getParentEdge()->resetCandidateFlags();
2758 lane->getParentEdge()->setPossibleCandidate(
true);
2771 FXLabel* legendLabel =
nullptr;
2815 FXLabel* colorLabel =
new FXLabel(horizontalFrameColors,
"",
nullptr,
GUIDesignLabelLeft);
FXDEFMAP(GNEFrameModuls::TagSelector) TagSelectorMap[]
@ MID_GNE_TAGTYPE_SELECTED
tag type selected in ComboBox
@ MID_GNE_DELETE
delete element
@ MID_GNE_OVERLAPPED_PREVIOUS
inspect previous element in overlapped modul
@ MID_GNE_TAG_SELECTED
tag selected in ComboBox
@ MID_GNE_OVERLAPPED_ITEMSELECTED
list item selected in overlapped modul
@ MID_GNE_CENTER
center element
@ MID_GNE_EDGEPATH_FINISH
finish edge path creation
@ MID_GNE_ACHIERARCHY_SHOWCHILDMENU
In HierarchicalElementTree list, show child menu.
@ MID_GNE_STARTDRAWING
start drawing polygon
@ MID_GNE_ACHIERARCHY_MOVEUP
In HierarchicalElementTree list, move element to up.
@ MID_GNE_OVERLAPPED_SHOWLIST
show list of overlapped elements
@ MID_GNE_EDGEPATH_REMOVELAST
remove last inserted element in path
@ MID_GNE_INSPECT
inspect element
@ MID_GNE_OVERLAPPED_NEXT
inspect next element in overlapped modul
@ MID_GNE_ABORTDRAWING
abort drawing polygon
@ MID_GNE_ACHIERARCHY_MOVEDOWN
In HierarchicalElementTree list, move element to down.
@ MID_GNE_EDGEPATH_SHOWCANDIDATES
enable or disable show path candidates
@ MID_GNE_STOPDRAWING
stop drawing polygon
@ MID_GNE_EDGEPATH_ABORT
abort edge path creation
@ MID_GNE_SET_TYPE
used to select a type of element in a combo box
#define GUIDesignLabelLeft
#define GUIDesignComboBox
#define GUIDesignListFixedHeight
design for FXLists with height fixed
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignDialogBox
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left
#define GUIDesignButtonIconRectangular
button only with icon
#define GUIDesignLabelFrameThicked
label extended over frame without thick and with text justify to left, used to show information in fr...
#define GUIDesignListSingleElementFixedHeight
design for FXLists that only allow a single selected elements selected and height fixed
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignButtonOK
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center
#define GUIDesignTreeListFrame
Tree list used in frames to represent elements children.
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
#define WRITE_WARNING(msg)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_PEDESTRIAN
pedestrian
const std::string DEFAULT_PEDTYPE_ID
const std::string DEFAULT_VTYPE_ID
const std::string DEFAULT_BIKETYPE_ID
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_WALK_BUSSTOP_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_EDGE
@ GNE_TAG_PERSONSTOP_BUSSTOP
@ GNE_TAG_RIDE_BUSSTOP_BUSSTOP
@ SUMO_TAG_EDGEREL
a relation between two edges
@ GNE_TAG_PERSONTRIP_BUSSTOP_EDGE
@ SUMO_TAG_VTYPE
description of a vehicle type
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route (used in NETEDIT)
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ GNE_TAG_RIDE_BUSSTOP_EDGE
@ SUMO_TAG_CONNECTION
connectio between two lanes
@ GNE_TAG_PERSONSTOP_EDGE
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ GNE_TAG_PERSONTRIP_EDGE_BUSSTOP
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ GNE_TAG_WALK_BUSSTOP_EDGE
@ GNE_TAG_VEHICLE_WITHROUTE
@ GNE_TAG_RIDE_EDGE_BUSSTOP
@ SUMO_TAG_POILANE
begin/end of the description of a Point of interest over Lane (used by Netedit)
@ GNE_TAG_PERSONTRIP_BUSSTOP_BUSSTOP
@ GNE_TAG_WALK_EDGE_BUSSTOP
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
An Element which don't belongs to GNENet but has influency in the simulation.
virtual const std::string & getID() const =0
return ID of object
static const GNETagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
FXIcon * getIcon() const
get FXIcon associated to this AC
static std::vector< std::pair< SumoXMLTag, const std::string > > getAllowedTagsByCategory(const int tagPropertyCategory, const bool onlyDrawables)
get tags of all editable element types using TagProperty Type (NetworkEditMode::NETWORKELEMENT,...
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
GNENet * getNet() const
get pointer to net
bool isSpecialCandidate() const
check if this element is a special candidate
bool isPossibleCandidate() const
check if this element is a possible candidate
bool isConflictedCandidate() const
check if this element is a conflicted candidate
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEJunction * getParentJunction() const
get parent Junction
An Element which don't belongs to GNENet but has influency in the simulation.
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
const std::vector< GNEGenericData * > & getGenericDataChildren() const
get generic data children
const std::map< const double, GNEDataInterval * > & getDataIntervalChildren() const
get data interval children
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
GNEViewNet * getViewNet() const
get view net
GNEDemandElement * getCurrentDemandElement() const
get current demand element
~DemandElementSelector()
destructor
void setDemandElement(GNEDemandElement *demandElement)
set current demand element
GNEEdge * getPersonPlanPreviousEdge() const
get previous edge for the current selected demand elemnt
long onCmdSelectDemandElement(FXObject *, FXSelector, void *)
const std::vector< SumoXMLTag > & getAllowedTags() const
std::vector< SumoXMLTag > myDemandElementTags
demand element tags
DemandElementSelector(GNEFrame *frameParent, SumoXMLTag demandElementTag)
FOX-declaration.
void showDemandElementSelector()
show demand element selector
FXComboBox * myDemandElementsMatchBox
comboBox with the list of elements type
bool isDemandElementSelectorShown() const
check if demand element selector is shown
void hideDemandElementSelector()
hide demand element selector
void refreshDemandElementSelector()
refresh demand element selector
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
void showDrawingShape()
show Drawing mode
FXLabel * myInformationLabel
Label with information.
void startDrawing()
start drawing
DrawingShape(GNEFrame *frameParent)
FOX-declaration.
bool getDeleteLastCreatedPoint()
get flag delete last created point
long onCmdStartDrawing(FXObject *, FXSelector, void *)
~DrawingShape()
destructor
void hideDrawingShape()
hide Drawing mode
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
void stopDrawing()
stop drawing and check if shape can be created
FXButton * myAbortDrawingButton
button for abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
const PositionVector & getTemporalShape() const
get Temporal shape
void addNewPoint(const Position &P)
add new point to temporal shape
void abortDrawing()
abort drawing
void removeLastPoint()
remove last added point
bool isDrawing() const
return true if currently a shape is drawed
FXButton * myStopDrawingButton
button for stop drawing
FXButton * myStartDrawingButton
button for start drawing
void showHierarchicalElementChildren(GNEHierarchicalElement *HE, FXTreeItem *itemParent)
show children of given hierarchical element
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user click over option "delete" of child menu
void removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier *HE)
if given AttributeCarrier is the same of myHE, set it as nullptr
FXTreeItem * showAttributeCarrierParents()
show child of current attributeCarrier
long onCmdMoveItemUp(FXObject *, FXSelector, void *)
called when user click over option "Move up" of child menu
void refreshHierarchicalElementTree()
refresh HierarchicalElementTree
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user click over option "inspect" of child menu
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user click over option "center" of child Menu
long onCmdMoveItemDown(FXObject *, FXSelector, void *)
called when user click over option "Move down" of child menu
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *clickedAC)
FXTreeList * myTreelist
tree list to show the children of the element to erase
HierarchicalElementTree(GNEFrame *frameParent)
FOX-declaration.
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show HierarchicalElementTree
void hideHierarchicalElementTree()
hide HierarchicalElementTree
FXTreeItem * addListItem(GNEAttributeCarrier *AC, FXTreeItem *itemParent=nullptr, std::string prefix="", std::string sufix="")
add item into list
~HierarchicalElementTree()
destructor
long onCmdOverlappingHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
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
OverlappedInspection()
FOX needs this.
bool checkSavedPosition(const Position &clickedPosition) const
check if given 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 buildFXElements()
build Fox Toolkit elemements
long onCmdShowList(FXObject *, FXSelector, void *)
show list of overlapped elements
long onCmdPreviousElement(FXObject *, FXSelector, void *)
Inspect previous element (from top to bot)
long onCmdListItemSelected(FXObject *, FXSelector, void *)
called when a list item is selected
~OverlappedInspection()
destructor
int getNumberOfOverlappedACs() const
get number of overlapped ACSs
long onCmdNextElement(FXObject *, FXSelector, void *)
Inspect next Element (from top to bot)
void hideOverlappedInspection()
hide template editor
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
bool myConflictDisconnected
flag to mark this path as disconnected
const std::vector< GNEEdge * > & getSubPath() const
get sub path
GNEAdditional * getFromBusStop() const
get from additional
Path()
default constructor
bool myConflictVClass
flag to mark this path as conflicted
std::vector< GNEEdge * > mySubPath
sub path
GNEAdditional * getToBusStop() const
to additional
bool isConflictVClass() const
check if current path is conflict due vClass
bool isConflictDisconnected() const
check if current path is conflict due is disconnected
GNEDemandElement * myRoute
route (usually a busStop)
bool addRoute(GNEDemandElement *route, const bool shiftKeyPressed, const bool controlKeyPressed)
add route
std::vector< GNEEdge * > getSelectedEdges() const
get current selected additionals
int myCreationMode
current creation mode
void updateInfoRouteLabel()
update InfoRouteLabel
const std::vector< Path > & getPath() const
get path route
bool drawCandidateEdgesWithSpecialColor() const
draw candidate edges with special color (Only for candidates, special and conflicted)
SUMOVehicleClass getVClass() const
get vClass
GNEAdditional * myToStoppingPlace
to additional (usually a busStop)
GNEDemandElement * getRoute() const
get route
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void removeLastElement()
remove path element
void abortPathCreation()
abort path creation
FXLabel * myControlLabel
label for control information
long onCmdCreatePath(FXObject *, FXSelector, void *)
FXButton * myAbortCreationButton
button for abort route creation
void recalculatePath()
recalculate path
void showPathCreatorModul(SumoXMLTag tag, const bool firstElement, const bool consecutives)
show PathCreator for the given tag
GNEFrame * myFrameParent
current frame parent
void clearPath()
clear edges (and restore colors)
GNEAdditional * getToStoppingPlace(SumoXMLTag expectedTag) const
get to stoppingPlace
bool addEdge(GNEEdge *edge, const bool shiftKeyPressed, const bool controlKeyPressed)
add edge
void createPath()
create path
long onCmdRemoveLastElement(FXObject *, FXSelector, void *)
Called when the user click over button "Remove las inserted edge".
void setPossibleCandidates(GNEEdge *originEdge, const SUMOVehicleClass vClass)
set edgereachability (This function will be called recursively)
void setVClass(SUMOVehicleClass vClass)
set vClass
bool addStoppingPlace(GNEAdditional *stoppingPlace, const bool shiftKeyPressed, const bool controlKeyPressed)
add stoppingPlace
GNEAdditional * myFromStoppingPlace
from additional (usually a busStop)
long onCmdShowCandidateEdges(FXObject *, FXSelector, void *)
Called when the user click over check button "show candidate edges".
SUMOVehicleClass myVClass
current vClass
void setSpecialCandidates(GNEEdge *originEdge)
set special candidates (This function will be called recursively)
FXLabel * myShiftLabel
label for shift information
FXLabel * myInfoRouteLabel
label with route info
long onCmdAbortPathCreation(FXObject *, FXSelector, void *)
Called when the user click over button "Abort route creation".
FXButton * myRemoveLastInsertedElement
button for removing last inserted element
FXCheckButton * myShowCandidateEdges
CheckBox for show candidate edges.
PathCreator(GNEFrame *frameParent)
default constructor
void hidePathCreatorModul()
show PathCreator
FXButton * myFinishCreationButton
button for finish route creation
void updateEdgeColors()
update edge colors
GNEAdditional * getFromStoppingPlace(SumoXMLTag expectedTag) const
get from stoppingPlace
PathLegend(GNEFrame *frameParent)
constructor
void hidePathLegendModul()
hide Legend modul
void showPathLegendModul()
show Legend modul
void refreshSelectorParentModul()
Refresh list of Additional Parents Modul.
std::string getIdSelected() const
get currently parent additional selected
FXLabel * myParentsLabel
Label with parent name.
SelectorParent(GNEFrame *frameParent)
constructor
void hideSelectorParentModul()
hide SelectorParent Modul
~SelectorParent()
destructor
bool showSelectorParentModul(SumoXMLTag additionalTypeParent)
Show list of SelectorParent Modul.
FXList * myParentsList
List of parents.
void setIDSelected(const std::string &id)
select manually a element of the list
void hideTagSelector()
hide item selector
void setCurrentTagType(GNETagProperties::TagType tagType)
set current type manually
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show
long onCmdSelectTag(FXObject *, FXSelector, void *)
Called when the user select an elementin ComboBox.
const GNETagProperties & getCurrentTagProperties() const
get current type tag
long onCmdSelectTagType(FXObject *, FXSelector, void *)
void showTagSelector()
show item selector
void setCurrentTag(SumoXMLTag newTag)
set current type manually
static FXLabel * buildRainbow(FXComposite *parent)
build rainbow in frame modul
An Element which don't belongs to GNENet but has influency in the simulation.
GNEDataInterval * getDataIntervalParent() const
get data interval parent
const PositionVector & getShape() const
The shape of the additional element.
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
const GNEGeometry::Geometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
const std::vector< GNETAZElement * > & getChildTAZElements() const
get child TAZElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNELane * > & getChildLanes() const
get child lanes
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
const std::vector< GNETAZElement * > & getParentTAZElements() const
get parent TAZElements
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
GNEEdge * getParentEdge() const
get arent edge
std::vector< GNEEdge * > calculatePath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
GNETAZElement * retrieveTAZElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named TAZElement.
GNENetHelper::PathCalculator * getPathCalculator()
obtain instance of PathCalculator
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEShape * retrieveShape(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named shape.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true) const
get junction by id
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
const std::string & getID() const
get ID
An Element which don't belongs to GNENet but has influency in the simulation.
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
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element
class used to group all variables related with objects under cursor after a click over view
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
GNENet * getNet() const
get the net object
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Stores the information about how to visualize structures.
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
A point in 2D or 3D with translation and scaling methods.
static const RGBColor WHITE
static const RGBColor GREY
static const RGBColor ORANGE
static const std::vector< RGBColor > & getRainbowScaledColors()
get scaled rainbow colors
static const RGBColor special
color for selected special candidate element (Usually selected using shift+click)
static const RGBColor conflict
color for selected conflict candidate element (Usually selected using ctrl+click)
static const RGBColor target
color for selected candidate target
static const RGBColor possible
color for possible candidate element
static const RGBColor source
color for selected candidate source