[vtkusers] Inheritance of QVTKInteractor under Python

Andrea Borsic Andrea.Borsic at Dartmouth.edu
Fri May 18 06:23:56 EDT 2012


Hi,

Just a follow up message: in VTK 5.10 with SIP Python wrapping the 
QVTKInteractor()  is now inheriting all the methods of 
vtkRenderWindowInteractor(), in other words things work fine.

Best Regards,

Andrea


On 5/7/2012 8:34 PM, Andrea Borsic wrote:
> Hi,
>
> I am using VTK 5.8 under Windows 7 64bit and OSX Lion, wrapped for 
> Python with SIP.
>
> Under both platforms I am unable to add observers to QVTKInteractor as 
> the method .AddObserver appears not to be an attribute of the class, 
> even though the class is derived from vtkRenderWindowInteractor.
>
> For example this small test program:
>
> import vtk
>
> a = vtk.QVTKInteractor()
> dir(a)
>
> results in:
>
>  ['ContextMenuEvent', 'DragEnterEvent', 'DragLeaveEvent', 
> 'DragMoveEvent', 'DropEvent', 'GetClassName', 'Initialize', 'IsA', 
> 'Start', 'StartListening', 'StopListening', 'TerminateApp', 'TimerEvent']
>
> while
>
> b = vtk.vtkRenderWindowInteractor()
> dir(b)
>
> results in:
>
> ['AddObserver', 'BreakOnError', 'CharEvent', 'ConfigureEvent', 
> 'CreateDefaultPicker', 'CreateOneShotTimer', 'CreateRepeatingTimer', 
> 'CreateTimer', 'DebugOff', 'DebugOn', 'DestroyTimer', 'Disable', 
> 'Enable', 'EnableRenderOff', 'EnableRenderOn', 'EndPickCallback', 
> 'EnterEvent', 'ExitCallback', 'ExitEvent', 'ExposeEvent', 
> 'FastDelete', 'FindPokedRenderer', 'FlyTo', 'FlyToImage', 
> 'GetAddressAsString', 'GetAltKey', 'GetClassName', 'GetControlKey', 
> 'GetDebug', 'GetDesiredUpdateRate', 'GetDesiredUpdateRateMaxValue', 
> 'GetDesiredUpdateRateMinValue', 'GetDolly', 'GetEnableRender', 
> 'GetEnabled', 'GetEventPosition', 'GetEventSize', 
> 'GetGlobalWarningDisplay', 'GetInitialized', 'GetInstallMessageProc', 
> 'GetInteractorStyle', 'GetKeyCode', 'GetKeySym', 
> 'GetLastEventPosition', 'GetLightFollowCamera', 'GetMTime', 
> 'GetNumberOfFlyFrames', 'GetNumberOfFlyFramesMaxValue', 
> 'GetNumberOfFlyFramesMinValue', 'GetObserverMediator', 'GetPicker', 
> 'GetReferenceCount', 'GetRenderWindow', 'GetRepeatCount', 
> 'GetShiftKey', 'GetSize', 'GetStillUpdateRate', 
> 'GetStillUpdateRateMaxValue', 'GetStillUpdateRateMinValue', 
> 'GetTimerDuration', 'GetTimerDurationMaxValue', 
> 'GetTimerDurationMinValue', 'GetTimerEventDuration', 
> 'GetTimerEventId', 'GetTimerEventPlatformId', 'GetTimerEventType', 
> 'GetUseTDx', 'GetVTKTimerId', 'GlobalWarningDisplayOff', 
> 'GlobalWarningDisplayOn', 'HasObserver', 'HideCursor', 'Initialize', 
> 'InstallMessageProcOff', 'InstallMessageProcOn', 'InvokeEvent', 'IsA', 
> 'IsOneShotTimer', 'IsTypeOf', 'KeyPressEvent', 'KeyReleaseEvent', 
> 'LeaveEvent', 'LeftButtonPressEvent', 'LeftButtonReleaseEvent', 
> 'LightFollowCameraOff', 'LightFollowCameraOn', 
> 'MiddleButtonPressEvent', 'MiddleButtonReleaseEvent', 'Modified', 
> 'MouseMoveEvent', 'MouseWheelBackwardEvent', 'MouseWheelForwardEvent', 
> 'NewInstance', 'OneShotTimer', 'PrintRevisions', 'ReInitialize', 
> 'Register', 'RemoveAllObservers', 'RemoveObserver', 'RemoveObservers', 
> 'Render', 'RepeatingTimer', 'ResetTimer', 'RightButtonPressEvent', 
> 'RightButtonReleaseEvent', 'SafeDownCast', 'SetAltKey', 
> 'SetClassExitMethod', 'SetControlKey', 'SetDebug', 
> 'SetDesiredUpdateRate', 'SetDolly', 'SetEnableRender', 
> 'SetEventInformation', 'SetEventInformationFlipY', 'SetEventPosition', 
> 'SetEventPositionFlipY', 'SetEventSize', 'SetGlobalWarningDisplay', 
> 'SetInstallMessageProc', 'SetInteractorStyle', 'SetKeyCode', 
> 'SetKeyEventInformation', 'SetKeySym', 'SetLastEventPosition', 
> 'SetLightFollowCamera', 'SetNumberOfFlyFrames', 'SetPicker', 
> 'SetReferenceCount', 'SetRenderWindow', 'SetRepeatCount', 
> 'SetShiftKey', 'SetSize', 'SetStillUpdateRate', 'SetTimerDuration', 
> 'SetTimerEventDuration', 'SetTimerEventId', 'SetTimerEventPlatformId', 
> 'SetTimerEventType', 'SetUseTDx', 'ShowCursor', 'Start', 
> 'StartPickCallback', 'TerminateApp', 'UnRegister', 'UpdateSize', 
> 'UserCallback']
>
> It doesn't seem to me that this behavior is intended.
>
> Is anybody else experiencing this ?
>
> Best Regards,
>
> Andrea
>
> _______________________________________________
> 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
>





More information about the vtkusers mailing list