[vtk-developers] [Paraview-developers] Moving vtkMemberFunctionCommand to VTK

David Gobbi david.gobbi at gmail.com
Wed Oct 6 09:25:24 EDT 2010


I was wondering about that dynamic_cast but I thought there
was a reason for it... but I can change it to a static_cast
for my commit.

So I'll stage and commit as soon as I can afford a full VTK
rebuild.

  David

On Wed, Oct 6, 2010 at 7:06 AM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> I like your changes. In absence of your changes, if a developer does
> indeed want to achieve same effect he'll be doing something similar
> and will indeed have the onus of worrying about dangling ptrs. So I
> don't think this makes it any more confusing. We should probably add
> documentation to that effect and that pretty much should do it.
>
> About the dynamic_cast, yea static_cast should be fine too and totally
> safe in this case. If the developer was stupid enough to pass in a ptr
> as a wrong type when making the AddObserver call, he deserves the side
> effects :).
>
> I'd vote for committing your changes. (You should use the stage, add
> your commit to the "member_function_observers" branch and then merge
> it in).
>
> Utkarsh
>
> On Wed, Oct 6, 2010 at 8:24 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>> On Wed, Oct 6, 2010 at 6:01 AM, David Doria <daviddoria at gmail.com> wrote:
>>>
>>> David G,
>>>
>>> Are you suggesting this in place of what Utkarsh pushed? Utkarsh, can
>>> you take a look and let David G know if he should push it? I think it
>>> is a good idea to allow event handling from as many places as possible
>>> (i.e. I support NOT requiring the class to derive from vtkObjectBase).
>>
>> I'm just putting it out for discussion.  It does come with some danger,
>> for example you should not use it instead of vtkEventQtSlotConnect,
>> because Qt's signal/slot mechanism is safe, and this is not.  It's only
>> safe when the listener is a vtkObjectBase class.
>>
>>  David
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list