コード例 #1
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            //MetaBlobsSchemeSettings settings = (MetaBlobsSchemeSettings)coDesc.SchemeSettings;

            atomsBufferCreators = new AtomGeometryCreator[] { new AtomBlobBufferCreator() };
            atomsBufferCreators[0].SetupForCreation(null);

            this.coDesc = coDesc;
        }
コード例 #2
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            //MetaBlobsSchemeSettings settings = (MetaBlobsSchemeSettings)coDesc.SchemeSettings;

            atomsBufferCreators = new AtomGeometryCreator[] { new AtomBlobBufferCreator() };
            atomsBufferCreators[0].SetupForCreation(null);

            this.coDesc = coDesc;
        }
コード例 #3
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            //SpriteSchemeSettings settings = (SpriteSchemeSettings)coDesc.SchemeSettings;

            atomsBufferCreators = new AtomGeometryCreator[] { new AtomSpriteBufferCreator() };
            atomsBufferCreators[0].SetupForCreation(null);

            lightBonds = false;
            lightAtoms = true;

            this.coDesc = coDesc;
        }
コード例 #4
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            //SpriteSchemeSettings settings = (SpriteSchemeSettings)coDesc.SchemeSettings;

            atomsBufferCreators = new AtomGeometryCreator[] { new AtomSpriteBufferCreator() };
            atomsBufferCreators[0].SetupForCreation(null);

            lightBonds = false;
            lightAtoms = true;

            this.coDesc = coDesc;
        }
コード例 #5
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            //SpaceFillSchemeSettings settings = (SpaceFillSchemeSettings)coDesc.SchemeSettings;

            atomsBufferCreators = new AtomGeometryCreator[] { new AtomSphereBufferCreator(0.5f, 16, 12) };
            atomsBufferCreators[0].SetupForCreation(null);

            bondsBufferCreators = null;

            lightAtoms = true;

            this.coDesc = coDesc;
        }
コード例 #6
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            //SpaceFillSchemeSettings settings = (SpaceFillSchemeSettings)coDesc.SchemeSettings;

            atomsBufferCreators = new AtomGeometryCreator[] { new AtomSphereBufferCreator(0.5f, 16, 12) };
            atomsBufferCreators[0].SetupForCreation(null);

            bondsBufferCreators = null;

            lightAtoms = true;

            this.coDesc = coDesc;
        }
コード例 #7
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            bool updateAtomLOD = true;
            bool updateBondLOD = true;
            bool updateSymbols = true;
            bool updateGlow    = true;

            bool updateBondSize = true;

            bool updateBonds  = true;
            bool updateAtoms  = true;
            bool updateScheme = true;

            if (this.coDesc != null)
            {
                this.coDesc = coDesc;
                updateAtoms = coDesc.CheckChange("AtomShadingDesc.");
                if (updateAtoms)
                {
                    updateSymbols = coDesc.CheckChange("AtomShadingDesc.", "SymbolText");
                    updateGlow    = coDesc.CheckChange("SchemeSettings.", "Glow");
                }
                updateBonds = coDesc.CheckChange("BondShadingDesc.");

                updateScheme = coDesc.CheckChange("SchemeSettings.");
                if (updateScheme)
                {
                    updateAtomLOD = coDesc.CheckChange("SchemeSettings.", "AtomLOD");
                    updateBondLOD = coDesc.CheckChange("SchemeSettings.", "BondLOD");

                    updateBondSize = coDesc.CheckChange("SchemeSettings.", "StickThickness");
                }
            }
            else
            {
                this.coDesc = coDesc;
            }
            BallAndStickSchemeSettings settings = (BallAndStickSchemeSettings)coDesc.SchemeSettings;

            int atomDetail1 = 4;
            int atomDetail2 = 1;

            if (updateAtoms || updateScheme)
            {
                /*if (updateAtomLOD)
                 * {*/
                switch (settings.AtomLOD)
                {
                case 0:
                    atomDetail1 = 4;
                    atomDetail2 = 1;
                    break;

                case 1:
                    atomDetail1 = 8;
                    atomDetail2 = 6;
                    break;

                case 2:
                    atomDetail1 = 12;
                    atomDetail2 = 9;
                    break;

                case 3:
                    atomDetail1 = 16;
                    atomDetail2 = 12;
                    break;

                case 4:
                    atomDetail1 = 24;
                    atomDetail2 = 18;
                    break;

                case 5:
                    atomDetail1 = 32;
                    atomDetail2 = 26;
                    break;
                }
                //}
                int bufCount = 1;
                if (settings.ElectronChargeCloud)
                {
                    bufCount++;
                }
                if (settings.Glow > 0)
                {
                    bufCount++;
                }
                if (coDesc.AtomShadingDesc.SymbolText)
                {
                    bufCount++;
                }

                // TODO: Reconfigure previous creators
                atomsBufferCreators    = new AtomGeometryCreator[bufCount];
                atomsBufferCreators[0] = new AtomSphereBufferCreator(0.2f, atomDetail1, atomDetail2);
                bufCount = 1;
                if (settings.Glow > 0)
                {
                    atomsBufferCreators[bufCount++] = new AtomSpriteBufferCreator();
                }
                if (settings.ElectronChargeCloud)
                {
                    atomsBufferCreators[bufCount++] = new AtomMetaballsBufferCreator(true);
                }
                if (coDesc.AtomShadingDesc.SymbolText)
                {
                    atomsBufferCreators[bufCount++] = new AtomSymbolSpriteBufferCreator();
                }

                foreach (AtomGeometryCreator creator in atomsBufferCreators)
                {
                    creator.SetupForCreation(null);
                }
            }

            if (updateBonds || updateScheme)
            {
                if (updateBondSize)
                {
                    if (settings.StickThickness == 0 && (bondsBufferCreators == null || !(bondsBufferCreators[0] is BondLinesBufferCreator)))
                    {
                        bondsBufferCreators = new BondGeometryCreator[] { new BondLinesBufferCreator() }
                    }
                    ;
                    else if (settings.StickThickness > 0 && (bondsBufferCreators == null || !(bondsBufferCreators[0] is BondThickLinesBufferCreator)))
                    {
                        bondsBufferCreators = new BondGeometryCreator[] { new BondThickLinesBufferCreator(5) }
                    }
                    ;
                    bondsBufferCreators[0].SetupForCreation(null);
                }
            }

            lightBonds = false;
            lightAtoms = true;

            this.coDesc = coDesc;
        }
    }
