private void ExportToObj() { // Convert geometry selection to sectors General.Map.Map.ConvertSelection(SelectionType.Sectors); //get sectors ICollection <Sector> sectors = General.Map.Map.SelectedSectorsCount == 0 ? General.Map.Map.Sectors : General.Map.Map.GetSelectedSectors(true); if (sectors.Count == 0) { General.Interface.DisplayStatus(StatusType.Warning, "OBJ export failed. Map has no sectors!"); return; } //show settings form WavefrontSettingsForm form = new WavefrontSettingsForm(General.Map.Map.SelectedSectorsCount == 0 ? -1 : sectors.Count); if (form.ShowDialog() == DialogResult.OK) { WavefrontExportSettings data = new WavefrontExportSettings(form); WavefrontExporter e = new WavefrontExporter(); e.Export(sectors, data); } }
public ModelViewModel(ViewModelXY xy, ViewModelXY xz, ViewModelXY yz, int sizeX = 0, int sizeY = 0) { if (sizeX != 0 && sizeY != 0) { isMapElement = true; mapSizeX = sizeX; mapSizeY = sizeY; } Elements.Get = new List <Element>(); exporter = new WavefrontExporter(Elements.Get); this.xy = xy; this.xz = xz; this.yz = yz; InsertCommand.ExecuteFunc = x => insert(); SelectCommand.ExecuteFunc = x => select(); SelectSingleCommand.ExecuteFunc = x => selectSingle(); CopyCommand.ExecuteFunc = x => copy(); CubeCommand.ExecuteFunc = x => cube(); NewModelCommand.ExecuteFunc = x => newModel(); ListCommand.ExecuteFunc = x => list(); CloseCommand.ExecuteFunc = x => close(); SaveCommand.ExecuteFunc = x => save(); LoadCommand.ExecuteFunc = x => load(); ExportCommand.ExecuteFunc = x => export(); MoveCommand.ExecuteFunc = x => move(); ResizeCommand.ExecuteFunc = x => resize(); BoneCommand.ExecuteFunc = x => bone(); TextureCommand.ExecuteFunc = x => texture(); Image0.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.einfügen); Image1.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.auswahl2); Image2.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.auswahl4); Image3.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.kopie); Image4.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.würfel2); Image5.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.würfelplus); Image6.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.liste2); Image7.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.diskette); Image8.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.close); Image9.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.export); Image10.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.schieben); Image11.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.größe_ändern); Image12.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.load); Image13.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.texture); Image14.Get = ImageHelper.ConvertImageToWpfImage(Resources.Resource.bone); this.xy.DrawCubeAction = drawCube; this.xz.DrawCubeAction = drawCube; this.yz.DrawCubeAction = drawCube; this.xy.NewCubeAction = newCube; this.xz.NewCubeAction = newCube; this.yz.NewCubeAction = newCube; this.xy.MoveAction = move; this.xz.MoveAction = move; this.yz.MoveAction = move; this.xy.ResizeAction = resize; this.xz.ResizeAction = resize; this.yz.ResizeAction = resize; this.xy.AddAction = add; this.xz.AddAction = add; this.yz.AddAction = add; this.xy.SelectAction = select; this.xz.SelectAction = select; this.yz.SelectAction = select; this.xy.LoadedAction = loaded; this.xz.LoadedAction = loaded; this.yz.LoadedAction = loaded; this.xy.BoneAction = bone; this.xz.BoneAction = bone; this.yz.BoneAction = bone; var modelWindowViewModel = new ModelViewWindowViewModel(); var window = ViewManager.ShowView(typeof(ModelViewWindow), modelWindowViewModel); engine = new ModelViewer(ViewManager.GetWindowHandle(window)); modelWindowViewModel.Engine = engine; SetPropertyChangeForAll(); }