{"action":"created","comment":{"url":"https://api.github.com/repos/ufz/ogs/pulls/comments/50810516","id":50810516,"diff_hunk":"@@ -0,0 +1,69 @@\n+/**\n+ * \\copyright\n+ * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)\n+ *            Distributed under a Modified BSD License.\n+ *              See accompanying file LICENSE.txt or\n+ *              http://www.opengeosys.org/project/license\n+ *\n+ */\n+\n+#include \"FlipElements.h\"\n+\n+#include \"MeshLib/Elements/Element.h\"\n+#include \"MeshLib/Node.h\"\n+#include \"MeshLib/Elements/Line.h\"\n+#include \"MeshLib/Elements/Tri.h\"\n+#include \"MeshLib/Elements/Quad.h\"\n+#include \"DuplicateMeshComponents.h\"\n+\n+namespace MeshLib\n+{\n+\n+MeshLib::Element* flipElement(MeshLib::Element const& elem, std::vector<MeshLib::Node*> const& nodes)\n+{\n+\tif (elem.getDimension()>2)\n+\t\treturn nullptr;\n+\n+\tstd::size_t const n_nodes (elem.getNNodes());\n+\tMeshLib::Node** elem_nodes = new MeshLib::Node*[n_nodes];\n+\tfor (unsigned i=0; i<n_nodes; ++i)\n+\t\telem_nodes[i] = nodes[elem.getNode(i)->getID()];\n+\tMeshLib::Node* tmp (elem_nodes[0]);\n+\telem_nodes[0] = elem_nodes[1];\n+\telem_nodes[1] = tmp;\n+\n+\tif (elem.getGeomType() == MeshElemType::LINE)\n+\t\treturn new MeshLib::Line(elem_nodes, elem.getID());\n+\telse if (elem.getGeomType() == MeshElemType::TRIANGLE)","path":"MeshLib/MeshEditing/FlipElements.cpp","position":37,"original_position":37,"commit_id":"80d70803267f52a8848e52b3354b400f2604fb94","original_commit_id":"80d70803267f52a8848e52b3354b400f2604fb94","user":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"body":"Why don't you flip triangles?","created_at":"2016-01-26T09:23:20Z","updated_at":"2016-01-26T09:23:20Z","html_url":"https://github.com/ufz/ogs/pull/990#discussion_r50810516","pull_request_url":"https://api.github.com/repos/ufz/ogs/pulls/990","_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/50810516"},"html":{"href":"https://github.com/ufz/ogs/pull/990#discussion_r50810516"},"pull_request":{"href":"https://api.github.com/repos/ufz/ogs/pulls/990"}}},"pull_request":{"url":"https://api.github.com/repos/ufz/ogs/pulls/990","id":57104337,"html_url":"https://github.com/ufz/ogs/pull/990","diff_url":"https://github.com/ufz/ogs/pull/990.diff","patch_url":"https://github.com/ufz/ogs/pull/990.patch","issue_url":"https://api.github.com/repos/ufz/ogs/issues/990","number":990,"state":"open","locked":false,"title":"Element flipping","user":{"login":"rinkk","id":798445,"avatar_url":"https://avatars.githubusercontent.com/u/798445?v=3","gravatar_id":"","url":"https://api.github.com/users/rinkk","html_url":"https://github.com/rinkk","followers_url":"https://api.github.com/users/rinkk/followers","following_url":"https://api.github.com/users/rinkk/following{/other_user}","gists_url":"https://api.github.com/users/rinkk/gists{/gist_id}","starred_url":"https://api.github.com/users/rinkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rinkk/subscriptions","organizations_url":"https://api.github.com/users/rinkk/orgs","repos_url":"https://api.github.com/users/rinkk/repos","events_url":"https://api.github.com/users/rinkk/events{/privacy}","received_events_url":"https://api.github.com/users/rinkk/received_events","type":"User","site_admin":false},"body":"adds a function to flip elements (i.e. reverse direction of 1d elems, change sign of normals for 2d elements). this solves #983.","created_at":"2016-01-25T17:40:34Z","updated_at":"2016-01-26T09:23:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"755414d9b18cf1fdfd1c7506637d67d0ff8dca83","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ufz/ogs/pulls/990/commits","review_comments_url":"https://api.github.com/repos/ufz/ogs/pulls/990/comments","review_comment_url":"https://api.github.com/repos/ufz/ogs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ufz/ogs/issues/990/comments","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/80d70803267f52a8848e52b3354b400f2604fb94","head":{"label":"rinkk:ElementFlipping","ref":"ElementFlipping","sha":"80d70803267f52a8848e52b3354b400f2604fb94","user":{"login":"rinkk","id":798445,"avatar_url":"https://avatars.githubusercontent.com/u/798445?v=3","gravatar_id":"","url":"https://api.github.com/users/rinkk","html_url":"https://github.com/rinkk","followers_url":"https://api.github.com/users/rinkk/followers","following_url":"https://api.github.com/users/rinkk/following{/other_user}","gists_url":"https://api.github.com/users/rinkk/gists{/gist_id}","starred_url":"https://api.github.com/users/rinkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rinkk/subscriptions","organizations_url":"https://api.github.com/users/rinkk/orgs","repos_url":"https://api.github.com/users/rinkk/repos","events_url":"https://api.github.com/users/rinkk/events{/privacy}","received_events_url":"https://api.github.com/users/rinkk/received_events","type":"User","site_admin":false},"repo":{"id":7148641,"name":"ogs","full_name":"rinkk/ogs","owner":{"login":"rinkk","id":798445,"avatar_url":"https://avatars.githubusercontent.com/u/798445?v=3","gravatar_id":"","url":"https://api.github.com/users/rinkk","html_url":"https://github.com/rinkk","followers_url":"https://api.github.com/users/rinkk/followers","following_url":"https://api.github.com/users/rinkk/following{/other_user}","gists_url":"https://api.github.com/users/rinkk/gists{/gist_id}","starred_url":"https://api.github.com/users/rinkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rinkk/subscriptions","organizations_url":"https://api.github.com/users/rinkk/orgs","repos_url":"https://api.github.com/users/rinkk/repos","events_url":"https://api.github.com/users/rinkk/events{/privacy}","received_events_url":"https://api.github.com/users/rinkk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rinkk/ogs","description":"OGS source code","fork":true,"url":"https://api.github.com/repos/rinkk/ogs","forks_url":"https://api.github.com/repos/rinkk/ogs/forks","keys_url":"https://api.github.com/repos/rinkk/ogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rinkk/ogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rinkk/ogs/teams","hooks_url":"https://api.github.com/repos/rinkk/ogs/hooks","issue_events_url":"https://api.github.com/repos/rinkk/ogs/issues/events{/number}","events_url":"https://api.github.com/repos/rinkk/ogs/events","assignees_url":"https://api.github.com/repos/rinkk/ogs/assignees{/user}","branches_url":"https://api.github.com/repos/rinkk/ogs/branches{/branch}","tags_url":"https://api.github.com/repos/rinkk/ogs/tags","blobs_url":"https://api.github.com/repos/rinkk/ogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rinkk/ogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rinkk/ogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rinkk/ogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rinkk/ogs/statuses/{sha}","languages_url":"https://api.github.com/repos/rinkk/ogs/languages","stargazers_url":"https://api.github.com/repos/rinkk/ogs/stargazers","contributors_url":"https://api.github.com/repos/rinkk/ogs/contributors","subscribers_url":"https://api.github.com/repos/rinkk/ogs/subscribers","subscription_url":"https://api.github.com/repos/rinkk/ogs/subscription","commits_url":"https://api.github.com/repos/rinkk/ogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rinkk/ogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rinkk/ogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rinkk/ogs/issues/comments{/number}","contents_url":"https://api.github.com/repos/rinkk/ogs/contents/{+path}","compare_url":"https://api.github.com/repos/rinkk/ogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rinkk/ogs/merges","archive_url":"https://api.github.com/repos/rinkk/ogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rinkk/ogs/downloads","issues_url":"https://api.github.com/repos/rinkk/ogs/issues{/number}","pulls_url":"https://api.github.com/repos/rinkk/ogs/pulls{/number}","milestones_url":"https://api.github.com/repos/rinkk/ogs/milestones{/number}","notifications_url":"https://api.github.com/repos/rinkk/ogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rinkk/ogs/labels{/name}","releases_url":"https://api.github.com/repos/rinkk/ogs/releases{/id}","deployments_url":"https://api.github.com/repos/rinkk/ogs/deployments","created_at":"2012-12-13T13:27:20Z","updated_at":"2014-09-01T13:43:48Z","pushed_at":"2016-01-25T17:37:56Z","git_url":"git://github.com/rinkk/ogs.git","ssh_url":"git@github.com:rinkk/ogs.git","clone_url":"https://github.com/rinkk/ogs.git","svn_url":"https://github.com/rinkk/ogs","homepage":"www.opengeosys.org","size":10918,"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":"ufz:master","ref":"master","sha":"c8376b44221734c80fe27f27ffd2c59ff09f44ee","user":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=3","gravatar_id":"","url":"https://api.github.com/users/ufz","html_url":"https://github.com/ufz","followers_url":"https://api.github.com/users/ufz/followers","following_url":"https://api.github.com/users/ufz/following{/other_user}","gists_url":"https://api.github.com/users/ufz/gists{/gist_id}","starred_url":"https://api.github.com/users/ufz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufz/subscriptions","organizations_url":"https://api.github.com/users/ufz/orgs","repos_url":"https://api.github.com/users/ufz/repos","events_url":"https://api.github.com/users/ufz/events{/privacy}","received_events_url":"https://api.github.com/users/ufz/received_events","type":"Organization","site_admin":false},"repo":{"id":1701384,"name":"ogs","full_name":"ufz/ogs","owner":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=3","gravatar_id":"","url":"https://api.github.com/users/ufz","html_url":"https://github.com/ufz","followers_url":"https://api.github.com/users/ufz/followers","following_url":"https://api.github.com/users/ufz/following{/other_user}","gists_url":"https://api.github.com/users/ufz/gists{/gist_id}","starred_url":"https://api.github.com/users/ufz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufz/subscriptions","organizations_url":"https://api.github.com/users/ufz/orgs","repos_url":"https://api.github.com/users/ufz/repos","events_url":"https://api.github.com/users/ufz/events{/privacy}","received_events_url":"https://api.github.com/users/ufz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ufz/ogs","description":"Experimental OGS-6 source code","fork":false,"url":"https://api.github.com/repos/ufz/ogs","forks_url":"https://api.github.com/repos/ufz/ogs/forks","keys_url":"https://api.github.com/repos/ufz/ogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ufz/ogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ufz/ogs/teams","hooks_url":"https://api.github.com/repos/ufz/ogs/hooks","issue_events_url":"https://api.github.com/repos/ufz/ogs/issues/events{/number}","events_url":"https://api.github.com/repos/ufz/ogs/events","assignees_url":"https://api.github.com/repos/ufz/ogs/assignees{/user}","branches_url":"https://api.github.com/repos/ufz/ogs/branches{/branch}","tags_url":"https://api.github.com/repos/ufz/ogs/tags","blobs_url":"https://api.github.com/repos/ufz/ogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ufz/ogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ufz/ogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ufz/ogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/{sha}","languages_url":"https://api.github.com/repos/ufz/ogs/languages","stargazers_url":"https://api.github.com/repos/ufz/ogs/stargazers","contributors_url":"https://api.github.com/repos/ufz/ogs/contributors","subscribers_url":"https://api.github.com/repos/ufz/ogs/subscribers","subscription_url":"https://api.github.com/repos/ufz/ogs/subscription","commits_url":"https://api.github.com/repos/ufz/ogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ufz/ogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ufz/ogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ufz/ogs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ufz/ogs/contents/{+path}","compare_url":"https://api.github.com/repos/ufz/ogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ufz/ogs/merges","archive_url":"https://api.github.com/repos/ufz/ogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ufz/ogs/downloads","issues_url":"https://api.github.com/repos/ufz/ogs/issues{/number}","pulls_url":"https://api.github.com/repos/ufz/ogs/pulls{/number}","milestones_url":"https://api.github.com/repos/ufz/ogs/milestones{/number}","notifications_url":"https://api.github.com/repos/ufz/ogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ufz/ogs/labels{/name}","releases_url":"https://api.github.com/repos/ufz/ogs/releases{/id}","deployments_url":"https://api.github.com/repos/ufz/ogs/deployments","created_at":"2011-05-04T14:09:57Z","updated_at":"2015-10-23T03:43:52Z","pushed_at":"2016-01-26T08:59:07Z","git_url":"git://github.com/ufz/ogs.git","ssh_url":"git@github.com:ufz/ogs.git","clone_url":"https://github.com/ufz/ogs.git","svn_url":"https://github.com/ufz/ogs","homepage":"www.opengeosys.org","size":12240,"stargazers_count":18,"watchers_count":18,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":84,"forks":39,"open_issues":84,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/990"},"html":{"href":"https://github.com/ufz/ogs/pull/990"},"issue":{"href":"https://api.github.com/repos/ufz/ogs/issues/990"},"comments":{"href":"https://api.github.com/repos/ufz/ogs/issues/990/comments"},"review_comments":{"href":"https://api.github.com/repos/ufz/ogs/pulls/990/comments"},"review_comment":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ufz/ogs/pulls/990/commits"},"statuses":{"href":"https://api.github.com/repos/ufz/ogs/statuses/80d70803267f52a8848e52b3354b400f2604fb94"}}}}