본문으로 건너뛰기

V.2.1.20.1119

Major Features

  • 뷰(View) 영역에서 UserControl 기본(Default) Mouse의 Down/Move/Up/DoubleClick/Wheel 이벤트 추가
  • Matrix 기반 Model Transform 기능 추가
  • 문자열 Matrix 정보를 Matrix3D 객체 반환 함수 추가
  • Matrix 행열/열행 우선 전환 함수 추가
  • 형상 정보가 없는 노드 (Body) 제거 기능 추가
  • VIZCore3D.NET Module 초기화 유틸리티 함수 추가
  • Mouse로 Part(부재) Double Click 시, 해당 형상을 화면 가운데로 이동 후, 화면 맞춤 기능 활성화/비활성화 API 추가
  • Mouse로 동일 형상 중복 선택(Click) 시, 선택 상태가 상위로 한단계식 올라가는 기능 활성화/비활성화 API 추가
  • 리뷰(노트, 측정)의 위치 변경 기능 추가
  • 마우스 기반 이동/회전 관련 기능에 Mouse Down/Move/Up/DoubleClick 이벤트 추가
  • Body 노드에 Polyhedral Primitive 생성 (혹은 추가) 기능 추가
  • 키보드 방향키를 활용하여 모델 이동/회전 기능 추가
  • Model 전체 BoundBox 계산 시, 형상없는 노드의 초기화 되지 않은 BoundBox 정보가 포함되지 않도록 개선
  • 초기화 되지 않은 BoundBox 정보로 인해 단면상자 생성 시, 모델보다 큰 영역에 단면상자가 생기는 문제 수정
  • 모델 삭제 시, 진행률 다이얼로그가 닫히지 않는 문제 수정
  • 모델 트리가 조회되고, 가로 길이가 최소화 상태에서 스크롤 시 발생하는 문제 수정
  • VIZ V.3.0.4 파일을 스트림(Stream)으로 열기/추가 시, 발생되는 문제 수정

Full List

Full List of Issues Covering all Changes in this Release

ModuleSummaryCategory
ViewManager뷰(View) 영역에서 Mouse Down 이벤트 추가
ViewManager.OnViewDefaultMouseDownEvent
New Feature
ViewManager뷰(View) 영역에서 Mouse Move 이벤트 추가
ViewManager.OnViewDefaultMouseMoveEvent
New Feature
ViewManager뷰(View) 영역에서 Mouse Up 이벤트 추가
ViewManager.OnViewDefaultMouseUpEvent
New Feature
ViewManager뷰(View) 영역에서 Mouse Double Click 이벤트 추가
ViewManager.OnViewDefaultMouseDoubleClickEvent
New Feature
ViewManager뷰(View) 영역에서 Mouse Wheel 이벤트 추가
ViewManager.OnViewDefaultMouseWheelEvent
New Feature
TransformManagerMatrix 기반 모델 Transform 기능 추가
TransformManager.Transform
TransformManager.GetTransform
Node.Transform(Matrix3D ,Boolean)
New Feature
Matrix3D문자열 Matrix 정보를 Matrix3D 객체 반환 함수 추가
Matrix3D.FromString(String, String)
New Feature
Matrix3DMatrix 행열/열행 우선 전환 함수 추가
Matrix3D.Flip()
New Feature
Object3DManager형상 정보가 없는 노드 (Body) 제거 기능 추가
Object3DManager.RemoveBodyWithoutShape()
Object3DManager.RemoveNodeWithoutBody(Boolean)
New Feature
ModuleInitializerVIZCore3D.NET Module 초기화 유틸리티 함수 추가
ModuleInitializer.Run
ModuleInitializer.GetAssemblyLocation()
ModuleInitializer.GetEntryAssemblyLocation()
ModuleInitializer.ExistLibrary()
ModuleInitializer.GetLibraryVersion()
ModuleInitializer.GetInteropLibraryVersion()
ModuleInitializer.CompareVersion()
New Feature
ViewManagerMouse로 Part(부재) Double Click 시, 해당 형상을 화면 가운데로 이동 후, 화면 맞춤 기능 활성화/비활성화 API 추가
ViewManager.EnableDoubleClickFocusAndFit
New Feature
ViewManagerMouse로 동일 형상 중복 선택(Click) 시, 선택 상태가 상위로 한단계식 올라가는 기능 활성화/비활성화 API 추가
ViewManager.EnableParentSelection
New Feature
NoteItem리뷰(노트, 측정)의 위치 변경 기능 추가
NoteItem.UpdatePosition
New Feature
MouseBasedObjectMoveManager마우스 기반 이동/회전 관련 기능에 Mouse Down 이벤트 추가
MouseBasedObjectMoveManager.OnMouseDownEvent
New Feature
MouseBasedObjectMoveManager마우스 기반 이동/회전 관련 기능에 Mouse Move 이벤트 추가
MouseBasedObjectMoveManager.OnMouseMoveEvent
New Feature
MouseBasedObjectMoveManager마우스 기반 이동/회전 관련 기능에 Mouse Up 이벤트 추가
MouseBasedObjectMoveManager.OnMouseUpEvent
New Feature
MouseBasedObjectMoveManager마우스 기반 이동/회전 관련 기능에 Mouse Double-Click 이벤트 추가
MouseBasedObjectMoveManager.OnMouseDoubleClickEvent
New Feature
MeshEditManagerBody 노드에 Polyhedral Primitive 생성 (혹은 추가) 기능 추가
MeshEditManager.CreateBodyPrimitivePolyhedral
MeshEditManager.AddPrimitivePolyhedral
New Feature
KeyboardBasedTransformManager키보드 방향키를 활용하여 모델 이동/회전 기능 추가

