[vtkusers] vtkInteractorStyleUser

Jim Peterson jimcp at cox.net
Tue Sep 14 19:38:36 EDT 2010


David Gobbi wrote:
> On Tue, Sep 14, 2010 at 3:05 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>
>   
>> Thanks Jim. So in summary vtkInteractorStyleUser is old and it is no
>> different than any other vtkInteractorStyle* . To use it, one should just
>> use observers like this :
>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/InteractorStyleUser
>> Would someone be so kind as to post an example of how to use observers (or
>> otherwise handle interaction) in Python?
>> Thanks,
>>     
>
> The vtkInteractorStyleUser is still the correct way to write a fully
> customized vtkInteractorStyle in the wrapper languages.  It isn't the
> only option, i.e. you can add observers to the other interactor
> styles, but it is different from the rest because it doesn't define
> any "default" interaction of its own.
>
>   David
>
>   
Thanks David,
ok, so in either case the way to get control at an event is to use the 
correct AddObserver event for the kind of interaction you want. the 
vtkInteractorStyleUser defers all actions to the observer events with no 
predefined actions.
So we are back to the only issue is the documentation of the obsolete 
Set...Method functions in vtkInteractorStyleUser.h.

Somebody really in the know needs to verify, but I don't believe there 
is a generic ButtonPressEvent, so the sentence is irrelevent. My vote 
would be to just remove the text about the Set... methods.

There are currently 16 predefined Interactor Styles, I have some 
research to do on those before I find I need to make a complete new one....

David Doria:

I would say the wiki example at least needs to say that when using the 
vtkInteractorStyleUser, all of the following events need to be handled 
if any interaction associated with them is desired:

     KeyPressEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe390599123e44f34034dd30fcae048236> 
    ConfigureEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe58f1fea8a64bcec48501116b478482f9> 
    MiddleButtonPressEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe8a3ef39c3fbb4d5a14a33a6b35773a14> 
    KeyReleaseEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fecd2612eb610e045f42441c9fa3c0c6c8> 
    UserEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fee177709a43a6bf74fa59806c157bd17f> 
    EnterEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe2d6f4e79ae638b37c82b9fbdd5379ab3> 
    MiddleButtonReleaseEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe7773b85fe1779cb53337246a9b9b24e8> 
    RightButtonPressEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe523dbba29689dac3c4e169e69f36bffa>  
    MouseMoveEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe014451a9f3dbfeba45c6c6c63b4c61eb> 
    ExposeEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fedd5b9b9b3b6ad72cca13b1489d6f164c> 
    TimerEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe8e9a017e5f6b3a3e543b10d54ddc8f11> 
    LeftButtonPressEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8febf5bb1f44f59aa539be7d61e42693923> 
    RightButtonReleaseEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8feffb66a85dad0f65c6d82a0b8345a7e7f> 
    LeaveEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe1221eea9de09abe23e4dd054d8cafa31> 
    LeftButtonReleaseEvent
    <a00332.html#59a8690330ebcb1af6b66b0f3121f8fe9f5bb78d69ea168492a544c1ebc5248c>

With a special note regarding 
<a00332.html#59a8690330ebcb1af6b66b0f3121f8fee18817d71f444c6338c50dcaa64762f8>
        CharEvent 
<a00332.html#59a8690330ebcb1af6b66b0f3121f8fee18817d71f444c6338c50dcaa64762f8>

I think if the user provides CharEvent observer, the 
vtkInteractorStyleUser doc might need to be remind them to handle the 
'q' 'Q' 'e' and 'E' keys since that looks like the only way to the 
window from vtkInteractorStyle.cxx.

Also, at a more general level,  I cannot find any external documentation 
for the ExitEvent observer, but it appears if one of those is defined, 
it will generally replace the TerminateApp() call in the respective 
RenderWindowInteractor.

Jim


Jim



More information about the vtkusers mailing list