Пример #1
0
        public void OnViewportMouseUp(object sender, MouseButtonEventArgs args)
        {
            args.GetPosition(mainViewport);
            if (args.ChangedButton == MouseButton.Left)
            {
                _mTransformMatrix.OnLBtnUp();
            }
            else if (args.ChangedButton == MouseButton.Right)
            {
                if (MnChartModelIndex == -1)
                {
                    return;
                }
                // 1. get the mesh structure related to the selection rect
                var meshGeometry = Model3D.GetGeometry(mainViewport, MnChartModelIndex);
                if (meshGeometry == null)
                {
                    return;
                }

                // 2. set selection in 3d chart
                _m_3DChart.Select(_mSelectRect, _mTransformMatrix, mainViewport);

                // 3. update selection display
                _m_3DChart.HighlightSelection(meshGeometry, Color.FromRgb(200, 200, 200));
            }
        }
        public void OnViewportMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs args)
        {
            Point pt = args.GetPosition(mainViewport);

            if (args.ChangedButton == MouseButton.Left)
            {
                m_transformMatrix.OnLBtnUp();
            }
            else if (args.ChangedButton == MouseButton.Right)
            {
                if (m_nChartModelIndex == -1)
                {
                    return;
                }
                // 1. get the mesh structure related to the selection rect
                MeshGeometry3D meshGeometry = WPFChart3D.Model3D.GetGeometry(mainViewport, m_nChartModelIndex);
                if (meshGeometry == null)
                {
                    return;
                }

                // 2. set selection in 3d chart
                m_3dChart.Select(m_selectRect, m_transformMatrix, mainViewport);

                // 3. update selection display
                m_3dChart.HighlightSelection(meshGeometry, Color.FromRgb(200, 200, 200));
            }
        }