private void AdjustSkin(object sender, RoutedEventArgs e) { if (_currentTextureType != TextureTypeEnum.FourCorners) { return; } var adjustSkinWindow = new AdjustSkin(_xCoodRangesFor4ImageTexture, _userXCoodRangesFor4ImageTexture); var result = adjustSkinWindow.ShowDialog(); if (!result.HasValue || !result.Value || adjustSkinWindow.ReturnValue == null) { return; } var returnValue = adjustSkinWindow.ReturnValue; if (_4CornerTextureAndBitmap == null) { return; } var indices = MainProcessor.GetIndicesFor4CornerTexture(_createMeshContract.ClickInputs.Angles); if (indices == null) { MessageBox.Show("Error in generating textures: Cannot identify photos for four corners.\nPlease check if photos are available for a full 360 degree view."); return; } var quickProcessingWindow = new QuickProcessingWindowHelper(ParentGrid); var add4CornerTexture = MainProcessor.GetAddTextureInfoForIndexCollection(_createMeshContract, indices); if (add4CornerTexture.ImageInfos != null) { SetUserSuppliedLimit(0, add4CornerTexture, returnValue.FrontPhotoTexCoodValueLimits); SetUserSuppliedLimit(1, add4CornerTexture, returnValue.RightPhotoTexCoodValueLimits); SetUserSuppliedLimit(2, add4CornerTexture, returnValue.BackPhotoTexCoodValueLimits); SetUserSuppliedLimit(3, add4CornerTexture, returnValue.LeftPhotoTexCoodValueLimits); } _userXCoodRangesFor4ImageTexture = returnValue; _4CornerTextureAndBitmap = TextureProcessor.GenerateTexture(add4CornerTexture, (MeshGeometry3D)_currentModel.Geometry, ""); quickProcessingWindow.Close(); ApplyTextureOnCurrentModel(_4CornerTextureAndBitmap); }
private void Generate8CornerTexture() { if (_8CornerTextureAndBitmap != null) { return; } var indices = MainProcessor.GetIndicesFor8CornerTexture(_createMeshContract.ClickInputs.Angles); if (indices == null) { MessageBox.Show("Error in generating textures: Cannot identify photos for eight corners.\nPlease check if photos are available for a full 360 degree view."); return; } var quickProcessingWindow = new QuickProcessingWindowHelper(ParentGrid); var add8CornerTexture = MainProcessor.GetAddTextureInfoForIndexCollection(_createMeshContract, indices); _8CornerTextureAndBitmap = TextureProcessor.GenerateTexture(add8CornerTexture, (MeshGeometry3D)_currentModel.Geometry, ""); quickProcessingWindow.Close(); if (indices.Length < 8) { MessageBox.Show(string.Format("Texture generated for {0} images as only {0} out of 8 images could be identified.", indices.Length)); } }