diff --git a/Resource/Images/UserControl/03-8-3.png b/Resource/Images/UserControl/03-8-3.png new file mode 100644 index 0000000..b2c78f5 Binary files /dev/null and b/Resource/Images/UserControl/03-8-3.png differ diff --git a/SparkClient.csproj b/SparkClient.csproj index 62c3379..cbedd23 100644 --- a/SparkClient.csproj +++ b/SparkClient.csproj @@ -189,6 +189,8 @@ + + diff --git a/Views/UserControl/Viewport3D.xaml b/Views/UserControl/Viewport3D.xaml index 2c2ccfc..532b5eb 100644 --- a/Views/UserControl/Viewport3D.xaml +++ b/Views/UserControl/Viewport3D.xaml @@ -45,6 +45,10 @@ x:Name="BtnFcuntion3View" Click="BtnFunction_OnClick"> + diff --git a/Views/UserControl/Viewport3D.xaml.cs b/Views/UserControl/Viewport3D.xaml.cs index 45df875..797a4f2 100644 --- a/Views/UserControl/Viewport3D.xaml.cs +++ b/Views/UserControl/Viewport3D.xaml.cs @@ -42,7 +42,12 @@ public partial class Viewport3D private void Viewport3D_OnLoaded(object sender, RoutedEventArgs e) { ViewportManager.SetViewport3D(Viewport3Dx); + ViewportManager.SetViewport(this); ViewportManager.LoadModelByEntities(new List()); + #if DEBUG + #else + BtnShow3DView.Visibility = Visibility.Hidden; + #endif //选项初始化 显示-后端-管理类 一致 ViewportRightMenuSelectFaceFrame.IsEnabled = ViewportRightMenuSelectFace.IsChecked ; @@ -174,7 +179,9 @@ public partial class Viewport3D { var directionName = ((Button)sender).Name.ToString(); var directionValue = (int) TbCustomizeRevolve.Value; - + + + switch (directionName) { case "BtnFcuntion1View": @@ -210,6 +217,9 @@ public partial class Viewport3D await Task.Delay(7000); ViewportManager.DoubleClickSelect = !false; break; + case "BtnShow3DView": + + break; } diff --git a/Views/UserControl/ViewportData/Helper/UnityHelper.cs b/Views/UserControl/ViewportData/Helper/UnityHelper.cs new file mode 100644 index 0000000..10dc8fd --- /dev/null +++ b/Views/UserControl/ViewportData/Helper/UnityHelper.cs @@ -0,0 +1,18 @@ +namespace SparkClient.Views.UserControl.ViewportData.Helper; + +public class UnityHelper +{ + private static string _image_path = AppDomain.CurrentDomain.BaseDirectory + "/temp/image/"; + + /*** + * 1、根据模型信息和钻石编码生成签名作为stl文件名(导出:ViewportHelperPro.ExportModelsToStl(null, path+filename)) + * 2、判断同名STL文件是否存在 存在跳到 7 + * 3、 清理temp下,image、stl两个目录 + * 4、导出模型stl文件,记录完整的路径paramA + * 5、执行导出命令 xx.exe --model=_stl_path+paramA --output=_image_path --type=0/1 0:心图(0.png) 1:箭图(1.png) + * 6、等待命令结束 + * 7、判断图片文件是否存在 --->>不存在:提示生成失败,请重试, --->>不存在并且从2过来的,跳到1 + * 8、展示图片弹窗,并注以说明:心箭图为模拟渲染,实际请以切工镜观测为准。 + * 9、关闭 + */ +} \ No newline at end of file diff --git a/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs b/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs index c6466b8..5984b47 100644 --- a/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs +++ b/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs @@ -899,6 +899,7 @@ public class ViewportHelperPro /// 旋转时间 秒 public static void RotateModel(Vector3D axis, bool hasLine = true, int speed = 7, int to = 360) { + ViewportManager.GetViewport().ViewportRightMenuShowModelFaceByType.IsChecked = false; ViewportManager.ClearDicModels(); ViewportManager.DoubleClickSelect = false; diff --git a/Views/UserControl/ViewportData/Helper/ViewportManager.cs b/Views/UserControl/ViewportData/Helper/ViewportManager.cs index 8efb773..d9ac7b4 100644 --- a/Views/UserControl/ViewportData/Helper/ViewportManager.cs +++ b/Views/UserControl/ViewportData/Helper/ViewportManager.cs @@ -63,6 +63,8 @@ public class ViewportManager /// 网格线(圈) /// public static LineGeometryModel3D MainModelCircleLine_P = new LineGeometryModel3D(); + + /// /// 腰垂直线 /// @@ -88,6 +90,9 @@ public class ViewportManager /// 模型控件对象映射 /// private static Viewport3DX _viewport; + + //模型 + private static Viewport3D _viewport3D = null; public static void SetViewport3D(Viewport3DX viewport3D) { if (_viewport != null) @@ -105,6 +110,24 @@ public class ViewportManager throw new Exception("Viewport is not set"); return _viewport; + } + public static void SetViewport(Viewport3D viewport3D) + { + if (_viewport != null) + { + ClearDicModels(); + _viewport.Items.Clear(); + + } + + _viewport3D = viewport3D; + } + public static Viewport3D GetViewport() + { + if (_viewport3D == null) + throw new Exception("Viewport is not set"); + return _viewport3D; + } #region 模型选中交互管理 //是否双击选中