[vtkusers] 3D widget causes std::cout::operator<< to malfunction?

tom fogal tfogal at apollo.sr.unh.edu
Mon Nov 8 14:29:52 EST 2004


 <20041108162643.89626.qmail at web60206.mail.yahoo.com>Frederic Perez writes:

<snip>

>-----------------------------------------------------------
>
>#include "vtkCamera.h"
>#include "vtkCellPicker.h"
>#include "vtkImagePlaneWidget.h"
>#include "vtkRenderWindow.h"
>#include "vtkRenderWindowInteractor.h"
>#include "vtkRenderer.h"
>#include "vtkVolume16Reader.h"
>#include "vtkImageData.h"
>#include "vtkRegressionTestImage.h" // for
>vtkTestUtilities::ExpandDataFileName

no "#include <iostream>" ? I would not really on VTK objects to include
the necessary "standard" headers.

>int
>main( int argc, char *argv[] )
>{

<snip>

>  std::cout << "This message appears as expected..." << std::endl;
>  renWin->Render();
>  std::cout 
>   << "...BUT FROM NOW ON std::cout::operator<< DOES NOT WORK!?!?"
>   << std::endl;

weird. Have you tried flushing the stream? I would imagine that a
newline should force the stream to be flushed but maybe something
awkward is happening that is modifying normal stream behavior.

<snip>

>Am I missing something, or doing something wrong?
>Any hint to make std::cout work properly will be much 
>appreciated.

Looks good to me, hopefully its a streambuffering error and the above
fixes it, although I doubt that.

Good luck.

-tom



More information about the vtkusers mailing list