Esempio n. 1
0
 private void ApplyTextureOnCurrentModel(TextureCoordinatesAndBitmap modelTextureAndBitmap)
 {
     if (modelTextureAndBitmap == null)
     {
         return;
     }
     _currentTextureBitmap  = modelTextureAndBitmap.Bitmap;
     _currentModel.Material = GetMaterial(_currentTextureBitmap);
     ((MeshGeometry3D)_currentModel.Geometry).TextureCoordinates = modelTextureAndBitmap.TextureCoordinates;
     UpdateModelDisplay(_currentModel);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private void Generate2CornerTexture()
        {
            if (_2CornerTextureAndBitmap != null)
            {
                return;
            }
            var quickProcessingWindow         = new QuickProcessingWindowHelper(ParentGrid);
            var addTextureInfoForFrontAndBack = MainProcessor.GetAddTextureInfoForFrontAndBackImage(_createMeshContract);

            if (addTextureInfoForFrontAndBack == null)
            {
                MessageBox.Show("Error in generating textures: Cannot identify front and back photos.\nPlease check if photos are available from front to back.");
                quickProcessingWindow.Close();
                return;
            }
            _2CornerTextureAndBitmap = TextureProcessor.GenerateTexture(addTextureInfoForFrontAndBack, (MeshGeometry3D)_currentModel.Geometry, "");
            quickProcessingWindow.Close();
        }
Esempio n. 4
0
        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));
            }
        }