Still looking for output.

Tom G. Smith smitty at kcc.com
Tue Oct 12 12:50:54 EDT 1999


As a quick check I moved -

	cout << "Smitty was here\n";
	cout << "sizeof(vtkUnstructuredGrid) = "
		<< sizeof(vtkUnstructuredGrid) << "\n";

to immediately in front of -

	renWin->Render();

and sure enough, that works.  Now I'll work on changing the dispatching
loop as you described.  Thanks for the help.
> 
> Tom,
> 
> [...]
> > copied graphics/examplesCxx/UGrid.cxx from the vtk 2.4 distribution
> > to my own directory, and added these statements at the end, just
> > before the final closing brace:
> > 	cout << "Smitty was here\n";
> > 	cout << "sizeof(vtkUnstructuredGrid) = " 
> > 		<< sizeof(vtkUnstructuredGrid) << "\n";
> > I can successfully compile my modified UGrid.cxx, and the window titled
> > "Visualization Toolkit - OpenGL" pops open with the image when I run
> > it, but neither "Smitty was here" nor "sizeof(vtkUnstructuredGrid)=nnn"
> > shows up anywhere.  Any ideas where it goes?
> 
> It goes nowhere because it never gets called...
> 
> If I remember correctly, the C++ code never returns from the function
> call to "iren->Start();" (so in fact the clean up code is never called
> either).
> 
> The first thing you would want to do is don't call that method, but then
> you loose Vtk's event processing (i.e. rotation, panning, scaling, etc.).
> 
> Some time ago, Audrius Stundzia + Lisa suggested substituting this line
> by your own event dispatching loop which would allow you to call code
> while maintaining Vtk's standard event processing.
> I'll append that at the end of this email. It may help you.
> 
> I have one question about the code mentioned below though: does anybody
> know how you get the application context from Vtk?
> 
> Bye,
> -- Rob
> 
> [] Robert Belleman         X  Section Computational Science            []
> [] robbel at wins.uva.nl     |X| University of Amsterdam, the Netherlands []
> [] tel: (+31) 20 525 7539  X  http://www.wins.uva.nl/~robbel/          []
> 
> -------------------------------------------------------------------------
> 
> Hi Lisa,
> 
> I celebrated the 4th by solving my problem. I can now have 2 or more
> visualization windows displaying stuff concurrently and interactively
> without
> blocking control. I took your suggestion, then used the X Windows code in
> the User Guide and wrote a modified XtAppMainLoop() in my visualization loop
> that checks whether or not there are any X events pending before calling the
> blocking XtAppNextEvent:
> 
>    pending = XtAppPending( context);
> 
>    if (pending > 0) 
>    {
>       XtAppNextEvent(  context
>                     , &event );
>                  
>       XtDispatchEvent( &event);
>    }
> 
> Thanks again for all your help.
> vtk is great software backed by a great team :)
> 
> Regards, 
> 
> Audrius Stundzia
> 
> IBMG
> 
> On Fri, 02 Jul 1999 15:31:00 -0400, Lisa Sobierajski Avila wrote:
> 
> > Hi Audrius,
> > 
> > >
> > >1. In the event loop, do I just repeatedly call aWindow->Render() for
> each
> > >   graphics pipeline?
> > 
> > No - you would write an event loop for X or Windows (I don't remember if
> > you mentioned with you are using). For example, if you look at the code
> for 
> > XtAppMainLoop() in Xt you would need to do something like that - pull
> > events off the queue and process them in a loop.
> > 
> > >2. Having intialized the interactor, can I use the default interaction
> > >commands     to rotate, zoom, pick, etc.? The impression I get from your
> > >e-mail comment
> > >   "(other than interaction)" is that I can't. I need to interact with
> the 
> > >   actors in the windows esp. rotate and pick.
> > 
> > If you write an event handling loop as mentioned above all registered
> > events would be processed - so you would be able to interact as always in
> > each of the render windows.
> > 
> > 
> > >3. If I can interact with the window, do I have to implement the
> > >appropriate
> > >   interactor callbacks (assuming  #2 is wrong)?
> > >
> > 
> > You only have to implement any specialized ones that you would want. All
> > the standard ones would work (rotate, translate, zoom, pick, etc).
> > 
> > 
> > Lisa
> 
> 
> 
> -----------------------------------------------------------------------------
> This is the private VTK discussion list.  Please keep messages on-topic.
> Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
> <majordomo at gsao.med.ge.com>.  For help, send message body containing
> "info vtkusers" to the same address.     Live long and prosper.
> -----------------------------------------------------------------------------
> 
> 


-- 


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list