69 using System.Collections.Generic;
126 public static float drag = 0.6f;
147 protected static Quaternion
NA_SCCROT =
new Quaternion (-0.1f, 0.1f, 0.0f, -1.0f);
148 protected static Vector3
NA_SCCPOS =
new Vector3 (0.4f, 1.8f, -12.0f);
172 private static Texture2D
guicon = Resources.Load (
"Artwork/guicon") as Texture2D;
175 private static string umolbase =
"http://www.baaden.ibpc.fr/umol";
234 public static Material
electricsymbol = (Material)Resources.Load (
"Materials/electricparticle");
241 if(m_colorPicker != null)
242 m_colorPicker = null;
251 scenecontroller = GameObject.Find (
"LoadBox");
252 mainCamera = Camera.main;
253 Molecule3DComp = scenecontroller.GetComponent<
Molecule3D> ();
280 listStyle =
new GUIStyle ();
281 listStyle.normal.textColor = Color.white;
282 Texture2D tex =
new Texture2D (2, 2);
283 Color[] colors =
new Color[4];
284 for (
int i=0; i<4; i++) {
285 colors [i] = Color.white;
288 tex.SetPixels (colors);
290 listStyle.hover.background = tex;
291 listStyle.onHover.background = tex;
292 listStyle.padding.left = listStyle.padding.right = listStyle.padding.top = listStyle.padding.bottom = 4;
294 aTexture = (Texture2D)Resources.Load (
"EnergyGrayColorAlpha");
303 Rect screen =
new Rect (0, 0, Screen.width, Screen.height);
305 Vector3 mousePos = Input.mousePosition;
306 mousePos.y = Screen.height - mousePos.y;
314 !screen.Contains (mousePos)
315 || GUIUtility.hotControl != 0
342 Transform lightrans = null;
343 lightrans = mainCamera.transform.Find(
"Directional light");
344 if(lightrans == null){
345 lightrans = GameObject.Find(
"Directional light").transform;
348 lightrans.parent = mainCamera.transform;
354 lightrans.parent = scenecontroller.transform.parent;
363 int padding = GUI.skin.window.padding.top ;
364 GUI.skin.window.padding.top = 5;
366 GUI.skin.window.padding.top = padding;
370 mainCamera.backgroundColor =
new Color (0.0f, 0.0f, 0.0f);
375 if (m_colorPicker != null) {
376 m_colorPicker.
OnGUI ();
379 backgroundColorRed = BackgroundColor.
color.r;
380 backgroundColorGreen = BackgroundColor.
color.g;
381 backgroundColorBlue = BackgroundColor.
color.b;
387 GUILayout.BeginHorizontal ();
388 GUILayout.Label (
"Visual", GUILayout.MaxWidth (50));
395 GUILayout.EndHorizontal ();
398 public static float LabelSlider (
float sliderValue,
float sliderMinValue,
float sliderMaxValue,
string labelText,
399 string toolTip,
bool enable,
int sliderwidth,
int labelwidth=100,
bool newLine =
false) {
400 GUI.enabled = enable;
402 GUILayout.BeginHorizontal();
403 GUILayout.Label (
new GUIContent (labelText, toolTip), GUILayout.MinWidth (labelwidth));
405 GUILayout.EndHorizontal();
406 GUILayout.BeginHorizontal();
409 sliderValue = GUILayout.HorizontalSlider (sliderValue, sliderMinValue, sliderMaxValue, GUILayout.Width (sliderwidth));
411 GUILayout.EndHorizontal();
413 if (Event.current.type == EventType.Repaint)
594 if (showWebContestMenu)
604 if (onlyBestTextures)
614 if (!toggle_VE_COPYR)
615 toggle_VE_COPYR =
true;
617 GUI.Box (
new Rect (Screen.width / 4, Screen.height / 4 + 30, Screen.width / 2, Screen.height / 2 - 60),
"UNITY MOL QUICK HELP");
618 GUILayout.BeginArea (
new Rect (5 + Screen.width / 4, 25 + Screen.height / 4 + 30, 0.5f * Screen.width, 0.5f * Screen.height - 25));
619 GUILayout.Label (
"Welcome to UnityMol. Most program functions will show a tooltip in the bottom left corner to provide some assistance.\n");
620 GUILayout.Label (
"The main menu functions are accessible from the buttons on the top left part of the screen." +
621 "GUI elements will be arranged along the screen borders in order to leave space in the middle for the molecule view." +
622 "The same button that opens a menu can usually also be re-used to close it again.\n");
623 GUILayout.Label (
"From the Open menu you can import PDB files, obj meshes or networks in cytoscape format." +
624 "Then modify the visual aspect with the options in the Atoms menu. Generate (or read) surfaces from the Surface menu." +
625 "The Electrostatics menu provides functionality to control the aspect of animated field lines." +
626 "Some general functionality is assembled in the Display menu.\n");
627 GUILayout.Label (
"UnityMol's functionality is described in detail in the corresponding publication (PLoS One 2013, 8(3):e57990)." +
628 "A tutorial image summarizing essential functions is also provided." +
629 "In the future, clicking on the bottom left UnityMol icon will open the online help (keep posted)." +
630 "Further information can be obtained from the UnityMol SourceForge website and mailing list.\n");
631 GUILayout.Label (
"Keyboard Controls :\n"+
632 "Move the molecule with the arrow Keys or Q/E/Z/X. Rotate it with W/A/S/D. Modify zoom with B/N.\n"+
633 "Focus an atom by selecting it and pressing T, reset camera and focus with R. Hide GUI with Backspace.\n");
641 GUILayout.Label (
"\nUnityMol is an open source project by Marc Baaden and the LBT team. version "+
UnityMolMain.
getVersionString() +
" (c) 2009-16.");
642 GUILayout.EndArea ();
644 if (GUI.Button (
new Rect (Screen.width / 4, 0.75f * Screen.height - 20 - 30, Screen.width / 2, 20),
"Close unity mol help window"))
657 if (toggle_VE_COPYR) {
659 GUI.Box (
new Rect (
Rectangles.
webHelpWidth, Screen.height - 25, Screen.width, 25),
UnityMolMain.
getVersionString() +
" (c)opyright 2009-16 by LBT team/M. Baaden, <baaden@smplinux.de>, S. Doutreligne, X. Martinez; SweetUnityMol by Tubiana, Imberty, Perez & MB");
662 if (GUI.Button (
Rectangles.
webHelpRect,
new GUIContent (guicon,
"Open the Unity Mol manual in a web browser"))) {
665 Application.OpenURL (umolbase +
"/page2/index.html");
672 if (GUI.Button (
Rectangles.
exitRect,
new GUIContent (
"EXIT",
"Exit the UnityMol program")))
676 if (GUI.Button (
Rectangles.
helpRect,
new GUIContent (
"?",
"Open quick help for the Unity Mol program"))) {
static bool onlyBestTextures
static void AtomsExtendedMenu(int a)
Open the atoms extended selection Menu to apply changes to a specific atom.
static bool toggle_NA_HIDE
static bool showSetAtomScales
static bool toggleIMDStackingEnergy
static void ChainsMenu(int a)
Open the Chain selection Menu to apply changes to a specific chain.
static void Electrostatics(int a)
Defines the electrostatic menu window, which is opened from the main menu window. ...
static void SurfaceParams(int a)
Defines the Surface Parameters menu window.
static GUIContent emptyContent
static void ResiduesMenu(int a)
Open the Residue selection Menu to apply changes to a specific residue.
static bool showElectrostaticsMenu
static Rect webContestMenuRect
static void PanelsMenu(int a)
Open the Panel selection Menu to apply premade color and texture panel.
static Rect surfaceMenuRect
static Molecule3D Molecule3DComp
static Rect hyperballRect
static bool showEffectType
static Rect artemisMenuRect
static void AtomStyle(int a)
Defines the style of atoms.
static float maxOrthoSize
static bool showBackgroundType
static bool toggle_HB_SANIM
static bool toggle_DISTANCE_CUEING
static ImprovedFileBrowser m_fileBrowser
static GUIStyle m_centredText
static bool showHyperballsMenu
static bool showArtemisMenu
static Material electricsymbol
static bool toggleIMDTotalEnergy
static bool showHydroMenu
void SetSurtfaceMobileCut()
static void Background(int a)
Defines the Background selection window.
static Rect colorPickerRect
static bool showColorTuneMenu
static Rect surfaceCutRect
static ColorPicker m_colorPicker
GameObject[] getSurfaces()
static void SetAtomsExtended()
static void AtomMenu(int a)
Defines the Atom menu.
static void HyperballStyle(int a)
Defines the Hyperball Style window.
static Rect panelsMenuRect
static Quaternion NA_SCCROT
static float backgroundColorBlue
static void SurfaceCut(int a)
Defines the static surface cut window, which is opened from the Surface parameters menu...
static void FieldLines(int a)
Defines the Field Lines window, which is opened from the Electrostatic window.
static Rect GuidedNavRect
static bool toggle_NA_HBALLSMOOTH
static bool showCubeLineBondMenu
static Rect atomStyleRect
static ColorObject BackgroundColor
static bool showSurfaceButton
static void SecStructMenu(int a)
Defines the menu for handling secondary structures (with ribbons)
static bool showMetaphorType
static string queryBestTextures()
static bool showAtomsExtendedMenu
static void SugarRibbonsTune(int a)
static bool showSurfaceMenu
static bool showHiRERNAMenu
static Rect hydroMenuRect
static void MoveCutPlane(int a)
Defines the move cut plane window, that lets the user change the cut plane of the surface by clicking...
static void Bond(int a)
Defines the bond type selection menu window, which is called from the appearance menu.
static bool toggle_MESHCOMBINE
static void Surface(int a)
Defines the Surface menu window, which is opened from the main menu window.
void CameraStop()
Prevents the camera from moving along with the mouse if the cursor is over any active menu or button...
void setSugarRibbonsTuneMenu()
static bool FileBrowser_show2
static string getVersionString()
void MinLoadTypeGUIAtom(int b)
static bool showBfactorMenu
static Rect hirernaMenuRect
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 toggle_VE_COPYR
static float backgroundColorRed
static bool toggle_HIDE_HYDROGEN
static bool LOD_INITIALIZED
static void CubeLineBond(int a)
Defines the cube/line bond window, that lets users define how wide they want their bonds...
static bool toggle_NA_MAXCAM
static void Effects(int a)
Defines the Effect selection window for SSAO, DOF, etc.
static bool showReactionMenu
static bool showSugarRibbonsTuneMenu
static GameObject scenecontroller
static Rect fieldLinesRect
static bool showSurfaceCut
static Rect electroMenuRect
static void SugarM(int a)
static void ArtemisMenu(int a)
Artemis main GUI window rendering procedure.
static bool toggle_NA_MEASURE
static Rect SugarRibbonsTuneRect
static void ColorTuneMenu(int a)
static bool showSugarChainMenu
!WiP Includes FLAGS of GUI.
static void AdvOptions(int a)
Defines the advanced options menu window, which is opened from the main menu window.
static bool toggle_HB_RANIM
static GUIStyle CentredText
static bool showPanelsMenu
static void HiRERNAContestMenu(int a)
static void MainFun(int a)
Defines the main menu of the GUI.
!WiP manage GUI, and provide static strings for the GUI.
static void CreateColorPicker(ColorObject col, string title, List< string > atomTarget, string residueTarget="All", string chainTarget="All")
static bool toggle_NA_CLICK
static void SetResidues()
static bool showAnimationMenu
static Rect ColorTuneRect
static void HydroMenu(int a)
static Rect surfaceMobileCutRect
static void GuidedOptions(int a)
static bool FileBrowser_show
static bool distanceCueingEnabled
static Rect residuesMenuRect
static bool toggle_NA_AUTOMOVE
static void HiRERNAMenu(int a)
static Rect surfaceParametersRect
static bool toggle_LIGHTCAM
static Rect secStructMenuRect
static bool toggle_NA_INTERACTIVE
static float previous_angle
static Rect movePlaneRect
static bool showSurfaceMobileCut
static Rect effectTypeRect
static SurfaceManager getSurfaceManager()
static bool toggle_HB_TRANS
static float minOrthoSize
static bool toggle_NA_CAMLOCK
static bool showGuidedMenu
static void SurfaceTexture(int a)
Defines the texture selection window.
static Rect SugarMenuRect
static void Metaphor(int a)
Defines the Metaphor menu window, which is launched by the Metaphor button in the Hperball Style wind...
static bool toggleIMDHBondsEnergy
static Rect cubeLineBondRect
static bool toggle_NA_SWITCH
static bool showChainsMenu
static void VisualControl()
static void LightStop()
Prevents the light from moving with the camera.
static bool HYPERBALLSDEFAULT
static bool showFieldLines
static bool showWebContestMenu
static bool showSurfaceTexture
static Rect advOptionsRect
static bool showSecStructMenu
Triggers the secondary structure menu display.
static float backgroundColorGreen
static Rect chainsMenuRect
static void SurfaceMobileCut(int a)
Defines the mobile surface cut window, which is opened from the Surface parameters menu...
static bool showResiduesMenu
static bool showGrayColor
static Rect atomsExtendedMenuRect