Still looking for output.

Tom G. Smith smitty at kcc.com
Mon Oct 11 18:34:39 EDT 1999


I thought I'd experiment with C++ source, to see if the solution were
any simpler in that language, or perhaps to glean a clue as to what's
going wrong in my Tcl scripts (BTW, I'm working in Linux, RedHat 5.2).
I successfully compiled and ran this program:
	#include <stream.h>
	void main( int argc, char *argv[] )
	{ cout << "Hello, World\n"; }
When I ran it, I got "Hello, World" printed on my display.  Then I
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?
> 
> Hello, Tom,
> 
> no, you're not a pest ;-)  I have only a few month Vtk experience, but
> I'm always happy to help people whenever I can. 
> 
> The problem you are describing is not so much a problem of redirecting
> the output to stdout, but as to what stdout actually is. I'm not sure
> what OS you are using, but with Windows, there effectively is no stdout
> when you double click a .tcl file. When you are using a console (Unix or
> Windows) to start the Tcl script, there is stdout (the console), but you
> normally will not get a chance to interrupt the normal program loop
> (specifically the message loop), and thus you cannot enter those
> commands. Only when the program terminates, you receive control .......
> 
> So, I see only two options: a) embed the commands inside the script, or
> b) use the interacter window as you described.
> 
> Succes, Marc
> 
> ir. Marc Schrijver
> Faculty of Electrical Engineering (S&S NT)
> University of Twente
> The Netherlands
> 
> > ----------
> > From: 	Tom G. Smith[SMTP:smitty at kcc.com]
> > Sent: 	Friday, October 08, 1999 6:09 PM
> > To: 	M.Schrijver at el.utwente.nl
> > Cc: 	vtkusers at gsao.med.ge.com
> > Subject: 	Re: Is there a method cross reference? (fwd)
> > 
> > Thanks for the explanation of ListMethod.  I've now penciled 
> > "ListMethods, page 461" in the margins of the index to "The
> > Visualization
> > Toolkit."  Writing a good index is the hardest part of finishing any
> > book, a discipline in its own right.
> > 
> > I hope I'm not being a pest, but I still have a question about output.
> > In Tcl, is there a way of directing the output of statements 2 and 3
> > in the following code snippet to stdout?  
> > 
> > 1  vtkPolyVertex cells ;# Declare cells to be instance of PolyVertex.
> > 2  cells ListMethods
> > 3  cells Print
> > 
> > The only way I can see the output of such statements is to invoke
> > vtk with e.g. "vtk sample.tcl," press "u" in the rendered window and
> > manually enter them on the interactor command line.  Then the output
> > only shows in the interactor window.
> > 
> > 
> 


-- 


-----------------------------------------------------------------------------
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