Пример #1
0
        public void Init(HashTableSettings gSettings, Ribbon mainRibbon)
        {
            ribbon = mainRibbon;

            devSettings = (bool)gSettings["DeveloperMode"];

            appDir         = Application.StartupPath + "\\";
            globalSettings = gSettings;

            // load recent files
            if (File.Exists(appDir + "recentFiles.xml"))
            {
                recentFiles = RecentFiles.LoadFromFile(appDir + "recentFiles.xml");
                recentFiles.ClearDeadEntires();
            }
            else
            {
                recentFiles = new RecentFiles();
            }

            RebuildRecentFilesMenu();

            baseDir = /*(string)gSettings["Base.Path"];*/ Path.GetFullPath(ConfigurationManager.AppSettings[(devSettings ? "dev@" : "") + "Base.Path.Relative"].Replace("%STARTUP%", Application.StartupPath));
            if (!Directory.Exists(baseDir))
            {
                throw new ApplicationException("Base directory does not exist! : " + baseDir);
            }

            cdi = ICommonDeviceInterface.NewInterface((byte)globalSettings["CDI.Adapter"], baseDir);
            cdi.ResourceLoader.RegisterContentLoader(new LayerContentLoader());
            cdi.ResourceLoader.RegisterContentLoader(new BooScriptContentLoader());

            ShowHideGroups(false);
        }
Пример #2
0
        public DevEnvIDEWindow(HashTableSettings gSettings)
        {
            InitializeComponent();

            devSettings = (bool)gSettings["DeveloperMode"];

            appDir = Application.StartupPath + "\\";

            globalSettings = gSettings;

            // load recent files
            if (File.Exists(appDir + ChemDevEnv.Properties.Resources.RecentFilesListLocation))
            {
                recentFiles = RecentFiles.LoadFromFile(ChemDevEnv.Properties.Resources.RecentFilesListLocation);
                recentFiles.ClearDeadEntires();
            }
            else
            {
                recentFiles = new RecentFiles();
            }

            RebuildRecentFilesMenu();

            cdi = ICommonDeviceInterface.NewInterface((byte)globalSettings["CDI.Adapter"], Path.GetFullPath(Application.StartupPath + ConfigurationSettings.AppSettings[(devSettings ? "dev@" : "") + "Base.Path.Relative"]));
        }
Пример #3
0
        public override void Init(HashTableSettings settings, ICommonDeviceInterface cdi)
        {
            base.Init(settings, cdi);

            renderContext = rContext = new VisRenderingContext3D(settings, this, (CommonDeviceInterface)cdi,
                                                                 profiles[0]);
            renderContext.BackColor = BackColor;
        }
Пример #4
0
        public virtual void Init(HashTableSettings settings, ICommonDeviceInterface cdi)
        {
            this.settings = settings;

            // load settings
            BackColor = (Color)settings["View3D.BgClr"];

            // filter profiles into supported
            // NOTE: Profiles should be done in CDI really
            List <GraphicsProfile> sProfiles = new List <GraphicsProfile>();

            foreach (GraphicsProfile profile in profiles)
            {
                if (GraphicsDeviceManager.CheckAdapterMeetsRequirements(((CommonDeviceInterface)cdi).Adapter,
                                                                        profile.MinReqs))
                {
                    sProfiles.Add(profile);
                    // decide which recommendation to use
                    profile.RecommendedVarInUse = -1;
                    for (int i = 0; i < profile.RecommendedVariations.Length; i++)
                    {
                        if (GraphicsDeviceManager.CheckAdapterMeetsRequirements(((CommonDeviceInterface)cdi).Adapter,
                                                                                profile.RecommendedVariations[i]))
                        {
                            profile.RecommendedVarInUse = i;
                            break;
                        }
                    }
                }
            }
            // TODO: This needs to feed back to UI?
            supportedProfiles = sProfiles.ToArray();
            if (supportedProfiles.Length == 0)
            {
                throw new Exception("None of the available graphics profiles meet the graphics devices capabilities");
            }
        }
Пример #5
0
        public void Init(HashTableSettings settings, ICommonDeviceInterface cdi)
        {
            this.settings = settings;
            settings["Molecule.Shading.Material.Type"] = "BySerie";

            // load settings
            BackColor = (Color)settings["View3D.BgClr"];

            // load local modules
            foreach (ISettingsModule module in modules)
            {
                module.LoadModuleSettings(settings);
            }

            renderContext           = new ChemRenderingContext3DDX9(settings, this, (CommonDeviceInterface)cdi);
            renderContext.BackColor = BackColor;

            // load default output settings
            CompleteOutputDescription desc = CompleteOutputDescription.LoadDescription(Assembly.GetExecutingAssembly().GetManifestResourceStream("NuGenSVisualLib.defaultOutput.xml"));

            desc.SchemeSettings         = new BallAndStickSchemeSettings();
            desc.SchemeSettings.AtomLOD = 2;
            ApplySettings(desc);
        }