모델 이동 : 선택된 모델이 있는 경우, 방향키(좌/우/상/하)를 누르면 모델이 이동 / Ctrl 키가 동시에 눌린 경우 상세 이동 거리 값 만큼 이동

모델 회전 : 선택된 모델이 있는 경우, Alt키와 방향키(좌/우)를 누르면 모델이 회전 / Ctrl 키가 동시에 눌린 경우 상세 회전 각도 값 만큼 회전
New Feature
ModelManagerModel 전체 BoundBox 계산 시, 형상없는 노드의 초기화 되지 않은 BoundBox 정보가 포함되지 않도록 개선
ModelManager.BoundBox
Enhancement

Resource

Figure 1 : Primitive 형상 생성 지원 유형

RELEASE_VIZCore3D.NET.Primitive.V2.1000.png

Sample

View Mouse Down/Move/Up/DoubleClick/Wheel 이벤트 추가

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

public void Example()
{
vizcore3d.View.OnViewDefaultMouseDownEvent += View_OnViewDefaultMouseDownEvent;
vizcore3d.View.OnViewDefaultMouseMoveEvent += View_OnViewDefaultMouseMoveEvent;
vizcore3d.View.OnViewDefaultMouseUpEvent += View_OnViewDefaultMouseUpEvent;
vizcore3d.View.OnViewDefaultMouseDoubleClickEvent += View_OnViewDefaultMouseDoubleClickEvent;
vizcore3d.View.OnViewDefaultMouseWheelEvent += View_OnViewDefaultMouseWheelEvent;
}

