{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/109609328","pull_request_review_id":30720725,"id":109609328,"diff_hunk":"@@ -0,0 +1,100 @@\n+#pragma once\n+#include \"routing/cross_mwm_index_graph.hpp\"\n+#include \"routing/cross_mwm_osrm_graph.hpp\"\n+#include \"routing/num_mwm_id.hpp\"\n+\n+#include \"routing/segment.hpp\"\n+\n+#include \"routing_common/vehicle_model.hpp\"\n+\n+#include \"indexer/index.hpp\"\n+\n+#include \"base/math.hpp\"\n+\n+#include <map>\n+#include <memory>\n+#include <vector>\n+\n+namespace routing\n+{\n+/// \\brief Getting information for cross mwm routing.\n+class CrossMwmGraph final\n+{\n+public:\n+  CrossMwmGraph(Index & index, std::shared_ptr<NumMwmIds> numMwmIds,\n+                std::shared_ptr<VehicleModelFactory> vehicleModelFactory, RoutingIndexManager & indexManager);\n+  ~CrossMwmGraph();\n+\n+  /// \\brief Transition segment is a segment which is crossed by mwm border. That means\n+  /// start and finsh of such segment have to lie in different mwms. If a segment is\n+  /// crossed by mwm border but its start and finish lie in the same mwm it's not\n+  /// a transition segment.\n+  /// For most cases there is only one transition segment for a transition feature.\n+  /// Transition segment at the picture below is marked as *===>*.\n+  /// Transition feature is a feature which contains one or more transition segments.\n+  /// Transition features at the picture below is marked as *===>*------>*.\n+  /// Every transition feature is duplicated in two neighbouring mwms.\n+  /// The duplicate is called \"twin\" at the picture below.\n+  /// For most cases a transition feature contains only one transition segment.\n+  /// -------MWM0---------------MWM1----------------MWM2-------------\n+  /// |                   |                 |                       |\n+  /// | F0 in MWM0   *===>*------>*    *===>*------>*  F2 of MWM1   |\n+  /// | Twin in MWM1 *===>*------>*    *===>*------>*  Twin in MWM2 |\n+  /// |                   |                 |                       |\n+  /// | F1 in MWM0      *===>*---->*      *===>*--->*  F3 of MWM1   |\n+  /// | Twin in MWM1    *===>*---->*      *===>*--->*  Twin in MWM2 |\n+  /// |                   |                 |                       |\n+  /// ---------------------------------------------------------------\n+  /// There are two kinds of transition segments:\n+  /// * enter transition segments are enters to their mwms;\n+  /// * exit transition segments are exits from their mwms;\n+  /// \\returns true if |s| is an exit (|isOutgoing| == true) or an enter (|isOutgoing| == false)\n+  /// transition segment.\n+  bool IsTransition(Segment const & s, bool isOutgoing);\n+\n+  /// \\brief Fills |twins| with duplicates of |s| transition segment in neighbouring mwm.\n+  /// For most cases there is only one twin for |s|.\n+  /// If |isOutgoing| == true |s| should be an exit transition segment and\n+  /// the mehtod fills |twins| with appropriate enter transition segments.\n+  /// If |isOutgoing| == false |s| should be an enter transition segment and\n+  /// the method fills |twins| with appropriate exit transition segments.\n+  /// \\note GetTwins(s, isOutgoing, ...) shall be called only if IsTransition(s, isOutgoing) returns true.\n+  /// \\note GetTwins(s, isOutgoing, twins) fills |twins| only if mwm contained |twins| has been downloaded.\n+  /// If not, |twins| could be emply after a GetTwins(...) call.\n+  void GetTwins(Segment const & s, bool isOutgoing, std::vector<Segment> & twins);\n+\n+  /// \\brief Fills |edges| with edges outgoing from |s| (ingoing to |s|).\n+  /// If |isOutgoing| == true then |s| should be an enter transition segment.\n+  /// In that case |edges| is filled with all edges starting from |s| and ending at all reachable\n+  /// exit transition segments of the mwm of |s|.\n+  /// If |isOutgoing| == false then |s| should be an exit transition segment.\n+  /// In that case |edges| is filled with all edges starting from all reachable\n+  /// enter transition segments of the mwm of |s| and ending at |s|.\n+  /// Weight of each edge is equal to weight of the route form |s| to |SegmentEdge::m_target|\n+  /// if |isOutgoing| == true and from |SegmentEdge::m_target| to |s| otherwise.\n+  void GetEdgeList(Segment const & s, bool isOutgoing, std::vector<SegmentEdge> & edges);\n+\n+  void Clear();\n+\n+private:\n+  using TransitionPoints = buffer_vector<m2::PointD, 1>;\n+\n+  /// \\returns points of |s|. |s| should be a transition segment of mwm with an OSRM cross-mwm sections or\n+  /// with an index graph cross-mwm section.\n+  /// \\param s is a transition segment of type |isOutgoing|.\n+  /// \\note the result of the method is returned by value because the size of the vector is usually one\n+  /// or very small in rare cases in OSRM.\n+  TransitionPoints GetTransitionPoints(Segment const & s, bool isOutgoing);\n+\n+  bool CrossMwmSectionExists(NumMwmId numMwmId);\n+\n+  /// \\brief Fills |twins| with transition segments of feature |ft| of type |isOutgoing|.\n+  void GetTransitions(FeatureType const & ft, bool isOutgoing, std::vector<Segment> & twins);","path":"routing/cross_mwm_graph.hpp","position":92,"original_position":92,"commit_id":"6150aa93be7e9f2f7d7c8b70478a89495a7d9bdf","original_commit_id":"6150aa93be7e9f2f7d7c8b70478a89495a7d9bdf","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars3.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":"Да. Давай.","created_at":"2017-04-04T08:58:05Z","updated_at":"2017-04-04T08:58:05Z","html_url":"https://github.com/mapsme/omim/pull/5686#discussion_r109609328","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/5686","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/109609328"},"html":{"href":"https://github.com/mapsme/omim/pull/5686#discussion_r109609328"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/5686"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/5686","id":112434209,"html_url":"https://github.com/mapsme/omim/pull/5686","diff_url":"https://github.com/mapsme/omim/pull/5686.diff","patch_url":"https://github.com/mapsme/omim/pull/5686.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/5686","number":5686,"state":"open","locked":false,"title":"[routing] Implementation of cross mwm methods (CrossMwmIndexGraph) for cross_mwm(non osrm) section.","user":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars3.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":"Реализация методов по получению меж mwm-ой информации на базе новой (не OSRM) секции (cross_mwm). Поддержка получения меж mwm-ой информации для смеси mwm с OSRM и без.\r\n\r\nОграничения:\r\n- сейчас не корректно работает метод: CrossMwmIndexGraph::GetEdgeList() на новых mwm. Онa возвращает переходы через mwm, но маршрут потом не прокладывается. Вероятно, не удается получить близнецы к этим переходам. Вероятно, сами переходы не корректны. Буду разбираться.\r\n- если карта состоит из смеси mwm, не все переходы через смешанную границу (не osrm - osrm) возвращаются корректно. Похожий баг был и ранее переходом через границы osrm-osrm. Данный баг я не планирую лечить, поскольку ресурсы ограничены. Важно, чтоб на новых mwm все отрабатывало корректно.\r\n\r\n@dobriy-eeh @ygorshenin @mpimenov PTAL","created_at":"2017-03-24T11:12:13Z","updated_at":"2017-04-04T08:58:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afd032bca66689080c26d3767a3551ebaa62e42f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/5686/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/5686/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/5686/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/6150aa93be7e9f2f7d7c8b70478a89495a7d9bdf","head":{"label":"mapsme:master-index-graph-cross-mwm-methods","ref":"master-index-graph-cross-mwm-methods","sha":"6150aa93be7e9f2f7d7c8b70478a89495a7d9bdf","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars2.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://avatars2.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 and Android","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":"2017-04-03T07:18:02Z","pushed_at":"2017-04-04T08:45:18Z","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":"","size":3011831,"stargazers_count":2203,"watchers_count":2203,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":444,"mirror_url":null,"open_issues_count":455,"forks":444,"open_issues":455,"watchers":2203,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"161aa3b8f8809ab98e96d9987c738ec80e14095f","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars2.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://avatars2.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 and Android","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":"2017-04-03T07:18:02Z","pushed_at":"2017-04-04T08:45:18Z","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":"","size":3011831,"stargazers_count":2203,"watchers_count":2203,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":444,"mirror_url":null,"open_issues_count":455,"forks":444,"open_issues":455,"watchers":2203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/5686"},"html":{"href":"https://github.com/mapsme/omim/pull/5686"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/5686"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/5686/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/5686/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/5686/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/6150aa93be7e9f2f7d7c8b70478a89495a7d9bdf"}}}}
{"actor":{"display_login":"bykoianko"}}