Esempio n. 1
0
        private void _glPanel3D_MouseMove(object sender, MouseEventArgs e)
        {
            var moveP = _glPanel3D.GetPosition();

            if (_glPanel3D.Selector.IsVisible)
            {
                _glPanel3D.Selector.P2    = moveP;
                _glPanel3D.Selector.Color = _glPanel3D.Selector.P1.X > _glPanel3D.Selector.P2.X ? new Color()
                {
                    ScA = 0.1f, ScG = 1f
                } : new Color()
                {
                    ScA = 0.1f, ScB = 1f
                };
            }
        }
Esempio n. 2
0
        private void _OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (_relativeTo != null)
            {
                _relativeTo.Focus();
                _relativeTo.CaptureMouse();
            }
            else
            {
                _panel.Focus();
                _panel.CaptureMouse();
            }

            _mouseDownPoint   = _panel.GetPosition();
            _mouseDownPoint3D = _panel.PointInWpfToPoint3D(_mouseDownPoint);

            _lastPoint   = _mouseDownPoint;
            _lastPoint3D = _mouseDownPoint3D;
        }
Esempio n. 3
0
        private void _glPanel3D_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var downP = _glPanel3D.GetPosition();
            var rets  = _glPanel3D.HitTest(downP);

            if (rets.Count() > 0)
            {
                var first = rets.First();
                if (first.Mesh.Type == MeshType.Triangle)
                {
                    var t = (TriangleMesh)first.Mesh;
                    _mesh.DeleteVertex(t.Index1);
                    MeshData = MeshUtil.ConvertTo(_mesh);
                }
            }
        }