[vtkusers] Switch off bounding box after pick

Paul Tait - OPES Paul at opes.com.au
Fri Mar 30 00:22:32 EDT 2007


Hi All
 
Well this has been driving me mad for ages and I've just stumbled on a
simple solution already built into VTK. I searched thru the source tree for
HighlightProp() and found it in vtkInteractorStyle.cxx. I've tried (see
previous posting on subject) calling HighlightProp(NULL) myself but it
didn't work :-( BUT.... then I saw SetEnabled(). The GetEnabled() checks to
see if it has been setup and if not inits it. Now my picked actor shows the
bounding box and then I switch it off. It seems to work fine for me but let
me know if I'm heading for trouble.
 
   if (0 == fpm3d->Interactor->GetInteractorStyle()->GetEnabled())
    fpm3d->Interactor->GetInteractorStyle()->SetEnabled(1);

   fpm3d->Interactor->GetInteractorStyle()->SetEnabled(0);
   fpm3d->Interactor->GetInteractorStyle()->SetEnabled(1);
 
I still think a better solution is needed as many people have asked this
question in the NG with no answer.
 
2 possibilities present themselves
 
1. Add a bool to vtkInteractorStyle to switch this function off or on
2. Some kind off callback or event that the user can hook to implement their
own highlighting
 
Paul Tait

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070330/68a7634e/attachment.htm>


More information about the vtkusers mailing list