From 4632f5a8c140c608e2c53702fc3c4aaf41d0eca1 Mon Sep 17 00:00:00 2001 From: "zhengxuan.zhang" Date: Sat, 7 Mar 2026 16:11:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?#0001=20=E5=88=9D=E7=89=88=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XplorePlane.sln | 25 + XplorePlane/App.xaml | 7 + XplorePlane/App.xaml.cs | 37 + XplorePlane/Assets/Icons/.gitkeep | 0 XplorePlane/Models/Models.cs | 287 +++++ XplorePlane/ViewModels/MainViewModel.cs | 312 +++++ XplorePlane/ViewModels/MainWindowViewModel.cs | 19 + XplorePlane/Views/MainWindow.xaml | 151 +++ XplorePlane/Views/MainWindow.xaml.cs | 15 + XplorePlane/XplorePlane.csproj | 12 + XplorePlane/XplorePlane.csproj.user | 4 + .../bin/Debug/net6.0-windows/DryIoc.dll | Bin 0 -> 568832 bytes .../Microsoft.Xaml.Behaviors.dll | Bin 0 -> 145792 bytes .../Debug/net6.0-windows/Prism.DryIoc.Wpf.dll | Bin 0 -> 27232 bytes .../bin/Debug/net6.0-windows/Prism.Wpf.dll | Bin 0 -> 135264 bytes .../bin/Debug/net6.0-windows/Prism.dll | Bin 0 -> 91232 bytes .../net6.0-windows/XplorePlane.deps.json | 109 ++ .../bin/Debug/net6.0-windows/XplorePlane.dll | Bin 0 -> 30720 bytes .../bin/Debug/net6.0-windows/XplorePlane.exe | Bin 0 -> 151040 bytes .../bin/Debug/net6.0-windows/XplorePlane.pdb | Bin 0 -> 20844 bytes .../XplorePlane.runtimeconfig.json | 15 + ...CoreApp,Version=v6.0.AssemblyAttributes.cs | 4 + XplorePlane/obj/Debug/net6.0-windows/App.g.cs | 55 + .../GeneratedInternalTypeHelper.g.cs | 2 + .../net6.0-windows/Views/MainWindow.baml | Bin 0 -> 6165 bytes .../net6.0-windows/Views/MainWindow.g.cs | 75 ++ .../net6.0-windows/XplorePl.321B731D.Up2Date | 0 .../XplorePlane.AssemblyInfo.cs | 24 + .../XplorePlane.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 18 + .../net6.0-windows/XplorePlane.assets.cache | Bin 0 -> 7155 bytes ...XplorePlane.csproj.AssemblyReference.cache | Bin 0 -> 2247 bytes ...XplorePlane.csproj.CoreCompileInputs.cache | 1 + .../XplorePlane.csproj.FileListAbsolute.txt | 28 + .../obj/Debug/net6.0-windows/XplorePlane.dll | Bin 0 -> 30720 bytes .../net6.0-windows/XplorePlane.g.resources | Bin 0 -> 6405 bytes .../XplorePlane.genruntimeconfig.cache | 1 + .../obj/Debug/net6.0-windows/XplorePlane.pdb | Bin 0 -> 20844 bytes .../XplorePlane_MarkupCompile.cache | 20 + .../XplorePlane_MarkupCompile.lref | 4 + ...plorePlane_zezjgrb4_wpftmp.AssemblyInfo.cs | 24 + ...e_zezjgrb4_wpftmp.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 18 + .../XplorePlane_zezjgrb4_wpftmp.assets.cache | Bin 0 -> 7155 bytes .../obj/Debug/net6.0-windows/apphost.exe | Bin 0 -> 151040 bytes .../Debug/net6.0-windows/ref/XplorePlane.dll | Bin 0 -> 13312 bytes .../net6.0-windows/refint/XplorePlane.dll | Bin 0 -> 13312 bytes .../obj/XplorePlane.csproj.nuget.dgspec.json | 82 ++ .../obj/XplorePlane.csproj.nuget.g.props | 19 + .../obj/XplorePlane.csproj.nuget.g.targets | 2 + XplorePlane/obj/project.assets.json | 1010 +++++++++++++++++ XplorePlane/obj/project.nuget.cache | 24 + XplorePlane/structure.txt | 44 + 53 files changed, 2450 insertions(+) create mode 100644 XplorePlane.sln create mode 100644 XplorePlane/App.xaml create mode 100644 XplorePlane/App.xaml.cs create mode 100644 XplorePlane/Assets/Icons/.gitkeep create mode 100644 XplorePlane/Models/Models.cs create mode 100644 XplorePlane/ViewModels/MainViewModel.cs create mode 100644 XplorePlane/ViewModels/MainWindowViewModel.cs create mode 100644 XplorePlane/Views/MainWindow.xaml create mode 100644 XplorePlane/Views/MainWindow.xaml.cs create mode 100644 XplorePlane/XplorePlane.csproj create mode 100644 XplorePlane/XplorePlane.csproj.user create mode 100644 XplorePlane/bin/Debug/net6.0-windows/DryIoc.dll create mode 100644 XplorePlane/bin/Debug/net6.0-windows/Microsoft.Xaml.Behaviors.dll create mode 100644 XplorePlane/bin/Debug/net6.0-windows/Prism.DryIoc.Wpf.dll create mode 100644 XplorePlane/bin/Debug/net6.0-windows/Prism.Wpf.dll create mode 100644 XplorePlane/bin/Debug/net6.0-windows/Prism.dll create mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.deps.json create mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.dll create mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.exe create mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.pdb create mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.runtimeconfig.json create mode 100644 XplorePlane/obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs create mode 100644 XplorePlane/obj/Debug/net6.0-windows/App.g.cs create mode 100644 XplorePlane/obj/Debug/net6.0-windows/GeneratedInternalTypeHelper.g.cs create mode 100644 XplorePlane/obj/Debug/net6.0-windows/Views/MainWindow.baml create mode 100644 XplorePlane/obj/Debug/net6.0-windows/Views/MainWindow.g.cs create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePl.321B731D.Up2Date create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.AssemblyInfo.cs create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.AssemblyInfoInputs.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.assets.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.csproj.AssemblyReference.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.csproj.CoreCompileInputs.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.csproj.FileListAbsolute.txt create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.dll create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.g.resources create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.genruntimeconfig.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.pdb create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_MarkupCompile.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_MarkupCompile.lref create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.AssemblyInfo.cs create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.AssemblyInfoInputs.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.assets.cache create mode 100644 XplorePlane/obj/Debug/net6.0-windows/apphost.exe create mode 100644 XplorePlane/obj/Debug/net6.0-windows/ref/XplorePlane.dll create mode 100644 XplorePlane/obj/Debug/net6.0-windows/refint/XplorePlane.dll create mode 100644 XplorePlane/obj/XplorePlane.csproj.nuget.dgspec.json create mode 100644 XplorePlane/obj/XplorePlane.csproj.nuget.g.props create mode 100644 XplorePlane/obj/XplorePlane.csproj.nuget.g.targets create mode 100644 XplorePlane/obj/project.assets.json create mode 100644 XplorePlane/obj/project.nuget.cache create mode 100644 XplorePlane/structure.txt diff --git a/XplorePlane.sln b/XplorePlane.sln new file mode 100644 index 0000000..e5c7cfb --- /dev/null +++ b/XplorePlane.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36811.4 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XplorePlane", "XplorePlane\XplorePlane.csproj", "{07978DB9-4B88-4F42-9054-73992742BD6A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {07978DB9-4B88-4F42-9054-73992742BD6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07978DB9-4B88-4F42-9054-73992742BD6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07978DB9-4B88-4F42-9054-73992742BD6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07978DB9-4B88-4F42-9054-73992742BD6A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DB6D69BA-49FD-432F-8069-2A8F64933CDE} + EndGlobalSection +EndGlobal diff --git a/XplorePlane/App.xaml b/XplorePlane/App.xaml new file mode 100644 index 0000000..000a134 --- /dev/null +++ b/XplorePlane/App.xaml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/XplorePlane/App.xaml.cs b/XplorePlane/App.xaml.cs new file mode 100644 index 0000000..38bec1d --- /dev/null +++ b/XplorePlane/App.xaml.cs @@ -0,0 +1,37 @@ +using System.Windows; +using XplorePlane.Views; +using XplorePlane.ViewModels; +using Prism.Ioc; +using Prism.DryIoc; + +namespace XplorePlane +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + // Initialize Prism with DryIoc + var bootstrapper = new AppBootstrapper(); + bootstrapper.Run(); + } + } + + public class AppBootstrapper : PrismBootstrapper + { + protected override Window CreateShell() + { + return Container.Resolve(); + } + + protected override void RegisterTypes(IContainerRegistry containerRegistry) + { + containerRegistry.RegisterForNavigation(); + containerRegistry.Register(); + } + } +} diff --git a/XplorePlane/Assets/Icons/.gitkeep b/XplorePlane/Assets/Icons/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/XplorePlane/Models/Models.cs b/XplorePlane/Models/Models.cs new file mode 100644 index 0000000..b3b8608 --- /dev/null +++ b/XplorePlane/Models/Models.cs @@ -0,0 +1,287 @@ +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Windows.Input; + +namespace XplorePlane.Models +{ + // ── Navigation Tree Models ──────────────────────────────────────── + public class NavGroupNode : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _name; + public string Name + { + get => _name; + set { _name = value; OnPropertyChanged(); } + } + + private ObservableCollection _children; + public ObservableCollection Children + { + get => _children; + set { _children = value; OnPropertyChanged(); } + } + + public NavGroupNode(string name) + { + Name = name; + Children = new ObservableCollection(); + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + public class NavLeafNode : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _name; + public string Name + { + get => _name; + set { _name = value; OnPropertyChanged(); } + } + + private string _iconColor; + public string IconColor + { + get => _iconColor; + set { _iconColor = value; OnPropertyChanged(); } + } + + private bool _isSelected; + public bool IsSelected + { + get => _isSelected; + set { _isSelected = value; OnPropertyChanged(); } + } + + public NavLeafNode(string name, string IconColor = "#888888", bool IsSelected = false) + { + Name = name; + this.IconColor = IconColor; + this.IsSelected = IsSelected; + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + // ── Inspection Callout Models ───────────────────────────────────── + public class InspectionCalloutVM : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _featureName; + public string FeatureName + { + get => _featureName; + set { _featureName = value; OnPropertyChanged(); } + } + + private double _x; + public double X + { + get => _x; + set { _x = value; OnPropertyChanged(); } + } + + private double _y; + public double Y + { + get => _y; + set { _y = value; OnPropertyChanged(); } + } + + private ObservableCollection _rows; + public ObservableCollection Rows + { + get => _rows; + set { _rows = value; OnPropertyChanged(); } + } + + public InspectionCalloutVM(string featureName, double x, double y, CalloutRowVM[] rows) + { + FeatureName = featureName; + X = x; + Y = y; + Rows = new ObservableCollection(rows); + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + public class CalloutRowVM : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _label; + public string Label + { + get => _label; + set { _label = value; OnPropertyChanged(); } + } + + private string _nominal; + public string Nominal + { + get => _nominal; + set { _nominal = value; OnPropertyChanged(); } + } + + private string _measured; + public string Measured + { + get => _measured; + set { _measured = value; OnPropertyChanged(); } + } + + private string _tolerance; + public string Tolerance + { + get => _tolerance; + set { _tolerance = value; OnPropertyChanged(); } + } + + private string _deviation; + public string Deviation + { + get => _deviation; + set { _deviation = value; OnPropertyChanged(); } + } + + private bool _isPass; + public bool IsPass + { + get => _isPass; + set { _isPass = value; OnPropertyChanged(); } + } + + public CalloutRowVM(string label, string nominal, string measured, string tolerance, string deviation, bool isPass) + { + Label = label; + Nominal = nominal; + Measured = measured; + Tolerance = tolerance; + Deviation = deviation; + IsPass = isPass; + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + // ── Feature Properties Model ────────────────────────────────────── + public class FeatureProperties : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _name; + public string Name + { + get => _name; + set { _name = value; OnPropertyChanged(); } + } + + private string _datumLabel; + public string DatumLabel + { + get => _datumLabel; + set { _datumLabel = value; OnPropertyChanged(); } + } + + private double _x; + public double X + { + get => _x; + set { _x = value; OnPropertyChanged(); } + } + + private double _y; + public double Y + { + get => _y; + set { _y = value; OnPropertyChanged(); } + } + + private double _z; + public double Z + { + get => _z; + set { _z = value; OnPropertyChanged(); } + } + + private double _nrX; + public double NrX + { + get => _nrX; + set { _nrX = value; OnPropertyChanged(); } + } + + private double _nrY; + public double NrY + { + get => _nrY; + set { _nrY = value; OnPropertyChanged(); } + } + + private double _nrZ; + public double NrZ + { + get => _nrZ; + set { _nrZ = value; OnPropertyChanged(); } + } + + private double _height; + public double Height + { + get => _height; + set { _height = value; OnPropertyChanged(); } + } + + private double _radius; + public double Radius + { + get => _radius; + set { _radius = value; OnPropertyChanged(); } + } + + private double _diameter; + public double Diameter + { + get => _diameter; + set { _diameter = value; OnPropertyChanged(); } + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + // ── RelayCommand Implementation ─────────────────────────────────── + public class RelayCommand : ICommand + { + private readonly Action _execute; + private readonly Predicate _canExecute; + + public event EventHandler CanExecuteChanged + { + add { CommandManager.RequerySuggested += value; } + remove { CommandManager.RequerySuggested -= value; } + } + + public RelayCommand(Action execute, Predicate canExecute = null) + { + _execute = execute ?? throw new ArgumentNullException(nameof(execute)); + _canExecute = canExecute; + } + + public bool CanExecute(object parameter) => _canExecute?.Invoke(parameter) ?? true; + + public void Execute(object parameter) => _execute(parameter); + } +} diff --git a/XplorePlane/ViewModels/MainViewModel.cs b/XplorePlane/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..49ffc96 --- /dev/null +++ b/XplorePlane/ViewModels/MainViewModel.cs @@ -0,0 +1,312 @@ +// MainViewModel.cs +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Windows.Input; +using XplorePlane.Models; + +namespace XplorePlane.ViewModels +{ + /// + /// Root ViewModel for the MainWindow. + /// Implements INotifyPropertyChanged for two-way data binding. + /// + public class MainViewModel : INotifyPropertyChanged + { + // ── INotifyPropertyChanged ──────────────────────────────────── + public event PropertyChangedEventHandler PropertyChanged; + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + + // ── Constructor ─────────────────────────────────────────────── + public MainViewModel() + { + // Seed navigation tree + NavigationTree = new ObservableCollection + { + new NavGroupNode("参考模型") + { + Children = new ObservableCollection + { + new NavGroupNode("007模型.stp") + { + Children = new ObservableCollection + { + new NavLeafNode("圆柱 2 -ref", IconColor: "#00AAFF"), + new NavLeafNode("圆柱 1 -ref", IconColor: "#00AAFF"), + new NavLeafNode("球 1 -ref", IconColor: "#FFAA00"), + new NavLeafNode("圆 1 -ref", IconColor: "#888888"), + new NavLeafNode("圆 2 -ref", IconColor: "#888888"), + new NavLeafNode("圆 3 -ref", IconColor: "#888888"), + new NavLeafNode("圆 4 -ref", IconColor: "#888888"), + } + } + } + }, + new NavGroupNode("目标模型") + { + Children = new ObservableCollection + { + new NavGroupNode("007数据.sti") + { + Children = new ObservableCollection + { + new NavLeafNode("圆柱 2 -tgt", IconColor: "#00AAFF"), + new NavLeafNode("圆柱 1 -tgt", IconColor: "#00AAFF", IsSelected: true), + new NavLeafNode("球 1 -tgt", IconColor: "#FFAA00"), + new NavLeafNode("圆 1 -tgt", IconColor: "#888888"), + new NavLeafNode("圆 2 -tgt", IconColor: "#888888"), + new NavLeafNode("圆 3 -tgt", IconColor: "#888888"), + new NavLeafNode("圆 4 -tgt", IconColor: "#888888"), + } + } + } + }, + new NavGroupNode("特征分类") + { + Children = new ObservableCollection + { + new NavLeafNode("默认特征分页", IconColor: "#888888") + } + } + }; + + // Seed inspection callouts + InspectionCallouts = new ObservableCollection + { + new InspectionCalloutVM("圆柱 1 -ref", 310, 270, + new[] + { + new CalloutRowVM("X", "20.0001", "19.7591", "±0.1000", "-0.2410", false), + new CalloutRowVM("Y", "79.9998", "79.2057", "±0.1000", "-0.7941", false), + new CalloutRowVM("Z", "12.0000", "12.6008", "±0.1000", "0.6008", false), + new CalloutRowVM("半径","5.0000", "4.9933", "±0.1000", "-0.0067", true), + new CalloutRowVM("圆3","300", "9.9866", "±0.1000", "-0.0134", true), + new CalloutRowVM("高度","15.0001","15.0028", "±0.1000", "0.0027", true), + }), + new InspectionCalloutVM("圆柱 2 -ref", 665, 270, + new[] + { + new CalloutRowVM("X", "180.0000","179.8487","±0.1000","-0.1513", false), + new CalloutRowVM("Y", "79.9999", "81.0710", "±0.1000", "1.0711", false), + new CalloutRowVM("Z", "35.0000", "27.3757", "±0.1000","-7.6243", false), + new CalloutRowVM("半径","5.0000", "4.9656", "±0.1000","-0.0344", true), + new CalloutRowVM("直径","10.0000","9.9311", "±0.1000","-0.0689", true), + new CalloutRowVM("高度","15.0001","15.0014", "±0.1000", "0.0013", true), + }), + new InspectionCalloutVM("球 1 -ref", 455, 415, + new[] + { + new CalloutRowVM("X", "60.0000","60.0000","±0.1000", "0.0000", true), + new CalloutRowVM("Y", "20.0000","20.0000","±0.1000","-0.0000",true), + new CalloutRowVM("Z", "20.0000","20.0000","±0.1000", "0.0000", true), + new CalloutRowVM("半径","12.0000","11.8959","±0.1000","-0.1041",false), + }), + }; + + // Selected feature (matches 圆柱 1) + SelectedFeature = new FeatureProperties + { + Name = "圆柱 1", + DatumLabel = "空", + X = 19.7591, + Y = 79.2067, + Z = 12.6008, + NrX = 0.0163, + NrY = 0.1049, + NrZ = 0.9943, + Height = 15.0028, + Radius = 4.9933, + Diameter = 9.9866, + }; + + // Status bar defaults + LicenseInfo = "软件购买类型: 通用;截止日期: 2025/6/30"; + ConnectionStatus = "Polyworks未连接"; + FpsInfo = "Fps = 0"; + TempInfo = "TempS = 0 ℃"; + CurrentTime = "AM 38%"; + ZoomLevel = 38; + } + + // ── Navigation Tree ─────────────────────────────────────────── + public ObservableCollection NavigationTree { get; } + + // ── Inspection Callouts ─────────────────────────────────────── + public ObservableCollection InspectionCallouts { get; } + + // ── Selected Feature Properties ─────────────────────────────── + private FeatureProperties _selectedFeature = new(); + public FeatureProperties SelectedFeature + { + get => _selectedFeature; + set { _selectedFeature = value; OnPropertyChanged(); } + } + + // ── Status Bar ──────────────────────────────────────────────── + private string _licenseInfo = string.Empty; + public string LicenseInfo + { + get => _licenseInfo; + set { _licenseInfo = value; OnPropertyChanged(); } + } + + private string _connectionStatus = string.Empty; + public string ConnectionStatus + { + get => _connectionStatus; + set { _connectionStatus = value; OnPropertyChanged(); } + } + + private string _fpsInfo = string.Empty; + public string FpsInfo + { + get => _fpsInfo; + set { _fpsInfo = value; OnPropertyChanged(); } + } + + private string _tempInfo = string.Empty; + public string TempInfo + { + get => _tempInfo; + set { _tempInfo = value; OnPropertyChanged(); } + } + + private string _currentTime = string.Empty; + public string CurrentTime + { + get => _currentTime; + set { _currentTime = value; OnPropertyChanged(); } + } + + private int _zoomLevel = 100; + public int ZoomLevel + { + get => _zoomLevel; + set { _zoomLevel = value; OnPropertyChanged(); } + } + + // ── Geometry Selection Flags ────────────────────────────────── + private bool _isPointSelected; + public bool IsPointSelected + { + get => _isPointSelected; + set { _isPointSelected = value; OnPropertyChanged(); } + } + + private bool _isPlaneSelected; + public bool IsPlaneSelected + { + get => _isPlaneSelected; + set { _isPlaneSelected = value; OnPropertyChanged(); } + } + + private bool _isCylinderSelected; + public bool IsCylinderSelected + { + get => _isCylinderSelected; + set { _isCylinderSelected = value; OnPropertyChanged(); } + } + + private bool _isSurfacePointSelected; + public bool IsSurfacePointSelected + { + get => _isSurfacePointSelected; + set { _isSurfacePointSelected = value; OnPropertyChanged(); } + } + + private bool _isCircleSelected; + public bool IsCircleSelected + { + get => _isCircleSelected; + set { _isCircleSelected = value; OnPropertyChanged(); } + } + + private bool _isSphereSelected; + public bool IsSphereSelected + { + get => _isSphereSelected; + set { _isSphereSelected = value; OnPropertyChanged(); } + } + + private bool _isLineSelected; + public bool IsLineSelected + { + get => _isLineSelected; + set { _isLineSelected = value; OnPropertyChanged(); } + } + + private bool _isSlotSelected; + public bool IsSlotSelected + { + get => _isSlotSelected; + set { _isSlotSelected = value; OnPropertyChanged(); } + } + + private bool _isFaceSelected; + public bool IsFaceSelected + { + get => _isFaceSelected; + set { _isFaceSelected = value; OnPropertyChanged(); } + } + + // ── Commands ────────────────────────────────────────────────── + public ICommand OpenFileCommand => new RelayCommand(_ => OpenFile()); + public ICommand ExportCommand => new RelayCommand(_ => Export()); + public ICommand ClearCommand => new RelayCommand(_ => Clear()); + public ICommand OpenTemplateCommand => new RelayCommand(_ => OpenTemplate()); + public ICommand SaveTemplateCommand => new RelayCommand(_ => SaveTemplate()); + public ICommand TemplateInspectCommand => new RelayCommand(_ => TemplateInspect()); + public ICommand GdtInspectCommand => new RelayCommand(_ => GdtInspect()); + public ICommand AutoAlignCommand => new RelayCommand(_ => AutoAlign()); + public ICommand NPointAlignCommand => new RelayCommand(_ => NPointAlign()); + public ICommand FeatureAlignCommand => new RelayCommand(_ => FeatureAlign()); + public ICommand RpsAlignCommand => new RelayCommand(_ => RpsAlign()); + public ICommand AxisAlignCommand => new RelayCommand(_ => AxisAlign()); + public ICommand ImportMatrixCommand => new RelayCommand(_ => ImportMatrix()); + public ICommand CalcColorDiffCommand => new RelayCommand(_ => CalcColorDiff()); + public ICommand AnnotateCommand => new RelayCommand(_ => Annotate()); + public ICommand ReportInfoCommand => new RelayCommand(_ => ReportInfo()); + public ICommand SavePdfCommand => new RelayCommand(_ => SavePdf()); + public ICommand SaveCsvCommand => new RelayCommand(_ => SaveCsv()); + public ICommand NavigateHomeCommand => new RelayCommand(_ => NavigateHome()); + public ICommand NavigateInspectCommand => new RelayCommand(_ => NavigateInspect()); + public ICommand ToggleFullScreenCommand=> new RelayCommand(_ => ToggleFullScreen()); + public ICommand OpenOptionsCommand => new RelayCommand(_ => OpenOptions()); + public ICommand CollapseNavCommand => new RelayCommand(_ => CollapseNav()); + public ICommand EditPropertiesCommand => new RelayCommand(_ => EditProperties()); + public ICommand ClosePropertiesCommand => new RelayCommand(_ => CloseProperties()); + public ICommand ClearAnnotationsCommand=> new RelayCommand(_ => ClearAnnotations()); + public ICommand DeleteSelectionCommand => new RelayCommand(_ => DeleteSelection()); + + // ── Command Handlers (stub — wire up your services here) ────── + private void OpenFile() { /* Open file dialog */ } + private void Export() { /* Export dialog */ } + private void Clear() { /* Clear scene */ } + private void OpenTemplate() { /* Load template project */ } + private void SaveTemplate() { /* Save template project */ } + private void TemplateInspect() { /* Run template inspection */ } + private void GdtInspect() { /* GD&T inspection dialog */ } + private void AutoAlign() { /* Auto alignment */ } + private void NPointAlign() { /* N-point alignment dialog */ } + private void FeatureAlign() { /* Feature alignment */ } + private void RpsAlign() { /* RPS alignment */ } + private void AxisAlign() { /* Axis alignment */ } + private void ImportMatrix() { /* Import alignment matrix */ } + private void CalcColorDiff() { /* Calculate color difference */ } + private void Annotate() { /* Add annotation */ } + private void ReportInfo() { /* Report info dialog */ } + private void SavePdf() { /* Save PDF report */ } + private void SaveCsv() { /* Save CSV report */ } + private void NavigateHome() { /* Switch to Home tab */ } + private void NavigateInspect() { /* Switch to Inspect tab */ } + private void ToggleFullScreen(){ /* Toggle fullscreen */ } + private void OpenOptions() { /* Open options dialog */ } + private void CollapseNav() { /* Collapse navigation panel */ } + private void EditProperties() { /* Edit selected feature props */ } + private void CloseProperties() { /* Close properties panel */ } + private void ClearAnnotations(){ /* Clear all viewport annotations */ } + private void DeleteSelection() { /* Delete selected item */ } + } +} \ No newline at end of file diff --git a/XplorePlane/ViewModels/MainWindowViewModel.cs b/XplorePlane/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..2e47d47 --- /dev/null +++ b/XplorePlane/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,19 @@ +using Prism.Mvvm; + +namespace XplorePlane.ViewModels +{ + public class MainWindowViewModel : BindableBase + { + private string _title = "Prism Application"; + public string Title + { + get { return _title; } + set { SetProperty(ref _title, value); } + } + + public MainWindowViewModel() + { + + } + } +} diff --git a/XplorePlane/Views/MainWindow.xaml b/XplorePlane/Views/MainWindow.xaml new file mode 100644 index 0000000..39a8690 --- /dev/null +++ b/XplorePlane/Views/MainWindow.xaml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + +