20230724_MBJC_upperpc/Views/FirstPageView.xaml.cs

127 lines
4.0 KiB
C#
Raw Normal View History

2023-11-20 05:11:09 +00:00
using _3DTools;
using System;
2023-10-24 02:41:55 +00:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
2023-11-13 07:46:12 +00:00
using System.Threading;
2023-10-24 02:41:55 +00:00
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
2023-11-20 05:11:09 +00:00
using System.Windows.Media.Animation;
2023-10-24 02:41:55 +00:00
using System.Windows.Media.Imaging;
2023-11-16 08:18:55 +00:00
using System.Windows.Media.Media3D;
2023-10-24 02:41:55 +00:00
using System.Windows.Navigation;
using System.Windows.Shapes;
2023-11-15 05:34:33 +00:00
namespace _20230724_MBJC_upperpc.Views
2023-10-24 02:41:55 +00:00
{
2023-11-16 08:18:55 +00:00
2023-11-15 05:34:33 +00:00
2023-10-24 02:41:55 +00:00
/// <summary>
2023-11-15 05:34:33 +00:00
/// FirstPageView.xaml 的交互逻辑
2023-10-24 02:41:55 +00:00
/// </summary>
2023-11-15 05:34:33 +00:00
public partial class FirstPageView : UserControl
2023-10-24 02:41:55 +00:00
{
2023-11-15 05:34:33 +00:00
public FirstPageView()
2023-10-24 02:41:55 +00:00
{
InitializeComponent();
2023-12-18 09:31:28 +00:00
this.DataContext = MainWindow.viewModel;
2023-11-13 07:46:12 +00:00
}
2023-11-15 05:34:33 +00:00
2023-11-13 07:46:12 +00:00
private async void re(List<Single> End)
{
2023-12-18 09:31:28 +00:00
//await Task.Run(() =>
//{
// for (int i = 0; i < End.Count; i++)
// {
// float a = single.Rotate_X;
// float b = single.Rotate_Y;
// float c = single.Rotate_Z;
// for (int j = 0; j < 100; j++)
// {
// Thread.Sleep(10);
// single.Rotate_X += (End[i].Rotate_X - a) / 100;
// single.Rotate_Y += (End[i].Rotate_Y - b) / 100;
// single.Rotate_Z += (End[i].Rotate_Z - c) / 100;
// }
// }
// //for (int i = 0; i < 6000; i++)
// //{
// // Thread.Sleep(1);
// // //single.Rotate_X += 0.1f;
// // single.Rotate_Y += 0.1f;
// // //single.Rotate_Z += 0.1f;
// //}
//});
2023-10-24 02:41:55 +00:00
}
2023-11-16 08:18:55 +00:00
private void TrackballDecorator_MouseUp(object sender, MouseButtonEventArgs e)
{
Console.WriteLine();
}
2023-11-20 05:11:09 +00:00
2023-12-15 08:14:17 +00:00
private void Button_Click(object sender, RoutedEventArgs e)
{
//re(new List<Single> { new Single() { Rotate_X = -180, Rotate_Y = -90, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -180, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 0 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 90 },
//new Single() { Rotate_X = -90, Rotate_Y = -90, Rotate_Z = 0 }});
re(new List<Single> { new Single() { Rotate_X = -90f + 2.02f, Rotate_Y = -90f + 0.41f, Rotate_Z = 0.05f } });
}
2024-01-17 01:24:32 +00:00
private void Anchor1_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Point1");
}
private void Anchor2_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Point2");
}
private void Anchor3_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Point3");
}
private void Anchor4_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Point4");
}
private void Anchor5_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Point5");
}
private void Anchor6_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Point6");
}
private void Support1_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Benchmark1");
}
private void Support2_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("Benchmark2");
}
private void Buoy_ButtonClick(object sender, RoutedEventArgs e)
{
MainWindow.viewModel.DoNavChanged("BuoyPlatformView");
}
2023-10-24 02:41:55 +00:00
}
}