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(); }
private void AddResult(VIZCore3D.NET.Data.ConnectedSurfaceNormalVectorItem item, bool note, bool nv) { VIZCore3D.NET.Data.Node node1 = vizcore3d.Object3D.FromIndex(item.Index1); VIZCore3D.NET.Data.Node node2 = vizcore3d.Object3D.FromIndex(item.Index2); string no = Convert.ToString(lvResult.Items.Count + 1); ListViewItem lvi = new ListViewItem( new string[] { no , node1.Index.ToString() , node2.Index.ToString() , node1.NodeName , node2.NodeName , item.UseTestPosition == true ? item.TestPosition.ToString() : "" , item.Normal.ToString() , item.Projection1.ToString() , item.Projection2.ToString() } ); lvi.Tag = item; lvResult.Items.Add(lvi); if (note == true) { VIZCore3D.NET.Data.MultiColorText text = new Data.MultiColorText(); text.AddLine(string.Format("NO. : {0}", no), Color.Purple); text.AddLine(string.Format("NODE #1 : {0}", node1.NodeName), Color.Black); text.AddLine(string.Format("NODE #2 : {0}", node2.NodeName), Color.Blue); text.AddLine(string.Format("N/V : {0}", item.Normal.ToString()), Color.Red); VIZCore3D.NET.Data.Vertex3D pos = new VIZCore3D.NET.Data.Vertex3D( item.Projection1.X + 500 , item.Projection1.Y + 500 , item.Projection1.Z + 3500 ); vizcore3d.Review.Note.AddNoteSurface(text, pos, item.Projection1); } if (nv == true) { if (Convert.ToInt32(item.Normal.X) != 0 || Convert.ToInt32(item.Normal.Y) != 0 || Convert.ToInt32(item.Normal.Z) != 0) { return; } vizcore3d.ShapeDrawing.AddVertex( new List <VIZCore3D.NET.Data.Vertex3D>() { item.TestPosition } , 0 , Color.Blue , 10 , 10 , true ); } }