using HelixToolkit.Wpf;
using System.Windows;
using System.Windows.Media.Media3D;

namespace SurfacePlot3D
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = Vm;
        }

        public SurfacePlotViewModel Vm { get; set; } = new SurfacePlotViewModel();

        private void HelixTestViewport_CameraChanged(object sender, RoutedEventArgs e)
        {
            var vp = sender as HelixViewport3D;
            if(vp != null ) 
            {
                var pc = vp.Camera as PerspectiveCamera;
                if(pc != null ) 
                {
                    
                }
            }
        }

        private void HelixTestViewport_Loaded(object sender, RoutedEventArgs e)
        {
            var vp = sender as HelixViewport3D;
            if (vp != null)
            {
                vp.ZoomExtents();
                //var pc = vp.Camera as PerspectiveCamera;
                //if (pc != null)
                //{
                //    pc.FieldOfView = 45;
                //    pc.NearPlaneDistance = .1;
                //    pc.UpDirection = new Vector3D(0, 0, 1);
                //    pc.LookDirection = new Vector3D(-2.0300415720244973, -16.24033257619598, -20.300415720244974);
                //    pc.Position = new Point3D(2, 16, 20); 
                //}
            }
        }
    }
}