70 using System.Collections.Generic;
108 public static string pdbServer =
"http://www.pdb.org/pdb/files/";
123 public static string id=
"";
171 private static Dictionary<string, List<RendererInfos>>
panelDict =
new Dictionary<string, List<RendererInfos>>();
180 public static Dictionary<string, Color>
ChainColorDict =
new Dictionary<string, Color>();
183 static Texture2D
colorButton =
new Texture2D(20,10,TextureFormat.ARGB32,
false);
234 if (Screen.width > 900)
236 if (Screen.width > 1200)
238 if (Screen.width > 1500)
240 if (Screen.width > 1900)
242 if (Screen.width > 2500)
246 m_last_texture_dir =
System.IO.Directory.GetCurrentDirectory();
247 m_lastOpenDir =
System.IO.Directory.GetCurrentDirectory();
250 for (
int i =0; i <200; i++){
251 colorButtonNew[i]= Color.red;
274 Debug.Log (
"If you don't see me, Uniteh brOke!");
278 m_fileBrowser = null;
292 directorypath =
System.IO.Path.GetDirectoryName(path);
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);
298 id =
System.IO.Path.GetFileNameWithoutExtension(path);
322 m_fileBrowser = null;
326 directorypath =
System.IO.Path.GetDirectoryName(path);
328 file_base_name = directorypath +
System.IO.Path.DirectorySeparatorChar +
329 System.IO.Path.GetFileNameWithoutExtension(path);
330 file_extension =
"reaction";
332 id =
System.IO.Path.GetFileNameWithoutExtension(path);
353 m_fileBrowser = null;
357 directorypath =
System.IO.Path.GetDirectoryName(path);
359 file_base_name = directorypath +
System.IO.Path.DirectorySeparatorChar +
360 System.IO.Path.GetFileNameWithoutExtension(path);
361 file_extension =
"animtop";
363 id =
System.IO.Path.GetFileNameWithoutExtension(path);
374 m_fileBrowser = null;
378 directorypath =
System.IO.Path.GetDirectoryName(path);
380 file_base_name = directorypath +
System.IO.Path.DirectorySeparatorChar +
381 System.IO.Path.GetFileNameWithoutExtension(path);
382 file_extension =
"animcrd";
384 id =
System.IO.Path.GetFileNameWithoutExtension(path);
407 directoryimage = (Texture2D)Resources.Load(
"FileBrowser/dossier");
408 fileimage=(Texture2D)Resources.Load(
"FileBrowser/fichiers");
416 GUILayout.BeginHorizontal();
418 if(GUILayout.Button (
new GUIContent(
"Open File From Disk",
"Load a PDB file from disk"))) {
432 if(GUILayout.Button(
new GUIContent(
"Activate experimental GUI")))
436 if(GUILayout.Button(
new GUIContent(
"Clear",
"Clear the scene"))) {
442 GUILayout.EndHorizontal();
446 float pServerWidth = menuWidth * 0.65f;
447 float pPortWidth = menuWidth * 0.30f;
449 GUILayout.BeginHorizontal();
450 GUILayout.Label(
"Proxy Server", GUILayout.Width(pServerWidth));
451 GUILayout.Label(
"Proxy Port", GUILayout.Width(pPortWidth));
452 GUILayout.EndHorizontal();
454 GUILayout.BeginHorizontal();
455 proxyServer = GUILayout.TextField(proxyServer, 256, GUILayout.Width(pServerWidth));
458 proxyPortValidate =
new StringBuilder();
460 foreach (
char c
in proxyPort)
462 proxyPortValidate.Append(c);
464 proxyPort = GUILayout.TextField(proxyPortValidate.ToString(),4);
465 GUILayout.EndHorizontal();
468 GUILayout.Label(
"Please input a PDB ID");
469 GUILayout.BeginHorizontal();
470 pdbID = GUILayout.TextField(pdbID, 4, GUILayout.Width(pPortWidth));
472 if(GUILayout.Button(
new GUIContent(
"Fetch PDB",
"Fetch a PDB file from the PDB server"))) {
482 GUILayout.EndHorizontal();
487 GUILayout.BeginHorizontal();
493 GUILayout.EndHorizontal();
495 GUILayout.BeginHorizontal();
496 GUILayout.Label(
"Connectivity :");
500 GUILayout.EndHorizontal();
504 GUILayout.BeginHorizontal();
505 if (GUILayout.Button (
new GUIContent(
"HiRE-RNA Contest",
"Connect to the Web App")))
509 GUILayout.EndHorizontal();
586 GUILayout.BeginHorizontal();
587 if(GUILayout.Button (
new GUIContent(
"Open Reaction File",
"Load a reaction file from disk")))
590 new Rect(100, 100, 600, 500),
599 if(GUILayout.Button (
new GUIContent(
"Pause",
"Pauses or unpauses the reaction")))
610 GUILayout.EndHorizontal();
611 GUILayout.BeginHorizontal();
612 if(GUILayout.Button (
new GUIContent(
"Replay",
"Replays the reaction")))
618 if(GUILayout.Button (
new GUIContent(
"Backwards",
"Plays the reaction backwards")))
625 GUILayout.EndHorizontal();
626 GUILayout.BeginHorizontal();
627 if(GUILayout.Button (
new GUIContent(
"Previous step",
"Moves the reaction X steps backwards")))
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]);
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]);
660 if(GUILayout.Button (
new GUIContent(
"Next step",
"Moves the reaction X steps forward")))
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]);
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]);
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();
709 GUILayout.BeginHorizontal();
712 if(GUILayout.Button (
new GUIContent(
"Open Top File",
"Load a top animation file from disk")))
715 new Rect(100, 100, 600, 500),
727 if(GUILayout.Button (
new GUIContent(
"Open Crd File",
"Load a crd animation file from disk")))
731 new Rect(100, 100, 600, 500),
741 if(GUILayout.Button (
new GUIContent(
"Pause",
"Pauses or unpauses the animation")))
752 GUILayout.EndHorizontal();
753 GUILayout.BeginHorizontal();
754 if(GUILayout.Button (
new GUIContent(
"Replay",
"Replays the animation")))
760 if(GUILayout.Button (
new GUIContent(
"Backwards",
"Plays the animation backwards")))
767 GUILayout.EndHorizontal();
768 GUILayout.BeginHorizontal();
769 if(GUILayout.Button (
new GUIContent(
"Previous step",
"Moves the animation X steps backwards")))
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]);
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]);
796 if(GUILayout.Button (
new GUIContent(
"Next step",
"Moves the animation X steps forward")))
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]);
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]);
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();
868 if(applyToAtoms == null)
869 applyToAtoms.Add(
"All");
871 if(applyToAtoms.Count > 1 && applyToAtoms.Contains(
"All"))
872 applyToAtoms.Remove(
"All");
903 AtomScales (
"lit_spheres/", textureMenuList[texture_set], textureMenuTitles[texture_set]);
937 List<string> sendingAtoms =
new List<string>();
938 sendingAtoms.Add(atom);
962 private void AtomScales(
string texDir,
string[] texList,
string texDescr){
966 if(mainCamera == null)
967 mainCamera = Camera.main;
970 int sliderWidth = (int)(fifth*1.65f);
971 int nameWidth = (int)(fifth*1.2f);
975 GUILayout.BeginHorizontal();
976 GUILayout.Box(
"Apply changes to:");
979 GUI.color = Color.yellow;
980 GUILayout.Label(
"Atom Selection Mode: All changes applied to selected atoms");
981 GUI.color = Color.white;
984 if(GUILayout.Button(
new GUIContent(
"Reset",
"Reset all selections"), GUILayout.Width(
Rectangles.
textureWidth / 8))){
985 applyToAtoms.Clear();
986 applyToAtoms.Add(
"All");
988 applyToChain =
"All";
993 GUILayout.FlexibleSpace();
994 GUILayout.EndHorizontal();
995 GUILayout.BeginHorizontal();
997 GUI.
color =
new Color(0.5f, 1.0f, 0.5f);
1000 if( GUILayout.Button (
new GUIContent (
"Quick atoms selection",
"Click-and-run mode for atom selection"), GUILayout.Width(
Rectangles.
textureWidth / 2))){
1001 quickSelection =
true;
1005 applyToAtoms.Clear();
1006 applyToAtoms.Add(
"All");
1008 GUI.color = Color.white;
1009 GUILayout.FlexibleSpace();
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");
1019 if(GUILayout.Button(
new GUIContent(
"None",
"Unselect all atoms"), GUILayout.Width(
Rectangles.
textureWidth / 6))){
1020 applyToAtoms.Clear();
1021 applyToAtoms.Add(
"None");
1024 GUILayout.EndHorizontal();
1026 GUILayout.BeginHorizontal();
1027 if(applyToAtoms.Contains(
"H") || applyToAtoms.Contains(
"All"))
1028 GUI.
color = Color.green;
1030 if(applyToAtoms.Contains(
"H"))
1031 applyToAtoms.Remove(
"H");
1033 applyToAtoms.Add(
"H");
1037 GUI.color = Color.white;
1038 GUILayout.FlexibleSpace();
1039 if(applyToAtoms.Contains(
"C") || applyToAtoms.Contains(
"All"))
1040 GUI.color = Color.green;
1042 if(applyToAtoms.Contains(
"C"))
1043 applyToAtoms.Remove(
"C");
1045 applyToAtoms.Add(
"C");
1049 GUI.color = Color.white;
1050 GUILayout.FlexibleSpace();
1051 if(applyToAtoms.Contains(
"N") || applyToAtoms.Contains(
"All"))
1052 GUI.color = Color.green;
1054 if(applyToAtoms.Contains(
"N"))
1055 applyToAtoms.Remove(
"N");
1057 applyToAtoms.Add(
"N");
1061 GUI.color = Color.white;
1062 GUILayout.FlexibleSpace();
1063 if(applyToAtoms.Contains(
"O") || applyToAtoms.Contains(
"All"))
1064 GUI.color = Color.green;
1066 if(applyToAtoms.Contains(
"O"))
1067 applyToAtoms.Remove(
"O");
1069 applyToAtoms.Add(
"O");
1073 GUI.color = Color.white;
1074 GUILayout.FlexibleSpace();
1075 if(applyToAtoms.Contains(
"P") || applyToAtoms.Contains(
"All"))
1076 GUI.color = Color.green;
1078 if(applyToAtoms.Contains(
"P"))
1079 applyToAtoms.Remove(
"P");
1081 applyToAtoms.Add(
"P");
1085 GUI.color = Color.white;
1086 GUILayout.FlexibleSpace();
1087 if(applyToAtoms.Contains(
"S") || applyToAtoms.Contains(
"All"))
1088 GUI.color = Color.green;
1090 if(applyToAtoms.Contains(
"S"))
1091 applyToAtoms.Remove(
"S");
1093 applyToAtoms.Add(
"S");
1097 GUI.color = Color.white;
1098 GUILayout.FlexibleSpace();
1099 if(applyToAtoms.Contains(
"X") || applyToAtoms.Contains(
"All"))
1100 GUI.color = Color.green;
1102 if(applyToAtoms.Contains(
"X"))
1103 applyToAtoms.Remove(
"X");
1105 applyToAtoms.Add(
"X");
1109 GUI.color = Color.white;
1111 GUILayout.FlexibleSpace();
1112 GUILayout.EndHorizontal();
1114 GUILayout.BeginHorizontal();
1116 GUI.color =
new Color(0.5f, 1.0f, 0.5f);
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;
1124 applyToAtoms.Clear();
1125 applyToAtoms.Add(
"All");
1127 GUI.color = Color.white;
1138 GUILayout.FlexibleSpace();
1141 GUILayout.EndHorizontal();
1145 GUILayout.BeginHorizontal();
1146 GUILayout.Label(
"Residue :");
1149 GUI.enabled =
false;
1153 if(GUILayout.Button(
new GUIContent(applyToRes,
"Change residue"), GUILayout.Width(
Rectangles.
textureWidth / 8)))
1158 GUILayout.FlexibleSpace();
1160 GUILayout.Label(
" Chain :");
1163 GUI.enabled =
false;
1164 applyToChain =
"All";
1166 if(GUILayout.Button(
new GUIContent(applyToChain,
"Change chain"), GUILayout.Width(
Rectangles.
textureWidth / 8))){
1171 GUILayout.FlexibleSpace();
1174 GUILayout.EndHorizontal();
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))) {
1182 if(GUILayout.Button(
new GUIContent(
"Reset scales",
"Reset all scales to 100"), GUILayout.Width(
Rectangles.
textureWidth / 4))){
1187 GUILayout.FlexibleSpace();
1188 GUILayout.EndHorizontal();
1190 GUILayout.BeginHorizontal();
1192 if(GUILayout.Button(colorButton,GUILayout.MinWidth(100),GUILayout.MinHeight(20))){
1195 GUILayout.FlexibleSpace();
1198 "Scale: "+(
int)(newScale*10)/10,
1199 "Determines atom radius",
true,sliderWidth,(
int)(nameWidth*0.75));
1200 if(newScale != oldScale){
1204 atomManager.
SetRadii(applyToAtoms, applyToRes, applyToChain);
1216 GUILayout.EndHorizontal();
1219 GUILayout.BeginHorizontal();
1220 GUILayout.Box(
"Texture: " + texDescr);
1221 GUILayout.FlexibleSpace();
1223 GUI.enabled =
false;
1226 GUILayout.EndHorizontal();
1228 GUILayout.BeginHorizontal();
1229 if(GUILayout.Button(
new GUIContent(
"<<",
"Go to previous series of textures"))){
1237 texture_set = textureMenuList.Count - 1;
1241 if(GUILayout.Button(
new GUIContent(
"Open",
"Open custom texture image from disk"))) {
1243 "Choose Image File",
1245 m_last_texture_dir);
1248 if(GUILayout.Button(
new GUIContent(
">>",
"Go to next series of textures"))) {
1255 if (texture_set > textureMenuList.Count - 1)
1259 GUILayout.EndHorizontal();
1261 GUILayout.BeginHorizontal();
1269 foreach(
string texFil
in texList) {
1270 i++;
if(i>5) {GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); i=1;}
1272 if(GUILayout.Button(
new GUIContent((Texture)Resources.Load(texDir+texFil),texFil),GUILayout.Width(buttonWidth),GUILayout.Height(buttonHeight))) {
1274 GameObject hbManagerObj = GameObject.FindGameObjectWithTag(
"HBallManager");
1279 if(texFil ==
"None")
1280 texture = (Texture)Resources.Load(
"lit_spheres/divers/daphz05");
1282 texture = (Texture)Resources.Load(texDir+texFil);
1289 hbManager.
SetTexture(texture, applyToAtoms, applyToRes, applyToChain);
1290 if(hbMeshManager.isInit)
1291 hbMeshManager.SetTexture(texture);
1301 GUILayout.EndHorizontal();
1305 if (Event.current.type == EventType.Repaint)
1315 for (
int i =0; i <200; i++){
1316 colorButtonNew[i] = buttonColor.
color;
1327 colorButton.SetPixels(colorButtonNew);
1328 colorButton.Apply(
true);
1349 m_fileBrowser = null;
1351 Debug.Log(
"Trying to load a texture for the Hyperballs");
1353 m_last_texture_dir =
System.IO.Path.GetDirectoryName(path);
1354 WWW www =
new WWW(
"file://" + m_textPath);
1356 GameObject hbManagerObj = GameObject.FindGameObjectWithTag(
"HBallManager");
1360 Texture2D grayTexture =
new Texture2D(www.texture.width, www.texture.height);
1365 hbManager.
SetTexture(www.texture, applyToAtoms, applyToRes, applyToChain);
1366 if(hbMeshManager.isInit)
1367 hbMeshManager.SetTexture(www.texture);
1372 hbManager.
SetTexture(grayTexture, applyToAtoms, applyToRes, applyToChain);
1373 if(hbMeshManager.isInit)
1374 hbMeshManager.SetTexture(grayTexture);
1383 if(hbMeshManager.isInit)
1384 hbMeshManager.SetTexture(www.texture);
1392 if(hbMeshManager.isInit)
1393 hbMeshManager.SetTexture(grayTexture);
1415 GUILayout.BeginHorizontal();
1416 GUILayout.Label(
"Color Panels");
1417 GUILayout.EndHorizontal();
1419 GUILayout.BeginHorizontal();
1420 if( GUILayout.Button(
new GUIContent(
"All white",
"Change all colors to white"))){
1423 if (GUILayout.Button(
new GUIContent(
"Goodsell",
"Change all colors to David Goodsell style colors"))){
1425 quickSelection =
true;
1427 quickSelection =
false;
1433 if (GUILayout.Button(
new GUIContent(
"Watercolor",
"Change all colors to Watercolor palette"))){
1434 quickSelection =
true;
1438 GUILayout.EndHorizontal();
1440 GUILayout.BeginHorizontal();
1441 if (GUILayout.Button(
new GUIContent(
"Pastel",
"Change all colors to pastel"))){
1442 quickSelection =
true;
1446 if (GUILayout.Button(
new GUIContent(
"CPK",
"A CPK-like atom color palette"))){
1447 quickSelection =
true;
1451 if(GUILayout.Button(
new GUIContent(
"Basic",
"Set previous default color parameters (quite intense colors)"))){
1452 quickSelection =
true;
1456 if (GUILayout.Button(
new GUIContent(
"IUPAC?",
"A IUPAC color palette (?)"))){
1457 quickSelection =
true;
1461 GUILayout.EndHorizontal();
1462 GUILayout.BeginHorizontal();
1464 GUI.enabled =
false;
1465 if (GUILayout.Button(
new GUIContent(
"Chains",
"Quick chains coloring"))){
1466 quickSelection =
true;
1471 if (GUILayout.Button(
new GUIContent(
"Sugar",
"Quick sugar type coloring"))){
1472 quickSelection =
true;
1475 if(GUILayout.Button(
new GUIContent(
"ADN/ARN",
"Base coloring: A[red] T/U[blue] C[yellow] G[green]"))){
1476 quickSelection =
true;
1479 if(GUILayout.Button(
new GUIContent(
"HiRE-RNA",
"Base coloring: A[red] T/U[blue] C[yellow] G[green]"))){
1480 quickSelection =
true;
1483 GUILayout.EndHorizontal();
1485 GUILayout.BeginHorizontal();
1486 GUILayout.Label(
"Texture Panels");
1487 GUILayout.EndHorizontal();
1490 GUI.enabled =
false;
1492 GUILayout.BeginHorizontal();
1493 if (GUILayout.Button(
new GUIContent(
"Default",
"Default color/texture palette"))){
1496 if (GUILayout.Button(
new GUIContent(
"Gummy",
"A plastic-like atom textures palette"))){
1497 quickSelection =
true;
1501 if (GUILayout.Button(
new GUIContent(
"Glass",
"A glassy atom textures palette"))){
1502 quickSelection =
true;
1506 if (GUILayout.Button(
new GUIContent(
"CPK",
"A CPK-like atom textures palette (great with CPK metaphor)"))){
1507 quickSelection =
true;
1511 GUILayout.EndHorizontal();
1513 GUILayout.BeginHorizontal();
1514 if (GUILayout.Button(
new GUIContent(
"Glass2",
"Another glassy atom textures palette"))){
1515 quickSelection =
true;
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;
1526 if (GUILayout.Button(
new GUIContent(
"Moon",
"A planet-like atom textures palette"))){
1527 quickSelection =
true;
1532 GUILayout.EndHorizontal();
1535 if (Event.current.type == EventType.Repaint)
1553 GUILayout.BeginHorizontal();
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");
1562 GUI.color = Color.white;
1563 GUILayout.EndHorizontal();
1567 GUILayout.BeginHorizontal();
1568 GUILayout.FlexibleSpace();
1570 for(
int i = 0; i < 4; i++){
1573 GUI.color = Color.green;
1583 GUI.color = Color.white;
1588 GUILayout.FlexibleSpace();
1589 GUILayout.EndHorizontal();
1592 if (Event.current.type == EventType.Repaint)
1610 GUILayout.BeginHorizontal();
1611 if(applyToRes ==
"All")
1612 GUI.color = Color.green;
1613 if(GUILayout.Button(
new GUIContent(
"All",
"All residues"))){
1617 GUI.color = Color.white;
1618 GUILayout.EndHorizontal();
1622 GUILayout.BeginHorizontal();
1623 GUILayout.FlexibleSpace();
1625 for(
int i = 0; i < 4; i++){
1628 GUI.color = Color.green;
1635 GUI.color = Color.white;
1640 GUILayout.FlexibleSpace();
1641 GUILayout.EndHorizontal();
1644 if (Event.current.type == EventType.Repaint)
1662 GUILayout.BeginHorizontal();
1663 if(applyToChain ==
"All")
1664 GUI.color = Color.green;
1665 if(GUILayout.Button(
new GUIContent(
"All",
"All chains"))){
1666 applyToChain =
"All";
1669 GUI.color = Color.white;
1670 GUILayout.EndHorizontal();
1673 GUILayout.BeginHorizontal();
1674 GUILayout.FlexibleSpace();
1676 for(
int i = 0; i < 4; i++){
1679 GUI.color = Color.green;
1686 GUI.color = Color.white;
1690 GUILayout.FlexibleSpace();
1691 GUILayout.EndHorizontal();
1694 if (Event.current.type == EventType.Repaint)
1705 TextAsset cPanel = (TextAsset)Resources.Load(
"ColorPanel");
1706 StringReader sr =
new StringReader(cPanel.text);
1709 string panelName =
"";
1710 string[] splittedLine;
1711 List<RendererInfos> infosFinal =
new List<RendererInfos>();
1712 bool firstLoop =
true;
1715 while((s=sr.ReadLine())!=null) {
1717 if(s.StartsWith(
"$")) {
1719 panelDict.Add(panelName,
new List<RendererInfos>(infosFinal));
1724 panelName = s.Substring(1, s.Length - 1);
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))){
1741 }
else if ((panelName==
"Chains") && (!ChainColorDict.ContainsKey(infos.
chain))){
1747 infosFinal.Add(infos);
1752 Debug.Log(
"ColorPanelDictionary Initialized");
1759 TextAsset tList = (TextAsset)Resources.Load(
"TexturesMenu");
1760 StringReader sr =
new StringReader(tList.text);
1763 string[] splittedLine;
1765 while((s=sr.ReadLine())!=null) {
1766 if(s.StartsWith(
"$"))
1767 textureMenuTitles.Add(s.Substring(1, s.Length - 1));
1769 splittedLine = s.Split(
';');
1770 for(
int i=0; i<splittedLine.Length; i++)
1771 splittedLine[i].Trim();
1772 textureMenuList.Add(splittedLine);
1777 Debug.Log(
"Textures Menu List Initialized");
1824 if(panelDict.ContainsKey(panelName)) {
1825 Debug.Log (
"Setting color panel : " + panelName);
1834 Debug.Log(
"!!! Invalid Panel Key : " + panelName);
1845 Debug.Log (
"Setting texture panel : " + panelName);
1846 GameObject hbManagerObj = GameObject.FindGameObjectWithTag(
"HBallManager");
1853 Debug.Log(
"!!! Invalid Panel Key (or not hyperball) : " + panelName);
1858 headerStyle.fontStyle = FontStyle.Bold;
1859 headerStyle.normal.textColor = Color.white;
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);
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);
static bool onlyBestTextures
static void AtomsExtendedMenu(int a)
Open the atoms extended selection Menu to apply changes to a specific atom.
static void InitRenderDict()
Inits the color/texture panel dictionary.
static bool showSetAtomScales
static void ChainsMenu(int a)
Open the Chain selection Menu to apply changes to a specific chain.
static ColorObject ChainColorD
static GUIStyle artemisPlotBlueStyle
static void InitHiRERNA()
static List< string > ToList(string atom)
Convertir a string to a List of String (Necessary for the SetColor and SetTexture functions) ...
static void ResiduesMenu(int a)
Open the Residue selection Menu to apply changes to a specific residue.
void Display()
Display a GUI pannel for selecting a PDB on a server or on a local file.
UIData.BondType defaultBondRepresentation
static Color[] colorButtonNew
static Texture2D chainbuttonB
static string proxyServer
static void PanelsMenu(int a)
Open the Panel selection Menu to apply premade color and texture panel.
static Texture2D chainbuttonC
static ColorObject phosphorusColor
static ColorObject carbonColor
static Texture2D chainbuttonE
static Color[] chainbuttonAnew
static List< string > existingName
List of the names existing in the molecule.
static Texture2D chainbuttonA
void OpenFileCallback(string path)
void OpenAnimationCrdCallback(string path)
static ColorObject ChainColorB
static GUIStyle artemisPlotWhiteStyle
void SetSurtfaceMobileCut()
abstract void SetColor(Color col, List< string > atoms, string residue="All", string chain="All")
static Color[] chainbuttonBnew
static ColorPicker m_colorPicker
void LoadMenu(int a)
Load the atom scale, color and texture menu with the current texture set.
GUIMoleculeController gUIMoleculeController
static string file_base_name
static ColorObject COIL_COLOR
static GUIStyle uracileStyle
static string unknownNumber
static List< string[]> textureMenuList
static Color[] coilButtonNew
static Color[] helixButtonNew
static List< string > applyToAtoms
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.
static bool connectivity_calc
static Texture2D coilButton
string m_last_texture_dir
static void ChangeAllColors()
Updates the colors of the ColorPicker boxes.
static string directorypath
static ColorObject ChainColorC
static bool showAtomsExtendedMenu
static void SetAtomColor(string atomChar, Color col)
Change the color of an atom type.
static Texture2D sheetButton
GUIDisplay()
Make a box for atom color selecting.
static void ColorPickerCaller()
Create a ColorPicker with the currents options.
static Dictionary< string, Color > ChainColorDict
static List< string > existingRes
List of the residues existing in the molecule.
static ColorObject nitrogenColor
static bool isRenderDictInit
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.
static ColorObject ChainColorA
static GUIStyle guanineStyle
void CameraStop()
Prevents the camera from moving along with the mouse if the cursor is over any active menu or button...
static Color[] sheetButtonNew
static string applyToChain
StringBuilder proxyPortValidate
static ColorObject buttonColor
static Color[] chainbuttonEnew
static GUIStyle artemisPlotRedStyle
void setSugarRibbonsTuneMenu()
static bool FileBrowser_show2
static bool isTexturesMenuListInit
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
static bool showReactionMenu
UIData.AtomType defaultAtomRepresentation
void FileSelectedCallback(string path)
static GUIStyle artemisPlotOrangeStyle
!WiP Includes FLAGS of GUI.
void AtomScales(string texDir, string[] texList, string texDescr)
Contents of the atom color/texture/scale menu.
static ColorObject STRAND_COLOR
static bool showPanelsMenu
static string nitrogenNumber
static bool SetTitleExit(string s)
This is a somewhat odd but very convenient function.
static Color[] chainbuttonCnew
!WiP manage GUI, and provide static strings for the GUI.
ImprovedFileBrowser m_fileBrowser
static void CreateColorPicker(ColorObject col, string title, List< string > atomTarget, string residueTarget="All", string chainTarget="All")
static bool toggle_NA_CLICK
static string file_extension
static bool showAnimationMenu
static int atomScalesHeight
static Dictionary< string, List< RendererInfos > > panelDict
static List< string > existingChain
List of the chains existing in the molecule.
static string carbonNumber
static ColorObject ChainColorE
static ColorObject unknownColor
static void InitAtomic()
Inits the atomic and chains scales.
static List< string > textureMenuTitles
static Rect fileBrowserRect
static GUIStyle headerStyle
static Color[] chainbuttonDnew
static Dictionary< string, Color > colorByResiduesDict
void OpenReactionCallback(string path)
static bool hasMoleculeDisplay
static bool quickSelection
static void clearScene()
Clears the scene.
static bool grayscalemode
static void SetColorPanel(string panelName)
Change the color of all atoms according to a color panel.
static string hydrogenNumber
static int atomScalesWidth
static string oxygenNumber
void OnLevelWasLoaded()
Debug function
static Rect atomScalesRect
static string sulphurNumber
static bool showChainsMenu
static ColorObject sulphurColor
static GUIStyle artemisPlotGreenStyle
static bool showWebContestMenu
static Texture2D chainbuttonD
static bool showSecStructMenu
Triggers the secondary structure menu display.
static string phosphorusNumber
static GUIStyle errorStyle
static int residuesMenuWidth
static Texture2D ToGray(Texture texture)
Return the grayscale version of a texture
static GUIStyle cytosineStyle
static Texture2D helixButton
List< GameObject > objList
void SetAtomScales()
Sets the atom scales, color and texture menu.
static ColorObject HELIX_COLOR
static bool connectivity_PDB
static GenericManager getCurrentAtomManager()
static Texture2D colorButton
static bool showResiduesMenu
void OpenAnimationTopCallback(string path)