Example #1
0
    private void SomeDataListToDivs(List <SomeData> someDataList, Dom.Element target)
    {
        var someDataItems = FindChildrenByName(target, "someDataItem");

        foreach (var s in someDataItems)
        {
            s.remove();
        }

        someDataList
        .OrderBy(current => current.Id())
        .Select(currentData =>
        {
            //TODO: Cria os span
            var idSpan                = document.createElement("span");
            idSpan.innerText          = currentData.Id().ToString();
            idSpan.style.paddingRight = "5vw";
            var idValue               = document.createElement("span");
            idValue.innerText         = currentData.Value().ToString();
            //TODO: Cria a div que embala os span
            var divBox = document.createElement("div");
            divBox.appendChild(idSpan);
            divBox.appendChild(idValue);
            divBox.style.paddingTop   = "2vh";
            divBox.style.paddingRight = "2vw";
            divBox.style.paddingLeft  = "2vw";
            divBox.setAttribute("name", "someDataItem");
            //TODO: Retorna a div
            return(divBox);
        })
        .ToList()
        .ForEach(currentElement => {
            target.appendChild(currentElement);
        });
    }
Example #2
0
 /// <summary>
 /// Delete all children in the given target.
 /// </summary>
 /// <param name="target"></param>
 private void RemoveAllChildren(Dom.Element target)
 {
     target.children.ToList().ForEach(child =>
     {
         target.removeChild(child);
     });
 }
Example #3
0
 // Update is called once per frame
 unsafe void Update()
 {
     Dom.Element container = document.getElementsByClassName("root-container").item(0);
     ApplyFullHeightToContainerElement();
     SetPersistentDataPath();
     //SomeDataListToDivs(libInterface.TestFillStructInCpp(), container);
     TestCanLoadDicom();
     // libInterface.FindAllDicomsInPath();
 }
Example #4
0
    //TODO: Tirar a animação do html e por no c#.

    private void HideProgressBarAndGoToNextSceneWhenLoadDone()
    {
        if (gdcmPlugin.LoadingState == MyGdcmPlugin.DirectoryLoadingState.LOADED)
        {
            Dom.Element progressBar = document.getElementById("progress-bar-container");
            progressBar.style.animation = "fade-progress-bar 1s";
            //TODO: Essa condição está mto fragil. Usar uma condição melhor
            if (progressBar.style.backgroundColor == "rgba(0,1686275,0,1686275,0,1686275,0)")
            {
                SceneManager.LoadScene("MainMenu");
            }
        }
    }
Example #5
0
        internal override void OnBlurEvent(FocusEvent fe)
        {
            // Is the new focused element a child of dropdown?
            Dom.Element current = fe.focusing as Dom.Element;

            while (current != null)
            {
                if (current.Tag == "dropdown")
                {
                    return;
                }

                current = current.parentElement;
            }

            Hide();
        }
Example #6
0
 private List <Dom.Element> FindChildrenByName(Dom.Element target, string name)
 {
     return(target.getElementsByName(name).ToList());
 }
Example #7
0
 //private void TestNumberOfDicoms()
 //{
 //    var amount = libInterface.FindAllDicomsInPath();
 //    document.getElementById("number-of-dicoms").innerText = amount.ToString();
 //}
 /// <summary>
 /// Root div won't have full height even with height = 100%. So in Update I manually set it's size in pixels
 /// to be equal to the screen height. It assumes an element with class name equal to "root-container".
 /// </summary>
 private void ApplyFullHeightToContainerElement()
 {
     Dom.Element container = document.getElementsByClassName("root-container").item(0);
     container.style.height = Screen.height + "px";
 }
    void Start()
    {
        //A hack to disable the gesture based control in the scenes. That is inappropriate while exploring the environments.
        PlayerPrefs.SetString("EyeSkills.practitionerMode", "1");

        if (PlayerPrefs.GetString("EyeSkills.Practitioner") == "")
        {
            //SceneManager.LoadScene("Username");
            PlayerPrefs.SetString("EyeSkills.Name", System.Guid.NewGuid().ToString());
            PlayerPrefs.SetString("EyeSkills.Practitioner", "practitioner1");
        }

        unlocked = PlayerPrefs.GetInt("EyeSkills.MenuUnlocked", 0);

        NetworkManager.instance.RegisterScene("Main Menu", "Select a calibration.");

        landscapeElement = UI.document.getElementById("landscape");
        menuElement      = UI.document.getElementById("menu");

        landscapeElement.style.display = "none";
        menuElement.style.display      = "none";

        BuildMenu(menuItems);

        UI.document.getById("submenu-button1").addEventListener("mousedown", delegate(MouseEvent e) {
            EnterSceneLockedEye(true);
        });

        UI.document.getById("submenu-button2").addEventListener("mousedown", delegate(MouseEvent e) {
            EnterSceneLockedEye(false);
        });

        UI.document.getById("submenu-button").addEventListener("mousedown", delegate(MouseEvent e) {
            EnterScene();
        });

        UI.document.getById("header").addEventListener("mousedown", delegate(MouseEvent e)
        {
            //clicks++;
            //if (clicks >= 3) {
            //  debugActive = true;
            //  BuildMenu(debugItems);
            //}
            //else {
            debugActive = false;
            BuildMenu(menuItems);
            UI.document.getById("swiper").animate("left:0%", .1f);
            //}
        });

        //StartCoroutine(_checkInternetConnection());
        StartCoroutine(_clickReset());

/*        Debug.Log("Checking Permissions");
 *      Application.RequestUserAuthorization(UserAuthorization.WebCam);
 *      if (Application.HasUserAuthorization(UserAuthorization.WebCam))
 *      {
 *          Debug.Log("webcam auth ok");
 *      }
 *      else
 *      {
 *          Debug.Log("webcam auth not ok");
 *      }*/
    }