/// <summary> /// 建構子,如果ModelInfoCollection是空的,則自製部分預設項目 /// </summary> public ModelSettingViewModel(ModelSettingView modelSettingView) { this._modelSettingView = modelSettingView; AddItemCommand = new RelayCommand(AddItem); RemoveItemCommand = new RelayCommand(RemoveItem); ModelSettingCommand = new RelayCommand(LoadSettingModel); //如果ModelInfoCollection為空的 if (ModelSettingCollection == null || ModelSettingCollection.Count == 0) { ModelSettingViewModel.ModelSettingCollection = new ObservableCollection <ModelSettingItem>(); ModelSettingCollection = ModelSettingViewModel.ModelSettingCollection; ModelSettingCollection.Add(new ModelSettingItem { MarkerId = "Head" , BoneFilePath = "D:\\Desktop\\研究資料\\蔡慧君_15755388_20151231\\註冊\\skull_wo_maxilla_w_ramus_BVRO_4.stl" , OspFilePath = "D:\\Desktop\\研究資料\\蔡慧君_15755388_20151231\\註冊\\max_OSP.stl" , OspDiffuseColor = System.Windows.Media.Color.FromArgb(50, 255, 0, 0) , BoneDiffuseColor = System.Windows.Media.Color.FromArgb(255, 40, 181, 187) }); ModelSettingCollection.Add(new ModelSettingItem { MarkerId = "C" , BoneFilePath = "D:\\Desktop\\研究資料\\蔡慧君_15755388_20151231\\註冊\\mandible_digital_segment_BVRO_0.4.stl" //ModelFilePath = "D:\\Desktop\\c2lpk7avgum8-E-45-Aircraft\\E-45-Aircraft\\E 45 Aircraft_stl.stl" , OspFilePath = "D:\\Desktop\\研究資料\\蔡慧君_15755388_20151231\\註冊\\man_OSP.stl" , BoneDiffuseColor = System.Windows.Media.Color.FromArgb(255, 40, 181, 187) , OspDiffuseColor = System.Windows.Media.Color.FromArgb(50, 0, 255, 0) }); ModelSettingCollection.Add(new ModelSettingItem { MarkerId = "A" , BoneFilePath = "D:\\Desktop\\研究資料\\蔡慧君_15755388_20151231\\註冊\\maxilla_0.4.stl" // ModelFilePath = "D:\\Desktop\\c2lpk7avgum8-E-45-Aircraft\\E-45-Aircraft\\E 45 Aircraft_stl.stl" // , //OSPFilePath = "D:\\Desktop\\研究資料\\蔡慧君_15755388_20151231\\註冊\\max_OSP.stl" , BoneDiffuseColor = System.Windows.Media.Color.FromArgb(100, 40, 181, 187) }); } }
/// <summary> /// 顯示設置好的各項模型資訊,按下Set Model 之後並且按ok後會走到這 /// </summary> private void SetModel(object o) { if (_modelSettingdlg == null) { _modelSettingdlg = new ModelSettingView(); } _modelSettingdlg.Owner = _mainWindow; _modelSettingdlg.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; _modelSettingdlg.ShowDialog(); RestoreGridLength(); }