UnityMol  0.9.6-875
UnityMol viewer / In developement
GUIDisplay.cs
Go to the documentation of this file.
1 
66 namespace UI {
67  using UnityEngine;
68  using System.Collections;
69  using System.IO;
70  using System.Collections.Generic;
72  using Molecule.View;
73  using Molecule.Model;
74  using System.Text;
75 
94  public class GUIDisplay {
95 
98 
99 
100 
101  public static float guiScale = 1.0f;
102  public static float oldGuiScale = guiScale;
103  /* TODO:
104  * GET RID OF STATIC VARIABLES ?
105  * See also : Singleton design pattern.
106  */
107  public static string pdbID="1KX2";
108  public static string pdbServer = "http://www.pdb.org/pdb/files/";
109  public static string proxyServer = ""; //OLD proxy : cache.ibpc.fr
110  public static string proxyPort = ""; //OLD port : 8080
111  private StringBuilder proxyPortValidate;
112 
113 // private static string idField="172.27.0.141";
114 // private static string PortField="843";
115  public bool display=false;
116  public bool displayChoice=false;
117 // private GUIContent []list;
118  public static string directorypath="/opt/src/Unity/UnityMol_SVN/";
119  // public static string directorypath="/opt/Unity3D/UnityMol_SVN/";
120  public static string file_base_name = "";
121  public static string file_extension = ".pdb";
122 
123  public static string id="";
124  public static bool m_max=false;
125  public static bool m_texture=false; // texture menu is displayed if true
126 // public static int texSet_max=30; /*!< Maximum number of full texture pages */ // Actually unused
127 // public static int besttexSet_min=-5; /*!< Maximum number of condensed texture pages (negative value!) */
128  public static int texture_set=0;
129 
130  public bool LoginFlag=false;
131  public bool LoginAgainFlag=false;
132 
134 
136  public string m_textPath;
137  public string m_last_texture_dir = null;
138  public string m_lastOpenDir = null ;
139  public Texture2D ext_surf;
140 
141  private Texture2D directoryimage, fileimage;
142 
143  public static float oldScale = 100f;
144  public static float newScale = 100f;
145 
146 /* private static Dictionary<string, bool> applyToAtoms = new Dictionary<string, bool>(){
147  {"H", false},
148  {"C", false},
149  {"N", false},
150  {"O", false},
151  {"P", false},
152  {"S", false},
153  {"X", false},
154  };
155 */
156 
157  public static bool quickSelection = true;
158  //public static bool extendedSelection = false;
159 
160  public static List<string> applyToAtoms = new List<string>();
161  private static string applyToRes = "All";
162  private static string applyToChain = "All";
163 
164  public struct RendererInfos {
165  public string atom;
166  public string residue;
167  public string chain;
168  public Color color;
169  public string texture;
170  }
171  private static Dictionary<string, List<RendererInfos>> panelDict = new Dictionary<string, List<RendererInfos>>();
172 
173  // Those are public because "SurfaceTexture" in LoadTypeGUI use them for the Surface Textures Menu.
174  // BTW, I don't really get how things are distributed between GUIDisplay, LoadTypeGUI or GUIMoleculeController... [Erwan]
175  public static List<string> textureMenuTitles = new List<string>();
176  public static List<string[]> textureMenuList = new List<string[]>();
177 
178  // public to be used in PaperChain script
179  public static Dictionary<string, Color> colorByResiduesDict = new Dictionary<string, Color>();
180  public static Dictionary<string, Color> ChainColorDict = new Dictionary<string, Color>();
181 
182  static Color[] colorButtonNew = new Color[200];
183  static Texture2D colorButton = new Texture2D(20,10,TextureFormat.ARGB32,false);
184 
185  static ColorObject buttonColor = new ColorObject(Color.red);
186 
187  // MB for centered text
188  protected GUIStyle CentredText {
189  get {
190  if (m_centredText == null) {
191  m_centredText = new GUIStyle(GUI.skin.label);
192  m_centredText.alignment = TextAnchor.MiddleCenter;
193  }
194  return m_centredText;
195  }
196  }
197  protected GUIStyle m_centredText;
198 
199  //Aurelien : determines how fast previous/next step buttons are
200  private int nbSteps = 1;
201 
202 
203  private Camera mainCamera = null;
204 // private int left=0;//0:oxygen;1:sulphur;2:carbon;3:nitrogen;4:phosphorus;5:unknown
205 
206  // Styles used by the GUI
207  // For labels
208  public static GUIStyle headerStyle = new GUIStyle();
209  public static GUIStyle errorStyle = new GUIStyle();
210 
211  // Styles used by Artemis plots
212  public static GUIStyle artemisPlotWhiteStyle = new GUIStyle();
213  public static GUIStyle artemisPlotGreenStyle = new GUIStyle();
214  public static GUIStyle artemisPlotRedStyle = new GUIStyle();
215  public static GUIStyle artemisPlotOrangeStyle = new GUIStyle();
216  public static GUIStyle artemisPlotBlueStyle = new GUIStyle();
217 
218  public static GUIStyle cytosineStyle = new GUIStyle();
219  public static GUIStyle guanineStyle = new GUIStyle();
220  public static GUIStyle adenineStyle = new GUIStyle();
221  public static GUIStyle uracileStyle = new GUIStyle();
222 
230  public GUIDisplay() {
234  if (Screen.width > 900)
235  guiScale = 0.9f;
236  if (Screen.width > 1200)
237  guiScale = 0.8f;
238  if (Screen.width > 1500)
239  guiScale = 0.76f;
240  if (Screen.width > 1900)
241  guiScale = 0.74f;
242  if (Screen.width > 2500)
243  guiScale = 0.66f;
244 
245  #if !UNITY_WEBPLAYER
246  m_last_texture_dir = System.IO.Directory.GetCurrentDirectory();
247  m_lastOpenDir = System.IO.Directory.GetCurrentDirectory();
248  #endif
249 
250  for (int i =0; i <200; i++){
251  colorButtonNew[i]= Color.red;
252  }
253 
254  ChangeAllColors();
255 
256  // AT:: temporary hack to test webplayer ------------------
257  // #if UNITY_WEBPLAYER
258  // {
259  // UIData.fetchPDBFile = false;
260  // UIData.isOpenFile = true;
261  // UIData.atomtype = UIData.AtomType.particleball;
262  // UIData.bondtype = UIData.BondType.nobond;
263  // GUIMoleculeController.showOpenMenu=false;
264  // }
265  // #endif
266 
267  // AT:: temporary hack to test webplayer ------------------
268  }
269 
274  Debug.Log ("If you don't see me, Uniteh brOke!");
275  }
276 
277  public void OpenFileCallback(string path) {
278  m_fileBrowser = null;
279  if(path == null)
280  return;
281 
282  if (UIData.loadHireRNA == false) {
283  UIData.ffType = UIData.FFType.atomic;
285  }
286  else
287  {
288  UIData.ffType = UIData.FFType.HiRERNA;
290  }
291 
292  directorypath = System.IO.Path.GetDirectoryName(path);
293  m_lastOpenDir = directorypath;
294  file_base_name = directorypath + System.IO.Path.DirectorySeparatorChar +
295  System.IO.Path.GetFileNameWithoutExtension(path);
296  file_extension = System.IO.Path.GetExtension(path).Substring(1);
297 
298  id = System.IO.Path.GetFileNameWithoutExtension(path);
299 
300  UIData.fetchPDBFile = false;
301  UIData.isOpenFile=true;
302  //Default representation when loaded
305  // UIData.atomtype=UIData.AtomType.hyperball;
306  // UIData.bondtype=UIData.BondType.hyperstick;
307  }
308 
309  //Aurélien : function called by the Open File button in the reaction menu
310  public void OpenReactionCallback(string path)
311  {
312  //Clears the previous molecule or reaction if needed
314  id="";
315 
317  //GUIMoleculeController.pdbgen = false;
318 
319  Reaction.coord.Clear();
320  }
321 
322  m_fileBrowser = null;
323  if(path == null)
324  return;
325 
326  directorypath = System.IO.Path.GetDirectoryName(path);
327  m_lastOpenDir = directorypath;
328  file_base_name = directorypath + System.IO.Path.DirectorySeparatorChar +
329  System.IO.Path.GetFileNameWithoutExtension(path);
330  file_extension = "reaction";
331 
332  id = System.IO.Path.GetFileNameWithoutExtension(path);
333 
334  UIData.fetchPDBFile = false;
335  Reaction.isReaction = false;
336  Reaction.isReady = false;
337  UIData.isOpenFile=true;
338  }
339 
340  //Aurélien : function called by the Open File button in the animation menu
341  public void OpenAnimationTopCallback(string path)
342  {
343  //Clears the previous molecule or reaction if needed
345  id="";
346 
347  //GUIMoleculeController.pdbgen = false;
348 
350  Reaction.coord.Clear();
351  }
352 
353  m_fileBrowser = null;
354  if(path == null)
355  return;
356 
357  directorypath = System.IO.Path.GetDirectoryName(path);
358  m_lastOpenDir = directorypath;
359  file_base_name = directorypath + System.IO.Path.DirectorySeparatorChar +
360  System.IO.Path.GetFileNameWithoutExtension(path);
361  file_extension = "animtop";
362 
363  id = System.IO.Path.GetFileNameWithoutExtension(path);
364 
365  UIData.fetchPDBFile = false;
366  Reaction.isReaction = false;
367  Reaction.isReady = false;
368  UIData.isOpenFile=true;
369  }
370 
371  //Aurélien : function called by OpenCdr()
372  public void OpenAnimationCrdCallback(string path)
373  {
374  m_fileBrowser = null;
375  if(path == null)
376  return;
377 
378  directorypath = System.IO.Path.GetDirectoryName(path);
379  m_lastOpenDir = directorypath;
380  file_base_name = directorypath + System.IO.Path.DirectorySeparatorChar +
381  System.IO.Path.GetFileNameWithoutExtension(path);
382  file_extension = "animcrd";
383 
384  id = System.IO.Path.GetFileNameWithoutExtension(path);
385 
386  UIData.fetchPDBFile = false;
387  Reaction.isReaction = false;
388  Reaction.isReady = false;
389  UIData.isOpenFile=true;
390  }
391 
398  public void Display() {
403  InitRenderDict();
406 
407  directoryimage = (Texture2D)Resources.Load("FileBrowser/dossier");
408  fileimage=(Texture2D)Resources.Load("FileBrowser/fichiers");
409 
411  GUILayout.BeginArea(Rectangles.openRect);
412  #if !UNITY_WEBPLAYER
413  {
414  //id != "" if a molecule is already open
415 
416  GUILayout.BeginHorizontal();
417  if (!UIData.hasMoleculeDisplay) {
418  if(GUILayout.Button (new GUIContent("Open File From Disk", "Load a PDB file from disk"))) {
419 
420 
421  m_fileBrowser = new ImprovedFileBrowser(Rectangles.fileBrowserRect, "", OpenFileCallback, m_lastOpenDir);
422 // m_fileBrowser.SelectionPattern = "*.pdb|*.xgmml";
423  m_fileBrowser.DirectoryImage = directoryimage;
424  m_fileBrowser.FileImage = fileimage;
427 
428 
429  }
430  }
431  else {
432  if(GUILayout.Button(new GUIContent("Activate experimental GUI")))
433  {
434 
435  }
436  if(GUILayout.Button(new GUIContent("Clear","Clear the scene"))) {
437 
439 
440  }
441  }
442  GUILayout.EndHorizontal();
443 
444  if (!UIData.hasMoleculeDisplay) {
445  int menuWidth = Rectangles.openWidth;
446  float pServerWidth = menuWidth * 0.65f;
447  float pPortWidth = menuWidth * 0.30f;
448 
449  GUILayout.BeginHorizontal();
450  GUILayout.Label("Proxy Server", GUILayout.Width(pServerWidth));
451  GUILayout.Label("Proxy Port", GUILayout.Width(pPortWidth));
452  GUILayout.EndHorizontal();
453 
454  GUILayout.BeginHorizontal();
455  proxyServer = GUILayout.TextField(proxyServer, 256, GUILayout.Width(pServerWidth));
456 // proxyServer = MyTextField.FixedTextField(proxyServer, 256, 150f) ;
457  // Validate the proxyPort : only digits
458  proxyPortValidate = new StringBuilder();
459 
460  foreach (char c in proxyPort)
461  if (char.IsDigit(c))
462  proxyPortValidate.Append(c);
463 
464  proxyPort = GUILayout.TextField(proxyPortValidate.ToString(),4);
465  GUILayout.EndHorizontal();
466 
467 
468  GUILayout.Label("Please input a PDB ID");
469  GUILayout.BeginHorizontal();
470  pdbID = GUILayout.TextField(pdbID, 4, GUILayout.Width(pPortWidth));
471 // pdbID=GUILayout.TextField(pdbID,4);
472  if(GUILayout.Button(new GUIContent("Fetch PDB", "Fetch a PDB file from the PDB server"))) {
473  id = pdbID;
474  UIData.fetchPDBFile = true;
475  UIData.isOpenFile = true;
477 
480 
481  }
482  GUILayout.EndHorizontal();
483  }
484 
485  }
486  if (id==""){
487  GUILayout.BeginHorizontal();
488 
489  UIData.readHetAtom = GUILayout.Toggle (UIData.readHetAtom, "Read Hetero Atoms?");
490 
491  UIData.readWater = GUILayout.Toggle (UIData.readWater, "Read Water?");
492 
493  GUILayout.EndHorizontal();
494 
495  GUILayout.BeginHorizontal();
496  GUILayout.Label("Connectivity :");
497  UIData.connectivity_calc = GUILayout.Toggle (UIData.connectivity_calc, "Calculed?");
498  UIData.connectivity_PDB = GUILayout.Toggle (UIData.connectivity_PDB, "from PDB?");
499 
500  GUILayout.EndHorizontal();
501 
502  GUILayout.Space(20);
503 
504  GUILayout.BeginHorizontal();
505  if (GUILayout.Button (new GUIContent("HiRE-RNA Contest", "Connect to the Web App")))
506  {
508  }
509  GUILayout.EndHorizontal();
510  }
511  #endif
512 
513  #if UNITY_WEBPLAYER
514 /* {
515  GUILayout.BeginHorizontal();
516  GUILayout.Label("Server Address:");
517  GUILayout.EndHorizontal();
518  GUILayout.BeginHorizontal();
519  idField=GUILayout.TextField(idField,15);
520  PortField=GUILayout.TextField(PortField,4);
521  FunctionConfig.id=idField;
522  FunctionConfig.port=PortField;
523  GUILayout.EndHorizontal();
524  if(!LoginFlag)
525  {
526 
527  if(GUILayout.Button("Login"))
528  {
529  Debug.Log("Login1");
530  UnitySocket.SocketConnection(FunctionConfig.id,int.Parse(FunctionConfig.port));
531  Debug.Log("Login2");
532  LoginFlag=true;
533  Debug.Log("Login3");
534  Debug.Log(UIData.loginSucess);
535 
536  }
537 
538  }
539  else
540  {
541  GUILayout.BeginHorizontal();
542  if(UIData.loginSucess)
543  {
544  GUILayout.Label("Login Success!");
545  }
546  else
547  {
548  Debug.Log(UIData.loginSucess);
549  GUILayout.Label("Login Error!",GUILayout.Width(80));
550  if(GUILayout.Button("Login Again",GUILayout.Width(80)))
551  {
552 
553  UnitySocket.SocketConnection(FunctionConfig.id,int.Parse(FunctionConfig.port));
554 
555  LoginAgainFlag=true;
556 
557  }
558  }
559 
560  GUILayout.EndHorizontal();
561  }
562 
563  GUILayout.BeginHorizontal();
564  if(GUILayout.Button("Main Menu"))
565  {
566  UIData.isclear = true;
567  GUIMoleculeController.pdbGen = false;
568  UIData.hasMoleculeDisplay = false;
569  Application.LoadLevel("MainMenu");
570  }
571  GUILayout.EndHorizontal();
572 
573  }
574 */
575  #endif
576  GUILayout.EndArea();
577 
578 
579  }
580  //Aurélien : reaction menu
582  //This avoids having the atom menu on top of the reaction menu
584 
585  GUILayout.BeginArea(Rectangles.openRect);
586  GUILayout.BeginHorizontal();
587  if(GUILayout.Button (new GUIContent("Open Reaction File","Load a reaction file from disk")))
588  {
589  m_fileBrowser = new ImprovedFileBrowser(
590  new Rect(100, 100, 600, 500),
591  "Choose text file",
593  m_lastOpenDir
594  );
595  m_fileBrowser.SelectionPattern = "*.txt";
596  m_fileBrowser.DirectoryImage = directoryimage;
597  m_fileBrowser.FileImage = fileimage;
598  }
599  if(GUILayout.Button (new GUIContent("Pause","Pauses or unpauses the reaction")))
600  {
601  if(Reaction.isReady)
602  {
603  Reaction.isReady = false;
604  }
605  else
606  {
607  Reaction.isReady = true;
608  }
609  }
610  GUILayout.EndHorizontal();
611  GUILayout.BeginHorizontal();
612  if(GUILayout.Button (new GUIContent("Replay","Replays the reaction")))
613  {
614  Reaction.isReady = true;
615  Reaction.forward = true;
616  Reaction.current = 0;
617  }
618  if(GUILayout.Button (new GUIContent("Backwards","Plays the reaction backwards")))
619  {
620  Reaction.isReady = true;
621  Reaction.forward = false;
622  Reaction.current = 0;
623  }
624 
625  GUILayout.EndHorizontal();
626  GUILayout.BeginHorizontal();
627  if(GUILayout.Button (new GUIContent("Previous step","Moves the reaction X steps backwards")))
628  {
629  Reaction.isReady = false;
631  if(Reaction.current < 0)
632  {
633  Reaction.current = 0;
634  }
635  if(Reaction.forward){
636  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.current];
637  for(int i=0;i<Reaction.acount;i++){
638  for(int j=0;j<Reaction.acount;j++){
639  if(((MoleculeModel.atoms[j] as GameObject).GetComponent("AtomIndex") as AtomIndex).index == i+1){
640  (MoleculeModel.atoms[j] as GameObject).transform.position = new Vector3((xyz[i] as float[])[0], (xyz[i] as float[])[1], (xyz[i] as float[])[2]);
641  break;
642  }
643  }
644  }
645  }
646  else
647  {
648  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.count - Reaction.current - 1];
649  for(int i=0;i<Reaction.acount;i++){
650  for(int j=0;j<Reaction.acount;j++){
651  if(((MoleculeModel.atoms[j] as GameObject).GetComponent("AtomIndex") as AtomIndex).index == i+1){
652  (MoleculeModel.atoms[j] as GameObject).transform.position = new Vector3((xyz[i] as float[])[0], (xyz[i] as float[])[1], (xyz[i] as float[])[2]);
653  break;
654  }
655  }
656  }
657  }
659  }
660  if(GUILayout.Button (new GUIContent("Next step","Moves the reaction X steps forward")))
661  {
662  Reaction.isReady = false;
665  {
667  }
668  if(Reaction.forward){
669  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.current];
670  for(int i=0;i<Reaction.acount;i++){
671  for(int j=0;j<Reaction.acount;j++){
672  if(((MoleculeModel.atoms[j] as GameObject).GetComponent("AtomIndex") as AtomIndex).index == i+1){
673  (MoleculeModel.atoms[j] as GameObject).transform.position = new Vector3((xyz[i] as float[])[0], (xyz[i] as float[])[1], (xyz[i] as float[])[2]);
674  break;
675  }
676  }
677  }
678  }
679  else
680  {
681  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.count - Reaction.current - 1];
682  for(int i=0;i<Reaction.acount;i++){
683  for(int j=0;j<Reaction.acount;j++){
684  if(((MoleculeModel.atoms[j] as GameObject).GetComponent("AtomIndex") as AtomIndex).index == i+1){
685  (MoleculeModel.atoms[j] as GameObject).transform.position = new Vector3((xyz[i] as float[])[0], (xyz[i] as float[])[1], (xyz[i] as float[])[2]);
686  break;
687  }
688  }
689  }
690  }
692  }
693  GUILayout.EndHorizontal();
694  GUILayout.BeginHorizontal();
695  nbSteps = (int)GUILayout.HorizontalSlider (nbSteps, 1, 20);
696  GUILayout.EndHorizontal();
697  GUILayout.BeginHorizontal();
698  GUILayout.Label ("Previous/Next step will move by " + nbSteps + " steps");
699  GUILayout.EndHorizontal();
700  GUILayout.EndArea();
701  }
702 
703  //Aurélien : animation menu
705  //This avoids having the atom menu on top of the reaction menu
707 
708  GUILayout.BeginArea(Rectangles.openRect);
709  GUILayout.BeginHorizontal();
710  if(!Reaction.top)
711  {
712  if(GUILayout.Button (new GUIContent("Open Top File","Load a top animation file from disk")))
713  {
714  m_fileBrowser = new ImprovedFileBrowser(
715  new Rect(100, 100, 600, 500),
716  "Choose text file",
718  m_lastOpenDir
719  );
720  m_fileBrowser.SelectionPattern = "*.top";
721  m_fileBrowser.DirectoryImage = directoryimage;
722  m_fileBrowser.FileImage = fileimage;
723  }
724  }
725  else
726  {
727  if(GUILayout.Button (new GUIContent("Open Crd File","Load a crd animation file from disk")))
728  {
729  Reaction.top = false;
730  m_fileBrowser = new ImprovedFileBrowser(
731  new Rect(100, 100, 600, 500),
732  "Choose text file",
734  m_lastOpenDir
735  );
736  m_fileBrowser.SelectionPattern = "*.*crd";
737  m_fileBrowser.DirectoryImage = directoryimage;
738  m_fileBrowser.FileImage = fileimage;
739  }
740  }
741  if(GUILayout.Button (new GUIContent("Pause","Pauses or unpauses the animation")))
742  {
743  if(Reaction.isReady)
744  {
745  Reaction.isReady = false;
746  }
747  else
748  {
749  Reaction.isReady = true;
750  }
751  }
752  GUILayout.EndHorizontal();
753  GUILayout.BeginHorizontal();
754  if(GUILayout.Button (new GUIContent("Replay","Replays the animation")))
755  {
756  Reaction.isReady = true;
757  Reaction.forward = true;
758  Reaction.current = 0;
759  }
760  if(GUILayout.Button (new GUIContent("Backwards","Plays the animation backwards")))
761  {
762  Reaction.isReady = true;
763  Reaction.forward = false;
764  Reaction.current = 0;
765  }
766 
767  GUILayout.EndHorizontal();
768  GUILayout.BeginHorizontal();
769  if(GUILayout.Button (new GUIContent("Previous step","Moves the animation X steps backwards")))
770  {
771  Reaction.isReady = false;
773  if(Reaction.current < 0)
774  {
775  Reaction.current = 0;
776  }
777  if(Reaction.forward){
778  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.current];
779  int j;
780  for(int i=0;i<Reaction.acount;i++){
781  j = ((MoleculeModel.atoms[i] as GameObject).GetComponent("AtomIndex") as AtomIndex).index;
782  (MoleculeModel.atoms[i] as GameObject).transform.position = new Vector3((xyz[j] as float[])[0], (xyz[j] as float[])[1], (xyz[j] as float[])[2]);
783  }
784  }
785  else
786  {
787  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.count - Reaction.current - 1];
788  int j;
789  for(int i=0;i<Reaction.acount;i++){
790  j = ((MoleculeModel.atoms[i] as GameObject).GetComponent("AtomIndex") as AtomIndex).index;
791  (MoleculeModel.atoms[i] as GameObject).transform.position = new Vector3((xyz[j] as float[])[0], (xyz[j] as float[])[1], (xyz[j] as float[])[2]);
792  }
793  }
795  }
796  if(GUILayout.Button (new GUIContent("Next step","Moves the animation X steps forward")))
797  {
798  Reaction.isReady = false;
801  {
803  }
804  if(Reaction.forward){
805  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.current];
806  int j;
807  for(int i=0;i<Reaction.acount;i++){
808  j = ((MoleculeModel.atoms[i] as GameObject).GetComponent("AtomIndex") as AtomIndex).index;
809  (MoleculeModel.atoms[i] as GameObject).transform.position = new Vector3((xyz[j] as float[])[0], (xyz[j] as float[])[1], (xyz[j] as float[])[2]);
810  }
811  }
812  else
813  {
814  ArrayList xyz = (ArrayList)Reaction.coord[Reaction.count - Reaction.current - 1];
815  int j;
816  for(int i=0;i<Reaction.acount;i++){
817  j = ((MoleculeModel.atoms[i] as GameObject).GetComponent("AtomIndex") as AtomIndex).index;
818  (MoleculeModel.atoms[i] as GameObject).transform.position = new Vector3((xyz[j] as float[])[0], (xyz[j] as float[])[1], (xyz[j] as float[])[2]);
819  }
820  }
821  }
822  GUILayout.EndHorizontal();
823  GUILayout.BeginHorizontal();
824  nbSteps = (int)GUILayout.HorizontalSlider (nbSteps, 1, 20);
825  GUILayout.EndHorizontal();
826  GUILayout.BeginHorizontal();
827  GUILayout.Label ("Previous/Next step will move by " + nbSteps + " steps");
828  GUILayout.EndHorizontal();
829  GUILayout.EndArea();
830  }
831 
832  gUIMoleculeController.SetAtomMenu();
833  gUIMoleculeController.SetSecStructMenu();
834  gUIMoleculeController.SetSurfaceMenu();
835  gUIMoleculeController.SetBfactorMenu();
836  gUIMoleculeController.SetFieldMenu();
837  gUIMoleculeController.DisplayGUI();
838  gUIMoleculeController.SetAtomType();
839  gUIMoleculeController.SetBondType();
840  gUIMoleculeController.SetCubeLineBond();
841  gUIMoleculeController.SetHyperBall();
842  gUIMoleculeController.SetEffectType();
843  gUIMoleculeController.SetSurfaceTexture();
844  gUIMoleculeController.SetSurfaceCut();
845  gUIMoleculeController.SetSurtfaceMobileCut();
846  gUIMoleculeController.SetBackGroundType();
847  gUIMoleculeController.SetMetaphorType();
848  gUIMoleculeController.SetAdvMenu();
849  gUIMoleculeController.SetGuidedMenu();
850  gUIMoleculeController.CameraStop();
851  gUIMoleculeController.RenderHelp();
852  gUIMoleculeController.setSugarMenu(); //
853  gUIMoleculeController.setSugarRibbonsTuneMenu();
854  gUIMoleculeController.setColorTuneMenu();
855  gUIMoleculeController.SetArtemisMenu();
856  gUIMoleculeController.SetHiRERNAMenu();
857  gUIMoleculeController.SetWebContestMenu();
858  gUIMoleculeController.SetHydroMenu ();
859 
860 // SetHyperballMatCapTexture();
861  SetAtomScales();
862 
863  if( GUIMoleculeController.m_colorPicker != null ){
864  ChangeAllColors();
865  //ColorPickerCaller ();
866  }
867 
868  if(applyToAtoms == null)
869  applyToAtoms.Add("All");
870 
871  if(applyToAtoms.Count > 1 && applyToAtoms.Contains("All"))
872  applyToAtoms.Remove("All");
873  }
874 
875 /* public void SetHyperballMatCapTexture() {
876 // GUIContent texturehyper = new GUIContent("Set Mat Cap texture");
877  if (m_texture && UIData.atomtype == UIData.AtomType.hyperball)
878  Rectangles.textureRect = GUI.Window(41,Rectangles.textureRect, loadtexture, "");
879 
880 // if(displayChoice){
881 // GUI.Window( 2, new Rect( Screen.width-295,355, 290, 200 ), DisplayColors, "");
882 // }
883 
884  }
885 */
886 
890  public void SetAtomScales() {
892  Rectangles.atomScalesRect = GUILayout.Window(41,Rectangles.atomScalesRect, LoadMenu, "");
893  }
894 
901  public void LoadMenu(int a){
902 
903  AtomScales ("lit_spheres/", textureMenuList[texture_set], textureMenuTitles[texture_set]);
904 
905  GUI.DragWindow();
906  }
907 
908 /* /// <summary>
917  private static List<string> ToList(Dictionary<string, bool> dic){
918  List<string> sendingAtoms = new List<string>();
919  foreach(string key in dic.Keys)
920  if(dic[key])
921  sendingAtoms.Add(key);
922 
923  return sendingAtoms;
924  }
925 */
926 
936  private static List<string> ToList(string atom){
937  List<string> sendingAtoms = new List<string>();
938  sendingAtoms.Add(atom);
939 
940  return sendingAtoms;
941  }
942 
946  private static void ColorPickerCaller(){
947  GUIMoleculeController.CreateColorPicker(buttonColor, "Select a color", applyToAtoms, applyToRes, applyToChain);
948  }
949 
962  private void AtomScales(string texDir,string[] texList, string texDescr){ // TODO: Move this ?
963  GUIMoleculeController.showSetAtomScales = LoadTypeGUI.SetTitleExit("Atom Colors, Textures and Scales");
964  // check on http://docs.unity3d.com/Documentation/ScriptReference/Texture2D.SetPixels.html
965 
966  if(mainCamera == null)
967  mainCamera = Camera.main;
968 
969  int fifth = Rectangles.atomScalesWidth / 5;
970  int sliderWidth = (int)(fifth*1.65f);
971  int nameWidth = (int)(fifth*1.2f);
972 
973 
974  // ---------- ATOMS CHOICE ----------
975  GUILayout.BeginHorizontal();
976  GUILayout.Box("Apply changes to:");
977 
979  GUI.color = Color.yellow;
980  GUILayout.Label("Atom Selection Mode: All changes applied to selected atoms");
981  GUI.color = Color.white;
982  }
983  else{
984  if(GUILayout.Button(new GUIContent("Reset", "Reset all selections"), GUILayout.Width(Rectangles.textureWidth / 8))){
985  applyToAtoms.Clear();
986  applyToAtoms.Add("All");
987  applyToRes = "All";
988  applyToChain = "All";
990  }
991  }
992 
993  GUILayout.FlexibleSpace();
994  GUILayout.EndHorizontal();
995  GUILayout.BeginHorizontal();
996  if(quickSelection)
997  GUI.color = new Color(0.5f, 1.0f, 0.5f);
999  GUI.enabled = false;
1000  if( GUILayout.Button (new GUIContent ("Quick atoms selection", "Click-and-run mode for atom selection"), GUILayout.Width(Rectangles.textureWidth / 2))){
1001  quickSelection = true;
1002  //extendedSelection = false;
1005  applyToAtoms.Clear();
1006  applyToAtoms.Add("All");
1007  }
1008  GUI.color = Color.white;
1009  GUILayout.FlexibleSpace();
1010  if(!quickSelection)
1011  GUI.enabled = false;
1012  if(GUILayout.Button(new GUIContent("All", "Select all atoms"), GUILayout.Width(Rectangles.textureWidth / 6))){
1013  applyToAtoms.Clear();
1014  applyToAtoms.Add("All");
1016  ColorPickerCaller ();
1017  }
1018 
1019  if(GUILayout.Button(new GUIContent("None", "Unselect all atoms"), GUILayout.Width(Rectangles.textureWidth / 6))){
1020  applyToAtoms.Clear();
1021  applyToAtoms.Add("None");
1023  }
1024  GUILayout.EndHorizontal();
1025 
1026  GUILayout.BeginHorizontal();
1027  if(applyToAtoms.Contains("H") || applyToAtoms.Contains("All"))
1028  GUI.color = Color.green;
1029  if(GUILayout.Button(new GUIContent ("H("+MoleculeModel.hydrogenNumber+")", "Modify hydrogen"))){
1030  if(applyToAtoms.Contains("H"))
1031  applyToAtoms.Remove("H");
1032  else
1033  applyToAtoms.Add("H");
1035  ColorPickerCaller ();
1036  }
1037  GUI.color = Color.white;
1038  GUILayout.FlexibleSpace();
1039  if(applyToAtoms.Contains("C") || applyToAtoms.Contains("All"))
1040  GUI.color = Color.green;
1041  if(GUILayout.Button(new GUIContent ("C("+MoleculeModel.carbonNumber+")", "Modify carbon"))){
1042  if(applyToAtoms.Contains("C"))
1043  applyToAtoms.Remove("C");
1044  else
1045  applyToAtoms.Add("C");
1047  ColorPickerCaller ();
1048  }
1049  GUI.color = Color.white;
1050  GUILayout.FlexibleSpace();
1051  if(applyToAtoms.Contains("N") || applyToAtoms.Contains("All"))
1052  GUI.color = Color.green;
1053  if(GUILayout.Button(new GUIContent ("N("+MoleculeModel.nitrogenNumber+")", "Modify nitrogen"))){
1054  if(applyToAtoms.Contains("N"))
1055  applyToAtoms.Remove("N");
1056  else
1057  applyToAtoms.Add("N");
1059  ColorPickerCaller ();
1060  }
1061  GUI.color = Color.white;
1062  GUILayout.FlexibleSpace();
1063  if(applyToAtoms.Contains("O") || applyToAtoms.Contains("All"))
1064  GUI.color = Color.green;
1065  if(GUILayout.Button(new GUIContent ("O("+MoleculeModel.oxygenNumber+")", "Modify oxygen"))){
1066  if(applyToAtoms.Contains("O"))
1067  applyToAtoms.Remove("O");
1068  else
1069  applyToAtoms.Add("O");
1071  ColorPickerCaller ();
1072  }
1073  GUI.color = Color.white;
1074  GUILayout.FlexibleSpace();
1075  if(applyToAtoms.Contains("P") || applyToAtoms.Contains("All"))
1076  GUI.color = Color.green;
1077  if(GUILayout.Button( new GUIContent ("P("+MoleculeModel.phosphorusNumber+")", "Modify phosphorus"))){
1078  if(applyToAtoms.Contains("P"))
1079  applyToAtoms.Remove("P");
1080  else
1081  applyToAtoms.Add("P");
1083  ColorPickerCaller ();
1084  }
1085  GUI.color = Color.white;
1086  GUILayout.FlexibleSpace();
1087  if(applyToAtoms.Contains("S") || applyToAtoms.Contains("All"))
1088  GUI.color = Color.green;
1089  if(GUILayout.Button(new GUIContent ("S("+MoleculeModel.sulphurNumber+")", "Modify sulphur"))){
1090  if(applyToAtoms.Contains("S"))
1091  applyToAtoms.Remove("S");
1092  else
1093  applyToAtoms.Add("S");
1095  ColorPickerCaller ();
1096  }
1097  GUI.color = Color.white;
1098  GUILayout.FlexibleSpace();
1099  if(applyToAtoms.Contains("X") || applyToAtoms.Contains("All"))
1100  GUI.color = Color.green;
1101  if(GUILayout.Button(new GUIContent ("X("+MoleculeModel.unknownNumber+")", "Modify unknown"))){
1102  if(applyToAtoms.Contains("X"))
1103  applyToAtoms.Remove("X");
1104  else
1105  applyToAtoms.Add("X");
1107  ColorPickerCaller ();
1108  }
1109  GUI.color = Color.white;
1110  GUI.enabled = true;
1111  GUILayout.FlexibleSpace();
1112  GUILayout.EndHorizontal();
1113 
1114  GUILayout.BeginHorizontal();
1115  if(!quickSelection)
1116  GUI.color = new Color(0.5f, 1.0f, 0.5f);
1117  if(GUIMoleculeController.toggle_NA_CLICK)//applyToAtoms["Select"])
1118  GUI.enabled = false;
1119  if( GUILayout.Button (new GUIContent ("Extended atoms selection", "In-depth atom selection"), GUILayout.Width(Rectangles.textureWidth / 2))){
1120  quickSelection = false;
1121  //extendedSelection = true;
1124  applyToAtoms.Clear();
1125  applyToAtoms.Add("All");
1126  }
1127  GUI.color = Color.white;
1128 // GUILayout.FlexibleSpace ();
1129 // GUILayout.EndHorizontal();
1130 
1131 // GUILayout.BeginHorizontal();
1132 /* GUILayout.Label(" : ");
1133  if(!extendedSelection)
1134  GUI.enabled = false;
1135  if(GUILayout.Button(new GUIContent("Extended atoms", "Change atom"), GUILayout.Width(Rectangles.textureWidth / 8)))
1136  GUIMoleculeController.showAtomsExtendedMenu = !GUIMoleculeController.showAtomsExtendedMenu;
1137 */
1138  GUILayout.FlexibleSpace();
1139 
1140  GUI.enabled = true;
1141  GUILayout.EndHorizontal();
1142 
1143 
1144  // ---------- RESIDUES, CHAIN, GRAYSCALE, SELECTION ----------
1145  GUILayout.BeginHorizontal();
1146  GUILayout.Label("Residue :");
1148  || !UIData.hasResidues) {
1149  GUI.enabled = false;
1150  applyToRes = "All";
1151  }
1152 
1153  if(GUILayout.Button(new GUIContent(applyToRes, "Change residue"), GUILayout.Width(Rectangles.textureWidth / 8)))
1155 
1156  GUI.enabled = true;
1157 
1158  GUILayout.FlexibleSpace();
1159 
1160  GUILayout.Label(" Chain :");
1162  || !UIData.hasChains) {
1163  GUI.enabled = false;
1164  applyToChain = "All";
1165  }
1166  if(GUILayout.Button(new GUIContent(applyToChain, "Change chain"), GUILayout.Width(Rectangles.textureWidth / 8))){
1168  }
1169  GUI.enabled = true;
1170 
1171  GUILayout.FlexibleSpace();
1172 
1173 
1174  GUILayout.EndHorizontal();
1175 
1176  // ---------- SCALE, COLOR ----------
1177  GUILayout.BeginHorizontal();
1178  GUILayout.Box("Color and Scale :");
1179  if (GUILayout.Button (new GUIContent ("Panels", "Open colors and textures panels menu"), GUILayout.Width(Rectangles.textureWidth / 4))) {
1181  }
1182  if(GUILayout.Button(new GUIContent("Reset scales", "Reset all scales to 100"), GUILayout.Width(Rectangles.textureWidth / 4))){
1183  newScale = 100f;
1185  atomManager.SetRadii(ToList("All"), "All", "All");
1186  }
1187  GUILayout.FlexibleSpace();
1188  GUILayout.EndHorizontal();
1189 
1190  GUILayout.BeginHorizontal();
1191  //GUILayout.FlexibleSpace();
1192  if(GUILayout.Button(colorButton,GUILayout.MinWidth(100),GUILayout.MinHeight(20))){
1194  }
1195  GUILayout.FlexibleSpace();
1196 
1197  newScale = GUIMoleculeController.LabelSlider(newScale, 50, 150.0f,
1198  "Scale: "+(int)(newScale*10)/10,
1199  "Determines atom radius",true,sliderWidth,(int)(nameWidth*0.75));
1200  if(newScale != oldScale){
1202 
1204  atomManager.SetRadii(applyToAtoms, applyToRes, applyToChain);
1205  oldScale = newScale;
1206  }
1207  else{
1208  foreach(GameObject obj in mainCamera.GetComponent<ClickAtom>().objList)
1209  atomManager.SetRadii((int)obj.GetComponent<BallUpdate>().number);
1210 
1211  oldScale = newScale;
1212  }
1213  }
1214 
1215  //GUILayout.FlexibleSpace();
1216  GUILayout.EndHorizontal();
1217 
1218  // ---------- TEXTURE ----------
1219  GUILayout.BeginHorizontal();
1220  GUILayout.Box("Texture: " + texDescr);
1221  GUILayout.FlexibleSpace();
1222  if(UIData.atomtype != UIData.AtomType.hyperball && UIData.atomtype != UIData.AtomType.optihb )
1223  GUI.enabled = false;
1224 
1225  UIData.grayscalemode = GUILayout.Toggle (UIData.grayscalemode, new GUIContent ("Grayscale", "Use grayscale version of the texture"));
1226  GUILayout.EndHorizontal();
1227 
1228  GUILayout.BeginHorizontal();
1229  if(GUILayout.Button(new GUIContent("<<","Go to previous series of textures"))){ // Cycle through texture sets
1230  texture_set--;
1232  if(texture_set < 0)
1233  texture_set = 4; // First 5 pages are best textures (0-4)
1234  }
1235  else{
1236  if(texture_set < 5)
1237  texture_set = textureMenuList.Count - 1;
1238  }
1239  }
1240 
1241  if(GUILayout.Button(new GUIContent("Open","Open custom texture image from disk"))) {
1242  m_fileBrowser = new ImprovedFileBrowser(Rectangles.fileBrowserRect,
1243  "Choose Image File",
1245  m_last_texture_dir);
1246  }
1247 
1248  if(GUILayout.Button(new GUIContent(">>","Go to next series of textures"))) { // Cycle through texture sets
1249  texture_set++;
1251  if(texture_set>4) // First 5 pages are best textures (0-4)
1252  texture_set = 0;
1253  }
1254  else{
1255  if (texture_set > textureMenuList.Count - 1)
1256  texture_set = 5;
1257  }
1258  }
1259  GUILayout.EndHorizontal();
1260 
1261  GUILayout.BeginHorizontal();
1262 
1263  // Check whether texList has more than 15 entries and raise an error !
1264  int i=0;
1265  int buttonWidth = (int) (Rectangles.atomScalesWidth * 0.18);
1266  int buttonHeight = (int) ( Rectangles.atomScalesHeight / 7f);
1267 
1268 
1269  foreach(string texFil in texList) {
1270  i++; if(i>5) {GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); i=1;}
1271 // if(GUILayout.Button((Texture)Resources.Load(texDir+texFil),GUILayout.Width(50),GUILayout.Height(50))) {
1272  if(GUILayout.Button(new GUIContent((Texture)Resources.Load(texDir+texFil),texFil),GUILayout.Width(buttonWidth),GUILayout.Height(buttonHeight))) {
1273 
1274  GameObject hbManagerObj = GameObject.FindGameObjectWithTag("HBallManager");
1275  HBallManager hbManager = hbManagerObj.GetComponent<HBallManager>();
1276  HBallMeshManager hbMeshManager = GameObject.FindGameObjectWithTag("HBallMeshManager").GetComponent<HBallMeshManager>();
1277 
1278  Texture texture;
1279  if(texFil == "None")
1280  texture = (Texture)Resources.Load("lit_spheres/divers/daphz05");
1281  else
1282  texture = (Texture)Resources.Load(texDir+texFil);
1283 
1284  if(UIData.grayscalemode)
1285  texture = TextureGray.ToGray(texture);
1286 
1288  if(hbManager.isInit)
1289  hbManager.SetTexture(texture, applyToAtoms, applyToRes, applyToChain);
1290  if(hbMeshManager.isInit)
1291  hbMeshManager.SetTexture(texture);
1292  }
1293  else {
1294  if(hbManager.isInit){
1295  foreach(GameObject obj in mainCamera.GetComponent<ClickAtom>().objList)
1296  hbManager.SetTexture(texture, (int)obj.GetComponent<BallUpdate>().number);
1297  }
1298  }
1299  }
1300  }
1301  GUILayout.EndHorizontal();
1302 
1303  GUI.enabled = true;
1304 
1305  if (Event.current.type == EventType.Repaint)
1306  MoleculeModel.newtooltip = GUI.tooltip;
1307 
1308  }
1309 
1313  public static void ChangeAllColors(){
1314 
1315  for (int i =0; i <200; i++){
1316  colorButtonNew[i] = buttonColor.color;
1325  }
1326 
1327  colorButton.SetPixels(colorButtonNew);
1328  colorButton.Apply(true);
1345  } // end of AtomScales
1346 
1347 
1348  public void FileSelectedCallback(string path) {
1349  m_fileBrowser = null;
1350  if (path!=null) {
1351  Debug.Log("Trying to load a texture for the Hyperballs");
1352  m_textPath = path;
1353  m_last_texture_dir = System.IO.Path.GetDirectoryName(path);
1354  WWW www = new WWW("file://" + m_textPath);
1355 
1356  GameObject hbManagerObj = GameObject.FindGameObjectWithTag("HBallManager");
1357  HBallManager hbManager = hbManagerObj.GetComponent<HBallManager>();
1358  HBallMeshManager hbMeshManager = GameObject.FindGameObjectWithTag("HBallMeshManager").GetComponent<HBallMeshManager>();
1359 
1360  Texture2D grayTexture = new Texture2D(www.texture.width, www.texture.height);
1362 
1363  if(!UIData.grayscalemode){
1364  if(hbManager.isInit)
1365  hbManager.SetTexture(www.texture, applyToAtoms, applyToRes, applyToChain);
1366  if(hbMeshManager.isInit)
1367  hbMeshManager.SetTexture(www.texture);
1368  }
1369  else{
1370  grayTexture = TextureGray.ToGray(www.texture);
1371  if(hbManager.isInit)
1372  hbManager.SetTexture(grayTexture, applyToAtoms, applyToRes, applyToChain);
1373  if(hbMeshManager.isInit)
1374  hbMeshManager.SetTexture(grayTexture);
1375  }
1376  }
1377  else {
1378  if(!UIData.grayscalemode){
1379  if(hbManager.isInit){
1380  foreach(GameObject obj in mainCamera.GetComponent<ClickAtom>().objList)
1381  hbManager.SetTexture(www.texture, (int)obj.GetComponent<BallUpdate>().number);
1382  }
1383  if(hbMeshManager.isInit)
1384  hbMeshManager.SetTexture(www.texture);
1385  }
1386  else{
1387  grayTexture = TextureGray.ToGray(www.texture);
1388  if(hbManager.isInit){
1389  foreach(GameObject obj in mainCamera.GetComponent<ClickAtom>().objList)
1390  hbManager.SetTexture(grayTexture, (int)obj.GetComponent<BallUpdate>().number);
1391  }
1392  if(hbMeshManager.isInit)
1393  hbMeshManager.SetTexture(grayTexture);
1394  }
1395  }
1396 
1397  }
1399 // Debug.Log("Mis a false");
1400  }
1401 
1402 
1409  public static void PanelsMenu(int a) {
1411 
1412  //---------- To edit/add Color and Texture palettes, please read Assets/Resources/HowToColorPanel.txt ----------
1413  // NB : the name "ColorPanel.txt" and everything related to it (like panelDict, RenderDict or whatever) doesn't seem really great,
1414  // but it would be a pain to change them now. [Erwan]
1415  GUILayout.BeginHorizontal();
1416  GUILayout.Label("Color Panels");
1417  GUILayout.EndHorizontal();
1418 
1419  GUILayout.BeginHorizontal();
1420  if( GUILayout.Button(new GUIContent("All white", "Change all colors to white"))){
1421  SetColorPanel("All_White");
1422  }
1423  if (GUILayout.Button(new GUIContent("Goodsell", "Change all colors to David Goodsell style colors"))){
1424  //extendedSelection = false;
1425  quickSelection = true;
1426  SetColorPanel("Goodsell");
1427  quickSelection = false;
1428  //extendedSelection = true;
1429  SetColorPanel("Goodsell");
1430  //O(0.95,0.76,0.76,1);N(0.75,0.76,0.94,1);S(0.85,0.84,0.46,1);C(0.76,0.76,0.76,1);P(0.99,0.82,0.59,1);H(0.95,0.95,0.95,1);X(0.55,0.55,0.55,1)
1431  // Now with precise coloring of charged O and N !
1432  }
1433  if (GUILayout.Button(new GUIContent("Watercolor", "Change all colors to Watercolor palette"))){
1434  quickSelection = true;
1435  SetColorPanel("Watercolor");
1436  //O(0.60,0.13,0.11,1);N(0.19,0.27,0.63,1);S(0.98,0.91,0.44,1);C(0.55,0.86,0.89,1);P(0.99,0.69,0.28,1);H(0.99,0.98,0.96,1);X(0.16,0.17,0.29,1)
1437  }
1438  GUILayout.EndHorizontal();
1439 
1440  GUILayout.BeginHorizontal();
1441  if (GUILayout.Button(new GUIContent("Pastel", "Change all colors to pastel"))){
1442  quickSelection = true;
1443  SetColorPanel("Pastel");
1444  //O(0.827,0.294,0.333,1);S(1,0.839,0.325,1);C(0.282,0.6,0.498,1);N(0.443,0.662,0.882,1);P(0.960,0.521,0.313,1);P(white);X(black)
1445  }
1446  if (GUILayout.Button(new GUIContent("CPK", "A CPK-like atom color palette"))){
1447  quickSelection = true;
1448  SetColorPanel("CPK");
1449  //O(0.78,0.0,0.09,1);N(0.21,0.67,0.92,1);S(0.86,0.84,0.04,1);C(0.02,0.02,0.03,1);P(1.0,0.60,0.0,1);H(1.0,1.00,0.99,1);X(0.03,0.56,0.26,1)
1450  }
1451  if(GUILayout.Button(new GUIContent("Basic","Set previous default color parameters (quite intense colors)"))){
1452  quickSelection = true;
1453  SetColorPanel("Basic");
1454  //O(red);S(yellow);C(green);N(blue);P(0.6,0.3,0.0,1);H(white);X(black)
1455  }
1456  if (GUILayout.Button(new GUIContent("IUPAC?", "A IUPAC color palette (?)"))){
1457  quickSelection = true;
1458  SetColorPanel("IUPAC");
1459  //O(0.21,0.67,0.92,1);N(0.03,0.56,0.26,1);S(0.86,0.84,0.04,1);C(1.0,1.00,0.99,1);P(1.0,0.60,0.0,1);H(0.02,0.02,0.03,1);X(0.78,0.0,0.09,1)
1460  }
1461  GUILayout.EndHorizontal();
1462  GUILayout.BeginHorizontal();
1463  if(!UIData.hasChains)
1464  GUI.enabled = false;
1465  if (GUILayout.Button(new GUIContent("Chains", "Quick chains coloring"))){
1466  quickSelection = true;
1467  SetColorPanel("Chains");
1468  }
1469  GUI.enabled = true;
1470  //T.T. Add coloring for sugar representation
1471  if (GUILayout.Button(new GUIContent("Sugar", "Quick sugar type coloring"))){
1472  quickSelection = true;
1473  SetColorPanel("Sugar");
1474  }
1475  if(GUILayout.Button(new GUIContent("ADN/ARN", "Base coloring: A[red] T/U[blue] C[yellow] G[green]"))){
1476  quickSelection = true;
1477  SetColorPanel("ADN-ARN");
1478  }
1479  if(GUILayout.Button(new GUIContent("HiRE-RNA", "Base coloring: A[red] T/U[blue] C[yellow] G[green]"))){
1480  quickSelection = true;
1481  SetColorPanel("HiRERNA");
1482  }
1483  GUILayout.EndHorizontal();
1484 
1485  GUILayout.BeginHorizontal();
1486  GUILayout.Label("Texture Panels");
1487  GUILayout.EndHorizontal();
1488 
1489  if(UIData.atomtype != UIData.AtomType.hyperball)
1490  GUI.enabled = false;
1491 
1492  GUILayout.BeginHorizontal();
1493  if (GUILayout.Button(new GUIContent("Default", "Default color/texture palette"))){
1494  SetTexturePanel("All_White");
1495  }
1496  if (GUILayout.Button(new GUIContent("Gummy", "A plastic-like atom textures palette"))){
1497  quickSelection = true;
1498  SetTexturePanel("Gummy");
1499  SetColorPanel("All_White");
1500  }
1501  if (GUILayout.Button(new GUIContent("Glass", "A glassy atom textures palette"))){
1502  quickSelection = true;
1503  SetTexturePanel("Glass");
1504  SetColorPanel("All_White");
1505  }
1506  if (GUILayout.Button(new GUIContent("CPK", "A CPK-like atom textures palette (great with CPK metaphor)"))){
1507  quickSelection = true;
1508  SetTexturePanel("CPK");
1509  SetColorPanel("All_White");
1510  }
1511  GUILayout.EndHorizontal();
1512 
1513  GUILayout.BeginHorizontal();
1514  if (GUILayout.Button(new GUIContent("Glass2", "Another glassy atom textures palette"))){
1515  quickSelection = true;
1516  SetTexturePanel("Glass2");
1517  SetColorPanel("All_White");
1518  }
1519  if(!UIData.hasResidues)
1520  GUI.enabled = false;
1521  if (GUILayout.Button(new GUIContent("Acid-Basic", "A texturing for acid (ASP/GLU) and basic (ARG/LYS) residues."))){
1522  quickSelection = true;
1523  SetTexturePanel("Acid-Base_Res");
1524  SetColorPanel("Acid-Base_Res");
1525  }
1526  if (GUILayout.Button(new GUIContent("Moon", "A planet-like atom textures palette"))){
1527  quickSelection = true;
1528  SetTexturePanel("Moon");
1529  SetColorPanel("All_White");
1530  }
1531  GUI.enabled = true;
1532  GUILayout.EndHorizontal();
1533 
1534 
1535  if (Event.current.type == EventType.Repaint)
1536  MoleculeModel.newtooltip = GUI.tooltip;
1537 
1538  GUI.DragWindow();
1539  }
1540 
1547  public static void AtomsExtendedMenu(int a) {
1549 
1550  int buttonWidth = (int)(Rectangles.residuesMenuWidth / 4.8);
1551  int count = 0;
1552 
1553  GUILayout.BeginHorizontal();
1554 
1555  if(applyToAtoms.Contains("All"))
1556  GUI.color = Color.green;
1557  if(GUILayout.Button(new GUIContent("All", "All atoms"))){
1558  applyToAtoms.Clear();
1559  applyToAtoms.Add("All");
1560  //GUIMoleculeController.showAtomsExtendedMenu = false;
1561  }
1562  GUI.color = Color.white;
1563  GUILayout.EndHorizontal();
1564 
1565 
1566  while(count < MoleculeModel.existingName.Count){
1567  GUILayout.BeginHorizontal();
1568  GUILayout.FlexibleSpace();
1569 
1570  for(int i = 0; i < 4; i++){
1571  if(count < MoleculeModel.existingName.Count){
1572  if(applyToAtoms.Contains(MoleculeModel.existingName[count]))
1573  GUI.color = Color.green;
1574  if(GUILayout.Button(new GUIContent(MoleculeModel.existingName[count], ""), GUILayout.Width(buttonWidth))){
1575  if(!applyToAtoms.Contains(MoleculeModel.existingName[count]))
1576  applyToAtoms.Add(MoleculeModel.existingName[count]);
1577  else
1578  applyToAtoms.Remove(MoleculeModel.existingName[count]);
1580  ColorPickerCaller ();
1581 // GUIMoleculeController.showAtomsExtendedMenu = false;
1582  }
1583  GUI.color = Color.white;
1584  }
1585  count++;
1586  }
1587 
1588  GUILayout.FlexibleSpace();
1589  GUILayout.EndHorizontal();
1590  }
1591 
1592  if (Event.current.type == EventType.Repaint)
1593  MoleculeModel.newtooltip = GUI.tooltip;
1594 
1595  GUI.DragWindow();
1596  }
1597 
1604  public static void ResiduesMenu(int a) {
1606 
1607  int buttonWidth = (int)(Rectangles.residuesMenuWidth / 4.8);
1608  int count = 0;
1609 
1610  GUILayout.BeginHorizontal();
1611  if(applyToRes == "All")
1612  GUI.color = Color.green;
1613  if(GUILayout.Button(new GUIContent("All", "All residues"))){
1614  applyToRes = "All";
1615  //GUIMoleculeController.showResiduesMenu = false;
1616  }
1617  GUI.color = Color.white;
1618  GUILayout.EndHorizontal();
1619 
1620 
1621  while(count < MoleculeModel.existingRes.Count){
1622  GUILayout.BeginHorizontal();
1623  GUILayout.FlexibleSpace();
1624 
1625  for(int i = 0; i < 4; i++){
1626  if(count < MoleculeModel.existingRes.Count){
1627  if(applyToRes == MoleculeModel.existingRes[count])
1628  GUI.color = Color.green;
1629  if(GUILayout.Button(new GUIContent(MoleculeModel.existingRes[count], ""), GUILayout.Width(buttonWidth))){
1630  applyToRes = MoleculeModel.existingRes[count];
1632  ColorPickerCaller ();
1633 // GUIMoleculeController.showResiduesMenu = false;
1634  }
1635  GUI.color = Color.white;
1636  }
1637  count++;
1638  }
1639 
1640  GUILayout.FlexibleSpace();
1641  GUILayout.EndHorizontal();
1642  }
1643 
1644  if (Event.current.type == EventType.Repaint)
1645  MoleculeModel.newtooltip = GUI.tooltip;
1646 
1647  GUI.DragWindow();
1648  }
1649 
1656  public static void ChainsMenu(int a) {
1658 
1659  int buttonWidth = (int)(Rectangles.residuesMenuWidth / 4.8);
1660  int count = 0;
1661 
1662  GUILayout.BeginHorizontal();
1663  if(applyToChain == "All")
1664  GUI.color = Color.green;
1665  if(GUILayout.Button(new GUIContent("All", "All chains"))){
1666  applyToChain = "All";
1667  //GUIMoleculeController.showChainsMenu = false;
1668  }
1669  GUI.color = Color.white;
1670  GUILayout.EndHorizontal();
1671 
1672  while(count < MoleculeModel.existingChain.Count){
1673  GUILayout.BeginHorizontal();
1674  GUILayout.FlexibleSpace();
1675 
1676  for(int i = 0; i < 4; i++){
1677  if(count < MoleculeModel.existingChain.Count){
1678  if(applyToChain == MoleculeModel.existingChain[count])
1679  GUI.color = Color.green;
1680  if(GUILayout.Button(new GUIContent(MoleculeModel.existingChain[count], ""), GUILayout.Width(buttonWidth))){
1681  applyToChain = MoleculeModel.existingChain[count];
1683  ColorPickerCaller ();
1684 // GUIMoleculeController.showChainsMenu = false;
1685  }
1686  GUI.color = Color.white;
1687  }
1688  count++;
1689  }
1690  GUILayout.FlexibleSpace();
1691  GUILayout.EndHorizontal();
1692  }
1693 
1694  if (Event.current.type == EventType.Repaint)
1695  MoleculeModel.newtooltip = GUI.tooltip;
1696 
1697  GUI.DragWindow();
1698  }
1699 
1700 
1704  public static void InitRenderDict() {
1705  TextAsset cPanel = (TextAsset)Resources.Load("ColorPanel");
1706  StringReader sr = new StringReader(cPanel.text);
1707 
1708  string s;
1709  string panelName = "";
1710  string[] splittedLine;
1711  List<RendererInfos> infosFinal = new List<RendererInfos>();
1712  bool firstLoop = true;
1713  float R, G, B, A;
1714 
1715  while((s=sr.ReadLine())!=null) {
1716  // The last line of the file MUST be a single "$" or the last panel won't be added.
1717  if(s.StartsWith("$")) {
1718  if(!firstLoop) {
1719  panelDict.Add(panelName, new List<RendererInfos>(infosFinal));
1720  infosFinal.Clear();
1721 
1722 
1723  }
1724  panelName = s.Substring(1, s.Length - 1);
1725  firstLoop = false;
1726  }
1727  else {
1728  RendererInfos infos = new RendererInfos();
1729  splittedLine = s.Split(';');
1730  infos.atom = splittedLine[0].Trim();
1731  infos.residue = splittedLine[1].Trim();
1732  infos.chain = splittedLine[2].Trim();
1733  float.TryParse(splittedLine[3].Trim(), out R);
1734  float.TryParse(splittedLine[4].Trim(), out G);
1735  float.TryParse(splittedLine[5].Trim(), out B);
1736  float.TryParse(splittedLine[6].Trim(), out A);
1737  infos.color = new Color(R, G, B, A);
1738  infos.texture = splittedLine[7].Trim();
1739  if((panelName=="PaperChain")&&(!colorByResiduesDict.ContainsKey(infos.residue))){
1740  colorByResiduesDict[infos.residue]=infos.color;
1741  }else if ((panelName=="Chains") && (!ChainColorDict.ContainsKey(infos.chain))){
1742  ChainColorDict[infos.chain] = infos.color;
1743  }
1744 
1745 
1746 
1747  infosFinal.Add(infos);
1748  }
1749  }
1750  sr.Close();
1751  UIData.isRenderDictInit = true;
1752  Debug.Log("ColorPanelDictionary Initialized");
1753  }
1754 
1758  public static void InitTextureMenuList() {
1759  TextAsset tList = (TextAsset)Resources.Load("TexturesMenu");
1760  StringReader sr = new StringReader(tList.text);
1761 
1762  string s;
1763  string[] splittedLine;
1764 
1765  while((s=sr.ReadLine())!=null) {
1766  if(s.StartsWith("$"))
1767  textureMenuTitles.Add(s.Substring(1, s.Length - 1));
1768  else {
1769  splittedLine = s.Split(';');
1770  for(int i=0; i<splittedLine.Length; i++)
1771  splittedLine[i].Trim();
1772  textureMenuList.Add(splittedLine);
1773  }
1774  }
1775  sr.Close();
1777  Debug.Log("Textures Menu List Initialized");
1778  }
1779 
1789  public static void SetAtomColor(string atomChar, Color col) {
1790  switch(atomChar) {
1791  case "H" :
1793  break;
1794  case "C" :
1796  break;
1797  case "N" :
1799  break;
1800  case "O" :
1802  break;
1803  case "P" :
1805  break;
1806  case "S" :
1808  break;
1809  case "X" :
1810  default :
1812  break;
1813  }
1814  }
1815 
1816 
1823  public static void SetColorPanel(string panelName) {
1824  if(panelDict.ContainsKey(panelName)) {
1825  Debug.Log ("Setting color panel : " + panelName);
1826 
1828 
1829  foreach(RendererInfos panel in panelDict[panelName]){
1830  atomManager.SetColor(panel.color, ToList(panel.atom), panel.residue, panel.chain);
1831  }
1832  }
1833  else
1834  Debug.Log("!!! Invalid Panel Key : " + panelName);
1835  }
1836 
1843  public static void SetTexturePanel(string panelName) {
1844  if(panelDict.ContainsKey(panelName) && UIData.atomtype == UIData.AtomType.hyperball) {
1845  Debug.Log ("Setting texture panel : " + panelName);
1846  GameObject hbManagerObj = GameObject.FindGameObjectWithTag("HBallManager");
1847  HBallManager hbManager = hbManagerObj.GetComponent<HBallManager>();
1848 
1849  foreach(RendererInfos panel in panelDict[panelName])
1850  hbManager.SetTexture(panel.texture, ToList(panel.atom), panel.residue, panel.chain);
1851  }
1852  else
1853  Debug.Log("!!! Invalid Panel Key (or not hyperball) : " + panelName);
1854  }
1855 
1856  public static void initStyles()
1857  {
1858  headerStyle.fontStyle = FontStyle.Bold;
1859  headerStyle.normal.textColor = Color.white;
1860 
1861 // errorStyle.normal.textColor = Color.red;
1862  artemisPlotWhiteStyle.normal.textColor = Color.white;
1863  artemisPlotGreenStyle.normal.textColor = Color.green;
1864  artemisPlotRedStyle.normal.textColor = Color.red;
1865  artemisPlotOrangeStyle.normal.textColor = new Color(0.95f, 0.52f, 0.19f, 1.0f);
1866  artemisPlotBlueStyle.normal.textColor = new Color(0.41f, 0.82f, 0.91f, 1.0f);
1867 
1868  cytosineStyle.normal.textColor = new Color(1.0f, 1.0f, 0.1f, 1.0f);
1869  guanineStyle.normal.textColor = new Color(0.0f, 1.0f, 0.0f, 1.0f);
1870  adenineStyle.normal.textColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);
1871  uracileStyle.normal.textColor = new Color(0.7f, 0.7f, 0.98f, 1.0f);
1872  }
1873 
1874  }
1875 
1876 }
static void AtomsExtendedMenu(int a)
Open the atoms extended selection Menu to apply changes to a specific atom.
Definition: GUIDisplay.cs:1547
static void InitRenderDict()
Inits the color/texture panel dictionary.
Definition: GUIDisplay.cs:1704
static void ChainsMenu(int a)
Open the Chain selection Menu to apply changes to a specific chain.
Definition: GUIDisplay.cs:1656
static ColorObject ChainColorD
Definition: Ribbons.cs:37
static GUIStyle artemisPlotBlueStyle
Definition: GUIDisplay.cs:216
static void InitHiRERNA()
Definition: AtomModel.cs:227
static List< string > ToList(string atom)
Convertir a string to a List of String (Necessary for the SetColor and SetTexture functions) ...
Definition: GUIDisplay.cs:936
static bool fetchPDBFile
Definition: UIData.cs:93
static float newScale
Definition: GUIDisplay.cs:144
static void ResiduesMenu(int a)
Open the Residue selection Menu to apply changes to a specific residue.
Definition: GUIDisplay.cs:1604
static bool isOpenFile
Definition: UIData.cs:100
void Display()
Display a GUI pannel for selecting a PDB on a server or on a local file.
Definition: GUIDisplay.cs:401
UIData.BondType defaultBondRepresentation
Definition: GUIDisplay.cs:97
GUIStyle CentredText
Definition: GUIDisplay.cs:188
static Color[] colorButtonNew
Definition: GUIDisplay.cs:182
static string proxyServer
Definition: GUIDisplay.cs:109
static void PanelsMenu(int a)
Open the Panel selection Menu to apply premade color and texture panel.
Definition: GUIDisplay.cs:1409
static ColorObject phosphorusColor
static float oldScale
Definition: GUIDisplay.cs:143
static ColorObject carbonColor
static List< string > existingName
List of the names existing in the molecule.
void OpenFileCallback(string path)
Definition: GUIDisplay.cs:277
bool displayChoice
Definition: GUIDisplay.cs:116
ColorObject color
Definition: ColorPicker.cs:112
void OpenAnimationCrdCallback(string path)
Definition: GUIDisplay.cs:372
string m_textPath
Definition: GUIDisplay.cs:136
static ColorObject ChainColorB
Definition: Ribbons.cs:35
static GUIStyle artemisPlotWhiteStyle
Definition: GUIDisplay.cs:212
static bool isReaction
Definition: Reaction.cs:11
abstract void SetColor(Color col, List< string > atoms, string residue="All", string chain="All")
static float oldGuiScale
Definition: GUIDisplay.cs:102
static ColorPicker m_colorPicker
void LoadMenu(int a)
Load the atom scale, color and texture menu with the current texture set.
Definition: GUIDisplay.cs:901
GUIMoleculeController gUIMoleculeController
Definition: GUIDisplay.cs:133
static string file_base_name
Definition: GUIDisplay.cs:120
static ColorObject COIL_COLOR
Definition: Ribbons.cs:32
static GUIStyle uracileStyle
Definition: GUIDisplay.cs:221
static List< string[]> textureMenuList
Definition: GUIDisplay.cs:176
static bool m_max
Definition: GUIDisplay.cs:124
static FFType ffType
Definition: UIData.cs:241
Texture2D directoryimage
Definition: GUIDisplay.cs:141
static List< string > applyToAtoms
Definition: GUIDisplay.cs:160
abstract void SetRadii(List< string > atoms, string residue="All", string chain="All")
static void SetTexturePanel(string panelName)
Change the texture and color of all atoms according to a texture panel.
Definition: GUIDisplay.cs:1843
static bool connectivity_calc
Definition: UIData.cs:112
string m_last_texture_dir
Definition: GUIDisplay.cs:137
static void ChangeAllColors()
Updates the colors of the ColorPicker boxes.
Definition: GUIDisplay.cs:1313
static string directorypath
Definition: GUIDisplay.cs:118
static string pdbServer
Definition: GUIDisplay.cs:108
static ColorObject ChainColorC
Definition: Ribbons.cs:36
static int textureWidth
Definition: Rectangles.cs:308
Color color
Definition: ColorObject.cs:72
static void SetAtomColor(string atomChar, Color col)
Change the color of an atom type.
Definition: GUIDisplay.cs:1789
GUIDisplay()
Make a box for atom color selecting.
Definition: GUIDisplay.cs:233
static void ColorPickerCaller()
Create a ColorPicker with the currents options.
Definition: GUIDisplay.cs:946
static Dictionary< string, Color > ChainColorDict
Definition: GUIDisplay.cs:180
static List< string > existingRes
List of the residues existing in the molecule.
static ColorObject nitrogenColor
static bool isRenderDictInit
Definition: UIData.cs:107
static string pdbID
Definition: GUIDisplay.cs:107
void SetTexture(Texture texture, List< string > atom, string residue="All", string chain="All")
Sets the texture of atoms.
static void InitTextureMenuList()
Inits the Textures Menu list.
Definition: GUIDisplay.cs:1758
static string applyToRes
Definition: GUIDisplay.cs:161
static ColorObject ChainColorA
Definition: Ribbons.cs:34
static GUIStyle guanineStyle
Definition: GUIDisplay.cs:219
void CameraStop()
Prevents the camera from moving along with the mouse if the cursor is over any active menu or button...
static string applyToChain
Definition: GUIDisplay.cs:162
StringBuilder proxyPortValidate
Definition: GUIDisplay.cs:111
static ColorObject buttonColor
Definition: GUIDisplay.cs:185
static int current
Definition: Reaction.cs:14
static GUIStyle artemisPlotRedStyle
Definition: GUIDisplay.cs:214
static float guiScale
Definition: GUIDisplay.cs:101
long number
Definition: BallUpdate.cs:84
static bool isTexturesMenuListInit
Definition: UIData.cs:108
static bool loadHireRNA
Definition: UIData.cs:240
static bool readWater
Definition: UIData.cs:111
static int openWidth
Definition: Rectangles.cs:122
static ColorObject hydrogenColor
static ColorObject oxygenColor
static float LabelSlider(float sliderValue, float sliderMinValue, float sliderMaxValue, string labelText, string toolTip, bool enable, int sliderwidth, int labelwidth=100, bool newLine=false)
static void UpdateBondsFromGameObject(ArrayList atoms)
static GUIStyle adenineStyle
Definition: GUIDisplay.cs:220
static bool hasChains
Definition: UIData.cs:98
static bool isReady
Definition: Reaction.cs:15
UIData.AtomType defaultAtomRepresentation
Definition: GUIDisplay.cs:96
void FileSelectedCallback(string path)
Definition: GUIDisplay.cs:1348
static bool forward
Definition: Reaction.cs:17
static GUIStyle artemisPlotOrangeStyle
Definition: GUIDisplay.cs:215
static string proxyPort
Definition: GUIDisplay.cs:110
static bool hasResidues
Definition: UIData.cs:97
GUIStyle m_centredText
Definition: GUIDisplay.cs:197
static Rect openRect
Definition: Rectangles.cs:126
!WiP Includes FLAGS of GUI.
Definition: UIData.cs:78
void AtomScales(string texDir, string[] texList, string texDescr)
Contents of the atom color/texture/scale menu.
Definition: GUIDisplay.cs:962
static ColorObject STRAND_COLOR
Definition: Ribbons.cs:31
Texture2D fileimage
Definition: GUIDisplay.cs:141
string m_lastOpenDir
Definition: GUIDisplay.cs:138
Texture2D ext_surf
Definition: GUIDisplay.cs:139
static bool SetTitleExit(string s)
This is a somewhat odd but very convenient function.
Definition: LoadTypeGUI.cs:153
static BondType bondtype
Definition: UIData.cs:141
!WiP manage GUI, and provide static strings for the GUI.
Definition: GUIDisplay.cs:94
ImprovedFileBrowser m_fileBrowser
Definition: GUIDisplay.cs:135
static void CreateColorPicker(ColorObject col, string title, List< string > atomTarget, string residueTarget="All", string chainTarget="All")
static string file_extension
Definition: GUIDisplay.cs:121
static int atomScalesHeight
Definition: Rectangles.cs:112
static Dictionary< string, List< RendererInfos > > panelDict
Definition: GUIDisplay.cs:171
static List< string > existingChain
List of the chains existing in the molecule.
static ColorObject ChainColorE
Definition: Ribbons.cs:38
static ColorObject unknownColor
static void InitAtomic()
Inits the atomic and chains scales.
Definition: AtomModel.cs:180
static List< string > textureMenuTitles
Definition: GUIDisplay.cs:175
static Rect fileBrowserRect
Definition: Rectangles.cs:107
bool LoginAgainFlag
Definition: GUIDisplay.cs:131
static GUIStyle headerStyle
Definition: GUIDisplay.cs:208
static AtomType atomtype
Definition: UIData.cs:139
static Dictionary< string, Color > colorByResiduesDict
Definition: GUIDisplay.cs:179
static bool m_texture
Definition: GUIDisplay.cs:125
void OpenReactionCallback(string path)
Definition: GUIDisplay.cs:310
static bool hasMoleculeDisplay
Definition: UIData.cs:96
static bool quickSelection
Definition: GUIDisplay.cs:157
static bool readHetAtom
Definition: UIData.cs:110
static void clearScene()
Clears the scene.
Definition: Molecule3D.cs:156
static bool grayscalemode
Definition: UIData.cs:159
static void SetColorPanel(string panelName)
Change the color of all atoms according to a color panel.
Definition: GUIDisplay.cs:1823
static int atomScalesWidth
Definition: Rectangles.cs:109
void OnLevelWasLoaded()
Debug function
Definition: GUIDisplay.cs:273
static Rect atomScalesRect
Definition: Rectangles.cs:115
static ArrayList coord
Definition: Reaction.cs:8
static ColorObject sulphurColor
static int texture_set
Definition: GUIDisplay.cs:128
static GUIStyle artemisPlotGreenStyle
Definition: GUIDisplay.cs:213
static void initStyles()
Definition: GUIDisplay.cs:1856
static bool showSecStructMenu
Triggers the secondary structure menu display.
static GUIStyle errorStyle
Definition: GUIDisplay.cs:209
static int residuesMenuWidth
Definition: Rectangles.cs:356
static Texture2D ToGray(Texture texture)
Return the grayscale version of a texture
Definition: TextureGray.cs:14
static GUIStyle cytosineStyle
Definition: GUIDisplay.cs:218
List< GameObject > objList
Definition: ClickAtom.cs:76
void SetAtomScales()
Sets the atom scales, color and texture menu.
Definition: GUIDisplay.cs:890
Camera mainCamera
Definition: GUIDisplay.cs:203
static ColorObject HELIX_COLOR
Definition: Ribbons.cs:30
static bool connectivity_PDB
Definition: UIData.cs:113
Definition: GUIDisplay.cs:66
static GenericManager getCurrentAtomManager()
Definition: UnityMolMain.cs:50
static Texture2D colorButton
Definition: GUIDisplay.cs:183
void OpenAnimationTopCallback(string path)
Definition: GUIDisplay.cs:341