示例#1
0
        private void UpdateItem(int index)
        {
            numVertices = 0;

            if (index >= 0 && index < Variables.Count)
            {
                ObservedVariable variable = Variables[index];

                if (DebugHandler.Debugger.CurrentMode == dbgDebugMode.dbgBreakMode)
                {
                    PointCloud pointCloud = null;

                    if (variable.MemberData == null)
                    {
                        pointCloud = DebugHandler.Load(variable.Name);
                    }
                    else
                    {
                        pointCloud = DebugHandler.Load(variable.Name, variable.MemberData);
                    }

                    if (pointCloud != null)
                    {
                        OpenGL gl = openGLControl.OpenGL;

                        vao.Bind(gl);

                        vbo.Bind(gl);
                        gl.BufferData(OpenGL.GL_ARRAY_BUFFER, pointCloud.vertices, OpenGL.GL_STATIC_DRAW);
                        numVertices = pointCloud.numVertices;
                    }
                }
            }
        }
示例#2
0
        public void AddItem(string name, PointCloudVisualizationData memberData)
        {
            bool success = false;

            if (Variables.Count > 0)
            {
                var variable = Variables[Variables.Count - 1];
                if (variable.Name == null || variable.Name == "")
                {
                    variable            = new ObservedVariable(name);
                    variable.MemberData = memberData;
                    ResetAt(variable, Variables.Count - 1);
                    SelectItem(Variables.Count - 1);
                    UpdateItem(Variables.Count - 1);
                    success = true;
                }
            }

            if (!success)
            {
                var variable = new ObservedVariable(name);
                variable.MemberData = memberData;
                ResetAt(variable, Variables.Count);
                SelectItem(Variables.Count - 1);
            }

            ResetAt(new ObservedVariable(), Variables.Count);
        }
示例#3
0
        private void SelectCurrentItem(object sender, KeyboardFocusChangedEventArgs e)
        {
            TextBox item = (TextBox)sender;

            ObservedVariable var = (ObservedVariable)item.DataContext;
            int index            = Variables.IndexOf(var);

            SelectItem(index);
        }
示例#4
0
 private void ResetAt(ObservedVariable item, int index)
 {
     ((System.ComponentModel.INotifyPropertyChanged)item).PropertyChanged += ObservedVariable_NameChanged;
     if (index < Variables.Count)
     {
         Variables.RemoveAt(index);
     }
     Variables.Insert(index, item);
 }
示例#5
0
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox          list     = (ListBox)sender;
            ObservedVariable variable = (ObservedVariable)list.SelectedItem;
            int index = Variables.IndexOf(variable);

            currentlyObservedVariable = index;

            if (index < 0 || index >= listBox.Items.Count)
            {
                return;
            }

            UpdateItem(index);
        }