[vtkusers] Re: CocoaWindow.h/mm incomplete
Mike Jackson
maillist at bluequartz.net
Fri Nov 25 20:06:51 EST 2005
On Nov 25, 2005, at 5:07 PM, Sean McBride wrote:
> On 2005-11-25 14:35, Mike Jackson said:
>
>> OK. I got the IB stuff hooked up, but now when trying to reuse my
>> code from the VTK4 days I am getting some compile errors. Now the
>> errors are pretty self explanatory. What I am not quite getting is
>> just how the "real" mac world is creating a VTK App.
>> Are you subclassing vtkCocoaGLView to add in things like setting the
>> Interactor Style?
>
> hmmm, it's been a while since I've looked at that code... let's
> see... I
> subclassed vtkCocoaGLView and added this method:
>
> - (void)finalInit
> {
> ren = vtkRenderer::New();
> renWin = vtkRenderWindow::New();
> renWinInt = vtkRenderWindowInteractor::New();
>
> renWin->SetWindowId([self window]);
> renWin->SetDisplayId(self);
>
> renWin->AddRenderer(ren);
> renWinInt->SetRenderWindow(renWin);
>
> [self setVTKRenderWindow:(vtkCocoaRenderWindow*)renWin];
>
> renWinInt->Initialize();
> }
>
> Then in my NSDocument subclass's windowControllerDidLoadNib I call
> [theVTKView finalInit]. The above code is very important, and is
> needed
> to set everything up.
>
> I hope this info clears things up. Maybe next week I'll create a
> simple
> sample Xcode project to share with everyone.
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng sean at rogue-research.com
> Rogue Research www.rogue-research.com
> Mac Software Developer Montréal, Québec, Canada
>
>
>
Thanks for the help. I finally got things working. I ended up doing
close to what you were doing above. I ended up implementing the
constructor initWithFrame() and did the first part of your code in
there. Then added the "finalInit" method for the second half.
Thanks again for the help. Now back to the vtkConnectivityFilter
problem.
---
Mike Jackson
mike _at_ bluequartz dot net
More information about the vtkusers
mailing list