public void ClearAtomHighlights() { if (Molecule1 != null) { Molecule1.ClearAtomHighlights(); } if (Molecule2 != null) { Molecule2.ClearAtomHighlights(); } }
// atom highlights are generally re-rendered only when interaction settings have been updated public void RenderAtomHighlights(MolecularInteractionSettings interactionSettings) { List <HighLightedAtom> molecule1Atoms = new List <HighLightedAtom>(); List <HighLightedAtom> molecule2Atoms = new List <HighLightedAtom>(); if (interactions != null) { foreach (AtomInteraction interaction in interactions) { if (interaction.InteractionColour == null) { continue; } if ((interaction.InteractionType == InteractionType.Attractive && !interactionSettings.ShowAttractiveInteractions) || (interaction.InteractionType == InteractionType.Stable && !interactionSettings.ShowStableInteractions) || (interaction.InteractionType == InteractionType.Repulsive && !interactionSettings.ShowRepulsiveInteractions)) { continue; } HighLightedAtom atom1 = new HighLightedAtom(); atom1.Atom = interaction.Atom1; atom1.HighlightColor = (Color)interaction.InteractionColour; molecule1Atoms.Add(atom1); HighLightedAtom atom2 = new HighLightedAtom(); atom2.Atom = interaction.Atom2; atom2.HighlightColor = (Color)interaction.InteractionColour; molecule2Atoms.Add(atom2); } } Molecule1.RenderAtomHighlights(molecule1Atoms); Molecule2.RenderAtomHighlights(molecule2Atoms); }