コード例 #1
0
        public override void MouseUpped(MyGame sender, System.Windows.Forms.MouseEventArgs e)
        {
            List <int>   tmpselectedlist = new List <int>();
            MyPMX        mypmx           = sender.mypmx;
            VertexSelect vS = sender.vS;

            for (int i = 0; i < mypmx.VertexArray.Length; i++)
            {
                bool contained = Is2Add(i, mypmx, vS, sender.Camera);
                if (contained)
                {
                    tmpselectedlist.Add(i);
                }
            }
            vS.selectedVertexIndex = tmpselectedlist.ToArray();
            sender.ResetSelectedBuffer();
            sender.drivingMode = Nothing.GetInstance();
        }
コード例 #2
0
        public void GetDrivingMode(MyGame sender, MouseEventArgs e)
        {
            Mode ret;

            //if (e.Button == MouseButtons.Middle || e.Button == MouseButtons.Right) ret = CameraMove.GetInstance();
            if (sender.form.TabControll.SelectedIndex == 1)
            {
                ret = Nothing.GetInstance();
            }
            else if (sender.form.IsScaleState)
            {
                ret = Scale.GetInstance();
            }
            else if (sender.form.IsRotateState)
            {
                ret = Rotate.GetInstance();
            }
            else if (KeyBoardEvent.GetInstance().OnKeys[(int)Keys.ShiftKey])
            {
                ret = Add.GetInstance();
            }
            else if (KeyBoardEvent.GetInstance().OnKeys[(int)Keys.ControlKey])
            {
                ret = Remove.GetInstance();
            }
            else if (sender.vS.GetNearSelected(sender.mypmx, sender.Camera, e.Location, 4) != -1)
            {
                ret = Move.GetInstance();
            }
            else if (sender.vS.GetNearUsed(sender.mypmx, sender.Camera, e.Location, 4) != -1)
            {
                sender.vS.selectedVertexIndex = new int[] {
                    sender.vS.GetNearUsed(sender.mypmx, sender.Camera, e.Location, 4)
                };
                ret = Move.GetInstance();
            }
            else
            {
                ret = Select.GetInstance();
            }
            sender.drivingMode = ret;
        }