Ejemplo n.º 1
0
 private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
 {
     if (e.Node.Count == 0)
     {
         return;
     }
 }
Ejemplo n.º 2
0
 private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
 {
     if (e.Node.Count == 0)
     {
         geometryPropertyGrid.SelectedObject = null;
         geometryPropertyGrid.Refresh();
     }
     else
     {
         VIZCore3D.NET.Data.Objects3DProperty prop = vizcore3d.Object3D.GeometryProperty.FromSelectedObject3D(false);
         geometryPropertyGrid.SelectedObject = prop;
     }
 }
Ejemplo n.º 3
0
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (e.Node.Count == 0)
            {
                txtNodeIndex.Text = String.Empty;
                node = null;
                pgNode.SelectedObject = null;
                return;
            }

            e.Node[0].UpdateNodePath();

            txtNodeIndex.Text = e.Node[0].Index.ToString();
            node = e.Node[0];
            pgNode.SelectedObject = node;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 개체 선택 이벤트
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">Event Args</param>
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (e.Node.Count > 0)
            {
                // 선택된 개체가 있음
                //MessageBox.Show(e.Node.Count.ToString());

                if (EnableMessage == true)
                {
                    vizcore3d.BeginUpdate();
                    Data.Object3DProperty prop = vizcore3d.Object3D.GeometryProperty.FromIndex(e.Node[0].Index, true);

                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_01, string.Format("Name : {0}", e.Node[0].NodeName), 5, 5, VIZCore3D.NET.Data.FontSize.Size_14_Bold, Color.Red);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_02, string.Format("Path : {0}", prop.AssemblyPath), 5, 20, VIZCore3D.NET.Data.FontSize.Size_14, Color.Orange);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_03, string.Format("Center : {0}", prop.CenterPoint.ToString()), 5, 35, VIZCore3D.NET.Data.FontSize.Size_14, Color.Yellow);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_04, string.Format("Min. : {0}", prop.MinPoint.ToString()), 5, 50, VIZCore3D.NET.Data.FontSize.Size_14, Color.Green);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_05, string.Format("Max. : {0}", prop.MaxPoint.ToString()), 5, 65, VIZCore3D.NET.Data.FontSize.Size_14, Color.Blue);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_06, string.Format("Mass : {0}", prop.Mass), 5, 80, VIZCore3D.NET.Data.FontSize.Size_14, Color.Indigo);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_07, string.Format("Area : {0}", prop.SurfaceArea), 5, 95, VIZCore3D.NET.Data.FontSize.Size_14, Color.Purple);

                    vizcore3d.EndUpdate();
                }
            }
            else
            {
                //모든 개체 선택 해제

                if (EnableMessage == true)
                {
                    vizcore3d.BeginUpdate();

                    vizcore3d.View.Message.Clear();
                    VIZCore3D.NET.Data.BoundBox3D bbox = vizcore3d.Model.BoundBox;

                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_01, string.Format("Min. X : {0}", bbox.MinX), 5, 5, VIZCore3D.NET.Data.FontSize.Size_14, Color.Red);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_02, string.Format("Min. Y : {0}", bbox.MinY), 5, 20, VIZCore3D.NET.Data.FontSize.Size_14, Color.Orange);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_03, string.Format("Min. Z : {0}", bbox.MinZ), 5, 35, VIZCore3D.NET.Data.FontSize.Size_14, Color.Yellow);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_04, string.Format("Max. X : {0}", bbox.MaxX), 5, 50, VIZCore3D.NET.Data.FontSize.Size_14, Color.Green);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_05, string.Format("Max. Y : {0}", bbox.MaxY), 5, 65, VIZCore3D.NET.Data.FontSize.Size_14, Color.Blue);
                    vizcore3d.View.Message.Show(VIZCore3D.NET.Data.MessageId.ID_06, string.Format("Max. Z : {0}", bbox.MaxZ), 5, 80, VIZCore3D.NET.Data.FontSize.Size_14, Color.Indigo);

                    vizcore3d.EndUpdate();
                }
            }
        }
Ejemplo n.º 5
0
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (ckSetColorByDefaultColor.Checked == false)
            {
                return;
            }

            if (rbColor1.Checked == true)
            {
                vizcore3d.Object3D.Color.SetColor(btnSelectColor1.BackColor);
            }
            else if (rbColor2.Checked == true)
            {
                vizcore3d.Object3D.Color.SetColor(btnSelectColor2.BackColor);
            }
            else if (rbColor3.Checked == true)
            {
                vizcore3d.Object3D.Color.SetColor(btnSelectColor3.BackColor);
            }
        }
Ejemplo n.º 6
0
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (e.Node.Count == 0)
            {
                lvAttribute.BeginUpdate();
                lvAttribute.Items.Clear();
                lvAttribute.EndUpdate();
            }
            else
            {
                Dictionary <string, string> attribute = vizcore3d.Object3D.UDA.FromIndex(e.Node[0].Index);

                lvAttribute.BeginUpdate();
                lvAttribute.Items.Clear();
                foreach (KeyValuePair <string, string> item in attribute)
                {
                    ListViewItem lvi = new ListViewItem(new string[] { item.Key, item.Value });
                    lvAttribute.Items.Add(lvi);
                }
                lvAttribute.EndUpdate();
            }
        }
