{"action":"created","comment":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/comments/33814556","id":33814556,"diff_hunk":"@@ -40,36 +42,124 @@ namespace detail { namespace envelope\n {\n \n \n-struct envelope_box_on_spheroid\n+template\n+<\n+    std::size_t Index,\n+    std::size_t Dimension,\n+    std::size_t DimensionCount,\n+    typename CS_Tag\n+>\n+struct envelope_indexed_box\n {\n-    template<typename BoxIn, typename BoxOut>\n+    template <typename BoxIn, typename BoxOut>\n     static inline void apply(BoxIn const& box_in, BoxOut& mbr)\n     {\n-        BoxIn box_in_normalized = detail::return_normalized<BoxIn>(box_in);\n+        detail::indexed_point_view<BoxIn const, Index> box_in_corner(box_in);\n+        detail::indexed_point_view<BoxOut, Index> mbr_corner(mbr);\n+\n+        detail::conversion::point_to_point\n+            <\n+                detail::indexed_point_view<BoxIn const, Index>,\n+                detail::indexed_point_view<BoxOut, Index>,\n+                Dimension,\n+                DimensionCount\n+            >::apply(box_in_corner, mbr_corner);\n+    }\n+};\n \n-        geometry::transform(box_in_normalized, mbr);\n+template\n+<\n+    std::size_t Index,\n+    std::size_t DimensionCount\n+>\n+struct envelope_indexed_box<Index, 0, DimensionCount, spherical_equatorial_tag>\n+{\n+    template <typename BoxIn, typename BoxOut>\n+    static inline void apply(BoxIn const& box_in, BoxOut& mbr)\n+    {\n+\n+       // transform() does not work with boxes of dimension higher\n+        // than 2; to account for such boxes we transform the min/max\n+        // points of the boxes using the indexed_point_view\n+        detail::indexed_point_view<BoxIn const, Index> box_in_corner(box_in);\n+        detail::indexed_point_view<BoxOut, Index> mbr_corner(mbr);\n+\n+        // first transform the units\n+        transform_units(box_in_corner, mbr_corner);\n+\n+        // now transform the remaining coordinates\n+        detail::conversion::point_to_point\n+            <\n+                detail::indexed_point_view<BoxIn const, Index>,\n+                detail::indexed_point_view<BoxOut, Index>,\n+                2,\n+                DimensionCount\n+            >::apply(box_in_corner, mbr_corner);\n     }\n };\n \n+template\n+<\n+    std::size_t Index,\n+    std::size_t Dimension,\n+    std::size_t DimensionCount\n+>\n+struct envelope_indexed_box<Index, Dimension, DimensionCount, geographic_tag>\n+    : envelope_indexed_box\n+        <\n+            Index, Dimension, DimensionCount, spherical_equatorial_tag\n+        >\n+{};\n+\n \n-template <typename CSTag>\n+template\n+<\n+    typename std::size_t Dimension,\n+    std::size_t DimensionCount,\n+    typename CS_Tag\n+>\n struct envelope_box\n {\n     template<typename BoxIn, typename BoxOut>\n     static inline void apply(BoxIn const& box_in, BoxOut& mbr)\n     {\n-        geometry::convert(box_in, mbr);\n+        envelope_indexed_box\n+            <\n+                min_corner, Dimension, DimensionCount, CS_Tag\n+            >::apply(box_in, mbr);\n+\n+        envelope_indexed_box\n+            <\n+                max_corner, Dimension, DimensionCount, CS_Tag\n+            >::apply(box_in, mbr);\n+    }\n+};\n+\n+\n+template <typename std::size_t DimensionCount>\n+struct envelope_box<0, DimensionCount, spherical_equatorial_tag>","path":"include/boost/geometry/algorithms/detail/envelope/box.hpp","position":126,"original_position":126,"commit_id":"9f760bcdc78c81d1b0b12a4adee26f392c8d7c15","original_commit_id":"9f760bcdc78c81d1b0b12a4adee26f392c8d7c15","user":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"body":"There is no need to expand here: we have a box and we return a box. Assuming that the input box is valid, the only thing that possibly needs to be done is normalization and unit transformation. The rest are just conversions.","created_at":"2015-07-02T19:36:52Z","updated_at":"2015-07-02T19:36:52Z","html_url":"https://github.com/boostorg/geometry/pull/302#discussion_r33814556","pull_request_url":"https://api.github.com/repos/boostorg/geometry/pulls/302","_links":{"self":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/comments/33814556"},"html":{"href":"https://github.com/boostorg/geometry/pull/302#discussion_r33814556"},"pull_request":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/302"}}},"pull_request":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/302","id":36672569,"html_url":"https://github.com/boostorg/geometry/pull/302","diff_url":"https://github.com/boostorg/geometry/pull/302.diff","patch_url":"https://github.com/boostorg/geometry/pull/302.patch","issue_url":"https://api.github.com/repos/boostorg/geometry/issues/302","number":302,"state":"open","locked":false,"title":"Envelope and expand for spherical coordinate systems","user":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"body":"This PR completes the work started in PR #289, by adding supporting for `bg::envelope()` and `bg::expand()` for geometries that have dimension greater than 2.\r\n\r\nA new/different design approach was taken: the dispatch class for both envelope and expand algorithms now takes a range of dimensions as template parameters (the semantics are that the envelope is computed, or the expansion is performed, only for the dimensions in the passed range). \r\n\r\nThis new design has allowed for an-easier-to-follow dimension-centric implementation for the envelope and expand algorithms, and natively allows for support for computing the envelope and for performing expansion of geometries with dimension greater than 2 (such as geometries that also accommodate height information).","created_at":"2015-06-01T21:24:43Z","updated_at":"2015-07-02T19:36:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f59ef15c189ee525df957be6a9bebee1fcf62549","assignee":null,"milestone":{"url":"https://api.github.com/repos/boostorg/geometry/milestones/1","html_url":"https://github.com/boostorg/geometry/milestones/1.59","labels_url":"https://api.github.com/repos/boostorg/geometry/milestones/1/labels","id":1017572,"number":1,"title":"1.59","description":"","creator":{"login":"awulkiew","id":1226951,"avatar_url":"https://avatars.githubusercontent.com/u/1226951?v=3","gravatar_id":"","url":"https://api.github.com/users/awulkiew","html_url":"https://github.com/awulkiew","followers_url":"https://api.github.com/users/awulkiew/followers","following_url":"https://api.github.com/users/awulkiew/following{/other_user}","gists_url":"https://api.github.com/users/awulkiew/gists{/gist_id}","starred_url":"https://api.github.com/users/awulkiew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awulkiew/subscriptions","organizations_url":"https://api.github.com/users/awulkiew/orgs","repos_url":"https://api.github.com/users/awulkiew/repos","events_url":"https://api.github.com/users/awulkiew/events{/privacy}","received_events_url":"https://api.github.com/users/awulkiew/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":16,"state":"open","created_at":"2015-03-12T02:04:50Z","updated_at":"2015-06-21T21:13:11Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/boostorg/geometry/pulls/302/commits","review_comments_url":"https://api.github.com/repos/boostorg/geometry/pulls/302/comments","review_comment_url":"https://api.github.com/repos/boostorg/geometry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boostorg/geometry/issues/302/comments","statuses_url":"https://api.github.com/repos/boostorg/geometry/statuses/9f760bcdc78c81d1b0b12a4adee26f392c8d7c15","head":{"label":"mkaravel:feature/envelope_and_expand_for_spherical_cs","ref":"feature/envelope_and_expand_for_spherical_cs","sha":"9f760bcdc78c81d1b0b12a4adee26f392c8d7c15","user":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"repo":{"id":15894753,"name":"geometry","full_name":"mkaravel/geometry","owner":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mkaravel/geometry","description":"Boost.org geometry module","fork":true,"url":"https://api.github.com/repos/mkaravel/geometry","forks_url":"https://api.github.com/repos/mkaravel/geometry/forks","keys_url":"https://api.github.com/repos/mkaravel/geometry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkaravel/geometry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkaravel/geometry/teams","hooks_url":"https://api.github.com/repos/mkaravel/geometry/hooks","issue_events_url":"https://api.github.com/repos/mkaravel/geometry/issues/events{/number}","events_url":"https://api.github.com/repos/mkaravel/geometry/events","assignees_url":"https://api.github.com/repos/mkaravel/geometry/assignees{/user}","branches_url":"https://api.github.com/repos/mkaravel/geometry/branches{/branch}","tags_url":"https://api.github.com/repos/mkaravel/geometry/tags","blobs_url":"https://api.github.com/repos/mkaravel/geometry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkaravel/geometry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkaravel/geometry/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkaravel/geometry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkaravel/geometry/statuses/{sha}","languages_url":"https://api.github.com/repos/mkaravel/geometry/languages","stargazers_url":"https://api.github.com/repos/mkaravel/geometry/stargazers","contributors_url":"https://api.github.com/repos/mkaravel/geometry/contributors","subscribers_url":"https://api.github.com/repos/mkaravel/geometry/subscribers","subscription_url":"https://api.github.com/repos/mkaravel/geometry/subscription","commits_url":"https://api.github.com/repos/mkaravel/geometry/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkaravel/geometry/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkaravel/geometry/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkaravel/geometry/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkaravel/geometry/contents/{+path}","compare_url":"https://api.github.com/repos/mkaravel/geometry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkaravel/geometry/merges","archive_url":"https://api.github.com/repos/mkaravel/geometry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkaravel/geometry/downloads","issues_url":"https://api.github.com/repos/mkaravel/geometry/issues{/number}","pulls_url":"https://api.github.com/repos/mkaravel/geometry/pulls{/number}","milestones_url":"https://api.github.com/repos/mkaravel/geometry/milestones{/number}","notifications_url":"https://api.github.com/repos/mkaravel/geometry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkaravel/geometry/labels{/name}","releases_url":"https://api.github.com/repos/mkaravel/geometry/releases{/id}","created_at":"2014-01-14T07:16:18Z","updated_at":"2015-03-11T09:37:57Z","pushed_at":"2015-07-02T17:53:11Z","git_url":"git://github.com/mkaravel/geometry.git","ssh_url":"git@github.com:mkaravel/geometry.git","clone_url":"https://github.com/mkaravel/geometry.git","svn_url":"https://github.com/mkaravel/geometry","homepage":"http://boost.org/libs/geometry","size":37741,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"boostorg:develop","ref":"develop","sha":"bc70826be49dea69ca11269f073d4951d2d44ea4","user":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"repo":{"id":7590021,"name":"geometry","full_name":"boostorg/geometry","owner":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boostorg/geometry","description":"Boost.org geometry module","fork":false,"url":"https://api.github.com/repos/boostorg/geometry","forks_url":"https://api.github.com/repos/boostorg/geometry/forks","keys_url":"https://api.github.com/repos/boostorg/geometry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boostorg/geometry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boostorg/geometry/teams","hooks_url":"https://api.github.com/repos/boostorg/geometry/hooks","issue_events_url":"https://api.github.com/repos/boostorg/geometry/issues/events{/number}","events_url":"https://api.github.com/repos/boostorg/geometry/events","assignees_url":"https://api.github.com/repos/boostorg/geometry/assignees{/user}","branches_url":"https://api.github.com/repos/boostorg/geometry/branches{/branch}","tags_url":"https://api.github.com/repos/boostorg/geometry/tags","blobs_url":"https://api.github.com/repos/boostorg/geometry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boostorg/geometry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boostorg/geometry/git/refs{/sha}","trees_url":"https://api.github.com/repos/boostorg/geometry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boostorg/geometry/statuses/{sha}","languages_url":"https://api.github.com/repos/boostorg/geometry/languages","stargazers_url":"https://api.github.com/repos/boostorg/geometry/stargazers","contributors_url":"https://api.github.com/repos/boostorg/geometry/contributors","subscribers_url":"https://api.github.com/repos/boostorg/geometry/subscribers","subscription_url":"https://api.github.com/repos/boostorg/geometry/subscription","commits_url":"https://api.github.com/repos/boostorg/geometry/commits{/sha}","git_commits_url":"https://api.github.com/repos/boostorg/geometry/git/commits{/sha}","comments_url":"https://api.github.com/repos/boostorg/geometry/comments{/number}","issue_comment_url":"https://api.github.com/repos/boostorg/geometry/issues/comments{/number}","contents_url":"https://api.github.com/repos/boostorg/geometry/contents/{+path}","compare_url":"https://api.github.com/repos/boostorg/geometry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boostorg/geometry/merges","archive_url":"https://api.github.com/repos/boostorg/geometry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boostorg/geometry/downloads","issues_url":"https://api.github.com/repos/boostorg/geometry/issues{/number}","pulls_url":"https://api.github.com/repos/boostorg/geometry/pulls{/number}","milestones_url":"https://api.github.com/repos/boostorg/geometry/milestones{/number}","notifications_url":"https://api.github.com/repos/boostorg/geometry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boostorg/geometry/labels{/name}","releases_url":"https://api.github.com/repos/boostorg/geometry/releases{/id}","created_at":"2013-01-13T15:59:29Z","updated_at":"2015-07-02T07:15:28Z","pushed_at":"2015-07-02T17:53:12Z","git_url":"git://github.com/boostorg/geometry.git","ssh_url":"git@github.com:boostorg/geometry.git","clone_url":"https://github.com/boostorg/geometry.git","svn_url":"https://github.com/boostorg/geometry","homepage":"http://boost.org/libs/geometry","size":50898,"stargazers_count":49,"watchers_count":49,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":3,"forks":36,"open_issues":3,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/302"},"html":{"href":"https://github.com/boostorg/geometry/pull/302"},"issue":{"href":"https://api.github.com/repos/boostorg/geometry/issues/302"},"comments":{"href":"https://api.github.com/repos/boostorg/geometry/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/boostorg/geometry/statuses/9f760bcdc78c81d1b0b12a4adee26f392c8d7c15"}}}}