Sample
Review 항목 제거 후 이벤트 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
vizcore3d.Review.OnReviewDeletedEvent += Review_OnReviewDeletedEvent;
}
private void Review_OnReviewDeletedEvent(object sender, Event.EventManager.ReviewDeletedEventArgs e)
{
int reviewId = e.ReviewID;
}
Generic 파일 Marking, String, End, Bevel 데이터 개수 및 가시화 기능 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
int countString = vizcore3d.GenericData.GetStringDataCount();
int countMarking = vizcore3d.GenericData.GetMarkingDataCount();
int countBevel = vizcore3d.GenericData.GetBevelSymbolDataCount();
int countEnd = vizcore3d.GenericData.GetLeftRightEndDataCount();
}
단면/상자 클리핑된 개체의 Area/Volume 정보 반환 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
VIZCore3D.NET.Data.Section section = vizcore3d.Section.SelectedItem;
if (section == null) return;
// 1. Geometry Property
VIZCore3D.NET.Data.SectionGeometryProperty prop =
vizcore3d.Section.GetGeometryProperty();
float area = prop.Area / 1000.0f / 1000.0f;
string areaDisplayStr = string.Format("{0} ㎡", area);
float volume = prop.Volume / 1000.0f / 1000.0f / 1000.0f;
string volumeDisplayStr = string.Format("{0} ㎥", volume);
// 2. Error Node Index
foreach (int errorNodeIndex in prop.ErrorIndex)
{
Console.WriteLine(string.Format("Error Node Index : {0}", errorNodeIndex));
}
// 3. Clipped Parts
List<VIZCore3D.NET.Data.Node> nodes = new List<VIZCore3D.NET.Data.Node>();
if (section.SectionType == VIZCore3D.NET.Manager.SectionManager.SectionTypes.SECTION)
{
nodes = vizcore3d.Section.GetSectionNode(section.ID, -1);
}
else if (section.SectionType == VIZCore3D.NET.Manager.SectionManager.SectionTypes.SECTION_BOX)
{
for (int i = 0; i < 6; i++)
{
nodes.AddRange(vizcore3d.Section.GetSectionNode(section.ID, i));
}
}
foreach (VIZCore3D.NET.Data.Node node in nodes)
{
VIZCore3D.NET.Data.SectionGeometryPartProperty partGeometry = null;
if (prop.PartData.ContainsKey(node.Index) == true)
{
partGeometry = prop.PartData[node.Index];
}
else if (prop.PartData.ContainsKey(node.Index + 1) == true)
{
partGeometry = prop.PartData[node.Index + 1];
}
float orgArea = 0.0f;
float orgVolume = 0.0f;
float resultArea = 0.0f;
float resultVolume = 0.0f;
if (partGeometry != null)
{
orgArea = partGeometry.OriginalArea / 1000.0f / 1000.0f;
orgVolume = partGeometry.OriginalVolume / 1000.0f / 1000.0f / 1000.0f;
resultArea = partGeometry.ResultArea / 1000.0f / 1000.0f;
resultVolume = partGeometry.ResultVolume / 1000.0f / 1000.0f / 1000.0f;
}
Console.WriteLine(
string.Format(
"{0}, {1}, {2}, {3}, {4}, {5}, {6}"
, node.Index.ToString()
, node.NodeName
, node.GetParentName()
, partGeometry == null ? "N/A" : orgArea.ToString()
, partGeometry == null ? "N/A" : orgVolume.ToString()
, partGeometry == null ? "N/A" : resultArea.ToString()
, partGeometry == null ? "N/A" : resultVolume.ToString()
)
);
}
}
이름의 특정 문자열을 지정된 문자열로 변경하는 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
string oldName = "HULL";
string newName = "선체";
vizcore3d.Object3D.ReplaceName(oldName, newName);
}
표면노트 기본값 설정 기능 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
// 기본 데이터 생성
VIZCore3D.NET.Data.SurfaceNoteDefaultData item = new VIZCore3D.NET.Data.SurfaceNoteDefaultData();
item.UseSymbol = true;
item.SymbolText = "1";
item.ModelNameLevel = 1;
// 기본 데이터 설정
vizcore3d.Review.Note.SurfaceNoteDefaultValue = item;
// 리뷰 변경 : 표면노트 추가 이벤트
vizcore3d.Review.OnReviewChangedEvent += Review_OnReviewChangedEvent;
// 표면노트 추가
vizcore3d.Review.Note.AddNoteSurfaceDialog();
}
private void Review_OnReviewChangedEvent(object sender, Event.EventManager.ReviewEventArgs e)
{
if (e.EventKind != Manager.ReviewManager.ReviewEventKind.ADDED_SURFACE_NOTE) return;
VIZCore3D.NET.Data.SurfaceNoteDefaultData item = vizcore3d.Review.Note.SurfaceNoteDefaultValue;
item.SymbolText = "2";
}
모델 추가 시, 추가된 노드 개체 목록 반환 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
List<string> models = new List<string>();
models.Add("C:\\Model\\BLOCK1.viz");
models.Add("C:\\Model\\BLOCK2.viz");
models.Add("C:\\Model\\BLOCK3.viz");
Dictionary<string, VIZCore3D.NET.Data.Node> nodes =
new Dictionary<string, VIZCore3D.NET.Data.Node>();
bool result = vizcore3d.Model.Add(models, out nodes);
if (result == false) return;
foreach (KeyValuePair<string, VIZCore3D.NET.Data.Node> node in nodes)
{
string file = node.Key;
int index = node.Value.Index;
string name = node.Value.NodeName;
}
}
단일 부재로 내보내기 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
string input = "C:\\Model\\Input.viz";
string output = "C:\\Model\\Output.viz";
bool result = vizcore3d.Model.MergeSingleNode(input, output);
}
간소화 품질 설정 가능한 Virtual Screen Size 및 Count 파라미터 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
string input = "C:\\Model\\Input.viz";
string output = "C:\\Model\\Output.viz";
vizcore3d.Model.ExportSimplifiedModel(
input /* INPUT FILE */
, output /* OUTPUT FILE */
, false /* KEEP Structure */
, false /* Limit BoundBox */
, 0 /* BoundBox - Min. X */
, 0 /* BoundBox - Min. Y */
, 0 /* BoundBox - Min. Z */
, 0 /* BoundBox - Max. X */
, 0 /* BoundBox - Max. Y */
, 0 /* BoundBox - Max. Z */
, false /* Limit Mesh Count */
, 0 /* Mesh Count */
, VIZCore3D.NET.Manager.ModelManager.SimplifiedUnit.TRIANGLE_MESH /* Unit */
, 1024 /* Virtual Screen Size */
, 1 /* Virtual Screen Count */
);
}
좌표계(Frame) 축별 좌표값으로 설정할 수 있는 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
if (vizcore3d.Frame.HasFrame == false) return;
vizcore3d.Frame.XAxisLabelAsPosition = false; // X-Axis. Frame
vizcore3d.Frame.YAxisLabelAsPosition = false; // Y-Axis. Frame
vizcore3d.Frame.ZAxisLabelAsPosition = true; // Z-Axis. Position
}
리뷰 항목 HitTest API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
vizcore3d.View.OnViewDefaultMouseUpEvent += View_OnViewDefaultMouseUpEvent;
}
private void View_OnViewDefaultMouseUpEvent(object sender, MouseEventArgs e)
{
// Case 1)
bool existReview1 = vizcore3d.Review.HitTest(e.X, e.Y);
// Case 2)
int reviewId = -1;
bool existReview2 = vizcore3d.Review.HitTest(e.X, e.Y, ref reviewId);
}
동일 부모 하위에 동일 이름 개체 삭제 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
int oldCount = vizcore3d.Model.GetModelInformation().NodeCount;
vizcore3d.Object3D.RemoveObjectsWithDuplicateNames();
int newCount = vizcore3d.Model.GetModelInformation().NodeCount;
}
워터마크 API 추가
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;
vizcore3d.BeginUpdate();
vizcore3d.View.Watermark.Color = Color.Black;
vizcore3d.View.Watermark.FontSize = VIZCore3D.NET.Data.FontSize.Size_26_Bold;
vizcore3d.View.Watermark.Rotate = 45.0f;
vizcore3d.View.Watermark.Spacing = new VIZCore3D.NET.Data.Vector3D(100, 200, 0);
vizcore3d.View.Watermark.Text = "VIZCore3D.NET\nWatermark";
vizcore3d.EndUpdate();
//vizcore3d.View.Watermark.Clear();
}