private void btnClearPos_Click(object sender, EventArgs e) { int id = vizcore3d.Walkthrough.AvatarPath.PathID; if (id == -1) { return; } VIZCore3D.NET.Data.AvatarPathItem item = vizcore3d.Walkthrough.AvatarPath.GetPath(id); item.DeletePosition(); lvPosition.Items.Clear(); }
private void btnDeletePos_Click(object sender, EventArgs e) { int id = vizcore3d.Walkthrough.AvatarPath.PathID; if (id == -1) { return; } VIZCore3D.NET.Data.AvatarPathItem item = vizcore3d.Walkthrough.AvatarPath.GetPath(id); if (lvPosition.SelectedItems.Count == 0) { return; } int index = Convert.ToInt32(lvPosition.SelectedItems[0].SubItems[0].Text); item.DeletePosition(index); List <VIZCore3D.NET.Data.Vertex3D> positions = item.Positions; lvPosition.BeginUpdate(); lvPosition.Items.Clear(); for (int i = 0; i < positions.Count; i++) { ListViewItem lvi = new ListViewItem(new string[] { i.ToString() , positions[i].X.ToString() , positions[i].Y.ToString() , positions[i].Z.ToString() } ); lvPosition.Items.Add(lvi); } lvPosition.EndUpdate(); }