UnityMol  0.9.6-875
UnityMol viewer / In developement
AtomsGUI.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 using UI;
4 using UnityEngine.UI;
5 using Molecule.View;
6 public class AtomsGUI : MonoBehaviour {
7 
8  public Button atmParticule;
9  public Button atmSphere;
10  public Button atmHyper;
11  public Button atmCube;
12  public Button atmOpti;
13 
14  public Button bondNone;
15  public Button bondHyper;
16  public Button bondLine;
17  public Button bondCube;
18  public Button bondOpti;
19 
20  public Slider radius;
21  public Slider scale;
22  public Slider shrink;
23  public Slider brightness;
24 
25  public Button metaLicorne;
26  public Button metaCpk;
27  public Button metaWdv;
28  public Button metaSmooth;
29  public Button metaSmoothLink;
30 
31  void Start() {
32  //Adding all listeners to the UI Objects
33  atmParticule.onClick.AddListener (() => {
34  ChangeAtmStyle (true, false, true, UIData.AtomType.particleball);});
35  atmHyper.onClick.AddListener (() => {
36  ChangeAtmStyle (true, false, true, UIData.AtomType.hyperball);});
37  atmSphere.onClick.AddListener (() => {
38  ChangeAtmStyle (true, true, false, UIData.AtomType.sphere);});
39  atmCube.onClick.AddListener (() => {
40  ChangeAtmStyle (true, false, true, UIData.AtomType.cube);});
41  atmOpti.onClick.AddListener (() => {
42  ChangeAtmStyle (true, false, true, UIData.AtomType.optihb);});
43 
44  bondNone.onClick.AddListener (() => {
45  SetBondStyle (UIData.BondType.nobond);});
46  bondHyper.onClick.AddListener (() => {
47  SetBondStyle (UIData.BondType.hyperstick);});
48  bondLine.onClick.AddListener (() => {
49  SetBondStyle (UIData.BondType.line);});
50  bondCube.onClick.AddListener (() => {
51  SetBondStyle (UIData.BondType.cube);});
52  bondOpti.onClick.AddListener (() => {
53  SetBondStyle (UIData.BondType.optihs);});
54 
55  // radius.onValueChanged.AddListener (delegate {
56  // radius.GetComponent<GUILinker> ().SetFloat (ref GUIMoleculeController.globalRadius);
57  // });
58  radius.onValueChanged.AddListener(Radius);
59 
60  // scale.onValueChanged.AddListener (delegate {
61  // scale.GetComponent<GUILinker> ().SetFloat (ref LoadTypeGUI.linkScale);
62  // });
63  scale.onValueChanged.AddListener(BondScale);
64 
65  // shrink.onValueChanged.AddListener (delegate {
66  // shrink.GetComponent<GUILinker> ().SetFloat (ref GUIMoleculeController.shrink);
67  // });
68  shrink.onValueChanged.AddListener(Shrink);
69  brightness.onValueChanged.AddListener (Brightness);
70 
71  metaLicorne.onClick.AddListener (() => {
72  Metaphor (0.1f, 0.0001f, 1.0f);});
73  metaCpk.onClick.AddListener (() => {
74  Metaphor (0.2f, 0.0001f, 0.3f);});
75  metaWdv.onClick.AddListener (() => {
76  Metaphor (1.0f, 0.8f, 0.0f);});
77  metaSmooth.onClick.AddListener (() => {
78  Metaphor (0.35f, 0.4f, 1.0f);});
79  metaSmooth.onClick.AddListener (() => {
80  Metaphor (0.4f, 0.5f, 1.0f);});
81  }
82 
86  public void ChangeAtmStyle(bool reset, bool cubeToSphere, bool sphereToCube, UIData.AtomType type){
87 
88 
90 
91  // showAtomType = false;
94  BallUpdate.resetColors = true;
95  }
96 
97 
98  public void SetBondStyle(UIData.BondType type){
99 
101 
102  }
103 
104  public void Brightness(float val) {
105  HBallManager.brightness = val;
109 
110  }
111 
112  public void Metaphor(float radius, float shrink, float scale){
120  }
121 
122  public void BondScale(float val){
125  }
126  public void Radius(float val){
129  }
130  public void Shrink(float val){
133  }
134 
135 }
Slider scale
Definition: AtomsGUI.cs:21
void BondScale(float val)
Definition: AtomsGUI.cs:122
static bool resetBrightness
Button metaWdv
Definition: AtomsGUI.cs:27
Button bondCube
Definition: AtomsGUI.cs:17
Button metaCpk
Definition: AtomsGUI.cs:26
static float brightness
Button bondOpti
Definition: AtomsGUI.cs:18
static bool resetColors
Definition: BallUpdate.cs:73
static bool resetScale
Slider radius
Definition: AtomsGUI.cs:20
void Brightness(float val)
Definition: AtomsGUI.cs:104
Button atmParticule
Definition: AtomsGUI.cs:8
void ChangeAtmStyle(bool reset, bool cubeToSphere, bool sphereToCube, UIData.AtomType type)
Changes atoms style.
Definition: AtomsGUI.cs:86
Button metaSmooth
Definition: AtomsGUI.cs:28
void Shrink(float val)
Definition: AtomsGUI.cs:130
static bool resetBrightness
Definition: HBallManager.cs:84
Button atmHyper
Definition: AtomsGUI.cs:10
Button bondLine
Definition: AtomsGUI.cs:16
!WiP Includes FLAGS of GUI.
Definition: UIData.cs:78
static void ChangeRepresentation(UIData.AtomType newAtomType, UIData.BondType newBondType=UIData.BondType.nobond)
Button bondNone
Definition: AtomsGUI.cs:14
void SetBondStyle(UIData.BondType type)
Definition: AtomsGUI.cs:98
static BondType bondtype
Definition: UIData.cs:141
static bool resetRadii
void Start()
Definition: AtomsGUI.cs:31
static AtomType atomtype
Definition: UIData.cs:139
Button metaSmoothLink
Definition: AtomsGUI.cs:29
Button bondHyper
Definition: AtomsGUI.cs:15
void Radius(float val)
Definition: AtomsGUI.cs:126
Button atmSphere
Definition: AtomsGUI.cs:9
void Metaphor(float radius, float shrink, float scale)
Definition: AtomsGUI.cs:112
Slider brightness
Definition: AtomsGUI.cs:23
Slider shrink
Definition: AtomsGUI.cs:22
Button atmOpti
Definition: AtomsGUI.cs:12
Button atmCube
Definition: AtomsGUI.cs:11
static float brightness
Definition: HBallManager.cs:82
static bool resetShrink
Definition: GUIDisplay.cs:66
Button metaLicorne
Definition: AtomsGUI.cs:25