Exemplo n.º 1
0
        async void DownloadSceneResultAs_Click(object sender, EventArgs e)
        {
            var scene = _TreeViewScenes.SelectedNode.Tag
                        as ReCapPhotoscene;

            string sceneName = scene.SceneName;

            SceneSettingsForm settingsForm = new SceneSettingsForm(
                sceneName,
                scene.MeshQuality,
                MeshFormatEnumExtensions.FromString(scene.ConvertFormat));

            if (settingsForm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            var linkResult = await _reCapClient.GetPhotosceneLinkAsync(
                scene.PhotosceneId,
                settingsForm.MeshFormat);

            if (!linkResult.IsOk())
            {
                LogReCapError(linkResult.Error);
                return;
            }

            scene = linkResult.Photoscene;

            if (scene.Progress != 100.0)
            {
                LogMessage("Start processing for scene: " + sceneName);

                ShowProgressForm(sceneName, scene.PhotosceneId);
            }
            else
            {
                DownloadSceneResult(scene);
            }
        }
Exemplo n.º 2
0
        async void NewScene_Click(object sender, EventArgs e)
        {
            SceneSettingsForm settingsForm = new SceneSettingsForm(
                "ADN - " + GetTimeStamp());

            if (settingsForm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            ReCapPhotosceneOptionsBuilder options =
                new ReCapPhotosceneOptionsBuilder(
                    settingsForm.MeshQuality,
                    settingsForm.MeshFormat);

            var id = await CreateNewPhotoscene(
                settingsForm.SceneName,
                options);

            if (id != string.Empty)
            {
                var sceneWithInfo = await RetrieveSceneInfo(id);

                if (sceneWithInfo != null)
                {
                    var root = _TreeViewScenes.Nodes[0];

                    TreeNode node =
                        root.Nodes.Add(
                            sceneWithInfo.PhotosceneId,
                            sceneWithInfo.SceneName,
                            2, 2);

                    node.Tag = sceneWithInfo;
                }

                ShowProgressForm(settingsForm.SceneName, id);
            }
        }