private void View_OnViewDefaultMouseDownEvent(object sender, MouseEventArgs e)
{
int index = vizcore3d.View.HitTest(e.Location.X, e.Location.Y);

if (index == -1) return;

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

private void View_OnViewDefaultMouseMoveEvent(object sender, MouseEventArgs e)
{
}

private void View_OnViewDefaultMouseUpEvent(object sender, MouseEventArgs e)
{
int index = vizcore3d.View.HitTest(e.Location.X, e.Location.Y);

if (index == -1) return;

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

private void View_OnViewDefaultMouseDoubleClickEvent(object sender, MouseEventArgs e)
{
int index = vizcore3d.View.HitTest(e.Location.X, e.Location.Y);

if (index == -1) return;

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

private void View_OnViewDefaultMouseWheelEvent(object sender, MouseEventArgs e)
{
if(e.Delta > 0)
{
// Some Code Here...
}
else
{
// Some Code Here...
}
}

Matrix 기반 모델(노드) Transform

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

public void Example()
{
string matrixStr = "1,0,0,0,0,1,0,0,0,0,1,0,188370,-22350,0,1";
VIZCore3D.NET.Data.Matrix3D matrix = VIZCore3D.NET.Data.Matrix3D.FromString(matrixStr);

VIZCore3D.NET.Data.Node node = vizcore3d.Object3D.FromIndex(5);
node.Transform(matrix, true);
}

Matrix 행열/열행 우선 전환 함수

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

public void Example()
{
string matrixStr = "1,0,0,0,0,1,0,0,0,0,1,0,188370,-22350,0,1";
VIZCore3D.NET.Data.Matrix3D matrix = VIZCore3D.NET.Data.Matrix3D.FromString(matrixStr);

// If necessary
matrix.Flip();

VIZCore3D.NET.Data.Node node = vizcore3d.Object3D.FromIndex(5);
node.Transform(matrix, true);
}

VIZCore3D.NET Module 초기화 유틸리티 함수

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

public FrmMain()
{
InitializeComponent();

//===================================
// Environment
//===================================
string assemblyPath = VIZCore3D.NET.ModuleInitializer.GetAssemblyLocation();
string entryAssemblyPath = VIZCore3D.NET.ModuleInitializer.GetEntryAssemblyLocation();

string assemblyVersion = VIZCore3D.NET.ModuleInitializer.GetLibraryVersion();
string interopVersion = VIZCore3D.NET.ModuleInitializer.GetInteropLibraryVersion();
bool compareVersion = VIZCore3D.NET.ModuleInitializer.CompareVersion();

bool existLibrary = VIZCore3D.NET.ModuleInitializer.ExistLibrary();

// Initialize VIZCore3D.NET
// Case 1. : Extract Library by Condition
//if(existLibrary == false || compareVersion == false)
// VIZCore3D.NET.ModuleInitializer.Run();
// Case 2. : Extract Library Always
VIZCore3D.NET.ModuleInitializer.Run();

// Construction
vizcore3d = new VIZCore3D.NET.VIZCore3DControl();
vizcore3d.Dock = DockStyle.Fill;
panelView.Controls.Add(vizcore3d);

// Event
vizcore3d.OnInitializedVIZCore3D += VIZCore3D_OnInitializedVIZCore3D;
}

리뷰(노트, 측정)의 위치 변경 기능 추가

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

public void Example()
{
int noteId = 5;

// 해당 리뷰(노트)의 정보 조회
VIZCore3D.NET.Data.NoteItem note = vizcore3d.Review.Note.GetItem(noteId);

// 해당 리뷰(노트)의 위치 정보 조회
List<VIZCore3D.NET.Data.ReviewPosition> positions = note.Position;

// 이동 거리
VIZCore3D.NET.Data.Vertex3D distance = new Data.Vertex3D(100, 200, 0);

// 마우스가 이동한 거리만큼 리뷰의 위치를 재설정
// Note Data : positions[0]
// Note Position : positions[0].Position
note.UpdatePosition(positions[0], positions[0].Position + distance);
}

마우스 기반 이동/회전 관련 기능에 Mouse Down/Move/Up/DoubleClick 이벤트 추가

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

// 마우스 위치
public System.Drawing.Point MousePt { get; set; }

// 선택 BLOCK 이동 거리
public VIZCore3D.NET.Data.Vertex3D BlockMovingDistance { get; set; }

private void Example()
{
// 마우스 다운 이벤트
vizcore3d.View.MouseBasedObjectMove.OnMouseDownEvent += MouseBasedObjectMove_OnMouseDownEvent;

// 마우스 이동 이벤트
vizcore3d.View.MouseBasedObjectMove.OnMouseMoveEvent += MouseBasedObjectMove_OnMouseMoveEvent;

// 마우스 업 이벤트
vizcore3d.View.MouseBasedObjectMove.OnMouseUpEvent += MouseBasedObjectMove_OnMouseUpEvent;

// 마우스 더블클릭 이벤트
vizcore3d.View.MouseBasedObjectMove.OnMouseDoubleClickEvent += MouseBasedObjectMove_OnMouseDoubleClickEvent;
}

private void MouseBasedObjectMove_OnMouseDownEvent(object sender, VIZCore3D.NET.Event.EventManager.MouseBaseObjectMoveEventArgs e)
{
string str = string.Format("Mouse Down : {0} / {1} / {2} / {3} / {4} / {5} / {6}"
, e.MoveOption.ToString()
, e.GroupId
, e.Move.ToString()
, e.Anlge
, e.MousePosition.X
, e.MousePosition.Y
, e.Node.Count()
);

System.Diagnostics.Debug.WriteLine(str);

// Mouse Down 위치 백업
MousePt = e.MousePosition;

// 선택 BLOCK 위치
BlockMovingDistance = new VIZCore3D.NET.Data.Vertex3D(0, 0, 0);
}

private void MouseBasedObjectMove_OnMouseMoveEvent(object sender, VIZCore3D.NET.Event.EventManager.MouseBaseObjectMoveEventArgs e)
{
string str = string.Format("Mouse Move : {0} / {1} / {2} / {3} / {4} / {5} / {6}"
, e.MoveOption.ToString()
, e.GroupId
, e.Move.ToString()
, e.Anlge
, e.MousePosition.X
, e.MousePosition.Y
, e.Node.Count()
);

System.Diagnostics.Debug.WriteLine(str);

// 마우스로 회전일 경우는 중단
if (e.MoveOption == VIZCore3D.NET.Manager.MouseBasedObjectMoveManager.MovingOptions.ROTATION) return;

// 현재 이동되는 개체의 연계된 리뷰 정보(아이디) 조회
List<int> review = vizcore3d.View.MouseBasedObjectMove.GetLinkedReview(e.GroupId);
if (review.Count == 0) return;

// 해당 리뷰(노트)의 정보 조회
VIZCore3D.NET.Data.NoteItem note = vizcore3d.Review.Note.GetItem(review[0]);

// 해당 리뷰(노트)의 위치 정보 조회
List<VIZCore3D.NET.Data.ReviewPosition> position = note.Position;

// 마우스가 이동한 거리만큼 리뷰의 위치를 재설정
note.UpdatePosition(position[0], position[0].Position + e.Move);

// BLOCK 이동 거리 누적
BlockMovingDistance = BlockMovingDistance + e.Move;
}

private void MouseBasedObjectMove_OnMouseUpEvent(object sender, VIZCore3D.NET.Event.EventManager.MouseBaseObjectMoveEventArgs e)
{
string str = string.Format("Mouse Up : {0} / {1} / {2} / {3} / {4} / {5} / {6}"
, e.MoveOption.ToString()
, e.GroupId
, e.Move.ToString()
, e.Anlge
, e.MousePosition.X
, e.MousePosition.Y
, e.Node.Count()
);

System.Diagnostics.Debug.WriteLine(str);

string ptStr = string.Format("X: {0}=={1} / Y: {2}=={3}", MousePt.X, e.MousePosition.X, MousePt.Y, e.MousePosition.Y);
System.Diagnostics.Debug.WriteLine(ptStr);

List<VIZCore3D.NET.Data.NearestObjectByAxisPoint> items
= vizcore3d.GeometryUtility.GetNearestObjects(
e.MousePosition.X /* Mouse Location X */
, e.MousePosition.Y /* Mouse Location Y */
, true /* Visible Only */
, false /* Opaque Only */
);

if (items.Count != 1) return;

// 현재 이동되는 개체의 연계된 리뷰 정보(아이디) 조회
List<int> review = vizcore3d.View.MouseBasedObjectMove.GetLinkedReview(e.GroupId);
if (review.Count == 0) return;

// 해당 리뷰(노트)의 정보 조회
VIZCore3D.NET.Data.NoteItem note = vizcore3d.Review.Note.GetItem(review[0]);

// 해당 리뷰(노트)의 위치 정보 조회
List<VIZCore3D.NET.Data.ReviewPosition> position = note.Position;

// 마우스가 이동한 거리만큼 리뷰의 위치를 재설정
note.UpdatePosition(position[0], position[0].Position - new VIZCore3D.NET.Data.Vertex3D(BlockMovingDistance.X, BlockMovingDistance.Y, BlockMovingDistance.Z));

// 원래 이동전 위치로 이동
vizcore3d.Object3D.Transform.Move(e.Node.ToArray(), -BlockMovingDistance.X, -BlockMovingDistance.Y, -BlockMovingDistance.Z, false);
}

private void MouseBasedObjectMove_OnMouseDoubleClickEvent(object sender, Event.EventManager.MouseBaseObjectMoveEventArgs e)
{
string str = string.Format("Mouse DoubleClick : {0} / {1} / {2} / {3} / {4} / {5} / {6}"
, e.MoveOption.ToString()
, e.GroupId
, e.Move.ToString()
, e.Anlge
, e.MousePosition.X
, e.MousePosition.Y
, e.Node.Count()
);

System.Diagnostics.Debug.WriteLine(str);

List<VIZCore3D.NET.Data.NearestObjectByAxisPoint> items
= vizcore3d.GeometryUtility.GetNearestObjects(
e.MousePosition.X /* Mouse Location X */
, e.MousePosition.Y /* Mouse Location Y */
, true /* Visible Only */
, false /* Opaque Only */
);

if (items.Count == 0) return;

// 선택된 블록 90도 회전
vizcore3d.Object3D.Transform.Rotate(e.Node.ToArray(), 0, 0, 90, false, false);
}

Body 노드에 Polyhedral Primitive 생성 (혹은 추가) 기능

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

private void Example()
{
// New Empty Model
int index = vizcore3d.Model.NewEmptyModel("MODEL");

string assemblyName = "ASSEMBLY";
VIZCore3D.NET.Data.Node assemblyNode =
vizcore3d.Structure.CreateNode(
index /* Parent Node Index */
, VIZCore3D.NET.Data.NodeKind.ASSEMBLY /* Node Kind */
, assemblyName /* Node Name */
);

string partName = "PART";
VIZCore3D.NET.Data.Node partNode =
vizcore3d.Structure.CreateNode(
assemblyNode.Index /* Parent Node Index */
, VIZCore3D.NET.Data.NodeKind.PART /* Node Kind */
, partName /* Node Name */
);

string bodyName = "BODY";
int bodyId =
vizcore3d.Structure.CreateBody(
partNode.Index /* Parent Node Index */
, bodyName /* Node Name */
);

int bodyIndex = vizcore3d.Object3D.GetBodyIndex(bodyId);

{
List<Point> point = new List<Point>();

point.Add(new Point(100, 0));
point.Add(new Point(600, 0));
point.Add(new Point(600, -600));
point.Add(new Point(0, -600));
point.Add(new Point(0, -100));
point.Add(new Point(100, -100));

vizcore3d.MeshEdit.AddPrimitivePolyhedral(
bodyIndex /* Body Node Index */
, point /* Point */
, 300.0f /* Height */
, Color.Orange /* Color */
, false /* Rebuild Data */
);
}

vizcore3d.Structure.RebuildData();
}

키보드 방향키를 활용하여 모델 이동/회전 기능

// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

private void Example()
{
if (vizcore3d.Model.IsOpen() == false) return;

// 기능 활성화
vizcore3d.View.KeyboardBasedTransform.Enable = true;

// 기준 축 지정
vizcore3d.View.KeyboardBasedTransform.Axis = VIZCore3D.NET.Data.AxisDirection.Z_PLUS;

// 이동 거리 : 기본, 상세
vizcore3d.View.KeyboardBasedTransform.Distance = 1000.0f;
vizcore3d.View.KeyboardBasedTransform.DetailDistance = 100.0f;

// 회전 각도 : 기본, 상세
vizcore3d.View.KeyboardBasedTransform.Angle = 90.0f;
vizcore3d.View.KeyboardBasedTransform.DetailAngle = 10.0f;

// 이동/회전 이벤트
vizcore3d.View.KeyboardBasedTransform.OnTransformEvent += KeyboardBasedTransform_OnTransformEvent;
}

private void KeyboardBasedTransform_OnTransformEvent(object sender, Event.EventManager.KeyboardBasedObjectTransformEventArgs e)
{
// 이동
if(e.Angle == null)
{
VIZCore3D.NET.Data.AxisDirection axis = e.Axis;
VIZCore3D.NET.Data.Vertex3D distance = e.Distance;
List<VIZCore3D.NET.Data.Node> node = e.Node;
}
// 회전
else
{
VIZCore3D.NET.Data.AxisDirection axis = e.Axis;
VIZCore3D.NET.Data.Vertex3D angle = e.Angle;
List<VIZCore3D.NET.Data.Node> node = e.Node;
}
}