[vtk-developers] [Paraview-developers] Moving vtkMemberFunctionCommand to VTK
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Fri Sep 24 12:38:46 EDT 2010
Couple of suggestions:
1> I think we should change the API to be:
SetCallback(ClassT* ...) rather than SetCallback(ClassT& ..)
That makes the mode more VTK-like when reading:
I'd prefer:
obs->SetCallback(this, &vtkMySelf::CallbackHandler);
to the current implementation i.e.:
obs->SetCallback(*this, &vtkMySelf::CallbackHandler);
2> We should use vtkWeakPointer for the Object ptr, to avoid dangling pointers.
3> The documentation needs to be fixed. Currently there are errors in
it, the usage described does not really match the real usage :).
4> Another possibility is simply moving the code to vtkCommand.h.
Like David said, let's wait a week to see if people respond, otherwise
I will make those changes and move the header to VTK/Common.
Utkarsh
On Fri, Sep 24, 2010 at 11:30 AM, David Doria <daviddoria at gmail.com> wrote:
> On Fri, Sep 24, 2010 at 10:57 AM, David Doria <daviddoria at gmail.com> wrote:
>> A few days ago Pat Marion pointed out on the VTK devel list that
>> ParaView/Servers/Filters/vtkMemberFunctionCommand.h is a great way to
>> catch events with class member functions. I tried it out and it is
>> indeed fantastic! It lets me handle events in a much more structured
>> way.
>>
>> We would like to propose moving this file into VTK so that it can be
>> used by VTK-only applications (without copying the file into each one,
>> as I have been doing :) ). Are there any objections to doing this?
>> Maybe this should actually be done by one of the Paraview devels so
>> that the appropriate changes can be made to Paraview so that it can
>> still see the file properly. Any volunteers?
>>
>> Please let me know what you think.
>>
>> Thanks,
>>
>> David
>>
>> ---------- Forwarded message ----------
>>
>> From: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
>>
>> Date: Fri, Sep 24, 2010 at 11:19 AM
>>
>> Subject: Re: [Paraview-developers] Moving vtkMemberFunctionCommand to VTK
>>
>> To: David Doria <daviddoria at gmail.com>
>>
>> Cc: paraview-developers at paraview.org
>>
>> That sounds like a good idea. However, you may want to raise the
>>
>> question on the vtk-developers list to chalk out a cleaner API. This
>>
>> would the only code in VTK that requires passing (*this) as an
>>
>> argument which may be a bit non-conventional for VTK.
>>
>> Utkarsh
>
> Please see the proposal and discussion above. Utkarsh sounds like he's on
> board with change, but would like to make sure no one has a problem with
> some specifics of the implementation. Would everyone take a look? If we
> don't hear anything by midweek, we'll assume the interface is acceptable and
> proceed with the move.
> Thanks,
>
> David
More information about the vtk-developers
mailing list