UnityMol  0.9.6-875
UnityMol viewer / In developement
RepresentationOldGUI.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 using UI;
4 using Molecule.Model;
5 using Molecule.View;
6 using System.Collections.Generic;
7 
8 public class RepresentationOldGUI {
9 
10 
11  public static bool showMetaphorType = false;
12  public static bool showAtomType = false;
13  public static bool showBondType = false;
14  public static bool showHyperballsMenu = false;
15  public static bool showCubeLineBondMenu = false ;
16 
17 
18  public static bool transMETAPHOR = false;
19  public static float deltaShrink;
20  public static float deltaScale;
21  public static float deltaRadius;
22  public static float newShrink;
23  public static float newScale;
24  public static float newGlobalRadius = 1.0f;
25  public static float transDelta = 25.0f;
26 
27 
28  public static float shrink = 0.4f;
29  public static float globalRadius = 0.35f;
30  public static float linkScale = 1.0f;
31  public static float bondWidth = 0.15f ; // default bond width for cube/line
32  public static float shininess = 0f;
33 
34  public static Molecule3D m3d = GameObject.Find ("LoadBox").GetComponent<Molecule3D> ();
35 
42  public static void AtomStyle (int a) {
43  LoadTypeGUI.SetTitle("Choose Atom Style");
44 
45  GUILayout.BeginHorizontal();
46  if (GUILayout.Button (new GUIContent ("Cube", "Use cubes to represent atoms"))) {
47 
48  Debug.Log("Cube representation");
49 
50 
52 
53  showAtomType = false;
54  LoadTypeGUI.toggle_NA_HIDE = false; // whether molecule must be hidden (I think)
56  BallUpdate.resetColors = true;
57  }
58 
59  if (GUILayout.Button (new GUIContent ("Sphere", "Use triangulated spheres to represent atoms"))) {
60 
61  Debug.Log("Sphere representation");
62 
64 
65  showAtomType = false;
68  BallUpdate.resetColors = true;
69  }
70  GUILayout.EndHorizontal ();
71 
72 
73  GUILayout.BeginHorizontal ();
74  if (GUILayout.Button (new GUIContent ("Hyperball", "Use the HyperBalls shader to render atoms"))) {
75 
76  Debug.Log("HyperBall representation");
77 
79 
80  showAtomType = false;
83  BallUpdate.resetColors = true;
84  }
85 
86 
87  if (GUILayout.Button (new GUIContent ("Particle", "Use the ParticleBall shader to represent atoms"))) {
88 
89 
91 
92 
93  showAtomType = false;
97 
98  }
99  GUILayout.EndHorizontal ();
100  GUILayout.BeginHorizontal ();
101 
102  if (GUILayout.Button (new GUIContent ("Optimized Hyperball", "Use the Optimized HyperBalls shader to render atoms"))) {
103  Debug.Log("Optimized Hyperball representation");
104 
105 
106  if(UIData.bondtype==UIData.BondType.hyperstick)
108 
109  else
111 
112 
113  showAtomType = false;
114  LoadTypeGUI.toggle_NA_HIDE = false;
116 
117  }
118 
119  GUILayout.EndHorizontal ();
120 
121 
122 
123  if (Event.current.type == EventType.Repaint)
124  MoleculeModel.newtooltip = GUI.tooltip;
125 
126  GUI.DragWindow();
127  } // end of AtomStyle
128 
132  private static void MetaphorControl () {
133  GUILayout.BeginHorizontal ();
134  if (GUILayout.Button (new GUIContent ("Metaphor", "Change HyperBalls parameters to values for standard representations")))
135  showMetaphorType = !showMetaphorType;
136  GUILayout.EndHorizontal ();
137 
138  if (Event.current.type == EventType.Repaint)
139  MoleculeModel.newtooltip = GUI.tooltip;
140  }
141 
142 
143 
150  public static void Bond (int a) {
151  LoadTypeGUI.SetTitle("Bond Style");
152 
153 // if(UIData.atomtype==UIData.AtomType.particleball&&!UIData.openAllMenu)GUI.enabled=false;
154  GUILayout.BeginHorizontal ();
155  GUILayout.FlexibleSpace();
156  if (GUILayout.Button (new GUIContent ("Cube", "Use Cubes to represent bonds"), GUILayout.Width(Rectangles.atomButtonWidth))) {
157  showBondType = false;
159 
160  }
161 
162  if (GUILayout.Button (new GUIContent ("Line", "Use the Line renderer to represent bonds"), GUILayout.Width(Rectangles.atomButtonWidth))) {
163  showBondType = false;
165 
166  }
167  GUILayout.FlexibleSpace();
168  GUILayout.EndHorizontal ();
169 
170  GUILayout.BeginHorizontal ();
171  GUILayout.FlexibleSpace();
172  if (GUILayout.Button (new GUIContent ("HyperStick", "Use the HyperStick shader to represent bonds"), GUILayout.Width(Rectangles.atomButtonWidth))) {
173  showBondType = false;
175 
176  }
177 
178  if (GUILayout.Button (new GUIContent ("No Stick", "Do not render any bonds"), GUILayout.Width(Rectangles.atomButtonWidth))) {
179  showBondType = false;
181 
182  }
183  GUILayout.FlexibleSpace();
184  GUILayout.EndHorizontal ();
185 
186  GUILayout.BeginHorizontal ();
187 
188  if (GUILayout.Button (new GUIContent ("Optimized HyperStick", "Use the Optimized HyperBalls shader to render sticks"))) {
189  showBondType = false;
191  }
192 
193  GUILayout.EndHorizontal ();
194 
195 
196  GUI.enabled = true;
197 
198  if (Event.current.type == EventType.Repaint)
199  MoleculeModel.newtooltip = GUI.tooltip;
200 
201  GUI.DragWindow();
202  } // end of Bond
203 
204 
212  public static void CubeLineBond (int a){
213  LoadTypeGUI.SetTitle("Bond Width");
214 
215  bondWidth = LoadTypeGUI.LabelSlider(bondWidth, 0.00001f, 0.5f, "Width: " + bondWidth.ToString("0.00"),
216  "Determines width of bonds for Cubes and Lines", true, (int)(0.90 * Rectangles.cubeLineBondTypeWidth), 1, true);
219  GUI.enabled = true;
220  GUI.DragWindow();
221  }
222 
223 
224 
225 
232  public static void Metaphor (int a) {
233  showMetaphorType = LoadTypeGUI.SetTitleExit("Metaphor");
234 
235  GUILayout.BeginHorizontal ();
236  if (GUILayout.Button (new GUIContent ("CPK", "CPK representation as balls and sticks"))) {
237  newGlobalRadius = 0.2f;
238  deltaRadius = (newGlobalRadius - globalRadius) / transDelta;
239  newShrink = 0.0001f;
240  deltaShrink = (newShrink - shrink) / transDelta;
241  newScale = 0.3f;
242  deltaScale = (newScale - linkScale) / transDelta;
243  transMETAPHOR = true;
244  }
245  GUILayout.EndHorizontal ();
246 
247  GUILayout.BeginHorizontal ();
248 
249  if (GUILayout.Button (new GUIContent ("Licorice", "Licorice representation of the molecule"))) {
250  newGlobalRadius = 0.1f;
251  deltaRadius = (newGlobalRadius - globalRadius) / transDelta;
252  newShrink = 0.0001f;
253  deltaShrink = (newShrink - shrink) / transDelta;
254  newScale = 1.0f;
255  deltaScale = (newScale - linkScale) / transDelta;
256  transMETAPHOR = true;
257  }
258  GUILayout.EndHorizontal ();
259  GUILayout.BeginHorizontal ();
260 
261  if (GUILayout.Button (new GUIContent ("VdW", "van der Waals representation as spacefilling spheres"))) {
262  newGlobalRadius = 1.0f;
263  deltaRadius = (newGlobalRadius - globalRadius) / transDelta;
264  newShrink = 0.8f;
265  deltaShrink = (newShrink - shrink) / transDelta;
266  newScale = 0.0f;
267  deltaScale = (newScale - linkScale) / transDelta;
268  transMETAPHOR = true;
269  }
270  GUILayout.EndHorizontal ();
271  GUILayout.BeginHorizontal ();
272 
273  if (GUILayout.Button (new GUIContent ("Smooth", "Smooth HyperBalls metaphor representation"))) {
274  newGlobalRadius = 0.35f;
275  deltaRadius = (newGlobalRadius - globalRadius) / transDelta;
276  newShrink = 0.4f;
277  deltaShrink = (newShrink - shrink) / transDelta;
278  newScale = 1.0f;
279  deltaScale = (newScale - linkScale) / transDelta;
280  transMETAPHOR = true;
281  }
282  GUILayout.EndHorizontal ();
283  GUILayout.BeginHorizontal ();
284 
285  if (GUILayout.Button (new GUIContent ("SmoothLink", "SmoothLink HyperBalls representation"))) {
286  newGlobalRadius = 0.4f;
287  deltaRadius = (newGlobalRadius - globalRadius) / transDelta;
288  newShrink = 0.5f;
289  deltaShrink = (newShrink - shrink) / transDelta;
290  newScale = 1.0f;
291  deltaScale = (newScale - linkScale) / transDelta;
292  transMETAPHOR = true;
293  }
294  GUILayout.EndHorizontal ();
295  if (Event.current.type == EventType.Repaint)
296  MoleculeModel.newtooltip = GUI.tooltip;
297  GUI.DragWindow();
298  } // End of Metaphor
299 
300 
301 
302 
307  private static void PhysicalChoice () {
308  GUILayout.BeginHorizontal ();
309  GUILayout.Label ("Velocity Colors:");
310  GUILayout.EndHorizontal ();
311 
312  GUILayout.BeginHorizontal ();
313 
314  UIData.toggleGray = GUILayout.Toggle (UIData.toggleGray, "Gray");
315  if (UIData.toggleGray)
316  UIData.toggleColor = false;
317  else
318  UIData.toggleColor = true;
319 
320  UIData.toggleColor = GUILayout.Toggle (UIData.toggleColor, "Normal");
321  if (UIData.toggleColor)
322  UIData.toggleGray = false;
323  else
324  UIData.toggleGray = true;
325 
326  GUILayout.EndHorizontal ();
327  if (Event.current.type == EventType.Repaint)
328  MoleculeModel.newtooltip = GUI.tooltip;
329  }
330 
331 
338  public static void HyperballStyle (int a) {
339 
340  LoadTypeGUI.SetTitle("Hyperball Style");
341 
342  int sliderWidth = (int)(0.40 * Rectangles.hyperballWidth);
343  shrink = LoadTypeGUI.LabelSlider (shrink, 0.00001f, 0.99f, "Shrink " + shrink.ToString("0.00"),
344  "Determines shrink factor parameter for HyperBalls", true, sliderWidth, 1);
345 
346 // toggle_HB_RANIM = GUILayout.Toggle (toggle_HB_RANIM, new GUIContent ("HB_RANIM", "Animate radius parameter"));
347  linkScale = LoadTypeGUI.LabelSlider (linkScale, 0.00001f, 1.0f, "Scale " + linkScale.ToString("0.00"),
348  "Determines scale parameter", true, sliderWidth, 1);
349 
350  LoadTypeGUI.depthfactor = LoadTypeGUI.LabelSlider (LoadTypeGUI.depthfactor, -3.0f, 3.0f, "DFactor " + LoadTypeGUI.depthfactor.ToString("0.00"),
351  "Determines depth factor for network visualization", MoleculeModel.networkLoaded, sliderWidth, 1);
352  GUI.enabled = true;
353 
354  if(GUI.changed){
357  }
358 
359 
360  MetaphorControl ();
361 
362  if(UIData.atomtype != UIData.AtomType.hyperball){
363  GUI.enabled = false;
365  }
366  LoadTypeGUI.toggle_NA_INTERACTIVE = GUILayout.Toggle (LoadTypeGUI.toggle_NA_INTERACTIVE, new GUIContent ("Interactive mode", "Toggle interactive mode, the physics engine will be used"));
367 
368 
369  GUI.enabled = true;
370  LoadTypeGUI.drag = LoadTypeGUI.LabelSlider (LoadTypeGUI.drag, 0.00001f, 5f, "Drag " + LoadTypeGUI.drag.ToString("0.00"), "Determines PhysX engine drag value",
371  UIData.interactive, sliderWidth, 1);
372  LoadTypeGUI.spring = LoadTypeGUI.LabelSlider (LoadTypeGUI.spring, 0.00001f, 20, "Spring " + LoadTypeGUI.spring.ToString("0.00"), "Determines PhysX engine spring constant",
373  UIData.interactive, sliderWidth, 1);
374  PhysicalChoice();
375 // LoadTypeGUI.toggle_NA_INTERACTIVE=false;
376  GUI.enabled = true;
377 
378  GUILayout.BeginHorizontal();
379  LoadTypeGUI.toggle_NA_MEASURE = GUILayout.Toggle (LoadTypeGUI.toggle_NA_MEASURE, new GUIContent ("Measure dist.", "Toggle mouse clicking to measure the distance between two atoms"));
380  GUILayout.EndHorizontal();
381 
382  GUILayout.BeginHorizontal();
383  LoadTypeGUI.toggle_DISTANCE_CUEING = GUILayout.Toggle (LoadTypeGUI.toggle_DISTANCE_CUEING, new GUIContent ("Dist. cueing", "Toggle distance cueing, which darkens distant objects"));
384  GUILayout.EndHorizontal();
385 
390  }
391  }
392  else{
396  }
397  }
398 
399  LoadTypeGUI.fov_angle = LoadTypeGUI.LabelSlider (LoadTypeGUI.fov_angle, 10f, 120f, "FOV " + LoadTypeGUI.fov_angle.ToString("0.00") + "°", "Set camera FOV angle",
400  true, sliderWidth, 1);
401 
403  {
406  }
407 
408  //Alex :
409  //TODO : LOD mode buggy with other representation than Hyperball
410 
411  GUI.enabled = true;
413  LoadTypeGUI.mainCamera.GetComponent<MeasureDistance> ().enabled = false;
415  LoadTypeGUI.mainCamera.GetComponent<MeasureDistance> ().enabled = true;
416 // GUILayout.EndHorizontal();
417 
418 
419 
421 
423  UIData.interactive = true;
424  UIData.resetInteractive = true;
425  } else {
426  UIData.toggleGray = false;
427  UIData.toggleColor = true;
428  UIData.interactive = false;
429  //UIData.resetInteractive = true;
431  LoadTypeGUI.showGrayColor = false;
434  }
435  // if (Event.current.type == EventType.Repaint)
436  // MoleculeModel.newtooltip = GUI.tooltip;
437 
438  GUI.DragWindow();
439  } // End of HyperballStyle
440 
441 
442 
446  private static void RenderingParameters () {
447 // toggle_HB_SANIM = GUILayout.Toggle (toggle_HB_SANIM, new GUIContent ("HB_SANIM", "Animate shrink parameter"));
448 
449  GUILayout.BeginHorizontal();
450  GUILayout.Label("Color/Texture/Scale"); // Make a little more place between the representation selection and the rendering parameters
451  GUILayout.EndHorizontal();
452 
453  GUILayout.BeginHorizontal ();
454  GUILayout.FlexibleSpace(); // so as to center the buttons
455  if (GUILayout.Button (new GUIContent ("Renderer", "Choose the color, texture and scale of each atom"), GUILayout.Width(Rectangles.atomButtonWidth))){
459  LoadTypeGUI.showChainsMenu = false;
460  GUIDisplay.applyToAtoms.Add("All");
461  }
462 
463  if (GUILayout.Button (new GUIContent ("Panels", "Open colors and textures panels menu"), GUILayout.Width(Rectangles.atomButtonWidth))) {
465  }
466 
467  GUILayout.FlexibleSpace();
468  GUILayout.EndHorizontal ();
469 
470  GUILayout.BeginHorizontal();
471  GUI.enabled = true;
472  bool wasHide = LoadTypeGUI.toggle_NA_HIDE;
473  LoadTypeGUI.toggle_NA_HIDE = GUILayout.Toggle (LoadTypeGUI.toggle_NA_HIDE, new GUIContent ("Hide", "Hide/Display atoms")); // && !carbon_alpha?
474  if(wasHide != LoadTypeGUI.toggle_NA_HIDE){
477  else
479 
480  }
481 
482 
483  UIData.shadow = GUILayout.Toggle (UIData.shadow, new GUIContent ("Shadows", "Display shadows"));
484 
485  if(GUI.changed){
487  if(UIData.shadow)
488  managerAtom.EnableShadows();
489  else
490  managerAtom.DisableShadows();
491 
493  if(UIData.shadow)
494  managerBond.EnableShadows();
495  else
496  managerBond.DisableShadows();
497  }
498 
499  GUILayout.EndHorizontal();
500 
501  float tmpRadius = globalRadius;
502  tmpRadius = LoadTypeGUI.LabelSlider (tmpRadius, 0.00001f, 2.0f, "Radius " + tmpRadius.ToString("0.00"), "Determines radius value", true, (int)(0.90 * Rectangles.atomMenuWidth), 1, true);
503 
504  if(tmpRadius != globalRadius){
505  globalRadius = tmpRadius;
507  }
508 
510  LoadTypeGUI.m_colorPicker = null;
511 
512  showAtomType = false;
513  BallUpdate.resetColors = true;
514  BallUpdate.resetRadii = true;
515  showBondType = false;
517 
518  linkScale = 1.0f;
519 
521  UIData.hballsmoothmode = false;
522  }
523 
524  GUILayout.BeginHorizontal();
525 
526  bool tmpHydro = LoadTypeGUI.toggle_HIDE_HYDROGEN;
527  LoadTypeGUI.toggle_HIDE_HYDROGEN = GUILayout.Toggle (LoadTypeGUI.toggle_HIDE_HYDROGEN, new GUIContent ("Hide hydrogens", "Toggles the hide hydrogens function"));
528 
529  if(tmpHydro != LoadTypeGUI.toggle_HIDE_HYDROGEN){
531  }
532  GUILayout.EndHorizontal();
533 
534 
535 
536  GUILayout.BeginHorizontal();
538  GUI.enabled = false;
539  LoadTypeGUI.toggle_NA_SWITCH = GUILayout.Toggle (LoadTypeGUI.toggle_NA_SWITCH, new GUIContent
540  ("LOD mode", "Toggle LOD. When this is enabled and the molecule is moving, hyperboloids are replaced by particle balls for smoother framerates."));
542  GUI.enabled = true;
544  GUI.enabled = false;
545  LoadTypeGUI.toggle_NA_AUTOMOVE = GUILayout.Toggle (LoadTypeGUI.toggle_NA_AUTOMOVE, new GUIContent ("Automove", "Camera auto rotation"));
546  GUI.enabled = true;
547  GUILayout.EndHorizontal();
548 
549 
550  const float maxshine = 200f;
551  float tmpShininess = shininess;
552 
553 
554  if(UIData.atomtype == UIData.AtomType.hyperball || UIData.atomtype == UIData.AtomType.optihb){
555 
556 
557  tmpShininess = LoadTypeGUI.LabelSlider (tmpShininess, 0f, maxshine, "Shininess " + tmpShininess.ToString("0.00"), "Determines shininess for hyperballs", true, (int)(0.90 * Rectangles.atomMenuWidth), 1, true);
558 
559 
560  if(tmpShininess != shininess){
561  shininess = tmpShininess;
562  float correctedShininess = 0.0f;
563  if(shininess != 0.0f){ //Shininess is strong when just over 0 and gets weaker after
564  //corrected shininess is ranged from 1f to nearly 200.9999...f
565  correctedShininess = (maxshine+1f) - shininess;
566  }
567 
568  HBallManager.shininess = correctedShininess;
570  HBallMeshManager.shininess = correctedShininess;
572  }
573  }
574  GUI.enabled = true;
575 
576  // GUI.enabled = true;
577  if (Event.current.type == EventType.Repaint)
578  MoleculeModel.newtooltip = GUI.tooltip;
579 
580  }
581 
582 
583 
587  public static void SetAtomStyle () {
588 
589  GUILayout.BeginHorizontal ();
590  GUILayout.FlexibleSpace();
591  GUILayout.Label("Atom Style", GUILayout.Width(Rectangles.atomButtonWidth));
592  GUILayout.Label("Bond Style", GUILayout.Width(Rectangles.atomButtonWidth));
593  GUILayout.FlexibleSpace();
594  GUILayout.EndHorizontal ();
595 
596  GUILayout.BeginHorizontal ();
597  GUILayout.FlexibleSpace();
598  string atomtype = "";
599  UIData.AtomType atype = UIData.atomtype;
600  if(atype == UIData.AtomType.noatom)
602  switch (atype) {
603  case UIData.AtomType.cube:
604  atomtype = "Cube";
605  break;
606  case UIData.AtomType.sphere:
607  atomtype = "Sphere";
608  break;
609  case UIData.AtomType.hyperball:
610  atomtype = "HyperBall";
611  break;
612  case UIData.AtomType.raycasting:
613  atomtype = "Raycasting";
614  break;
615  case UIData.AtomType.billboard:
616  atomtype = "Common Billboard";
617  break;
618  case UIData.AtomType.rcbillboard:
619  atomtype = "RayCasting Billboard";
620  break;
621  case UIData.AtomType.hbbillboard:
622  atomtype = "HyperBall Billboard";
623  break;
624  case UIData.AtomType.rcsprite:
625  atomtype = "RayCasting Sprite";
626  break;
627  case UIData.AtomType.multihyperball:
628  atomtype = "Multi-Hyperball";
629  break;
630  case UIData.AtomType.combinemeshball:
631  atomtype = "CombineMesh HyperBall";
632  break;
633  case UIData.AtomType.particleball:
634  atomtype = "ParticleBall";
635  break;
636  case UIData.AtomType.particleballalphablend:
637  atomtype = "ParticleBallAlpahBlend";
638  break;
639  case UIData.AtomType.optihb:
640  atomtype = "Optimized Hyperball";
641  break;
642  }
643 
644  string displayAtomType;
645  if (atomtype == "ParticleBall")
646  displayAtomType = "Particle";
647  else
648  displayAtomType = atomtype;
649  if (GUILayout.Button (new GUIContent (displayAtomType, "Change the atom appearance style or rendering method"), GUILayout.Width(Rectangles.atomButtonWidth))) {
650  showAtomType = !showAtomType;
651  showBondType = false;
652  LoadTypeGUI.m_colorPicker = null;
653  }
654 
655 
656  string bondtype = "";
657  switch (UIData.bondtype) {
658  case UIData.BondType.cube:
659  bondtype = "Cube";
660  break;
661  case UIData.BondType.line:
662  bondtype = "Line";
663  break;
664  case UIData.BondType.hyperstick:
665  bondtype = "HyperStick";
666  break;
667  case UIData.BondType.tubestick:
668  bondtype = "TubeStick";
669  break;
670  case UIData.BondType.bbhyperstick:
671  bondtype = "Billboard HyperStick";
672  break;
673  case UIData.BondType.particlestick:
674  bondtype = "Particle Stick";
675  break;
676  case UIData.BondType.nobond:
677  bondtype = "No Stick";
678  break;
679  case UIData.BondType.optihs:
680  bondtype = "Optimized HyperStick";
681  break;
682  }
683 
684 
685  if (GUILayout.Button (new GUIContent (bondtype, "Change the bond appearance style or rendering method"), GUILayout.Width(Rectangles.atomButtonWidth))) {
686  showBondType = !showBondType;
687  showAtomType = false;
688  }
689  GUILayout.FlexibleSpace();
690  GUILayout.EndHorizontal ();
691 
692  GUILayout.BeginHorizontal();
694  GUI.enabled = false;
695 
696  if(GUILayout.Button(new GUIContent("Smooth HyperBalls", "Set a parameter combo for HyperBalls and Sticks with SmoothLinks once"))) {
699  }
700  GUILayout.EndHorizontal();
701  GUILayout.BeginHorizontal();
702  if(GUILayout.Button(new GUIContent("Optimized HyperBalls", "Create a mesh for an effective rendering method"))) {
703 
705 
706 
707  }
708  GUILayout.EndHorizontal();
709 
710  if (Event.current.type == EventType.Repaint)
711  MoleculeModel.newtooltip = GUI.tooltip;
712  } // End of SetAtomStyle
713 
714 
721  public static void AtomMenu (int a) {
722  LoadTypeGUI.showAtomMenu = LoadTypeGUI.SetTitleExit("Atom appearance");
723  SetAtomStyle ();
725 
726  GUILayout.BeginHorizontal();
727  LoadTypeGUI.toggle_NA_CLICK = GUILayout.Toggle (LoadTypeGUI.toggle_NA_CLICK, new GUIContent ("Atom selection", "Toggles mouse clicking to select/deselect atoms (left click/right click)"));
728  GUILayout.EndHorizontal();
729 
730  GUILayout.BeginHorizontal();
731  LoadTypeGUI.toggle_NA_CAMLOCK = GUILayout.Toggle (LoadTypeGUI.toggle_NA_CAMLOCK, new GUIContent ("Lock camera", "Enable/Disable camera movements"));
732  LoadTypeGUI.toggle_LIGHTCAM = GUILayout.Toggle (LoadTypeGUI.toggle_LIGHTCAM, new GUIContent ("Lock light", "Enable/Disable light movements"));
733 
734  if(GUI.changed && LoadTypeGUI.toggle_LIGHTCAM != UIData.lightStop){
736  }
737  GUILayout.EndHorizontal();
738 
740  LoadTypeGUI.mainCamera.GetComponent<ClickAtom> ().enabled = false;
741  else if (LoadTypeGUI.toggle_NA_CLICK && LoadTypeGUI.mainCamera.GetComponent<ClickAtom> ())
742  LoadTypeGUI.mainCamera.GetComponent<ClickAtom> ().enabled = true;
743 
744 
745  int sliderWidth = (int) (Rectangles.atomMenuWidth * 0.5f);
746  int labelWidth = (int) (Rectangles.atomButtonWidth * 0.4f);
747 
748  GUILayout.BeginHorizontal();
749  HBallManager.brightness = LoadTypeGUI.LabelSlider(HBallManager.brightness, 0.33f, 2.0f, "Brightness: " + HBallManager.brightness.ToString("0.00"),
750  "Adjusts the brightness of atoms and bonds represented with the MatCap shader",
751  (UIData.atomtype == UIData.AtomType.hyperball||UIData.atomtype == UIData.AtomType.optihb), sliderWidth, labelWidth, false);
752 
754 
755  if(GUI.changed){
758  }
759  GUILayout.EndHorizontal();
760 
761 
762  if (Event.current.type == EventType.Repaint)
763  MoleculeModel.newtooltip = GUI.tooltip;
764  GUI.DragWindow();
765  } // End of AtomMenu
766 
767 
768 
769 
770 
771 }
static void ToggleDistanceCueing(bool enabling)
static void AtomStyle(int a)
Defines the style of atoms.
static bool toggleColor
Definition: UIData.cs:126
static bool interactive
Definition: UIData.cs:145
static bool resetBrightness
static bool resetShininess
Definition: HBallManager.cs:85
static float width
static bool switchmode
Definition: UIData.cs:155
static float shininess
Definition: HBallManager.cs:83
static bool lightStop
Definition: UIData.cs:133
static ColorPicker m_colorPicker
void SetFOV(float angle)
Definition: Molecule3D.cs:697
static void AtomMenu(int a)
Defines the Atom menu.
static void HyperballStyle(int a)
Defines the Hyperball Style window.
static float width
Definition: LineUpdate.cs:79
abstract void DisableShadows()
static List< string > applyToAtoms
Definition: GUIDisplay.cs:160
static float brightness
static bool resetColors
Definition: BallUpdate.cs:73
static bool resetScale
static void PhysicalChoice()
This function defines the GUI components that let users choose the colors used in interactive mode...
static void Bond(int a)
Defines the bond type selection menu window, which is called from the appearance menu.
static void showHydrogens(bool hide)
static int hyperballWidth
Definition: Rectangles.cs:300
static bool resetBrightness
Definition: HBallManager.cs:84
static float LabelSlider(float sliderValue, float sliderMinValue, float sliderMaxValue, string labelText, string toolTip, bool enable, int sliderwidth, int labelwidth=100, bool newLine=false)
static bool resetInteractive
Definition: UIData.cs:147
static void CubeLineBond(int a)
Defines the cube/line bond window, that lets users define how wide they want their bonds...
static int cubeLineBondTypeWidth
Definition: Rectangles.cs:258
static float shininess
!WiP Includes FLAGS of GUI.
Definition: UIData.cs:78
static void ChangeRepresentation(UIData.AtomType newAtomType, UIData.BondType newBondType=UIData.BondType.nobond)
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
static bool hballsmoothmode
Definition: UIData.cs:157
static int atomMenuWidth
Definition: Rectangles.cs:130
static bool resetRadii
static bool toggleGray
Definition: UIData.cs:125
static void SetTitle(string s)
Sets the title of the current window.
Definition: LoadTypeGUI.cs:129
static AtomType atomtype
Definition: UIData.cs:139
static bool resetShininess
static int atomButtonWidth
Definition: Rectangles.cs:131
static void MetaphorControl()
Just triggers the metaphor menu.
static void RenderingParameters()
Defines the rendering parameters, in the atom appearance menu.
static void Metaphor(int a)
Defines the Metaphor menu window, which is launched by the Metaphor button in the Hperball Style wind...
static GenericManager getCurrentBondManager()
Definition: UnityMolMain.cs:54
static void LightStop()
Prevents the light from moving with the camera.
static bool shadow
Definition: UIData.cs:198
static float brightness
Definition: HBallManager.cs:82
static void SetAtomStyle()
Sets the atom style.
abstract void EnableShadows()
UIData.AtomType PreviousAtomType
Definition: Molecule3D.cs:135
static bool resetShrink
Definition: GUIDisplay.cs:66
static bool resetRadii
Definition: BallUpdate.cs:76
static GenericManager getCurrentAtomManager()
Definition: UnityMolMain.cs:50