Ejemplo n.º 7
0
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (e.Node.Count == 0)
            {
            }
            else
            {
                VIZCore3D.NET.Data.Node item = vizcore3d.Object3D.FromIndex(e.Node[0].Index, true);
                // WELDLINE 모델은 NodePath에 "WELD"가 포함되어 있음.
                if (item.NodePath.Contains("WELD") == false)
                {
                    return;
                }

                List <VIZCore3D.NET.Importer.ShxWdlTreeData> items = wdl.GetTree(item.NodeName);

                if (items.Count == 0)
                {
                    return;
                }

                wdlTree.AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(this.wdlTree_AfterSelect);
                TreeNode itemNode = null;
                foreach (TreeNode node in wdlTree.Nodes)
                {
                    itemNode = FromID(items[0], node);
                    if (itemNode != null)
                    {
                        break;
                    }
                }
                if (itemNode != null)
                {
                    wdlTree.SelectedNode = itemNode;
                }
                wdlTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.wdlTree_AfterSelect);
            }
        }
Ejemplo n.º 8
0
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (e.Node.Count == 0)
            {
                return;
            }
            if (ckEnable.Checked == false)
            {
                return;
            }

            if (rbBoundBox.Checked == true)
            {
                DrawByBoundBox(e.Node);
            }
            else if (rbEdgeVertex.Checked == true)
            {
                DrawByEdgeVertex(e.Node);
            }
            else
            {
                DrawByOsnap(e.Node);
            }
        }
Ejemplo n.º 9
0
        private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
        {
            if (e.Node.Count == 0)
            {
                return;
            }
            if (ckEnable.Checked == false)
            {
                return;
            }

            Data.Node node = vizcore3d.Object3D.FromIndex(e.Node[0].Index, true);

            // 현재 노트 스타일 가져오기 및 수정
            Data.NoteStyle style = vizcore3d.Review.Note.GetStyle();
            {
                // 화살표 색상
                style.ArrowColor = Color.Black;
                // 화살표 두께
                style.ArrowWidth = 10;

                // 배경 투명하게 처리 여부
                style.BackgroudTransparent = ckTransparent.Checked;
                // 배경 색상 - 배경을 투명하게 처리할 경우, 적용되지 않음
                style.BackgroundColor = Color.White;

                // 노트 글자 색상
                style.FontColor = Color.Black;
                // 노트 글자 크기
                style.FontSize = Data.FontSizeKind.SIZE18;
                // 노트 글자 굵게 표시 여부
                style.FontBold = false;

                // 라인 색상
                style.LineColor = Color.Red;
                // 라인 두께
                style.LineWidth = 3;

                // 텍스트 상자 표시 여부
                style.UseTextBox = true;

                // 라인과 텍스트 박스의 연결 위치
                style.LinkArrowTailToText = Manager.NoteManager.LinkArrowTailToTextKind.OUTLINE;

                // 심볼 배경색
                style.SymbolBackgroundColor = Color.Yellow;
                // 심볼 글자 색상
                style.SymbolFontColor = Color.Black;
                // 심볼 글자 크기
                style.SymbolFontSize = Data.FontSizeKind.SIZE16;
                // 심볼 글자 굵게 표시 여부
                style.SymbolFontBold = true;
                // 심볼 위치
                style.SymbolPosition = Manager.NoteManager.SymbolPositionKind.ARROW;
                // 심볼 크기
                style.SymbolSize = 10;

                // 심볼 사용 유무
                style.UseSymbol = ckUseSymbol.Checked;
                // 심볼 텍스트
                style.SymbolText = Convert.ToString(vizcore3d.Review.Note.GetID().Count + 1);
            }

            // 색상 텍스트 생성
            VIZCore3D.NET.Data.MultiColorText text = new Data.MultiColorText();
            text.Add("MODEL : ", Color.Black);
            text.AddLine(string.Format("{0}", vizcore3d.Object3D.FromIndex(0).NodeName), Color.Red);
            text.Add("NAME : ", Color.Black);
            text.AddLine(node.NodeName, Color.Red);

            //{
            //    text.NewLine();

            //    // Geometry 속성 조회
            //    Data.Object3DProperty prop = vizcore3d.Object3D.GeometryProperty.FromIndex(e.Node[0].Index, false);

            //    text.Add("Center : ", Color.Black);
            //    text.AddLine(string.Format("{0}", prop.CenterPoint.ToString()), Color.Purple);

            //    text.Add("Min. : ", Color.Black);
            //    text.AddLine(string.Format("{0}", prop.MinPoint.ToString()), Color.Purple);

            //    text.Add("Max. : ", Color.Black);
            //    text.AddLine(string.Format("{0}", prop.MaxPoint.ToString()), Color.Purple);
            //}

            //{
            //    text.NewLine();

            //    // UDA(User Define Attribute) 조회
            //    Dictionary<string, string> uda = vizcore3d.Object3D.UDA.FromIndex(node.Index);

            //    foreach (KeyValuePair<string, string> item in uda)
            //    {
            //        text.Add(string.Format("{0} : ", item.Key), Color.Red);
            //        text.AddLine(string.Format("{0}", item.Value), Color.DarkGray);
            //    }
            //}

            // 부재의 표면점 조회
            Data.Vertex3D surfacePt = vizcore3d.Object3D.GetSurfaceVertexClosestToModelCenter(new List <int>()
            {
                node.Index
            });

            // 화면 갱신 차단
            vizcore3d.BeginUpdate();

            // 노트 생성
            vizcore3d.Review.Note.AddNoteSurface(text
                                                 , new Data.Vertex3D(surfacePt.X + 2000.0f, surfacePt.Y, surfacePt.Z + 2000.0f)
                                                 , surfacePt
                                                 , style
                                                 );

            // 화면 갱신 차단 해제
            vizcore3d.EndUpdate();
        }
Ejemplo n.º 10
0
 private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
 {
 }
Ejemplo n.º 11
0
 private void Object3D_OnSelectedObject3D(object sender, VIZCore3D.NET.Event.EventManager.SelectedObject3DEventArgs e)
 {
     vizcore3d.BeginUpdate();
     vizcore3d.SelectionBox.Select(false);
     vizcore3d.EndUpdate();
 }