Skip to content

IViewExtension and other infrastructure changes in Dynamo to support DM extension#5314

Merged
aparajit-pratap merged 18 commits intoDynamoDS:masterfrom
aparajit-pratap:dirManExtension
Sep 25, 2015
Merged

IViewExtension and other infrastructure changes in Dynamo to support DM extension#5314
aparajit-pratap merged 18 commits intoDynamoDS:masterfrom
aparajit-pratap:dirManExtension

Conversation

@aparajit-pratap
Copy link
Contributor

Purpose

This PR is to support the following tasks:
http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-8041
http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-8042

This PR makes few changes to API's in support for DM feature as an IViewExtension. Please refer to associated PR for the Extension implementation here.

A new event is introduced in NodeModel called OnRequestRenderPackages to request for additional render packages for the node when it is updated. This is called in OnRenderPackageUpdateCompleted. OnRequestRenderPackages returns with additional RP's if available and these are aggregated with the node's RP's before being sent to Watch3DViewModelBase to handle for rendering.

A new event SelectionCollectionChanged is introduced in ViewLoadedParams so that it can be subscribed to by the new IViewExtension for node selection/de-selection events in the worskpace.

Impact assessment

  • Changes a public interface

Added a new interface, IWatch3DView to expose a limited set of methods/properties to extensions like DM Extension. This interface is exposed to the external IViewExtension through the BackgroundPreView property via ViewLoadedParams.

HelixWatchViewModel.DeleteGeometryForIdentifier() access has been changed from protected to internal as it is called from Watch3DView in order to implement the IWatch3DView interface method for use in the extension.

@ikeough is there a better way to update the Model3DDictionary outside of HelixWatchViewModel?

References (FILL ME IN)

  • Link to architectural design
    image

Reviewers

@ikeough Reviewer 1
@pboyer Reviewer 2

FYIs

@benglin

@aparajit-pratap aparajit-pratap added the DNM Do not merge. For PRs. label Sep 18, 2015
@aparajit-pratap aparajit-pratap changed the title Support for Direct Manipulation as an IViewExtension in Dynamo IViewExtension and other infrastructure changes in Dynamo to support DM extension Sep 18, 2015
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing the selection changed event through ViewLoadedParams so that it can register with and handled by DMExtension. See PR: https://git.autodesk.com/Dynamo/DynamoPro/pull/178

@ikeough
Copy link
Contributor

ikeough commented Sep 18, 2015

@aparajit-pratap I know you're filling in the details, but there are few places where you are making public things that were not designed to be public. Can you provide in your details a high-level explanation of what you need your view extension to do, and what you need it to have access to? It is quite possible that we can implement an interface which meets your requirements without having to expose a Watch3DView object which brings Helix along with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this additional matrix transformation here as the model up vector being used in Dynamo is flipped wrt the default up vector in Helix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just fix the up vector thing now? I don't want to have to keep putting kludges in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing Watch3DView as an IWatch3DView property in ViewLoadedParams class so that it can be passed to DMExtension.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment below regarding moving this interface to the view model instead. That way we get access to the Watch3DViewModel that we need through the DynamoViewModel which we already have :)

@pboyer
Copy link
Contributor

pboyer commented Sep 22, 2015

@aparajit-pratap I'll largely defer to @ikeough for this review as it touches a lot of the helix stuff, it seems. Make sure your code matches the coding standards:

https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these methods just call methods on the view model, I propose that instead of implementing the IWatch3DView interface on the view, you do it on the view model. So, make it IWatch3DViewModel. Make Watch3DViewModelBase : IWatch3DViewModel, and get access to the Watch3DViewModel you want to include in the LoadedParams through the DynamoViewModel.Watch3DViewModels property. DynamoViewModel is already provided as part of the loaded params.

@aparajit-pratap
Copy link
Contributor Author

@ikeough I agree with your idea of creating an IWatch3DViewModel rather than a IWatch3DView. I'm creating a separate task for this and submitting this PR for the time-being. Thanks.

aparajit-pratap added a commit that referenced this pull request Sep 25, 2015
IViewExtension and other infrastructure changes in Dynamo to support DM extension
@aparajit-pratap aparajit-pratap merged commit 8927583 into DynamoDS:master Sep 25, 2015
@aparajit-pratap aparajit-pratap deleted the dirManExtension branch September 28, 2015 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DNM Do not merge. For PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants