public void UnhookEvents() { this.UserStyle.KeyPressEvt -= this.UserHandler; this.UserStyle.CharEvt -= this.UserHandler; this.UserStyle.KeyReleaseEvt -= this.UserHandler; this.Interactor.AnyEvt -= this.InteractorHandler; this.UserHandler = null; this.UserStyle = null; this.InteractorHandler = null; this.Interactor = null; }
public new static vtkInteractorStyleUser New() { vtkInteractorStyleUser result = null; uint mteStatus = 0u; uint mteIndex = 4294967295u; uint rawRefCount = 0u; IntPtr intPtr = vtkInteractorStyleUser.vtkInteractorStyleUser_New(ref mteStatus, ref mteIndex, ref rawRefCount); if (IntPtr.Zero != intPtr) { bool flag; result = (vtkInteractorStyleUser)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, true, out flag); } return(result); }
public new static vtkInteractorStyleUser SafeDownCast(vtkObjectBase o) { vtkInteractorStyleUser vtkInteractorStyleUser = null; uint mteStatus = 0u; uint mteIndex = 4294967295u; uint rawRefCount = 0u; IntPtr intPtr = vtkInteractorStyleUser.vtkInteractorStyleUser_SafeDownCast_31((o == null) ? default(HandleRef) : o.GetCppThis(), ref mteStatus, ref mteIndex, ref rawRefCount); if (IntPtr.Zero != intPtr) { bool flag; vtkInteractorStyleUser = (vtkInteractorStyleUser)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, true, out flag); if (flag) { vtkInteractorStyleUser.Register(null); } } return(vtkInteractorStyleUser); }
public void HookEvents() { this.HookErrorWindowEvents(); this.Interactor = this.renderWindowControl1.RenderWindow.GetInteractor(); this.InteractorHandler = new Kitware.VTK.vtkObject.vtkObjectEventHandler(Interactor_AnyEventHandler); this.Interactor.AnyEvt += this.InteractorHandler; // Give our own style a higher priority than the built-in one // so that we see the events first: // float builtInPriority = this.Interactor.GetInteractorStyle().GetPriority(); this.UserStyle = Kitware.VTK.vtkInteractorStyleUser.New(); this.UserStyle.SetPriority(0.5f); this.UserStyle.SetInteractor(this.Interactor); this.UserHandler = new Kitware.VTK.vtkObject.vtkObjectEventHandler(UserStyle_MultipleEventHandler); // Keyboard events: this.UserStyle.KeyPressEvt += this.UserHandler; this.UserStyle.CharEvt += this.UserHandler; this.UserStyle.KeyReleaseEvt += this.UserHandler; }