[vtkusers] Callback not firing?
Francois Bertel
francois.bertel at kitware.com
Mon Oct 19 14:02:18 EDT 2009
Hello,
The event is listed in the doc, see Events section:
http://www.vtk.org/doc/nightly/html/classvtkInteractorStyleRubberBand2D.html
I agree that every class should clearly document which events it can
invoke. And not only that but also the optional calldata coming with
it: a while ago I ran grep on the VTK source tree to track down all
events invoked with a calldata and I collected the result in the
documentation of vtkCommand. See the part that starts with "Here is
the list of events that may be invoked with a none NULL callData."
http://www.vtk.org/doc/nightly/html/classvtkCommand.html
Regards.
On Mon, Oct 19, 2009 at 1:51 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Mon, Oct 19, 2009 at 10:35 AM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
>> I don't see in your code the line:
>>
>> style->AddObserver(vtkCommand::SelectionChangedEvent,SelectionChangedCallback);
>>
>> The interactor style invokes the event, so you need to attach the
>> callback to it.
>>
>> Jeff
>>
>
> Thanks Jeff - that did it. This is exactly the type of thing I am
> trying to sort out and make examples of for the wiki (although I think
> the better solution is still for better documentation in the classes
> themselves so the doxygen pages contain this type of information).
>
> Another thing: I tried to override this function:
>
> void vtkInteractorStyleRubberBand2D::OnLeftButtonUp()
> {
> vtkstd::cout << "LeftButtonUp!" << vtkstd::endl;
> }
>
> but now when I release the button the rubberband outline is not
> erased. I'm assuming I have to "forward" the event to whichever
> function was going to handle this before I overrode the function - how
> would I find out which function that is / how to do that?
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
More information about the vtkusers
mailing list