Beispiel #1
0
        protected override void OnTabChanged()
        {
            base.OnTabChanged();
            currentVis = (VisViewTab)currentSelected;

            // change settings / view
            if (currentVis != null)
            {
                // change data sources
                ButtonBarItem[] items = currentVis.VisViewControl.GetHeightSources();
                if (items != null)
                {
                    foreach (ButtonBarItem item in items)
                    {
                        AddToButtonBar(uiDSHMapBar, explorerBarContainerControl3, item);
                    }
                }
                items = currentVis.VisViewControl.GetDiffuseSources();
                if (items != null)
                {
                    foreach (ButtonBarItem item in items)
                    {
                        AddToButtonBar(uiDsDiffuseBar, explorerBarContainerControl4, item);
                    }
                }

                // change layers
                foreach (GeometryVisLayer layer in currentVis.VisViewControl.GeometryLayers)
                {
                    ButtonBarItem item = new ButtonBarItem(layer.Name);
                    item.Image = layer.Preview;
                    AddToButtonBar(ui3DLayersBar, explorerBarContainerControl1, item);
                }

                // update scene entity tree
                treeView1.Nodes.Clear();
                TreeNode sceneRoot = new TreeNode("Scene");
                
                SceneEntity[] entities = currentVis.VisViewControl.GetSceneEntities();
                foreach (SceneEntity entity in entities)
                {
                    sceneRoot.Nodes.Add(entity.GetType().ToString());
                }
                treeView1.Nodes.Add(sceneRoot);
            }
        }
Beispiel #2
0
        private void NewVisualizationFromImg()
        {
            // open data sourcing dialog
            OpenFileDialog openDlg = new OpenFileDialog();
            openDlg.Title = "Open Image";
            openDlg.Filter = fileFilter;
            openDlg.InitialDirectory = baseDir;
            if (openDlg.ShowDialog(this) == DialogResult.OK)
            {
                NewVisDlg dlg = new NewVisDlg(openDlg.FileName, fileTypes, dataProfiles);
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    // create visualization
                    UI3DVisControl control = new UI3DVisControl();
                    VisViewTab tab = new VisViewTab(control);

                    control.Title = tab.Text = dlg.VisName;
                    tab.MdiParent = this;
                    tab.Show();

                    HashTableSettings localSettings = new HashTableSettings();
                    //localSettings["Base.Path"] = baseDir;
                    localSettings["GeometryVis.HeightShadingEnabled"] = false;
                    localSettings["GeometryVis.HeightShadingClr"] = Color.Red;
                    control.Init(localSettings, cdi);

                    OnTabChanged();

                    control.LoadVisualization(dlg.VisDataProfile, dlg.VisSubDataProfile, dlg.VisDataReader,
                                              dlg.VisDataSourceInfo);

                    OnTabChanged();

                    dlg.VisDataReader = null;

                    recentFiles.AddFile(openDlg.FileName, RecentFiles.RecentFileType.Molecule);
                    RebuildRecentFilesMenu();
                }
                dlg.Dispose();
            }
        }