コード例 #8
0
        public override void SetOutputDescription(CompleteOutputDescription coDesc)
        {
            bool updateAtomLOD = true;
            bool updateBondLOD = true;
            bool updateSymbols = true;
            bool updateGlow = true;

            bool updateBondSize = true;

            bool updateBonds = true;
            bool updateAtoms = true;
            bool updateScheme = true;

            if (this.coDesc != null)
            {
                this.coDesc = coDesc;
                updateAtoms = coDesc.CheckChange("AtomShadingDesc.");
                if (updateAtoms)
                {
                    updateSymbols = coDesc.CheckChange("AtomShadingDesc.", "SymbolText");
                    updateGlow = coDesc.CheckChange("SchemeSettings.", "Glow");
                }
                updateBonds = coDesc.CheckChange("BondShadingDesc.");

                updateScheme = coDesc.CheckChange("SchemeSettings.");
                if (updateScheme)
                {
                    updateAtomLOD = coDesc.CheckChange("SchemeSettings.", "AtomLOD");
                    updateBondLOD = coDesc.CheckChange("SchemeSettings.", "BondLOD");
                    
                    updateBondSize = coDesc.CheckChange("SchemeSettings.", "StickThickness");
                }
            }
            else
                this.coDesc = coDesc;
            BallAndStickSchemeSettings settings = (BallAndStickSchemeSettings)coDesc.SchemeSettings;

            int atomDetail1 = 4;
            int atomDetail2 = 1;
            if (updateAtoms || updateScheme)
            {
                /*if (updateAtomLOD)
                {*/
                    switch (settings.AtomLOD)
                    {
                        case 0:
                            atomDetail1 = 4;
                            atomDetail2 = 1;
                            break;
                        case 1:
                            atomDetail1 = 8;
                            atomDetail2 = 6;
                            break;
                        case 2:
                            atomDetail1 = 12;
                            atomDetail2 = 9;
                            break;
                        case 3:
                            atomDetail1 = 16;
                            atomDetail2 = 12;
                            break;
                        case 4:
                            atomDetail1 = 24;
                            atomDetail2 = 18;
                            break;
                        case 5:
                            atomDetail1 = 32;
                            atomDetail2 = 26;
                            break;
                    }
                //}
                int bufCount = 1;
                if (settings.ElectronChargeCloud)
                    bufCount++;
                if (settings.Glow > 0)
                    bufCount++;
                if (coDesc.AtomShadingDesc.SymbolText)
                    bufCount++;

                // TODO: Reconfigure previous creators
                atomsBufferCreators = new AtomGeometryCreator[bufCount];
                atomsBufferCreators[0] = new AtomSphereBufferCreator(0.2f, atomDetail1, atomDetail2);
                bufCount = 1;
                if (settings.Glow > 0)
                    atomsBufferCreators[bufCount++] = new AtomSpriteBufferCreator();
                if (settings.ElectronChargeCloud)
                    atomsBufferCreators[bufCount++] = new AtomMetaballsBufferCreator(true);
                if (coDesc.AtomShadingDesc.SymbolText)
                    atomsBufferCreators[bufCount++] = new AtomSymbolSpriteBufferCreator();

                foreach (AtomGeometryCreator creator in atomsBufferCreators)
                {
                    creator.SetupForCreation(null);
                }
            }

            if (updateBonds || updateScheme)
            {
                if (updateBondSize)
                {
                    if (settings.StickThickness == 0 && (bondsBufferCreators == null || !(bondsBufferCreators[0] is BondLinesBufferCreator)))
                        bondsBufferCreators = new BondGeometryCreator[] { new BondLinesBufferCreator() };
                    else if (settings.StickThickness > 0 && (bondsBufferCreators == null || !(bondsBufferCreators[0] is BondThickLinesBufferCreator)))
                        bondsBufferCreators = new BondGeometryCreator[] { new BondThickLinesBufferCreator(5) };
                    bondsBufferCreators[0].SetupForCreation(null);
                }
            }

            lightBonds = false;
            lightAtoms = true;

            this.coDesc = coDesc;
        }