63         GUILayout.BeginHorizontal ();
    66         GUILayout.EndHorizontal ();
    68         GUILayout.BeginHorizontal ();
    70         if (GUILayout.Button (
new GUIContent (
"Generate", 
"Generate a new surface mesh"))) {
    72             isTransparentSurface = 
false;
    74         GUILayout.EndHorizontal();
    76         GUILayout.BeginHorizontal ();
    78         if (GUILayout.Button (
new GUIContent (
"BFactor", 
"Generate a new surface mesh using b-factors"))) {
    81         GUILayout.EndHorizontal();
    83         GUILayout.BeginHorizontal ();
    84         if (GUILayout.Button (
new GUIContent(
"Volumetric", 
"Display volumetric density"))) {
    88         GUILayout.EndHorizontal ();
    90         GUILayout.BeginHorizontal();
    92         if (GUILayout.Button (
new GUIContent (
"Toggle surface", 
"Toggles surface from visible to hidden and vice versa"))) {
    95         GUILayout.EndHorizontal();
    98         GUILayout.BeginHorizontal();
   102                                                                                           new GUIContent(
"HetAtoms", 
"Use Hetero atoms for surface calculation"));
   104                                                                                          new GUIContent(
"Sugars", 
"Use sugar for surface calculation"));
   105         GUILayout.EndHorizontal();
   107         if (Event.current.type == EventType.Repaint)
   124         if (GUILayout.Button (
new GUIContent (
"Transparent", 
"Show a transparent surface"))){
   129         if(isTransparentSurface){
   130             if (GUILayout.Button (
new GUIContent (
"Color", 
"Choose the color of the surface"))){
   135                 Color mycol = tmpSurfaceColor.
color;
   136                 mycol.a = (float)alphaTransparentSurface;
   144             if(tmpalpha != alphaTransparentSurface){
   145                 alphaTransparentSurface = tmpalpha;
   146                 Color mycol = tmpSurfaceColor.
color;
   147                 mycol.a = (float)alphaTransparentSurface;
   153         if(!isTransparentSurface){
   154             if (GUILayout.Button (
new GUIContent (
"Color", 
"Choose the color of the surface"))){
   162             if (GUILayout.Button (
new GUIContent (
"Inside color", 
"Choose the color of the inside of the surface")))
   172             if (GUILayout.Button (
new GUIContent (
"Use atom color", 
"Enable/Disable the colors of the atoms on the surface (\"Hide\" must be off)"))) {
   177             if (GUILayout.Button (
new GUIContent (
"Use chain color", 
"Enable/Disable the colors of the chain on the surface (\"Hide\" must be off)"))) {
   181             if (GUILayout.Button (
new GUIContent (
"Hydrophobic scale", 
"Open Hydrophobic scales Menu"))) {
   186             if (GUILayout.Button (
new GUIContent (
"Use properties color", 
"Show amino acids properties (red/acid ; blue/basic ; green/polar ; white/apolar) (\"Hide\" must be off)"))) {
   190             if (GUILayout.Button (
new GUIContent (
"Use BFactor color", 
"Show B-Factor values (\"Hide\" must be off)"))) {
   195             if (GUILayout.Button (
new GUIContent (
"Texture", 
"Choose the texture of the surface"))) 
   198             if (GUILayout.Button (
new GUIContent (
"Static cut", 
"Activate a static cut plane on the surface"))) {
   201                     showSurfaceCut = 
false;
   206                     showSurfaceCut = 
true;
   207                     showSurfaceMobileCut = 
false;
   211             if (GUILayout.Button (
new GUIContent (
"Mobile cut", 
"Activate a mobile cut plane on the surface"))) {
   214                     showSurfaceMobileCut = 
false;
   218                     showSurfaceMobileCut = 
true;
   219                     showSurfaceCut = 
false;
   223             GUILayout.BeginHorizontal();
   225             GUILayout.EndHorizontal();
   227             GUILayout.BeginHorizontal();
   230                                                     "Adjust the brightness of the surface", 
true, sliderWidth, 0, 
false);
   233             GUILayout.EndHorizontal();
   236             GUILayout.BeginHorizontal();
   238             GUILayout.EndHorizontal();
   240             GUILayout.BeginHorizontal();
   242                                                      "Adjust the weight of the vertex colors of the surface", 
true, sliderWidth, 0, 
false);
   245             GUILayout.EndHorizontal();
   248         if (Event.current.type == EventType.Repaint)
   258         if (GUILayout.Button (
new GUIContent (
"Kyte & Doolittle", 
"Surface coloring by using Kyte and Doolittle hydrophobic scale"))) {
   262         if (GUILayout.Button (
new GUIContent (
"Engleman & al.", 
"Surface coloring by using Engleman & al hydrophobic scale"))) {
   266         if (GUILayout.Button (
new GUIContent (
"Eisenberg", 
"Surface coloring by using Eisenberg scale"))) {
   270         if (GUILayout.Button (
new GUIContent (
"White Octanol", 
"Surface coloring by using White Octanol scale"))) {
   290                                               "Determines cut plane depth position", 
true, sliderWidth, 1, 
true); 
   292                                           "Determines cut plane X position", 
true, sliderWidth, 1, 
true); 
   294                                           "Determines cut plane Y position", 
true, sliderWidth, 1, 
true); 
   296                                           "Determines cut plane Z position", 
true, sliderWidth, 1, 
true);
   316         Vector3 mousePos = Input.mousePosition;
   317         mousePos.y = Screen.height - mousePos.y;
   321             if (Input.GetMouseButton (0)) {
   353                                               "Determines mobile cut plane depth position", 
true, sliderWidth, 1); 
   356                                                         "Determines field line cut position", 
true, sliderWidth, 1); 
   380     private static void textureMenu (
string texDir, 
string[] texList, 
string texDescr) {
   388         GUILayout.BeginHorizontal();
   389         GUILayout.FlexibleSpace();
   391         GUILayout.EndHorizontal();
   393         GUILayout.BeginHorizontal ();
   394         if (GUILayout.Button (
new GUIContent (
"<<", 
"Go to previous series of textures"))) { 
   408         if (GUILayout.Button (
new GUIContent (
"Open", 
"Open custom texture image from disk"))) {    
   411                 new Rect (400, 100, 600, 500),
   418         if (GUILayout.Button (
new GUIContent (
">>", 
"Go to next series of textures"))) { 
   430         GUILayout.EndHorizontal ();
   432         GUILayout.BeginHorizontal ();           
   437         foreach (
string texFil 
in texList) {
   440                 GUILayout.EndHorizontal (); 
   441                 GUILayout.BeginHorizontal (); 
   447             if (GUILayout.Button (
new GUIContent ((Texture2D)Resources.Load (texDir + texFil), texFil), GUILayout.Width (buttonWidth), GUILayout.Height (buttonHeight))) { 
   448                 if(texFil != 
"None") {
   458         GUILayout.EndHorizontal ();
   459         if (Event.current.type == EventType.Repaint)
 static bool onlyBestTextures
 
static bool toggle_NA_HIDE
 
static void useChainColor()
 
static ColorObject SurfaceColor
 
static void SurfaceParams(int a)
Defines the Surface Parameters menu window. 
 
static bool useHetatmForSurface
 
static ColorObject tmpSurfaceInsideColor
 
static void openCloseSurfaceMenu()
Opens or closes the surface menu. 
 
void SetTransparentSurface(bool transparent)
 
static ImprovedFileBrowser m_fileBrowser
 
static void useBFactorColor()
 
static void useEnglemanColor()
 
static void SurfaceRenderUp()
 
static int surfaceCutWidth
 
static ColorObject tmpSurfaceColor
 
static void useEinsenbergColor()
 
static bool showHydroMenu
 
static void ShowHideSurfaces()
 
static void GenerateSurfaceBfact()
 
static bool externalSurfaceTexture
 
static void textureMenu(string texDir, string[] texList, string texDescr)
Helper function to fill a texture choice menu with up to 15 boxes. 
 
static ColorPicker m_colorPicker
 
GameObject[] getSurfaces()
 
static List< string[]> textureMenuList
 
static void SurfaceCut(int a)
Defines the static surface cut window, which is opened from the Surface parameters menu...
 
static int surfaceMenuWidth
 
static bool InDeadZone(Rect rect, Vector3 mpos)
Returns true if the mouse cursor is lower than the Window title. 
 
static void ShowHideVolumetricDensity()
 
static bool isTransparentSurface
 
static void setBrightness(float value)
 
static bool showSurfaceMenu
 
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 FileSelectedCallback(string path)
 
static void Surface(int a)
Defines the Surface menu window, which is opened from the main menu window. 
 
static bool cutPlaneIsDraggable
 
static bool FileBrowser_show2
 
static bool showBfactorMenu
 
static void useWhiteOctanolColor()
 
static float LabelSlider(float sliderValue, float sliderMinValue, float sliderMaxValue, string labelText, string toolTip, bool enable, int sliderwidth, int labelwidth=100, bool newLine=false)
 
static float alphaTransparentSurface
 
static void usePropertiesColor()
 
static bool showReactionMenu
 
static bool showSurfaceCut
 
static string surfaceTextureName
 
static ElectrostaticManager getElectrostaticManager()
 
static string m_last_extSurf_Path
 
!WiP Includes FLAGS of GUI. 
 
static ColorObject SurfaceInsideColor
 
static bool SetTitleExit(string s)
This is a somewhat odd but very convenient function. 
 
!WiP manage GUI, and provide static strings for the GUI. 
 
static void useKyteAndDoolittleColor()
 
static void CreateColorPicker(ColorObject col, string title, List< string > atomTarget, string residueTarget="All", string chainTarget="All")
 
static bool showAnimationMenu
 
static void HydroMenu(int a)
 
static bool useSugarForSurface
 
static List< string > textureMenuTitles
 
void SetTransparentSurfaceColor(Color newcolor)
 
static void SetTitle(string s)
Sets the title of the current window. 
 
static Rect movePlaneRect
 
static bool showSurfaceMobileCut
 
static SurfaceManager getSurfaceManager()
 
static bool hasMoleculeDisplay
 
static bool grayscalemode
 
static void SurfaceTexture(int a)
Defines the texture selection window. 
 
static bool surfaceFileExists
 
static void GenerateSurface()
 
static bool showSurfaceTexture
 
static float surfaceThreshold
 
static void SurfaceMobileCut(int a)
Defines the mobile surface cut window, which is opened from the Surface parameters menu...
 
static void setColorWeight(float value)