Exemple #1
0
        private void textBoxMatrixName_Validating(object sender, CancelEventArgs e)
        {
            if (listBoxMatrices.SelectedIndex < 0)
            {
                return;
            }

            TransformDefinition matrixDefinition = _savedMatrices[(string)listBoxMatrices.SelectedItem];

            _savedMatrices.Remove((string)listBoxMatrices.SelectedItem);
            _savedMatrices.Add(textBoxMatrixName.Text, matrixDefinition);
            listBoxMatrices.Items[listBoxMatrices.SelectedIndex] = textBoxMatrixName.Text;
        }
        public bool UpdatePanel(TransformDefinition NewDefinition, string PanelName = "")
        {
            if (String.IsNullOrEmpty(PanelName))
            {
                PanelName = ActivePanelName;
            }

            if (!_vrPanelSettings.ContainsKey(PanelName))
            {
                return(false);
            }

            _vrPanelSettings[PanelName] = NewDefinition;
            return(true);
        }
        public bool RenamePanel(string NewPanelName, string ExistingPanelName = "")
        {
            if (String.IsNullOrEmpty(ExistingPanelName))
            {
                ExistingPanelName = ActivePanelName;
            }

            if (!_vrPanelSettings.ContainsKey(ExistingPanelName))
            {
                return(false);
            }

            TransformDefinition m = _vrPanelSettings[ExistingPanelName];

            _vrPanelSettings.Remove(ExistingPanelName);
            _vrPanelSettings.Add(NewPanelName, m);
            return(true);
        }
Exemple #4
0
        private void DisplayMatrix()
        {
            if (listBoxMatrices.SelectedIndex < 0)
            {
                return;
            }

            _displayingMatrixData = true;
            TransformDefinition matrix = _savedMatrices[(string)listBoxMatrices.SelectedItem];

            numericUpDownX.Value            = (decimal)matrix.PositionX;
            numericUpDownY.Value            = (decimal)matrix.PositionY;
            numericUpDownZ.Value            = (decimal)matrix.PositionZ;
            trackBarRotationX.Value         = (int)(matrix.RotationX);
            trackBarRotationY.Value         = (int)(matrix.RotationY);
            trackBarRotationZ.Value         = (int)(matrix.RotationZ);
            numericUpDownOverlayWidth.Value = (decimal)matrix.Width;
            _displayingMatrixData           = false;
            if (_vrLocatorOverlay != null)
            {
                _vrLocatorOverlay.Transform = _savedMatrices[(string)listBoxMatrices.SelectedItem].ToHmdMatrix34_t();
            }
        }
        public static VRPanelSetting DefaultVRMatrix()
        {
            TransformDefinition defaultMatrix = new TransformDefinition();

            return(new VRPanelSetting("Default", defaultMatrix));
        }
 public VRPanelSetting(string Name, TransformDefinition Matrix)
 {
     HMDPanelMatrix = Matrix;
     PanelName      = Name;
 }