Consolidated FilteredSceneProcessor filter access into helper methods.

At a later date this will give us a single place to control the Context in which filter queries are made.
First pass at SetFilter.
Added further unit tests for SetFilter.
Made SetFilter compatible with Isolate and Prune nodes.
Improved FilteredSceneProcessor documentation.
Added UI file for SetFilter.

This includes a useful right click menu for populating the set plug with the names of sets available in the connected scenes.
Replaced custom Filter context with field in standard context.

Now we have an optimised Context implementation, the performance difference appears negligible, and using the standard Context for everything is preferable over having special cases.

I did consider modifying the Context class to allow RunTimeTyped storage rather than just Data storage, so that the scene plug could be stored without encoding as uint64_t, but decided against it. Because RunTimeTyped (or GraphComponent, or Plug) doesn't have a copy() method, it would make implementing the ownership semantics the Context requires impossible, or would require documenting special cases for non-copyable types. It seems preferable to have one nasty isolated cast for an isolated use case than to confuse an API which is central to everything.
Added context argument to FilteredSceneProcessor utility methods.

Since we already have access to the context, it doesn't make sense to pull it out of thread local storage again.
Removed unnecessary Context construction in Prune and Isolate.

Also improved documentation in FilteredSceneProcessor to reduce the chance of doing it again.
Implemented UnionFilter::sceneAffectsMatch().

UnionFilter is now compatible with SetFilter inputs.

Fixes #92.
Fixed deadlock removing input from running InteractiveRender node.

We were calling from Python into C++ by calling ViewportGadget::dropSignal() in GadgetWidget, and that was calling Plug::setInput( NULL ), which would then trigger destruction of the renderer in InteractiveRender, which would then start trying to flush buckets and close display drivers on a background thread, which would end up in GafferDisplayDriver, which would emit dataReceivedSignal() or imageReceivedSignal(), which would attempt to enter into python to call the python slots which were connected, but block because the GadgetWidget thread had the GIL. Fun.

Now releasing the GIL in all signal calls, which fixes this and should prevent a host of similar problems in the future.
Added pausing of interactive renders.

Previously pausing a render just meant that we stopped sending edits, but the render was still happening in the background and taking up valuable cycles. We now pause the renderer itself in addition to not sending edits any more.

Refactored the code a bit to make it all easier to follow. Before, we were changing our internal state and stopping/starting renders in various different signal handlers and it was hard to follow the overall logic. Now we use much simpler signal handlers which just track what has been dirtied, and keep all our update logic in a single update() method, which is hopefully easier to follow.

Fixes #646.
Hid ScriptNode binding internals in an anonymous namespace.
Added GIL release to ScriptNode undo() and redo() bindings.

This fixes a deadlock when an IPR restart was triggered from undo or redo - with the UI holding the GIL on the main thread and the Display node emitting a signal with a python slot attached on a background thread.
Merge pull request #851 from johnhaddon/setFilter

SetFilter
Merge pull request #845 from johnhaddon/iprPause

IPR Pausing
Removed ScriptNode.h include from GafferImage/Format.h

Format _should_ be a simple math class with no knowledge of Nodes or Plugs whatsoever. But until we get that fixed we can at least use a forward declaration to stop it forcing a rebuild of the whole of GafferImage when the ScriptNode header changes.
Fixed circular references within undo system.

These resulted in ScriptNodes never dying, because the Action items in the undo queue held references back to the ScriptNode itself. Because the ScriptNodes weren't dying at shutdown, interactive renders weren't being ended during shutdown either, causing crashes as the background rendering threads tried to continue while everything disappeared around them.

Fixes #397, replacing it with a nice reliable deadlock (#855). Progress!
Removed unnecessary IntrusivePtr usage from Action::enact().

We need to tighten up on this in general, and only use IntrusivePtr where ownership is required.
Fixed PyQt circular references within GafferUI.Menu.

With PySide there appears to be no problem at all with the existing menu code, but PyQt was keeping the slots connected to the menu actions alive forever, even following garbage collection. Since the slots had references to arbitrary curried commands in them, this could actually leak significantly. For instance, the File->OpenRecent menu items contain references to the current script, and this PyQt bug meant that the ScriptNode would never be destroyed. This has dire consequences for proper application shutdown.

It seems that we _can_ trust PyQt to properly manage the lifetime of the QMenu and QAction objects we create, so rather than curry things into the slots called by signals, we now store the menu definitions on the QMenus themselves, and the menu item definitions on the QActions themselves. This also allows us to reduce the number of arguments to __build and __actionTriggered (formerly __commandWrapper).

Fixes #397 for real - previously it was fixed for PySide builds but not it is fixed for PyQt as well.