InteractionSelect

객체 선택을 위한 사용자 입력(마우스/키보드) 클래스.
User input (mouse/keyboard) class for object selection.

new Ditap.InteractionSelect(viewer, selectOptions, propertyOptions)

Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
selectOptions object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Description
hoverColor Color optional 객체에 마우스를 이동할 때 변하는 색상.
The color that changes when the mouse moves over an object.
selectedColor Color optional 객체를 선택했을 때 변하는 색상.
The color that changes when an object is selected.
propertyOptions object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Description
type string optional 속성 타입("popup" 또는 "panel").
The property Type("popup" or "panel").
element string optional 속성 컨테이너 (요소 또는 아이디).
Specify a property container(id(string) or Element).
propertyCallback function optional 속성 팝업 생성 시 실행되는 콜백함수.
A promise that receives a selected object as an parameter and asynchronously requests property values.
Example:
// 샌드캐슬 예제 'DiTAP - Model Select' 참조
const viewer = new Ditap.DitapViewer("ditapContainer");

const destination = Ditap.Cartesian3.fromDegrees(
  126.978275264,
  37.566642192,
  400
);

// 카메라 이동
viewer.scene.camera.flyTo({
  destination: destination,
});

const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
  Ditap.Cartesian3.fromDegrees(126.9782349646649, 37.56671536989183)
);
const model = await Ditap.Model.fromGltfAsync{
 id: "model_01",
 url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
 modelMatrix: modelMatrix,
 scale: 3,
});
viewer.scene.primitives.add(model);

const interactionSelect = new Ditap.InteractionSelect(viewer);
interactionSelect.on();

Members

highlightedObjects : Array.<object>

하이라이트 된 객체 배열.
Array of highlighted objects.

hoverColor : Color

마우스 호버시 변경될 색상.
Color that changes when the mouse is over.

readonly isOn

핸들러 비/활성화.
Check handler enable/disable status.

propertyCallback : Element

속성 팝업 생성시 실행되는 콜백함수.
Callback function executed when creating property popup.

propertyElement : Element

속성 컨테이너 요소.
Element of panel.

propertyType : string

속성 패널 타입.("popup" or "panel").
Type that open property panel.

selectedColor : Color

클릭시 변경될 색상.
Color that changes when the mouse is clicked.

viewer : DitapViewer

사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.

Methods

checkPropertyOptions(property)object

속성 타입 확인.
check the property type.
Name Type Description
property object 속성 옵션.
object of property.
Returns:
확인된 속성 옵션.
Verified property type.

checkSelectOptions(options)object

선택 옵션 확인.
check the object of select.
Name Type Description
options object 선택 옵션.
object of select options.
Returns:
확인된 선택 옵션.
Verified select options.

destroy()

객체의 리소스 파괴.
Destroy resources held by this object.

getSelectObjectProperty(pickedObject)object

선택된 객체의 속성을 조회.
Get DitapEntity Saved in DitapViewer Storage.
Name Type Description
pickedObject object 선택된 객체.
The selected object.
Returns:
선택된 객체의 속성.
The properties of selected Object.

off()

객체 선택 핸들러 종료.
End object selection handler.

on()

객체 선택 핸들러 실행.
Execute object selection handler.

openPropertyPanel(object)

속성 판넬 활성화.
Open property panel.
Name Type Description
object object 선택된 객체.
Selected object.

removeMobileEvent()

모바일 전용 이벤트 제거.
Remove mobile-specific event.

setSelectedObjectToOriginalColor()

선택된 객체 기존 색상으로 변경.
change selected object to original color.

toggle()

InteracionSelect on/off 기능.
Function on and off.