コード例 #1
0
        protected void GeneratePreviewProcess()
        {
            try
            {
                status       = Status.Generating;
                loadProgress = 0;

                Thread.Sleep(500);

                if (updateBonds || updateAtoms)
                {
                    sceneManger.UpdateAtoms(latestCoDesc, atoms);
                    loadProgress = 50;
                    OnPaint(null);
                }
                else
                {
                    sceneManger.OnNewDataSource(atoms, bonds, new Vector3(0, 0, 0.5f), new Bounds3D(new Vector3(), new Vector3(), 4));
                    loadProgress = 50;
                    OnPaint(null);
                }

                loadProgress = 100;

                status = Status.Rendering;
                OnPaint(null);
            }
            catch (ThreadAbortException tae)
            {
                // clean up
                status = Status.NoData;
                //scheme.Clear();
            }
        }
コード例 #2
0
        private void OnNewDevice()
        {
            if (outSettings != null)
            {
                outSettings.CreateDevice(this, out device, out pParams);
            }

            if (device != null)
            {
                pipeline   = new GraphicsFixedPipeline3D(device);
                deviceFont = new Microsoft.DirectX.Direct3D.Font(device, Font);

                sceneManger = new MoleculeSceneManager(device, outSettings);
                BallAndStickRenderingScheme scheme = new BallAndStickRenderingScheme(device);
                sceneManger.SetScheme(scheme);
                sceneManger.SetOutputDesc(latestCoDesc);
                sceneManger.OnNewDataSource(atoms, null, new Vector3(), new Bounds3D(new Vector3(), new Vector3(), 3));
            }
            else
            {
            }
        }
コード例 #3
0
        private void OnNewDevice()
        {
            if (outSettings != null)
                outSettings.CreateDevice(this, out device, out pParams);

            if (device != null)
            {
                pipeline = new GraphicsFixedPipeline3D(device);
                deviceFont = new Microsoft.DirectX.Direct3D.Font(device, Font);

                sceneManger = new MoleculeSceneManager(device, outSettings);
                BallAndStickRenderingScheme scheme = new BallAndStickRenderingScheme(device);
                sceneManger.SetScheme(scheme);
                sceneManger.SetOutputDesc(latestCoDesc);
                sceneManger.OnNewDataSource(atoms, null, new Vector3(), new Bounds3D(new Vector3(), new Vector3(), 3));
            }
            else
            {
            }
        }