My mistake, did not think it through. The existing iren->Start() could take care of the event recording and playback as well... depending on whether -I, --DisableReplay, --Record flags are set.<br><br>The parsing of the command line arguments would be done in the CMAKE_TEST_DRIVER_BEFORE_MAIN thing.. and appropriate the switches set on vtkTestingInteractor so it can do the playback -or- record -or- interactive_mode_w/wo_playback. That would get necessitate moving all those long eventlog strings into VTKData first.<br>
<br>Would that be better ?<br><br>thanks<br>--<br>karthik<br><br><div class="gmail_quote">On Thu, Sep 2, 2010 at 5:36 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Karthik,<br>
<br>
If we add the addition Start method to vtkTestingInteractor, then we<br>
should add the same method (perhaps a dummy method) to<br>
vtkRenderWindowInteractor. The idea is that the test/example should<br>
look the same whether run as a test or as an example.<br>
<br>
Bill<br>
<br>
On Tue, Aug 31, 2010 at 2:09 AM, Karthik Krishnan<br>
<div class="im"><<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> On Tue, Aug 24, 2010 at 2:24 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Karthik,<br>
>><br>
>> I'm trying to complete a project I started last year to modernize the<br>
>> vtk cxx tests. I have gone through all of the Widgets cxx tests and<br>
>> changed them to use smart pointers and the vtkTestingInteractor. This<br>
>> reduces the number of lines in each test and makes them more readable.<br>
>><br>
>> Can you apply the attached patch and give me some feedback? Marcus is<br>
>> also working to modernize the Charts testing.<br>
>><br>
><br>
> Thanks Bill.<br>
><br>
> I'll submit this after my experimental build ends up nice and green.<br>
><br>
> In addition to your attached patch, I'll also try and trim it a bit more but<br>
> I was hoping to get some feedback.<br>
><br>
> (a) I'd also like to replace lines of the form<br>
><br>
> vtkSmartPointer<vtkInteractorEventRecorder> recorder =<br>
> vtkSmartPointer<vtkInteractorEventRecorder>::New();<br>
> recorder->SetInteractor(iren);<br>
> recorder->ReadFromInputStringOn();<br>
> recorder->SetInputString(BoxWidgetEventLog2);<br>
> recorder->Play();<br>
> recorder->Off();<br>
> iren->Start();<br>
> return EXIT_SUCCESS;<br>
><br>
> with just<br>
><br>
> return vtkTesting::InteractorEventLoop( argc, argv, iren,<br>
> BoxWidgetEventLog2 );<br>
><br>
> Perhaps we should move that recorder stuff into vtkTestingInteractor<br>
> instead; something like<br>
> iren->Start(BoxWidgetEventLog2)<br>
><br>
> It would also be great to pass the event log as a command line; I'll try and<br>
> submit a patch ?<br>
><br>
> Thanks<br>
> --<br>
> karthik<br>
><br>
</div></div></blockquote></div><br>