Beispiel #1
0
        private void lvPath_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvPath.SelectedItems.Count == 0)
            {
                return;
            }
            if (lvPath.SelectedItems[0].Tag == null)
            {
                return;
            }

            VIZCore3D.NET.Data.AvatarPathItem item = (VIZCore3D.NET.Data.AvatarPathItem)lvPath.SelectedItems[0].Tag;
            vizcore3d.Walkthrough.AvatarPath.Select(item.ID, true);

            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();
        }
Beispiel #2
0
        private void btnAddPath_Click(object sender, EventArgs e)
        {
            if (vizcore3d.Model.IsOpen() == false)
            {
                return;
            }

            int count = vizcore3d.Walkthrough.AvatarPath.Count;

            VIZCore3D.NET.Dialogs.AddNodeDialog dlg = new Dialogs.AddNodeDialog(string.Format("AVATAR PATH #{0}", count++));
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            string title = dlg.NodeName;

            VIZCore3D.NET.Data.AvatarPathItem item = vizcore3d.Walkthrough.AvatarPath.Add(title);

            lvPath.BeginUpdate();
            ListViewItem lvi = new ListViewItem(new string[]
            {
                item.ID.ToString()
                , item.Title
            }
                                                );

            lvi.Tag = item;
            lvPath.Items.Add(lvi);
            lvPath.EndUpdate();

            lvPosition.Items.Clear();
        }
Beispiel #3
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            vizcore3d.Walkthrough.AvatarPath.OpenFileDialog();

            lvPosition.Items.Clear();
            lvPath.Items.Clear();

            lvPath.BeginUpdate();
            int count = vizcore3d.Walkthrough.AvatarPath.Count;

            for (int i = 0; i < count; i++)
            {
                VIZCore3D.NET.Data.AvatarPathItem item = vizcore3d.Walkthrough.AvatarPath.GetPathByIndex(i);

                ListViewItem lvi = new ListViewItem(new string[]
                {
                    item.ID.ToString()
                    , item.Title
                }
                                                    );
                lvi.Tag = item;
                lvPath.Items.Add(lvi);
            }
            lvPath.EndUpdate();
        }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        private void btnAddPos_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.AddPosition(new VIZCore3D.NET.Data.Vertex3D(100, 200, 300));
            item.AddPosition(-1, ckRepeat.Checked);
        }
Beispiel #6
0
        private void btnDeletePath_Click(object sender, EventArgs e)
        {
            if (lvPath.SelectedItems.Count == 0)
            {
                return;
            }
            if (lvPath.SelectedItems[0].Tag == null)
            {
                return;
            }

            VIZCore3D.NET.Data.AvatarPathItem item = (VIZCore3D.NET.Data.AvatarPathItem)lvPath.SelectedItems[0].Tag;

            vizcore3d.Walkthrough.AvatarPath.Delete(item.ID);

            lvPath.Items.Remove(lvPath.SelectedItems[0]);
        }
Beispiel #7
0
        private void AvatarPath_OnPositionUpdatedEvent(object sender, Event.EventManager.AvatarPathEventArgs e)
        {
            lvPosition.BeginUpdate();
            lvPosition.Items.Clear();
            VIZCore3D.NET.Data.AvatarPathItem  item     = vizcore3d.Walkthrough.AvatarPath.GetPath(e.ID);
            List <VIZCore3D.NET.Data.Vertex3D> position = item.Positions;

            for (int i = 0; i < position.Count; i++)
            {
                ListViewItem lvi = new ListViewItem(new string[]
                {
                    i.ToString()
                    , position[i].X.ToString()
                    , position[i].Y.ToString()
                    , position[i].Z.ToString()
                }
                                                    );
                lvPosition.Items.Add(lvi);
            }
            lvPosition.EndUpdate();
        }
Beispiel #8
0
        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();
        }