Click or drag to resize

ViewManagerHitTest Method

뷰 화면 X, Y 좌표로 개체 선택

Namespace:  VIZCore3D.NET.Manager
Assembly:  VIZCore3D.NET (in VIZCore3D.NET.dll) Version: 2.8.24.1104 (2.8.24.1104)
Syntax
C#
public int HitTest(
	int x,
	int y
)

Parameters

x
Type: SystemInt32
X 좌표
y
Type: SystemInt32
Y 좌표

Return Value

Type: Int32
선택된 개체 Index. 선택된 개체가 없는 경우 -1 반환.
Examples
C#
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

private void Example()
{
    // Event 선언
    vizcore3d.View.OnViewDragDrop += View_OnViewDragDrop;
}

private void View_OnViewDragDrop(object sender, Event.EventManager.ViewDragDropEventArgs e)
{
    int x = e.X;
    int y = e.Y;

    // 해당 위치 개체 조회
    int index = vizcore3d.View.HitTest(x, y);
    if(index != -1)
    {
        VIZCore3D.NET.Data.Node node = vizcore3d.Object3D.FromIndex(index);
    }
}
See Also