Beispiel #1
0
        private void Form2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            switch (e.Button)
            {
            case MouseButtons.Left:
                if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl)
                {
                    return;
                }
                switch (myCurrentMode)
                {
                case CurrentAction3d.CurAction3d_Nothing:
                    if (e.X == myXmin && e.Y == myYmin)
                    {
                        myXmax = e.X; myYmax = e.Y;
                        if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift)
                        {
                            MultiInputEvent(myXmax, myYmax);
                        }
                        else
                        {
                            InputEvent(myXmax, myYmax);
                        }
                    }
                    else
                    {
                        myXmax = e.X; myYmax = e.Y;
                        DrawRectangle(false);
                        if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift)
                        {
                            MultiDragEvent(myXmax, myYmax, 1);
                        }
                        else
                        {
                            DragEvent(myXmax, myYmax, 1);
                        }
                    }
                    break;

                case CurrentAction3d.CurAction3d_DynamicZooming:
                    myCurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_WindowZooming:
                    myXmax = e.X; myYmax = e.Y;
                    DrawRectangle(false);
                    int ValZWMin = 1;
                    if (Math.Abs(myXmax - myXmin) > ValZWMin && Math.Abs(myXmax - myYmax) > ValZWMin)
                    {
                        myOCCTProxy.WindowFitAll(myXmin, myYmin, myXmax, myYmax);
                    }
                    this.Cursor = System.Windows.Forms.Cursors.Default;
                    IE_WinForms.tBarBackView f = (IE_WinForms.tBarBackView) this.ParentForm;
                    f.SelectionChanged();
                    myCurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_DynamicPanning:
                    myCurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_GlobalPanning:
                    myOCCTProxy.Place(e.X, e.Y, myCurZoom);
                    myCurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_DynamicRotation:
                    myCurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    if (!myDegenerateModeIsOn)
                    {
                        myOCCTProxy.SetDegenerateModeOff();
                        myDegenerateModeIsOn = false;
                    }
                    else
                    {
                        myOCCTProxy.SetDegenerateModeOn();
                        myDegenerateModeIsOn = true;
                    }
                    break;

                default:
                    break;
                }
                break;

            case MouseButtons.Right:
                if (!myDegenerateModeIsOn)
                {
                    myOCCTProxy.SetDegenerateModeOff();
                    myDegenerateModeIsOn = false;
                }
                else
                {
                    myOCCTProxy.SetDegenerateModeOn();
                    myDegenerateModeIsOn = true;
                }
                break;

            default:
                break;
            }

            IE_WinForms.tBarBackView parent = (IE_WinForms.tBarBackView) this.ParentForm;
            parent.SelectionChanged();
        }
Beispiel #2
0
        private void Form2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            switch (e.Button)
            {
            case MouseButtons.Left:
                myXmin = e.X; myYmin = e.Y;
                myXmax = e.X; myYmax = e.Y;
                if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl)
                {
                    // start the dinamic zooming....
                    myCurrentMode = CurrentAction3d.CurAction3d_DynamicZooming;
                }
                else
                {
                    switch (myCurrentMode)
                    {
                    case CurrentAction3d.CurAction3d_Nothing:
                        if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift)
                        {
                            MultiDragEvent(myXmax, myYmax, -1);
                        }
                        else
                        {
                            DragEvent(myXmax, myYmax, -1);
                        }
                        break;

                    case CurrentAction3d.CurAction3d_DynamicRotation:
                        if (!myDegenerateModeIsOn)
                        {
                            myOCCTProxy.SetDegenerateModeOn();
                        }
                        //start the rotation
                        myOCCTProxy.StartRotation(e.X, e.Y);
                        break;

                    case IE_WinForms.CurrentAction3d.CurAction3d_WindowZooming:
                        this.Cursor = System.Windows.Forms.Cursors.Hand;
                        break;

                    default:
                        break;
                    }
                }
                break;

            case MouseButtons.Right:
                //MessageBox.Show("right mouse button is down");
                if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl)
                {
                    if (!myDegenerateModeIsOn)
                    {
                        myOCCTProxy.SetDegenerateModeOn();
                    }
                    myOCCTProxy.StartRotation(e.X, e.Y);
                }
                else
                {
                    Popup(e.X, e.Y);
                }
                break;

            case MouseButtons.Middle:
                //myCurrentPressedKey = CurrentPressedKey.CurPressedKey_Ctrl;
                //  if (!myDegenerateModeIsOn)
                //    myOCCTProxy.SetDegenerateModeOn();
                //  myOCCTProxy.StartRotation(e.X, e.Y);
                break;

            default:
                break;
            }
        }
