UnityMol  0.9.6-875
UnityMol viewer / In developement
BallUpdate.cs
Go to the documentation of this file.
1 
66 using UnityEngine;
67 using System.Collections;
68 using UI;
69 using Molecule.Model;
70 
71 
72 public class BallUpdate : MonoBehaviour {
73  public static bool resetColors = true;
74  public static bool resetBondColors = true;
75  public static bool bondsReadyToBeReset = true;
76  public static bool resetRadii = true;
77 
78  public float rayon = 1.0f;
79  public float rayonFactor = 1.0f;
80  public float oldrayonFactor = 2.0f;
81  public static float radiusFactor = 1.0f;
82  public static float oldRadiusFactor = 1.0f;
83 
84  public long number=0;
85 
86  public Color atomcolor;
87  public Color oldatomcolor = Color.black;
88 
89  public bool independant = false;
90  public bool isSplineNode = false; // If true, this is not an atom but a node in a spline.
91 
92  public virtual Color AtomColor {
93  get { return atomcolor; }
94  set { atomcolor = value; }
95  }
96 
97  public virtual void SetRayonFactor(float rf) {
98  rayonFactor = rf;
99  }
100 
101  public virtual float GetRealRadius() {
102  return(rayon*rayonFactor*radiusFactor);
103  }
104 
105  public static void UpdateColorsFromModel() {
106  BallUpdate[] balls = GameObject.FindObjectsOfType(typeof(BallUpdate)) as BallUpdate[];
107  foreach(BallUpdate ball in balls)
108  ball.atomcolor = AtomModel.GetAtomColor(ball.tag);
109 
110  resetColors = true;
111  }
112 }
virtual void SetRayonFactor(float rf)
Definition: BallUpdate.cs:97
virtual Color AtomColor
Definition: BallUpdate.cs:92
static void UpdateColorsFromModel()
Definition: BallUpdate.cs:105
virtual float GetRealRadius()
Definition: BallUpdate.cs:101
static bool resetBondColors
Definition: BallUpdate.cs:74
static bool resetColors
Definition: BallUpdate.cs:73
static Color GetAtomColor(string atomType)
Gets the color of the atom type.
Definition: AtomModel.cs:163
Color atomcolor
Definition: BallUpdate.cs:86
long number
Definition: BallUpdate.cs:84
float rayon
Definition: BallUpdate.cs:78
bool isSplineNode
Definition: BallUpdate.cs:90
Color oldatomcolor
Definition: BallUpdate.cs:87
static float radiusFactor
Definition: BallUpdate.cs:81
static float oldRadiusFactor
Definition: BallUpdate.cs:82
static bool bondsReadyToBeReset
Definition: BallUpdate.cs:75
float oldrayonFactor
Definition: BallUpdate.cs:80
bool independant
Definition: BallUpdate.cs:89
float rayonFactor
Definition: BallUpdate.cs:79
Definition: GUIDisplay.cs:66
static bool resetRadii
Definition: BallUpdate.cs:76