UnityMol  0.9.6-875
UnityMol viewer / In developement
Selections.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 using System.Collections.Generic;
4 using Molecule.Model;
5 using UI;
6 
7 
8 
9 public class Selections : MonoBehaviour {
10 
11  private List<BallUpdate> selections = new List<BallUpdate>();
12 
13  public void selectResidue(int resid)
14  {
15  if(MoleculeModel.residues.ContainsKey(resid) == false)
16  return;
17 
19 
20  ArrayList atomIds = MoleculeModel.residues[resid];
21  foreach(int id in atomIds)
22  {
23  GameObject atom = MoleculeModel.atoms[id] as GameObject;
24  BallUpdate comp = atom.GetComponent<BallUpdate>();
25  selections.Add(comp);
26 // comp.independant = true;
27  comp.AtomColor = Color.magenta;
28  comp.SetRayonFactor(3.0f);
29  }
30  }
31 
32  public void clearSelection()
33  {
34  foreach(BallUpdate comp in selections)
35  {
36 // comp.independant = false;
39  }
40  selections.Clear();
41  }
42 
43 }
44 
virtual void SetRayonFactor(float rf)
Definition: BallUpdate.cs:97
virtual Color AtomColor
Definition: BallUpdate.cs:92
List< BallUpdate > selections
Definition: Selections.cs:11
void selectResidue(int resid)
Definition: Selections.cs:13
static List< AtomModel > atomsTypelist
The type of each atom.
static Color GetAtomColor(string atomType)
long number
Definition: BallUpdate.cs:84
void clearSelection()
Definition: Selections.cs:32
static Dictionary< int, ArrayList > residues
The residues.
Definition: GUIDisplay.cs:66