UnityMol  0.9.6-875
UnityMol viewer / In developement
HBallMeshManager.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 using System.Collections.Generic;
4 using UI;
5 using UnityEngine.Rendering;
6 
7 using Molecule.Model;
8 using System.Linq;
9 
10 
12 
13  public GameObject[] hball_meshes = new GameObject[0];
14  public GameObject[] collidersGO;
15  public static int selectionAtoms;
16  private List<int> texturesToUpdate;
17  public Dictionary<int,KeyValuePair<int,int> > coordAtomTexture;
18  public Material[] materialsAtoms;
19  public Texture2D[] texturesAtoms;
20  public Material[] materialsSticks;
21  public static float brightness = 1.0f;
22  public static float shininess = 0.0f;
23  public static bool resetBrightness = false;
24  public static bool resetRadii = false;
25  public static bool resetShininess = false;
26  public static float scaleAtoms = 1.0f;
27  public GameObject collidersParent;
28 
29 
33  public override void Init () {
34  enabled = true;
35  texturesToUpdate = new List<int>();
36  materialsAtoms = new Material[hball_meshes.Length];
37  texturesAtoms = new Texture2D[hball_meshes.Length];
38  for(int i=0;i<hball_meshes.Length;i++){
39  materialsAtoms[i] = hball_meshes[i].GetComponent<Renderer>().material;
40  texturesAtoms[i] = (Texture2D)materialsAtoms[i].mainTexture;
41  }
42  isInit = true;
44  }
48  public override void DestroyAll() {
49 
50  for(int i=0;i<hball_meshes.Length;i++)
51  GameObject.Destroy(hball_meshes[i]);
52  hball_meshes = new GameObject[0];
53 
54  if(collidersGO.Length > 0)
55  GameObject.Destroy(collidersParent);
56  // for(int i=0;i<collidersGO.Length;i++)
57  // GameObject.Destroy(collidersGO[i]);
58 
59  collidersGO = new GameObject[0];
60 
61  isInit = false;
62 
63  }
64  public override void ToggleDistanceCueing(bool enabling) {
65  float attenuation;
66  attenuation = enabling? 1f : 0f;
67  for (int i=0; i<hball_meshes.Length; i++)
68  materialsAtoms[i].SetFloat("_Attenuation", attenuation);
69  }
70 
71 
87  public override void SetColor(Color col, List<string> atom, string residue = "All", string chain = "All"){
88 
89  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
90 
91  if(!atom.Contains ("All")){
92  if(residue == "All"){
93  if(chain == "All"){
94  // ---------- ATOM
95  // Debug.Log("ATOM");
97  for (int i=0; i< MoleculeModel.atomsNamelist.Count; i++) {
99  if(atom.Contains(aModel.type)){
101  if(coordAtomTexture.TryGetValue(i,out res)){
102  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
103  texturesToUpdate.Add(res.Key);
104  }
105  }
106  }
107  }
108  else{
109  for (int i=0; i< MoleculeModel.atomsNamelist.Count; i++) {
110  if(atom.Contains(MoleculeModel.atomsNamelist[i])){
112  if(coordAtomTexture.TryGetValue(i,out res)){
113  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
114  texturesToUpdate.Add(res.Key);
115  }
116  }
117  }
118  }
119  }
120  else{
121  // ---------- ATOM + CHAIN
122  // Debug.Log("ATOM+CHAIN");
124  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
126  if(atom.Contains(aModel.type)
127  && Molecule.Model.MoleculeModel.atomsChainList[i] == chain){
128 
130  if(coordAtomTexture.TryGetValue(i,out res)){
131  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
132  texturesToUpdate.Add(res.Key);
133  }
134  }
135  }
136  }
137  else{
138  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
139  if(atom.Contains(MoleculeModel.atomsNamelist[i])
140  && Molecule.Model.MoleculeModel.atomsChainList[i] == chain){
141 
143  if(coordAtomTexture.TryGetValue(i,out res)){
144  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
145  texturesToUpdate.Add(res.Key);
146  }
147  }
148  }
149  }
150  }
151  }
152 
153  else{
154  if(chain == "All"){
155  // ---------- ATOM + RESIDUE
157  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
159  if(atom.Contains(aModel.type)
160  && Molecule.Model.MoleculeModel.atomsResnamelist[i] == residue){
162  if(coordAtomTexture.TryGetValue(i,out res)){
163  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
164  texturesToUpdate.Add(res.Key);
165  }
166  }
167  }
168  }
169  else{
170  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
171  if(atom.Contains(Molecule.Model.MoleculeModel.atomsNamelist[i])
172  && Molecule.Model.MoleculeModel.atomsResnamelist[i] == residue){
174  if(coordAtomTexture.TryGetValue(i,out res)){
175  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
176  texturesToUpdate.Add(res.Key);
177  }
178  }
179  }
180  }
181  }
182  else{
183  // ---------- ATOM + RESIDUE + CHAIN
185  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
187  if(atom.Contains(aModel.type)
189  && Molecule.Model.MoleculeModel.atomsChainList[i] == chain){
191  if(coordAtomTexture.TryGetValue(i,out res)){
192  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
193  texturesToUpdate.Add(res.Key);
194  }
195  }
196  }
197  }
198  else{
199  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
200  if(atom.Contains(Molecule.Model.MoleculeModel.atomsNamelist[i])
202  && Molecule.Model.MoleculeModel.atomsChainList[i] == chain){
204  if(coordAtomTexture.TryGetValue(i,out res)){
205  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
206  texturesToUpdate.Add(res.Key);
207  }
208  }
209  }
210  }
211  }
212  }
213  }
214  else{
215  if(residue == "All"){
216  if(chain == "All"){
217  // ---------- EVERYTHING
218  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
220  if(coordAtomTexture.TryGetValue(i,out res)){
221  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
222  texturesToUpdate.Add(res.Key);
223  }
224  }
225  }
226  else{
227  // ---------- CHAIN
228  // Debug.Log("CHAIN");
229  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
230  if(Molecule.Model.MoleculeModel.atomsChainList[i] == chain){
232  if(coordAtomTexture.TryGetValue(i,out res)){
233  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
234  texturesToUpdate.Add(res.Key);
235  }
236  }
237  }
238  }
239  }
240  else{
241  if(chain == "All"){
242  // ---------- RESIDUE
243  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
244  if(Molecule.Model.MoleculeModel.atomsResnamelist[i] == residue){
246  if(coordAtomTexture.TryGetValue(i,out res)){
247  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
248  texturesToUpdate.Add(res.Key);
249  }
250  }
251  }
252  }
253  else{
254  // ---------- CHAIN + RESIDUE
255  // Debug.Log("RESIDUE+CHAIN");
256  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++){
258  && Molecule.Model.MoleculeModel.atomsChainList[i] == chain){
260 
261  if(coordAtomTexture.TryGetValue(i,out res)){
262  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
263  texturesToUpdate.Add(res.Key);
264  }
265  }
266  }
267  }
268  }
269  }
270 
272  ApplyTextures();
273 
274  }
275 
285  public override void SetColor(Color col, int atomNum) {
286 
287  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
288 
289  if(atomNum >= MoleculeModel.atomsTypelist.Count){
290  Debug.LogError("Invalid atom number : "+atomNum);
291  return;
292  }
293 
294  AtomModel aModel = (AtomModel)MoleculeModel.atomsTypelist[atomNum];
295 
297  if(coordAtomTexture.TryGetValue(atomNum,out res)){
298  texturesAtoms[res.Key].SetPixel(1,res.Value,col);
299  texturesToUpdate.Add(res.Key);
300  }
301  ApplyTextures();
302  //TODO only reset the changed colors
304 
305  }
306 
319  public override void SetRadii(List<string> atom, string residue = "All", string chain = "All"){
320  Debug.Log("SetRadii =========================");
321  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
322  if(!atom.Contains ("All")){
323  if(residue == "All"){
324  if(chain == "All"){
325  // ---------- ATOM
326  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++) {
327  if(atom.Contains(MoleculeModel.atomsNamelist[i])){
329  if(coordAtomTexture.TryGetValue(i,out res)){
330  // texturesAtoms[res.Key].SetPixel(0,res.Value,EncodeFloatToColor.EncodeFloatRGBA(...*GUIDisplay.newScale));
331  texturesToUpdate.Add(res.Key);
332 
333  }
334  }
335  }
336  }
337  /*
338  else{
339  // ---------- ATOM + CHAIN
340  if(GUIDisplay.quickSelection){
341  for (int i=0; i<hballs.Length; i++) {
342  if(atom.Contains(hballs[i].tag)
343  && Molecule.Model.MoleculeModel.atomsChainList[(int)hballs[i].number] == chain)
344  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
345  }
346  }else{
347  for (int i=0; i<hballs.Length; i++) {
348  if(atom.Contains(Molecule.Model.MoleculeModel.atomsNamelist[(int)hballs[i].number])
349  && Molecule.Model.MoleculeModel.atomsChainList[(int)hballs[i].number] == chain)
350  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
351  }
352  }
353  }
354  }
355  else{
356  if(chain == "All"){
357  // ---------- ATOM + RESIDUE
358  if(GUIDisplay.quickSelection){
359  for (int i=0; i<hballs.Length; i++) {
360  if(atom.Contains(hballs[i].tag)
361  && Molecule.Model.MoleculeModel.atomsResnamelist[(int)hballs[i].number] == residue)
362  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
363  }
364  }else{
365  for (int i=0; i<hballs.Length; i++) {
366  if(atom.Contains(Molecule.Model.MoleculeModel.atomsNamelist[(int)hballs[i].number])
367  && Molecule.Model.MoleculeModel.atomsResnamelist[(int)hballs[i].number] == residue)
368  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
369  }
370  }
371  }
372  else{
373  // ---------- ATOM + CHAIN + RESIDUE
374  if(GUIDisplay.quickSelection){
375  for (int i=0; i<hballs.Length; i++) {
376  if(atom.Contains(hballs[i].tag)
377  && Molecule.Model.MoleculeModel.atomsResnamelist[(int)hballs[i].number] == residue
378  && Molecule.Model.MoleculeModel.atomsChainList[(int)hballs[i].number] == chain)
379  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
380  }
381  }else{
382  for (int i=0; i<hballs.Length; i++) {
383  if(atom.Contains(Molecule.Model.MoleculeModel.atomsNamelist[(int)hballs[i].number])
384  && Molecule.Model.MoleculeModel.atomsResnamelist[(int)hballs[i].number] == residue
385  && Molecule.Model.MoleculeModel.atomsChainList[(int)hballs[i].number] == chain)
386  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
387  }
388  }
389  }
390  }
391  }
392  else{
393  if(residue == "All"){
394  if(chain == "All"){
395  // ---------- EVERYTHING
396  for (int i=0; i<hballs.Length; i++) {
397  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
398  }
399  }
400  else{
401  // ---------- CHAIN
402  for (int i=0; i<hballs.Length; i++) {
403  if(Molecule.Model.MoleculeModel.atomsChainList[(int)hballs[i].number] == chain)
404  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
405  }
406  }
407  }
408  else{
409  if(chain == "All"){
410  // ---------- RESIDUE
411  for (int i=0; i<hballs.Length; i++) {
412  if(Molecule.Model.MoleculeModel.atomsResnamelist[(int)hballs[i].number] == residue)
413  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
414  }
415  }
416  else{
417  // ---------- CHAIN + RESIDUE
418  for (int i=0; i<hballs.Length; i++) {
419  if(Molecule.Model.MoleculeModel.atomsResnamelist[(int)hballs[i].number] == residue
420  && Molecule.Model.MoleculeModel.atomsChainList[(int)hballs[i].number] == chain)
421  Molecule.Model.MoleculeModel.atomsLocalScaleList[(int)hballs[i].number] = (GUIDisplay.newScale);
422  }
423  }*/
424  }
425  }
426 
427  }
434  public override void SetRadii(int id){
435 
436  }
437 
438  public void SetTexture(Texture texture){
439  for (int i=0; i< hball_meshes.Length; i++){
440  materialsAtoms[i].SetTexture("_MatCap", texture);
441  }
442  HStickMeshManager.texture = texture;
444  }
445  public void SetTexture(string resource_name){
446  Texture text2D = (Texture)Resources.Load(resource_name);
447  SetTexture(text2D);
448  }
449 
450 
451 
461  public override GameObject GetBall(int id){
462  // BallUpdateHB[] hballs = GameObject.FindObjectsOfType(typeof(BallUpdateHB)) as BallUpdateHB[];
463  // return hballs[id].gameObject;
464  //Returns null if other managers has not be initialized
465  return (GameObject)Molecule.Model.MoleculeModel.atoms[id];
466  // return collidersGO[id];
467  // return null;
468  }
469 
473  public override void ResetPositions(){
474 
475  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
476  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++) {
477  if(coordAtomTexture.TryGetValue(i,out res)){
478  float[] atomPos = Molecule.Model.MoleculeModel.atomsLocationlist[i];
479  texturesAtoms[res.Key].SetPixel(2,res.Value,EncodeFloatToColor.EncodeFloatRGBA(atomPos[0]));
480  texturesAtoms[res.Key].SetPixel(3,res.Value,EncodeFloatToColor.EncodeFloatRGBA(atomPos[1]));
481  texturesAtoms[res.Key].SetPixel(4,res.Value,EncodeFloatToColor.EncodeFloatRGBA(atomPos[2]));
482 
483  Vector3 vec3AtomPos = Vector3.zero;
484  vec3AtomPos.x = atomPos[0];
485  vec3AtomPos.y = atomPos[1];
486  vec3AtomPos.z = atomPos[2];
487  collidersGO[i].transform.position = vec3AtomPos;
488 
489  texturesToUpdate.Add(res.Key);
490  }
491  }
492 
493  ApplyTextures();
494 
495  }
496 
500  public override void ResetIMDSimulationPositions(){
501 
502  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
503  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++) {
504  if(coordAtomTexture.TryGetValue(i,out res)){
506 
507  texturesAtoms[res.Key].SetPixel(2,res.Value,EncodeFloatToColor.EncodeFloatRGBA(atomPos.x));
508  texturesAtoms[res.Key].SetPixel(3,res.Value,EncodeFloatToColor.EncodeFloatRGBA(atomPos.y));
509  texturesAtoms[res.Key].SetPixel(4,res.Value,EncodeFloatToColor.EncodeFloatRGBA(atomPos.z));
510 
511  collidersGO[i].transform.position = atomPos;
512 
513  texturesToUpdate.Add(res.Key);
514  }
515  }
516 
517  ApplyTextures();
518 
519  }
520 
521 
525  public override void DisableRenderers() {
527  {
529  }
530 
531  for (int i=0; i< hball_meshes.Length; i++)
532  hball_meshes[i].GetComponent<Renderer>().enabled = false;
533 
534  for(int i=0;i<collidersGO.Length;i++)
535  collidersGO[i].GetComponent<Collider>().enabled = false;
536  }
537 
538 
542  public override void EnableRenderers(){
545  {
547  }
548  for (int i=0; i< hball_meshes.Length; i++)
549  hball_meshes[i].GetComponent<Renderer>().enabled = true;
550  for(int i=0;i<collidersGO.Length;i++)
551  collidersGO[i].GetComponent<Collider>().enabled = true;
552 
553  }
554 
555  public override void EnableShadows(){
556  for (int i=0; i< hball_meshes.Length; i++){
557  hball_meshes[i].GetComponent<Renderer>().shadowCastingMode = ShadowCastingMode.On;
558  hball_meshes[i].GetComponent<Renderer>().receiveShadows = true;
559  hball_meshes[i].GetComponent<Renderer>().material.shader = Shader.Find("FvNano/Ball HyperBalls Shadow Merged");
560  }
561  }
562  public override void DisableShadows(){
563  for (int i=0; i< hball_meshes.Length; i++){
564  hball_meshes[i].GetComponent<Renderer>().shadowCastingMode = ShadowCastingMode.Off;
565  hball_meshes[i].GetComponent<Renderer>().receiveShadows = false;
566  hball_meshes[i].GetComponent<Renderer>().material.shader = Shader.Find("FvNano/Ball HyperBalls Merged");
567  }
568  }
569 
570 
571  public void SetBrightness(float val){
572  brightness = val;
573  }
574  public void ResetBrightness(){
575  for(int i=0;i<materialsAtoms.Length;i++)
576  materialsAtoms[i].SetFloat("_Brightness",brightness);
577 
580  resetBrightness = false;
581  }
582 
583  public override void ResetRadii(){
584  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
585  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++) {
586  if(coordAtomTexture.TryGetValue(i,out res)){
587  float oriRadius = Molecule.Model.MoleculeModel.atomsTypelist[i].radius;
588  texturesAtoms[res.Key].SetPixel(0,res.Value,EncodeFloatToColor.EncodeFloatRGBA(oriRadius
591 
592  collidersGO[i].GetComponent<SphereCollider>().radius = oriRadius
595 
596  texturesToUpdate.Add(res.Key);
597  }
598  }
599  for(int i=0;i<collidersGO.Length;i++){
600  collidersGO[i].GetComponent<SphereCollider>().radius *= RepresentationOldGUI.globalRadius;
601  }
602  ApplyTextures();
603  resetRadii = false;
605  HStickManager.adjustRadii = true;
606 
607  }
608  public void ResetShininess(){
609  for(int i=0;i<materialsAtoms.Length;i++)
610  materialsAtoms[i].SetFloat("_Shininess",shininess);
611  resetShininess = false;
616  }
617 
618  public void ApplyTextures(){
619  List<int> idtex = texturesToUpdate.Distinct().ToList();
620  foreach(int id in idtex){
621  if(id != -1)
622  texturesAtoms[id].Apply(false,false);
623  }
624 
625  texturesToUpdate.Clear();
626  }
627 
628  public override void showHydrogens(bool hide) {
629  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
630 
631  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++) {
632  if(MoleculeModel.atomsTypelist[i].type == "H"){
633  if(coordAtomTexture.TryGetValue(i,out res)){
634  if(hide)
635  texturesAtoms[res.Key].SetPixel(5,res.Value,Vector4.zero);
636  else
637  texturesAtoms[res.Key].SetPixel(5,res.Value,Vector4.one);
638 
639  texturesToUpdate.Add(res.Key);
640  }
641  }
642  }
643  ApplyTextures();
644 
645  }
646  public void hideAtom(int idAtom, bool show){
647  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
648  if(coordAtomTexture.TryGetValue(idAtom,out res)){
649  if(show)
650  texturesAtoms[res.Key].SetPixel(5,res.Value,Vector4.one);
651  else
652  texturesAtoms[res.Key].SetPixel(5,res.Value,Vector4.zero);
653 
654  texturesToUpdate.Add(res.Key);
655  }
656  }
657  public void ResetVisibility(){
658  KeyValuePair<int,int> res = new KeyValuePair<int,int>();
659 
660  for (int i=0; i<MoleculeModel.atomsNamelist.Count; i++) {
661  if(coordAtomTexture.TryGetValue(i,out res)){
662  texturesAtoms[res.Key].SetPixel(5,res.Value,Vector4.one);
663  texturesToUpdate.Add(res.Key);
664  }
665  }
666  ApplyTextures();
667  }
668 
669  //Dirty but mandatory
670  void Update(){
671  // if(UIData.atomtype != UIData.AtomType.optihb) {
672  // enabled = false;
673  // return;
674  // }
675  if(resetBrightness)
676  ResetBrightness();
677 
678  if(resetRadii)
679  ResetRadii();
680 
681  if(resetShininess)
682  ResetShininess();
683  }
684 
685  // Returns the closest atom game object in space from a given position during an IMD simulation.
687 
688  // Instantiate atom selection mono behavior script for every atom.
690  for (int i=0; i<collidersGO.Length; i++) {
691  MouseOverMoleculeIMDSimulation mover = (MouseOverMoleculeIMDSimulation) collidersGO[i].AddComponent<MouseOverMoleculeIMDSimulation>();
692  mover.setAtomId(i);
693  }
694  }
695 
696  // Deinstantiate atom selection mono behavior script for every atom.
698  for (int i=0; i<collidersGO.Length; i++) {
699  Destroy(collidersGO[i].GetComponent<MouseOverMoleculeIMDSimulation>());
700  }
701  }
702 }
void SetBrightness(float val)
override void SetRadii(int id)
Changes the scale for Atom selection.
override void ResetPositions()
Resets the positions of all balls.
override void Init()
Initalizes this instance.
static bool resetShininess
static float newScale
Definition: GUIDisplay.cs:144
override void SetColor(Color col, int atomNum)
Sets the color of a specific atom.
static float shininess
Material[] materialsSticks
static bool resetBrightness
void hideAtom(int idAtom, bool show)
GameObject[] hball_meshes
SingleAtomSelection getClosestAtomGameObject(Vector3 position)
static float shininess
override void DestroyAll()
Disable and destroys all the Hyperballs
static bool resetBrightness
override void EnableRenderers()
Enables the renderers for the entire set of balls and sticks.
override void ResetRadii()
static List< string > atomsNamelist
The name of each atom.
override void ToggleDistanceCueing(bool enabling)
static List< string > atomsChainList
The chain of each atom.
void DestroyMouseOversIMDSimulation()
static float brightness
static List< AtomModel > atomsTypelist
The type of each atom.
static List< Vector3 > atomsIMDSimulationLocationlist
The coordinates of each atom, simulated through an IMD simulation.
GameObject collidersParent
override void EnableShadows()
void SetTexture(string resource_name)
List< int > texturesToUpdate
static Vector4 EncodeFloatRGBA(float v)
Texture2D[] texturesAtoms
static bool resetTexture
static void setCurrentAtomManager(GenericManager manager)
Definition: UnityMolMain.cs:63
static bool resetBrightness
static float shininess
static Texture texture
static bool resetRadii
static bool resetShininess
!WiP manage GUI, and provide static strings for the GUI.
Definition: GUIDisplay.cs:94
static List< Color > atomsColorList
The color of each atom.
override void SetRadii(List< string > atom, string residue="All", string chain="All")
Changes the scale of the atoms.
override void showHydrogens(bool hide)
Dictionary< int, KeyValuePair< int, int > > coordAtomTexture
static bool resetRadii
override void SetColor(Color col, List< string > atom, string residue="All", string chain="All")
Sets the color of atoms.
Material[] materialsAtoms
override GameObject GetBall(int id)
Gets the GameObject from hballs at the position "id".
static int selectionAtoms
static float scaleAtoms
override void ResetIMDSimulationPositions()
Resets the positions of all balls.
static bool resetShininess
static List< string > atomsResnamelist
The name of the residue to which each atom belongs.
GameObject[] collidersGO
static bool quickSelection
Definition: GUIDisplay.cs:157
override void DisableRenderers()
Disables the renderers for the entire set of balls and sticks.
static bool adjustRadii
static bool resetColors
void SetTexture(Texture texture)
override void DisableShadows()
Definition: GUIDisplay.cs:66
static List< float > atomsLocalScaleList
void CreateMouseOversIMDSimulation()
static List< float[]> atomsLocationlist
The coordinates of each atom.