{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/91859617","pull_request_review_id":12369989,"id":91859617,"diff_hunk":"@@ -176,9 +255,45 @@ void IndexGraphStarter::FindPointsWithCommonFeature(Joint::Id jointId0, Joint::I\n   CHECK(found, (\"Can't find common feature for joints\", jointId0, jointId1));\n }\n \n+void IndexGraphStarter::AddAdditionalZeroEdges(FakeJoint const & fp, EndPointType endPointType)\n+{\n+  CHECK(!m_graph.IsFakeFeature(fp.m_point.GetFeatureId()), ());\n+\n+  bool const isJoint = fp.BelongsToGraph();\n+\n+  vector<DirectedEdge> edges;\n+  if (isJoint)\n+  {\n+    m_graph.GetEdgeList(fp.m_jointId, endPointType == EndPointType::Start /* is outgoing */,\n+                        true /* graphWithoutRestrictions */, edges);\n+  }\n+  else\n+  {\n+    m_graph.GetIntermediatePointEdges(fp.m_point, true /* graphWithoutRestrictions */, edges);\n+  }\n+\n+  for (DirectedEdge const & edge : edges)\n+  {\n+    m_graph.ForEachEdgeMappingNode(edge, [&](DirectedEdge const & e){\n+      if (edge == e)\n+        return;\n+\n+      switch (endPointType) {\n+      case EndPointType::Start:\n+        AddZeroLengthOnewayFeature(isJoint ? edge.GetFrom() : edge.GetTo(),","path":"routing/index_graph_starter.cpp","position":204,"original_position":204,"commit_id":"8730bb120cf40cfe6cd8f9fba3f12c66276ba701","original_commit_id":"8730bb120cf40cfe6cd8f9fba3f12c66276ba701","user":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"body":"Could you please explain why do you use |edge| here at all? ","created_at":"2016-12-11T16:45:35Z","updated_at":"2016-12-11T16:45:35Z","html_url":"https://github.com/mapsme/omim/pull/4817#discussion_r91859617","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/4817","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/91859617"},"html":{"href":"https://github.com/mapsme/omim/pull/4817#discussion_r91859617"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/4817","id":95372509,"html_url":"https://github.com/mapsme/omim/pull/4817","diff_url":"https://github.com/mapsme/omim/pull/4817.diff","patch_url":"https://github.com/mapsme/omim/pull/4817.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/4817","number":4817,"state":"open","locked":false,"title":"[routing] Applying restrictions on index graph","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"body":"Данный PR реализовывает наложение restriction на index graph. В не тривильных случаях это одно из двух преобразований графа: \r\nRestriction type Only\r\n```\r\n  // It's possible to move only from one segment to another in case of any number of ingoing and\r\n  // outgoing edges.\r\n  // The idea is to tranform the navigation graph for every non-degenerate case as it's shown below.\r\n  // At the picture below a restriction for permission moving only from 6 to O to 3 is shown.\r\n  // So to implement it it's necessary to remove (disable) an edge 6-O and add feature (edge) 4-N-3.\r\n  // Adding N is important for a route recovery stage. (The geometry of O will be copied to N.)\r\n  //\r\n  // 1       2       3                     1       2       3\r\n  // *       *       *                     *       *       *\r\n  //  ↖     ^     ↗                        ↖     ^     ↗^\r\n  //    ↖   |   ↗                            ↖   |   ↗  |\r\n  //      ↖ | ↗                                ↖ | ↗    |\r\n  //         *  O             ==>                  *  O    * N\r\n  //      ↗ ^ ↖                                 ↗^       ^\r\n  //    ↗   |   ↖                             ↗  |       |\r\n  //  ↗     |     ↖                         ↗    |       |\r\n  // *       *       *                     *       *       *\r\n  // 4       5       6                     4       5       6\r\n  //\r\n  // In case of this transformation the following edge mapping happens:\r\n  // 6-O -> 6-N\r\n  // O-3 -> O-3; N-3\r\n```\r\n\r\nRestriction type No\r\n```\r\n  // Prohibition of moving from one segment to another in case of any number of ingoing and outgoing\r\n  // edges.\r\n  // The idea is to transform the navigation graph for every non-degenerate case as it's shown below.\r\n  // At the picture below a restriction for prohibition moving from 4 to O to 3 is shown.\r\n  // So to implement it it's necessary to remove (disable) an edge 4-O and add features (edges)\r\n  // 4-N-1 and N-2.\r\n  //\r\n  // 1       2       3                     1       2       3\r\n  // *       *       *                     *       *       *\r\n  //  ↖     ^     ↗                       ^↖   ↗^     ↗\r\n  //    ↖   |   ↗                         |  ↖   |   ↗\r\n  //      ↖ | ↗                           |↗   ↖| ↗\r\n  //         *  O             ==>        N *       *  O\r\n  //      ↗ ^ ↖                           ^       ^ ↖\r\n  //    ↗   |   ↖                         |       |   ↖\r\n  //  ↗     |     ↖                       |       |     ↖\r\n  // *       *       *                     *       *       *\r\n  // 4       5       6                     4       5       6\r\n  //\r\n  // In case of this transformation the following edge mapping happens:\r\n  // 4-O -> 4-N\r\n  // O-1 -> O-1; N-1\r\n  // O-2 -> 0-2; N-2\r\n```\r\n\r\nВ данном PR я планирую еще доделать наложение пересекающихся рестрикшинов (входная дуга одного совпадает с выходной дугой другого). И добавить тестов.\r\n\r\nНо это сильно не повлияет на уже написанный код. Прошу всех заинтересованных коллег приступать к ревью.\r\n\r\n@ygorshenin @mpimenov @dobriy-eeh PTAL\r\n","created_at":"2016-11-26T14:06:55Z","updated_at":"2016-12-11T16:45:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d77bcb760d2277b5d8e2454dd2de98cacf047804","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/4817/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/4817/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/4817/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/8730bb120cf40cfe6cd8f9fba3f12c66276ba701","head":{"label":"mapsme:master-applying-restrictions","ref":"master-applying-restrictions","sha":"8730bb120cf40cfe6cd8f9fba3f12c66276ba701","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-12-08T22:59:26Z","pushed_at":"2016-12-10T22:10:24Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2939441,"stargazers_count":2061,"watchers_count":2061,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":410,"mirror_url":null,"open_issues_count":366,"forks":410,"open_issues":366,"watchers":2061,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"8cdfcc00d0c156ba93d28875b698764dc2384cbf","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-12-08T22:59:26Z","pushed_at":"2016-12-10T22:10:24Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2939441,"stargazers_count":2061,"watchers_count":2061,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":410,"mirror_url":null,"open_issues_count":366,"forks":410,"open_issues":366,"watchers":2061,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817"},"html":{"href":"https://github.com/mapsme/omim/pull/4817"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/4817"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/4817/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4817/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/8730bb120cf40cfe6cd8f9fba3f12c66276ba701"}}}}
{"actor":{"display_login":"ygorshenin"}}