Exemplo n.º 1
0
        private void AddSurfaceData(bool pick, bool surface, VIZCore3D.NET.Data.Vertex3D position, VIZCore3D.NET.Data.Vector3D normal)
        {
            ListViewItem lvi = new ListViewItem(
                new string[] {
                pick == true ? "True" : "False"
                , surface == true ? "True" : "False"
                , position.ToString()
                , normal.ToString()
            }
                );

            lvItems.Items.Add(lvi);
        }
Exemplo n.º 2
0
        private void View_OnViewDefaultMouseDownEvent(object sender, MouseEventArgs e)
        {
            if (ckEnable.Checked == false)
            {
                return;
            }

            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            VIZCore3D.NET.Data.PickedSurfaceData data = vizcore3d.View.GetPickedSurfaceNormalVector(e.X, e.Y);

            // 선택된 부재가 없음
            if (data.Picked == false)
            {
                return;
            }

            // 표면점이 없음
            if (data.Surface == false)
            {
                return;
            }

            // 선택된 지점
            VIZCore3D.NET.Data.Vertex3D position = data.Position;

            // 선택된 지점의 Normal Vector
            VIZCore3D.NET.Data.Vector3D normal = data.Normal;

            string str = string.Format("VERTEX: {0}\r\nNORMAL : {1}", position.ToString(), normal.ToString());

            System.Console.WriteLine(str);

            int nodeIndex = vizcore3d.View.HitTest(e.X, e.Y);

            if (nodeIndex < 0)
            {
                return;
            }

            VIZCore3D.NET.Data.Node node = vizcore3d.Object3D.FromIndex(nodeIndex);

            int noteId = vizcore3d.Review.Note.AddNoteSurface(string.Format("{0}\r\n{1}", node.GetParentName(), str), new VIZCore3D.NET.Data.Vertex3D(position.X + 5000, position.Y + 5000, position.Z + 1000), position, GetStyle());

            if (ckDepthTest.Checked == true)
            {
                vizcore3d.Review.Note.EnableDepthTest(noteId, true);
            }
        }