Esempio n. 1
0
        public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button)
        {
            if (mesh == null)
            {
                return;
            }
            base.MouseDown(mouseDownPos, button);

            if (StartMoving() == false)
            {
                return;
            }
            Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y);

            p.x += 100;
            p.y += 100;

            switch (button)
            {
            case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break;

            case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break;

            case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break;
            }

            TriMeshUtil.GroupVertice(mesh);
            OnChanged(EventArgs.Empty);
        }
Esempio n. 2
0
        public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button)
        {
            if (mesh == null)
            {
                return;
            }
            base.MouseDown(mouseDownPos, button);

            bool haveSelected = false;

            for (int i = 0; i < mesh.Vertices.Count; i++)
            {
                if (mesh.Vertices[i].Traits.SelectedFlag == (byte)1)
                {
                    haveSelected = true;
                }
            }


            if (button == EnumMouseButton.Left && !haveSelected)
            {
                selectedPoint = SelectByPoint();
            }


            if (StartMoving() == false)
            {
                return;
            }
            Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y);

            p.x += 100;
            p.y += 100;

            switch (button)
            {
            case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break;

            case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break;

            case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break;
            }

            TriMeshUtil.GroupVertice(mesh);
            OnChanged(EventArgs.Empty);
        }