コード例 #1
0
    /// <summary>
    /// Adds the specified window to the list of open windows
    /// </summary>
    /// <param name="window">The new window</param>
    public void Add(Window3D window)
    {
        // if it is stackable => close all open windows
        if (!window.stackable)
        {
            List <Window3D> tempCopy = CopyWindows();
            foreach (Window3D w in tempCopy)
            {
                w.Close();
            }
        }
        // if it is a type singleton => close all windows of the same type
        else if (window.typeSingleton)
        {
            List <Window3D> tempCopy = CopyWindows();
            foreach (Window3D w in tempCopy)
            {
                if (w.typeId == window.typeId)
                {
                    w.Close();
                }
            }
        }
        // else: just add the window to the stack

        openWindows.Add(window);

        UpdateAlignment();
    }
コード例 #2
0
ファイル: MessageBox.cs プロジェクト: rwth-acis/GaMR
    /// <summary>
    /// Internal function which is the base for the different public Show methods
    /// Displays a MessageBox and sets it either at a fixed position or to follow the user
    /// </summary>
    /// <param name="text">The text message which should be displayed to the user</param>
    /// <param name="type">The type of the MessageBox</param>
    /// <param name="fixedPosition">True if the MessageBox should be displayed at a fixed position</param>
    /// <param name="position">The global position where the message box is shown (only used if fixedPosition true)</param>
    /// <param name="rotation">The global rotation of the message box (only used if fixedPosition true)</param>
    private static void Show(string text, MessageBoxType type, bool fixedPosition, Vector3 position, Quaternion rotation)
    {
        // load the MessageBox from the resources and set the necessary variables
        GameObject messageBox = (GameObject)Instantiate(Resources.Load("MessageBox"));
        //messageBox.transform.position = Camera.main.transform.position + Camera.main.transform.forward * 3;
        MessageBox msgBox = messageBox.GetComponent <MessageBox>();

        msgBox.Text = text;
        msgBox.type = type;

        if (fixedPosition)
        {
            // if a fixed position is used: destroy all compononents from the prefab which modify the position and rotation
            SimpleTagalong tagalong = messageBox.GetComponent <SimpleTagalong>();
            Destroy(tagalong);
            FaceCamera faceCamera = messageBox.GetComponent <FaceCamera>();
            Destroy(faceCamera);
            Window3D window = messageBox.GetComponent <Window3D>();
            Destroy(window);

            // then set the position and rotation
            messageBox.transform.position = position;
            messageBox.transform.rotation = rotation;
        }

        count++;
    }
コード例 #3
0
 private static void HideBoreholeInWindow3D(Window3D window3D, Borehole borehole)
 {
     // if there is alreay a well made visible by this command hide it
     if (borehole != Borehole.NullObject && window3D.IsVisible(borehole))
     {
         window3D.HideObject(borehole);
     }
 }
コード例 #4
0
 private static void ShowBoreholeInWindow3D(Window3D window3D, Borehole borehole)
 {
     // show the borehole in the window3d if possible
     if (borehole != Borehole.NullObject && window3D.CanShowObject(borehole))
     {
         window3D.ShowObject(borehole);
     }
 }
コード例 #5
0
        private void btnShow_Click(object sender, EventArgs e)
        {
            Window3D win3d = PetrelProject.ToggleWindows.Add(WellKnownWindows.Window3D) as Window3D;

            win3d.ShowObject(args.NovozhentsevWellLog.Borehole);
            win3d.ShowObject(args.NovozhentsevResultProperty);
            win3d.ShowAxis       = true;
            win3d.ShowAutoLegend = true;
            win3d.ZScale         = 5;
            ka = true;
        }
コード例 #6
0
 internal SoXYZNode(XYZObject xyzObject, Window3D window)
 {
     _xyzObject = xyzObject;
     _window    = window;
     //
     // subscribe to property changed o fthe object
     _xyzObject.PropertyChanged += XyzObjectOnPropertyChanged;
     //
     // create a translation
     _translation = new SoTranslation();
     UpdateSoTranslation();
     this.AddChild(_translation);
     //
     // create a sphere
     _sphere = new SoSphere();
     UpdateSoSphere();
     this.AddChild(_sphere);
 }
コード例 #7
0
    private static void Display(string label, string text, int maxNumberOfCharacters, Action <string> callWithResult, bool fullKeyboard, bool fixedPosition, Vector3 position, Quaternion rotation)
    {
        GameObject keyboardInstance;

        if (fullKeyboard)
        {
            keyboardInstance = GameObject.Instantiate(WindowResources.Instance.Keyboard);
        }
        else
        {
            keyboardInstance = GameObject.Instantiate(WindowResources.Instance.Numpad);
        }
        Keyboard keyboard = keyboardInstance.GetComponent <Keyboard>();

        keyboard.label.text     = label;
        keyboard.Text           = text;
        keyboard.callWithResult = callWithResult;
        keyboard.IsFullKeyboard = fullKeyboard;
        keyboard.MaxLength      = maxNumberOfCharacters;

        if (fixedPosition) // use a fixed position for the keyboardi instead of tracking it with the view
        {
            // delete the components from the prefab which realize the view tracking
            SimpleTagalong tagalong = keyboardInstance.GetComponent <SimpleTagalong>();
            Destroy(tagalong);
            FaceCamera faceCamera = keyboardInstance.GetComponent <FaceCamera>();
            Destroy(faceCamera);
            Window3D window = keyboardInstance.GetComponent <Window3D>();
            Destroy(window);

            // set the position of the keyboard
            keyboardInstance.transform.position = position;
            keyboardInstance.transform.rotation = rotation;
        }

        currentlyOpenedKeyboard = keyboard;
    }
コード例 #8
0
 /// <summary>
 /// Removes a window from the openWindows-stack
 /// </summary>
 /// <param name="window">The window to remove</param>
 public void Remove(Window3D window)
 {
     openWindows.Remove(window);
     UpdateAlignment();
 }