{"action":"created","comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/42211700","id":42211700,"diff_hunk":"@@ -196,7 +198,7 @@ public DefaultWatch3DViewModel(Watch3DViewModelStartupParams parameters)\n             TogglePanCommand = new DelegateCommand(TogglePan, CanTogglePan);\n             ToggleOrbitCommand = new DelegateCommand(ToggleOrbit, CanToggleOrbit);\n             ToggleCanNavigateBackgroundCommand = new DelegateCommand(ToggleCanNavigateBackground, CanToggleCanNavigateBackground);\n-\n+            ZoomToFitCommand = new DelegateCommand(ZoomToFit, CanZoomToFit);","path":"src/DynamoCoreWpf/ViewModels/Watch3D/DefaultWatch3DViewModel.cs","position":14,"original_position":14,"commit_id":"9acd9d1cca12ffa27c77114458a0c7f502a893c1","original_commit_id":"9acd9d1cca12ffa27c77114458a0c7f502a893c1","user":{"login":"ikeough","id":1139788,"avatar_url":"https://avatars.githubusercontent.com/u/1139788?v=3","gravatar_id":"","url":"https://api.github.com/users/ikeough","html_url":"https://github.com/ikeough","followers_url":"https://api.github.com/users/ikeough/followers","following_url":"https://api.github.com/users/ikeough/following{/other_user}","gists_url":"https://api.github.com/users/ikeough/gists{/gist_id}","starred_url":"https://api.github.com/users/ikeough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikeough/subscriptions","organizations_url":"https://api.github.com/users/ikeough/orgs","repos_url":"https://api.github.com/users/ikeough/repos","events_url":"https://api.github.com/users/ikeough/events{/privacy}","received_events_url":"https://api.github.com/users/ikeough/received_events","type":"User","site_admin":false},"body":"ZoomToFit is now a command on the view model instead of a click event handler in the view's code behind.","created_at":"2015-10-16T06:18:05Z","updated_at":"2015-10-16T06:18:05Z","html_url":"https://github.com/DynamoDS/Dynamo/pull/5539#discussion_r42211700","pull_request_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539","_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/42211700"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/5539#discussion_r42211700"},"pull_request":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539"}}},"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539","id":47873046,"html_url":"https://github.com/DynamoDS/Dynamo/pull/5539","diff_url":"https://github.com/DynamoDS/Dynamo/pull/5539.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/5539.patch","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5539","number":5539,"state":"open","locked":false,"title":"MAGN-7851, MAGN-8334","user":{"login":"ikeough","id":1139788,"avatar_url":"https://avatars.githubusercontent.com/u/1139788?v=3","gravatar_id":"","url":"https://api.github.com/users/ikeough","html_url":"https://github.com/ikeough","followers_url":"https://api.github.com/users/ikeough/followers","following_url":"https://api.github.com/users/ikeough/following{/other_user}","gists_url":"https://api.github.com/users/ikeough/gists{/gist_id}","starred_url":"https://api.github.com/users/ikeough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikeough/subscriptions","organizations_url":"https://api.github.com/users/ikeough/orgs","repos_url":"https://api.github.com/users/ikeough/repos","events_url":"https://api.github.com/users/ikeough/events{/privacy}","received_events_url":"https://api.github.com/users/ikeough/received_events","type":"User","site_admin":false},"body":"### Purpose\r\n\r\nThis PR addresses [MAGN-7851](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-7851) and [MAGN-8334](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-8334).\r\n\r\nFor MAGN-7851, we've added a new method to calculate the near and far clip plane distances to accurately encapsulate the scene, `HelixWatch3DViewModel.ComputeClipPlaneDistances(...)`. Previously, when a object far away was added to Dynamo, the near clip plane would adjust to a high value, and the near geometries would get clipped.\r\n\r\nFor MAGN-8334, it was found while fixing MAGN-7851, that the HelixToolkit was not properly calculating the bounds for `GeometryModel3D` objects whose geometry was updated. This was most obvious when placing a series of points in Dynamo. The `Bounds` property for the `PointGeometryModel3D` object would only return the bounds of the first point in the series. What's worse is that, because it's a point, the bounds would return a zero-size bounding box. An extension method, `GeometryModel3D.Bounds()` has been added which correctly calculates the bounds of point objects AND adds sizes the bounds so that the point is in the middle and the bounds have a size of 5 units. \r\n\r\n### Bonus Feature\r\nFYI @Racel @lillismith \r\nWhen fixing MAGN-7851 it was impossible to test whether the clip planes were working, because we could not zoom to fit around and object way out in space. This PR also adds overload functionality to the \"Zoom to Fit\" functionality. The Zoom to Fit modes are now as follows:\r\n- Zoom to Fit with nothing selected. Zooms to fit all geometry.\r\n- Zoom to Fit with nodes selected. Zooms to fit around geometry from the selected nodes.\r\nThe zoom to fit operation already re-centered the point of rotation, so you are now able to zoom to very remote objects and tumble them view around their center.\r\n\r\n### Declarations\r\n\r\nCheck these if you believe they are true\r\n\r\n- [x] The code base is in a better state after this PR\r\n- [x] Is documented according to the [standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)\r\n- [x] The level of testing this PR includes is appropriate\r\n- [x] User facing strings, if any, are extracted into `*.resx` files\r\n  - No new user-facing strings added.\r\n\r\n### Reviewers\r\n\r\n@ramramps ","created_at":"2015-10-16T05:45:11Z","updated_at":"2015-10-16T06:18:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"855e9587026ef6c6332cb809627ae52ae787bf8f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539/commits","review_comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539/comments","review_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5539/comments","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/9acd9d1cca12ffa27c77114458a0c7f502a893c1","head":{"label":"ikeough:MAGN-7851","ref":"MAGN-7851","sha":"9acd9d1cca12ffa27c77114458a0c7f502a893c1","user":{"login":"ikeough","id":1139788,"avatar_url":"https://avatars.githubusercontent.com/u/1139788?v=3","gravatar_id":"","url":"https://api.github.com/users/ikeough","html_url":"https://github.com/ikeough","followers_url":"https://api.github.com/users/ikeough/followers","following_url":"https://api.github.com/users/ikeough/following{/other_user}","gists_url":"https://api.github.com/users/ikeough/gists{/gist_id}","starred_url":"https://api.github.com/users/ikeough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikeough/subscriptions","organizations_url":"https://api.github.com/users/ikeough/orgs","repos_url":"https://api.github.com/users/ikeough/repos","events_url":"https://api.github.com/users/ikeough/events{/privacy}","received_events_url":"https://api.github.com/users/ikeough/received_events","type":"User","site_admin":false},"repo":{"id":37068216,"name":"Dynamo","full_name":"ikeough/Dynamo","owner":{"login":"ikeough","id":1139788,"avatar_url":"https://avatars.githubusercontent.com/u/1139788?v=3","gravatar_id":"","url":"https://api.github.com/users/ikeough","html_url":"https://github.com/ikeough","followers_url":"https://api.github.com/users/ikeough/followers","following_url":"https://api.github.com/users/ikeough/following{/other_user}","gists_url":"https://api.github.com/users/ikeough/gists{/gist_id}","starred_url":"https://api.github.com/users/ikeough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikeough/subscriptions","organizations_url":"https://api.github.com/users/ikeough/orgs","repos_url":"https://api.github.com/users/ikeough/repos","events_url":"https://api.github.com/users/ikeough/events{/privacy}","received_events_url":"https://api.github.com/users/ikeough/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ikeough/Dynamo","description":"Visual Programming","fork":true,"url":"https://api.github.com/repos/ikeough/Dynamo","forks_url":"https://api.github.com/repos/ikeough/Dynamo/forks","keys_url":"https://api.github.com/repos/ikeough/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ikeough/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ikeough/Dynamo/teams","hooks_url":"https://api.github.com/repos/ikeough/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/ikeough/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/ikeough/Dynamo/events","assignees_url":"https://api.github.com/repos/ikeough/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/ikeough/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/ikeough/Dynamo/tags","blobs_url":"https://api.github.com/repos/ikeough/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ikeough/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ikeough/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ikeough/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ikeough/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/ikeough/Dynamo/languages","stargazers_url":"https://api.github.com/repos/ikeough/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/ikeough/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/ikeough/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/ikeough/Dynamo/subscription","commits_url":"https://api.github.com/repos/ikeough/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ikeough/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ikeough/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ikeough/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ikeough/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/ikeough/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ikeough/Dynamo/merges","archive_url":"https://api.github.com/repos/ikeough/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ikeough/Dynamo/downloads","issues_url":"https://api.github.com/repos/ikeough/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/ikeough/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/ikeough/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/ikeough/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ikeough/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/ikeough/Dynamo/releases{/id}","created_at":"2015-06-08T13:21:59Z","updated_at":"2015-08-04T20:52:36Z","pushed_at":"2015-10-16T06:17:06Z","git_url":"git://github.com/ikeough/Dynamo.git","ssh_url":"git@github.com:ikeough/Dynamo.git","clone_url":"https://github.com/ikeough/Dynamo.git","svn_url":"https://github.com/ikeough/Dynamo","homepage":"http://dynamobim.org","size":814373,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"DynamoDS:master","ref":"master","sha":"cebed15d1abe1fd8dd0f194e25e87d18286cebaa","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Visual Programming","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","created_at":"2012-02-09T07:35:33Z","updated_at":"2015-10-16T00:31:17Z","pushed_at":"2015-10-16T06:17:07Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":1050149,"stargazers_count":280,"watchers_count":280,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":206,"mirror_url":null,"open_issues_count":776,"forks":206,"open_issues":776,"watchers":280,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/5539"},"issue":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5539"},"comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5539/comments"},"review_comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539/comments"},"review_comment":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5539/commits"},"statuses":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/9acd9d1cca12ffa27c77114458a0c7f502a893c1"}}}}