[vtk-developers] Patch to modernize Widgets/Testing/Cxx

Bill Lorensen bill.lorensen at gmail.com
Thu Sep 2 09:09:44 EDT 2010


That sounds much better. Let's chew on it a bit more.

Bill

On Thu, Sep 2, 2010 at 8:17 AM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> 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.
>
> 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.
>
> Would that be better ?
>
> thanks
> --
> karthik
>
> On Thu, Sep 2, 2010 at 5:36 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>>
>> Karthik,
>>
>> If we add the addition Start method to vtkTestingInteractor, then we
>> should add the same method (perhaps a dummy method) to
>> vtkRenderWindowInteractor. The idea is that the test/example should
>> look the same whether run as a test or as an example.
>>
>> Bill
>>
>> On Tue, Aug 31, 2010 at 2:09 AM, Karthik Krishnan
>> <karthik.krishnan at kitware.com> wrote:
>> > On Tue, Aug 24, 2010 at 2:24 AM, Bill Lorensen <bill.lorensen at gmail.com>
>> > wrote:
>> >>
>> >> Karthik,
>> >>
>> >> I'm trying to complete a project I started last year to modernize the
>> >> vtk cxx tests. I have gone through all of the Widgets cxx tests and
>> >> changed them to use smart pointers and the vtkTestingInteractor.  This
>> >> reduces the number of lines in each test and makes them more readable.
>> >>
>> >> Can you apply the attached patch and give me some feedback? Marcus is
>> >> also working to modernize the Charts testing.
>> >>
>> >
>> > Thanks Bill.
>> >
>> > I'll submit this after my experimental build ends  up nice and green.
>> >
>> > In addition to your attached patch, I'll also try and trim it a bit more
>> > but
>> > I was hoping to get some feedback.
>> >
>> > (a) I'd also like to replace lines of the form
>> >
>> >   vtkSmartPointer<vtkInteractorEventRecorder> recorder =
>> >     vtkSmartPointer<vtkInteractorEventRecorder>::New();
>> >   recorder->SetInteractor(iren);
>> >   recorder->ReadFromInputStringOn();
>> >   recorder->SetInputString(BoxWidgetEventLog2);
>> >   recorder->Play();
>> >   recorder->Off();
>> >   iren->Start();
>> >   return EXIT_SUCCESS;
>> >
>> > with just
>> >
>> >   return vtkTesting::InteractorEventLoop( argc, argv, iren,
>> > BoxWidgetEventLog2 );
>> >
>> > Perhaps we should move that recorder stuff into vtkTestingInteractor
>> > instead; something like
>> >   iren->Start(BoxWidgetEventLog2)
>> >
>> > It would also be great to pass the event log as a command line; I'll try
>> > and
>> > submit a patch ?
>> >
>> > Thanks
>> > --
>> > karthik
>> >
>
>



More information about the vtk-developers mailing list