[vtkusers] how to reset input to a writer?
Dean Inglis
dean.inglis at on.aibn.com
Wed Jul 10 11:22:37 EDT 2002
Hi,
I tried this question last month without success and now it has come up
again.
I'm building movie frame generator functionality into an (not available yet)
interactor event recorder that writes the playback of previously recorded
events to a numbered sequence of bitmap images. The pipeline consists of:
vtkWindowToImageFilter wif
vtkBMPWriter bmpWriter
The interactor event recorder (this) owns the wif and the bmpWriter and a
reference to a vtkRenderWindowInteractor:
Prior to start of the playback loop:
if ( this->RecordMovie )
{
this->wif->SetInput((vtkWindow*)this->Interactor->GetRenderWindow());
this->FrameNumber = 0;
}
within the playback loop:
while ( reading_events_from_a_file )
{
get_event_info_from_file();
make_interactor_invoke_event();
if (this_is_a_movie_recordable_event)
{
this->bmpWriter->SetInput(this->wif->GetOutput());
char* name = create_a_movie_file_name(this->FrameNumber);
this->bmpWriter->SetFileName(name);
this->bmpWriter->Write();
delete [] name;
this->FrameNumber++;
}
}
The problem is that the images are all the same: bmpWriter doesn't change
its input.
How do I 'reset' the bmpWriter/wif pair to update?
Dean
More information about the vtkusers
mailing list