[vtkusers] VTK Mac and Java

Bryan Keller bryan.keller at stanford.edu
Tue Jul 12 14:54:56 EDT 2005


Sean,

Well basically it just didn't work. It would crash on startup. I  
modeled the code after the other wrappers, like VTK Carbon and VTK  
Win32, which don't have separate window handles for the GL view and  
the window, rather just a GL context that belongs to the window. This  
solved a lot of funny behavior with events (resizing, mouse events,  
etc.) once I got the app to start without crashing. I pretty much  
started from scratch with a lot of this, so doing a diff might be a  
painful exercise.

Unless a developer is specifically accessing the Cocoa wrappers  
(which I don't think is a good idea?), compatibility shouldn't be a  
problem...? I've used this Cocoa wrapper implementation with C++ and  
Java, but haven't done much testing w/ Tcl. Python can't use the  
Cocoa wrapper, only Carbon, so I've done no testing there.

Since OS X 10.3, I believe there is no way to use the Carbon wrapper  
with Java, so this is what motivated me to look into this.

I'd love to collaborate on fixing this for everyone so we here at  
Stanford aren't using a one-off tweaked version of VTK to run our  
apps on the Mac.

Bryan

On Jul 12, 2005, at 11:38 AM, Sean McBride wrote:

> On 2005-07-12 10:47, Bryan Keller said:
>
>
>> It seems as though the VTK Mac Java wrapper is pretty broken with the
>> current versions of Mac OS X (the Cocoa wrapper more specifically).
>>
>
> How is it broken?  (I don't doubt you, I'm just asking for details...)
>
>
>> I've overhauled the Cocoa wrapper to make it work. Attached are the
>> Cocoa wrapper files I have modified to get it to work. I tweaked a
>> few other things here and there, but these files are the main ones
>> that changed. Let me know if anyone has problems with it. I'd be
>> happy to fix it for them (and you would be doing me a favor by
>> testing it for me!).
>>
>
> Well, I looked over your changes really fast, and some of them are  
> good
> but some of them bad IMHO.  I mean, you have removed several public
> methods from classes (for example, you removed getVTKRenderWindow from
> vtkCocoaWindow) and so this breaks compatibility in a big way.  I'll
> look over your changes more closely this afternoon.
>
> Anyway, in my opinion, the cocoa stuff in vtk needs work, and I'm glad
> I'm not alone in thinking so.  I have made some changes too (not in
> cvs), but there seems to be few people in the vtk community with the
> time/interest/expertise/whatever to look them over. Since I didn't  
> write
> any of the code, I am hesitant to make significant changes.
>
> Are you interested in collaborating to fix up the cocoa stuff?  I'd  
> like
> to hear the rational for some of your changes....
>
>
>> I have this working with VTK 4.2 and 4.4 (but to
>> get VTK to compile on OS X requires minor tweaks throughout VTK).
>>
>
> The CVS version of vtk builds fine on Mac OS X.  I suggest that if you
> are working on the Mac, to stay away from 4.2 and 4.4.
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
>




More information about the vtkusers mailing list