Exemple #1
0
        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;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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;
        }
        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 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;
        }