vtkInteractor question..

Miller, James V (CRD) millerjv at crd.ge.com
Thu Jul 29 09:28:16 EDT 1999


Try setting the ExitMethod() on the interactor to one of you own functions.  If the ExitMethod is
set, it is instead of calling exit().  This will at least handle the case of not exiting when the "e"
or "q" key is pressed in the window.  I am not sure what the chain of events are that occur when the
window is killed using the button in the upper left.  
 
Subclassing the Interactor is the way to go.  The super class has two virtual functions: Enable() and
Disable() which are called to insert and remove the appropriate callback function.  In you subclass
of the interactor, all you need to do is override Enable() and Disable() such they insert/remove your
specific callback function.  
 
Note that you do not have to have your callback function handle everything.  Your callback can be
setup to handle just those events that you want to handle differently than the superclass.  If the
event is not one of the types you want to handle, you can then pass control to the default callback
(by calling it directly and passing the input parameters to your callback down to it).
 
If all you want to do is override the mouse bindings, you may not need to subclass the interactor at
all.  You can setup callback functions for the button press/release methods directly from the
interactor API. If any of these are set, they are called instead of using the default behavior.  This
is useful if you want to allow people to rotate an object by not translate it, etc....
 
 

-----Original Message-----
From: K.R.Subramanian [mailto:krs at zappa.uncc.edu]
Sent: Wednesday, July 28, 1999 6:32 PM
To: VTK HELP
Subject: vtkInteractor question..



I am spawning multiple windows with associated interactors as part of the application. However 
killing any one of the windows destroys the entire application. Is killing the window (using the kill

button on upper left of window) equivalent to calling the exit function of the interactor, which, if 
not defined, calls the Unix exit() method, terminating the application?  I would like to be able to 
delete the windows without exiting the application. 


Also, if I would like to redefine the keyboard or mouse bindings of the interactor, is subclassing 
the  vtkXRenderWindowInteractor and overriding the XRenderWindowInteractorCallback function 
the way to go? 


Thanks. 


    -- krs 

-- 

K.R.Subramanian                           Phone: (704) 547-4872

Department of Computer Science            FAX:   (704) 547-3516

UNC Charlotte                             Email: krs at cs.uncc.edu

9201 Univ. City Blvd.                     WWW:  http://www.cs.uncc.edu/~krs
<http://www.cs.uncc.edu/~krs> 

Charlotte, NC 28223-0001
  



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list