[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] Switch off bounding box after pick
From:       "Paul Tait - OPES" <Paul () opes ! com ! au>
Date:       2007-03-30 4:22:32
Message-ID: 034601c77283$098c2450$8d0aa8c0 () VTK
[Download RAW message or body]

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


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>Hi 
All</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=481290704-30032007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>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.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007></SPAN></FONT><FONT 
face=Arial size=2><SPAN class=481290704-30032007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>&nbsp;&nbsp;&nbsp;if 
(0 == 
fpm3d-&gt;Interactor-&gt;GetInteractorStyle()-&gt;GetEnabled())<BR>&nbsp;&nbsp;&nbsp;& \
nbsp;fpm3d-&gt;Interactor-&gt;GetInteractorStyle()-&gt;SetEnabled(1);</SPAN></FONT></DIV><FONT><SPAN \
 class=481290704-30032007>
<DIV><BR><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;fpm3d-&gt;Interactor-&gt;GetInteractorStyle()-&gt;SetEnabled( \
0);<BR>&nbsp;&nbsp;&nbsp;fpm3d-&gt;Interactor-&gt;GetInteractorStyle()-&gt;SetEnabled(1);</FONT></DIV>
 <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=481290704-30032007></SPAN><FONT face=Arial size=2>I<SPAN 
class=481290704-30032007> still think a better solution is needed as many people 
have asked this question in the NG with no answer.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=481290704-30032007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>2 possibilities 
present themselves</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=481290704-30032007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>1. Add a bool to 
vtkInteractorStyle to switch this function off or on</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>2. Some&nbsp;kind 
off callback or event that the user can hook to implement their own 
highlighting</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=481290704-30032007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=481290704-30032007>Paul 
Tait</SPAN></DIV>
<DIV><BR></DIV></FONT></SPAN></FONT></BODY></HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic