Example #1
0
        /// <summary>
        /// Creates a new <see cref="Residue" /> object.
        /// </summary>
        /// <param name="molecule">The molecule this residue belongs to.</param>
        /// <param name="atom">An atom in the residue. This is needed to obtain residue properties
        /// since there is no corresponding PDB file record.</param>
        internal Residue(Molecule molecule, Atom atom)
        {
            this.molecule = molecule;
            this.molecule.ShowCartoonChanged += this.MoleculeShowCartoonChanged;

            this.residueName           = atom.ResidueName;
            this.chainIdentifier       = atom.ChainIdentifier;
            this.residueSequenceNumber = atom.ResidueSequenceNumber;

            this.atoms = new List <Atom>();
            this.atoms.Add(atom);

            this.residueIdentifier = Residue.GetResidueIdentifier(this.residueName);
            this.residueColor      = Residue.GetResidueColor(this.residueName);

            this.structureColor = this.residueIdentifier != "O" ? Colors.LightGray : Colors.Red;

            this.colorScheme = ColorScheme.Structure;

            this.residueStripItems = new List <ResidueStripItem>();
            foreach (char character in this.residueIdentifier)
            {
                ResidueStripItem residueStripItem = new ResidueStripItem(character.ToString());
                residueStripItem.Residue = this;
                this.residueStripItems.Add(residueStripItem);
            }

            this.model = new Model3DGroup();

            this.UpdateColorView();
        }
Example #2
0
        private void AddResidueStripItem(ResidueStripItem residueStripItem, int row, int column)
        {
            while (column >= this.totalColumnCount)
            {
                this.identifierGrid.ColumnDefinitions.Add(new ColumnDefinition());
                this.totalColumnCount++;
            }

            residueStripItem.Size = new Size(ResidueControl.itemWidth, ResidueControl.itemHeight);
            residueStripItem.SetValue(Grid.RowProperty, row);
            residueStripItem.SetValue(Grid.ColumnProperty, column);
            this.identifierGrid.Children.Add(residueStripItem);
        }
Example #3
0
        /// <summary>
        /// Creates a new <see cref="Residue" /> object.
        /// </summary>
        /// <param name="molecule">The molecule this residue belongs to.</param>
        /// <param name="atom">An atom in the residue. This is needed to obtain residue properties
        /// since there is no corresponding PDB file record.</param>
        internal Residue(Molecule molecule, Atom atom)
        {
            this.molecule = molecule;
            this.molecule.ShowCartoonChanged += this.MoleculeShowCartoonChanged;

            this.residueName = atom.ResidueName;
            this.chainIdentifier = atom.ChainIdentifier;
            this.residueSequenceNumber = atom.ResidueSequenceNumber;

            this.atoms = new List<Atom>();
            this.atoms.Add(atom);

            this.residueIdentifier = Residue.GetResidueIdentifier(this.residueName);
            this.residueColor = Residue.GetResidueColor(this.residueName);

            this.structureColor = this.residueIdentifier != "O" ? Colors.LightGray : Colors.Red;

            this.colorScheme = ColorScheme.Structure;

            this.residueStripItems = new List<ResidueStripItem>();
            foreach (char character in this.residueIdentifier)
            {
                ResidueStripItem residueStripItem = new ResidueStripItem(character.ToString());
                residueStripItem.Residue = this;
                this.residueStripItems.Add(residueStripItem);
            }

            this.model = new Model3DGroup();

            this.UpdateColorView();
        }
        private void AddResidueStripItem(ResidueStripItem residueStripItem, int row, int column)
        {
            while (column >= this.totalColumnCount)
            {
                this.identifierGrid.ColumnDefinitions.Add(new ColumnDefinition());
                this.totalColumnCount++;
            }

            residueStripItem.Size = new Size(ResidueControl.itemWidth, ResidueControl.itemHeight);
            residueStripItem.SetValue(Grid.RowProperty, row);
            residueStripItem.SetValue(Grid.ColumnProperty, column);
            this.identifierGrid.Children.Add(residueStripItem);
        }