5 using System.Collections.Generic;
16 public override void Init () {
25 Debug.Log(
"Destroying Spheres");
29 foreach(BallUpdateSphere sb
in balls) {
32 GameObject.Destroy(sb.gameObject);
49 foreach(BallUpdateSphere sp
in balls){
53 sp.GetComponent<Renderer>().enabled =
true;
54 sp.GetComponent<Collider>().enabled =
true;
65 foreach(BallUpdateSphere sp
in balls){
66 sp.GetComponent<Renderer>().enabled =
false;
68 sp.GetComponent<Collider>().enabled =
false;
75 sp.GetComponent<Renderer>().shadowCastingMode = ShadowCastingMode.On;
76 sp.GetComponent<Renderer>().receiveShadows =
true;
81 sp.GetComponent<Renderer>().shadowCastingMode = ShadowCastingMode.Off;
82 sp.GetComponent<Renderer>().receiveShadows =
false;
117 public override void SetColor(Color col, List<string> atom,
string residue =
"All",
string chain =
"All") {
119 if(!atom.Contains (
"All")){
120 if(residue ==
"All"){
126 if(atom.Contains(sp.tag))
141 if(atom.Contains(sp.tag)
160 if(atom.Contains(sp.tag)
177 if(atom.Contains(sp.tag)
194 if(residue ==
"All"){
245 public override void SetColor(Color col,
int atomNum) {
266 public override void SetRadii(List<string> atom,
string residue =
"All",
string chain =
"All") {
267 if(!atom.Contains (
"All")){
268 if(residue ==
"All"){
273 if(atom.Contains(sp.tag))
287 if(atom.Contains(sp.tag)
305 if(atom.Contains(sp.tag)
321 if(atom.Contains(sp.tag)
338 if(residue ==
"All"){
401 if(sp.transform.position == pos)
402 return sp.GetComponent<Renderer>().material.GetColor(
"_Color");
416 return balls[id].gameObject;
425 sp.transform.localScale =
new Vector3( buffer, buffer, buffer);
437 for (
int i=0; i<sphereGameObjects.Length; i++) {
447 for (
int i=0; i<sphereGameObjects.Length; i++) {
448 Destroy(sphereGameObjects[i].GetComponent<MouseOverMoleculeIMDSimulation>());
467 for (
int j=0; j<balls.Length; j++){
468 int i = (int)balls[j].number;
476 for (
int j=0; j<balls.Length; j++){
477 int i = (int)balls[j].number;
486 float minDist = Vector3.Distance(closestAtom.gameObject.transform.position, position);
491 for (
int i = 1; i < balls.Length; i++) {
493 tempDist = Vector3.Distance(tempAtom.gameObject.transform.position, position);
494 if (tempDist < minDist) {
496 closestAtom = tempAtom;
500 selection.
go = closestAtom.gameObject;
506 for (
int j=0; j<balls.Length; j++){
507 if (balls[j].tag==
"H")
508 balls[j].GetComponent<Renderer>().enabled=!hide;
void DestroyMouseOversIMDSimulation()
Destroys the mouse overs
override void SetColor(Color col, List< string > atom, string residue="All", string chain="All")
Sets the color of atoms.
override void ResetPositions()
override void DisableShadows()
void CreateMouseOversIMDSimulation()
Creates the mouse overs, needed when an IMD simulation and mouse interaction are required ...
override void DestroyAll()
override void SetRadii(int id)
Changes the scale for Atom selection.
static List< string > atomsNamelist
The name of each atom.
static List< string > atomsChainList
The chain of each atom.
SingleAtomSelection getClosestAtomGameObject(Vector3 position)
static List< AtomModel > atomsTypelist
The type of each atom.
static List< Vector3 > atomsIMDSimulationLocationlist
The coordinates of each atom, simulated through an IMD simulation.
override void SetColor(Color col, int atomNum)
Sets the color of a specific atom.
override void ToggleDistanceCueing(bool enabling)
static void setCurrentAtomManager(GenericManager manager)
!WiP Includes FLAGS of GUI.
override void ResetIMDSimulationPositions()
void ResetColors()
Resets the colors of all spheres and sticks.
override void EnableShadows()
!WiP manage GUI, and provide static strings for the GUI.
override void DisableRenderers()
Disables the renderers for all objects managed by the instance of the manager.
static List< Color > atomsColorList
The color of each atom.
static float radiusFactor
override void showHydrogens(bool hide)
static float oldRadiusFactor
static bool bondsReadyToBeReset
override void Init()
Initializes this sphere manager.
static List< string > atomsResnamelist
The name of the residue to which each atom belongs.
Color GetColor(Vector3 pos)
Gets the color of the atom at the location "pos".
static float globalRadius
static bool quickSelection
override void SetRadii(List< string > atom, string residue="All", string chain="All")
override void ResetRadii()
override GameObject GetBall(int id)
Gets the GameObject from balls at the position "id".
static GameObject[] sphereGameObjects
void setAtomId(int atomId)
override void EnableRenderers()
Enables the renderers for all objects managed by the instance of the manager.
static List< float > atomsLocalScaleList
static List< float[]> atomsLocationlist
The coordinates of each atom.