[vtk-developers] Changes to the Carbon and Cocoa interactors

Sean McBride sean at rogue-research.com
Thu Dec 17 18:42:22 EST 2009

On 12/17/09 9:18 AM, David Gobbi said:

>We just finished a slew of changes to the RenderWindowInteractors for
>Carbon and Cocoa.  The main goal was to fill the missing features of
>these classes wrt the X and Win32 interactors.  People who rely on
>these classes should test them to make sure that their applications
>still behave as expected. Briefly, the new behaviors of these classes
>are as follows:
>1) Mouse behavior: During a drag, MouseMove events continue if the
>drag goes outside the window (carbon didn't do this before).  If no
>mouse buttons are held down, the events cease when the mouse leaves
>the window (cocoa didn't do this before).
>2) EnterEvent and LeaveEvent have been implemented (finally!).
>3) As mentioned in an earlier email, KeySym information is now mostly
>compatible with the X and Win32 interactors and with Tk.


Thanks for posting this notice/warning.  I did a review.  Looks great! 
Some comments/questions/suggestions:

1) these changes could certainly cause compatibility issues (as is often
the case changing superclasses).  Subclasses, like ours, may have
assumed that certain methods inherited from NSView were not overridden. 
For example, before your changes, mouseEntered:, mouseExited:,
resetCursorRects, and flagsChanged: were not implemented in
vtkCocoaGLView and subclasses may have expected the NSView behaviour
(nothing) and now there is some behaviour.  I've updated the
documentation in the .h (which was already out of date, but more so
after your change).  Still, I don't think this would affect many others,
except perhaps the OsiriX folks.

2) is clearTrackingRect a public API?  If not, we should not declare it
in the .h.

3) rolloverTrackingRectTag should not be int, but NSTrackingRectTag (not
the same on 64 bit).

4) why does 'altDown' match both command and option keys?

5) there were a few spots where you sent 'frame' without ensuring that
the pointer was non-nil.  Messaging nil returns undefined structures.  I
added checks for paranoia's sake. :)

6) I made other minor changes.

My changes are attached, I have not committed to CVS.  Can you review first?

Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Archive.zip
Type: application/zip
Size: 14020 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091217/bbf7609b/attachment-0001.zip>

More information about the vtk-developers mailing list