[vtkusers] Re: CocoaWindow.h/mm incomplete

Sean McBride sean at rogue-research.com
Fri Nov 25 17:07:34 EST 2005


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





More information about the vtkusers mailing list