Пример #1
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();
            }
        }
Пример #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();
            }
        }