Beispiel #3
0
        public Form2()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myView = new shell();
            myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
            myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Nothing;
            myDegenerateModeIsOn=true;
            IsRectVisible=false;
        }
Beispiel #4
0
        private void Form2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            switch(e.Button)
            {
                case MouseButtons.Left:
                    if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
                        return;
                switch(myCurrentMode)
                {
                    case CurrentAction3d.CurAction3d_Nothing:
                        if( e.X==myXmin && e.Y==myYmin)
                        {
                            myXmax=e.X; myYmax=e.Y;
                            if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
                                MultiInputEvent(myXmax, myYmax);
                            else
                                InputEvent(myXmax, myYmax);
                        }
                        else
                        {
                            myXmax=e.X; myYmax=e.Y;
                            DrawRectangle(false);
                            if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
                                MultiDragEvent(myXmax, myYmax, 1);
                            else
                                DragEvent(myXmax, myYmax, 1);
                        }
                        break;
                    case CurrentAction3d.CurAction3d_DynamicZooming:
                        myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
                        break;
                    case CurrentAction3d.CurAction3d_WindowZooming:
                        myXmax=e.X; myYmax=e.Y;
                        DrawRectangle(false);
                        int ValZWMin = 1;
                        if (Math.Abs(myXmax-myXmin)>ValZWMin && Math.Abs(myXmax-myYmax)>ValZWMin)
                            myView.WindowFitAll(myXmin, myYmin, myXmax, myYmax);
                        this.Cursor=System.Windows.Forms.Cursors.Default;
                        IE.Form1 f = (IE.Form1)this.ParentForm;
                        f.SelectionChanged();
                        myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
                        break;
                    case CurrentAction3d.CurAction3d_DynamicPanning:
                        myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
                        break;
                    case CurrentAction3d.CurAction3d_GlobalPanning:
                        myView.Place(e.X, e.Y, myCurZoom);
                        myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
                        break;
                    case CurrentAction3d.CurAction3d_DynamicRotation:
                        myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
                        if (!myDegenerateModeIsOn)
                        {
                            myView.SetDegenerateModeOff();
                            myDegenerateModeIsOn=false;
                        }
                        else
                        {
                            myView.SetDegenerateModeOn();
                            myDegenerateModeIsOn=true;
                        }
                        break;
                    default:
                        break;

                }
                    break;
                case MouseButtons.Right:
                    if (!myDegenerateModeIsOn)
                    {
                        myView.SetDegenerateModeOff();
                        myDegenerateModeIsOn=false;
                    }
                    else
                    {
                        myView.SetDegenerateModeOn();
                        myDegenerateModeIsOn=true;
                    }
                    break;
                default:
                    break;
            }

            IE.Form1 parent = (IE.Form1)this.ParentForm;
            parent.SelectionChanged();
        }
Beispiel #5
0
 private void Form2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     switch (e.Button)
     {
         case MouseButtons.Left:
             myXmin=e.X;	myYmin=e.Y;
             myXmax=e.X;	myYmax=e.Y;
             if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
                 // start the dinamic zooming....
                 myCurrentMode=CurrentAction3d.CurAction3d_DynamicZooming;
             else
             {
                 switch(myCurrentMode)
                 {
                     case CurrentAction3d.CurAction3d_Nothing:
                         if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
                             MultiDragEvent(myXmax, myYmax, -1);
                         else
                             DragEvent(myXmax, myYmax, -1);
                         break;
                     case CurrentAction3d.CurAction3d_DynamicRotation:
                         if (!myDegenerateModeIsOn)
                             myView.SetDegenerateModeOn();
                         //start the rotation
                         myView.StartRotation(e.X, e.Y);
                         break;
                     case IE.CurrentAction3d.CurAction3d_WindowZooming:
                         this.Cursor=System.Windows.Forms.Cursors.Hand;
                         break;
                     default:
                         break;
                 }
             }
             break;
         case MouseButtons.Right:
             //MessageBox.Show("right mouse button is down");
             if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
             {
                 if (!myDegenerateModeIsOn)
                     myView.SetDegenerateModeOn();
                 myView.StartRotation(e.X, e.Y);
             }
             else
                 Popup(e.X, e.Y);
             break;
         default:
             break;
     }
 }
Beispiel #6
0
        public Form2()
        {
            //
              // Required for Windows Form Designer support
              //
              InitializeComponent();

              //
              // Create OCCT proxy object
              //
              myOCCTProxy = new OCCTProxy();
              myCurrentMode = CurrentAction3d.CurAction3d_Nothing;
              myCurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing;
              myDegenerateModeIsOn = true;
              IsRectVisible = false;
        }