Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer grid #854

Merged
merged 7 commits into from
Jun 10, 2014
Merged

Viewer grid #854

merged 7 commits into from
Jun 10, 2014

Conversation

johnhaddon
Copy link
Member

This implements the grid for the 3d viewer as required by #41, and also does a bit of restructuring to pave the way for more flexible views and hopefully tools/manipulators at some point.

Note that this does change the API for Gadgets a little - let me know if it impacts existing code and I'll provide backwards compatibility somehow. The only change I think is likely to be a problem is ViewportGadget setChild()/getChild() being replaced with setPrimaryChild()/getPrimaryChild(), but since the only custom views I know of derive from existing views, I doubt they actually call setChild() anyway.

Previously this was only allowed for the ContainerGadget class and derived classes. This was a little odd, as it meant that the ContainerGadget::acceptsChild() implementation was less restrictive than the Gadget::acceptsChild() implementation - the general rule is that derived classes may be more restrictive, but must not accept something the base class can't handle.
It was always strange that NodeGadget should have an is-a relationship with a pretty restrictive container - deriving straight from Gadget makes more sense and provides more flexibility to implementations. It also prevents it from being possible to totally clobber the NodeGadget's implementation by calling setChild( somethingElse ).
These mirror the semantics of the identical methods already existing on the Widget class. Invisible child gadgets are not counted towards the bound of the parent, and do not affect the layout computed by containers.
This allows viewports to have multiple child gadgets, which will make it easier to implement more complex Views, and pave the way for allowing interactive tools like manipulators to add their own content to the viewport.
As per the Node documentation, plugDirtiedSignal() is the appropriate one for observers of a plug to use - it is triggered any time the observable value has changed. This makes the SceneView more robust to having input connections to the grid plug, rather than just having the values set directly.
andrewkaufman added a commit that referenced this pull request Jun 10, 2014
@andrewkaufman andrewkaufman merged commit 742317e into GafferHQ:master Jun 10, 2014
@johnhaddon johnhaddon deleted the viewerGrid branch June 11, 2014 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants