AnalysisSplit

분할을 위한 분석 기능 클래스.
Analysis feature class for object deletion.

new Ditap.AnalysisSplit(viewer)

Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
Example:
// 샌드캐슬 예제 'DiTAP - Split' 참조

const viewer = new Ditap.DitapViewer("ditapContainer", {
  baseLayerPicker: true,
});

// InteractionSplit 생성
const interactionSplit = new Ditap.InteractionSplit(viewer);

// interactionSplit handler 실행 버튼
Sandcastle.addToolbarButton("Split On", async () => {
  // interactionSplit handler 실행
  interactionSplit.on(viewer);

  // AnalysisSplit 인스턴스 생성
  const analysisSplit = interactionSplit.analysisSplit;

  // 뷰어에 추가할 데이터 생성
  // 1. 정사영상
  // 정사영상 인스턴스 생성
  const imagery = new Ditap.NationwideOrthoImageryProvider();

  // 2. 모델
  // 모델 좌표
  const modelPosition = new Ditap.Cartesian3.fromDegrees(
    126.9782349646649,
    37.56671536989183,
    100
  );

  // 모델 행렬 생성
  const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
    modelPosition
  );

  // 모델 인스턴스 생성
  const model = await Ditap.Model.fromGltfAsync({
    id: "model_01",
    url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
    modelMatrix: modelMatrix,
    minimumPixelSize: 128,
  });

  // 분할된 뷰어에 생성된 인스턴스 추가
  // 우측 분할 뷰어에 정사영상 추가
  const rightImagery = analysisSplit.addImagery(
    Ditap.SplitDirection.RIGHT,
    imagery
  );

  // 좌측 분할 뷰어에 모델 추가
  const leftModel = analysisSplit.addModel(
    Ditap.SplitDirection.LEFT,
    model
  );

  // 모델 위치로 카메라 이동
  viewer.camera.flyTo({
    destination: Ditap.Cartesian3.fromDegrees(
      126.9782349646649,
      37.5645,
      150
    ),
    duration: 2,
    orientation: {
      heading: Ditap.Math.toRadians(0),
      pitch: Ditap.Math.toRadians(-10),
      roll: 0,
    },
  });
});

// interactionSplit handler 종료 버튼
Sandcastle.addToolbarButton("Split Off", () => {
  // interactionSplit handler 종료
  // interactionSplit.off() - 모든 분할 뷰어에 생성된 객체가 제거됩니다.
  // interactionSplit.off(Ditap.SplitDirection.LEFT) - 좌측 분할 뷰어에 생성된 객체가 유지됩니다.
  // interactionSplit.off(Ditap.SplitDirection.RIGHT) - 우측 분할 뷰어에 생성된 객체가 유지됩니다.
  // interactionSplit.off(Ditap.SplitDirection.BOTH) - 좌측, 우측 모든 분할 뷰어에 생성된 객체가 유지됩니다.
  interactionSplit.off();
});

Members

readonly leftImagerys

좌측 DitapViewer에 생성된 이미지 배열.
Array of Imagery created in the left DitapViewer.

readonly leftModels

좌측 DitapViewer에 생성된 모델 배열.
Array of Model created in the left DitapViewer.

readonly leftTilesets

좌측 DitapViewer에 생성된 타일셋 배열.
Array of tilesets created in the left DitapViewer

readonly rightImagerys

우측 DitapViewer에 생성된 이미지 배열.
Array of Imagery created in the right DitapViewer.

readonly rightModels

우측 DitapViewer에 생성된 모델 배열.
Array of Model created in the right DitapViewer.

readonly rightTilesets

우측 DitapViewer에 생성된 타일셋 배열.
Array of tilesets created in the right DitapViewer.

viewer : DitapViewer

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

Methods

addImagery(type, ortho)object

DitapViewer에 이미지 추가.
Add Imagery to viewer.
Name Type Description
type SplitDirection 추가할 뷰어 방향.
Split direction of DitapViewer.
ortho ImageryProvider 추가할 이미지.
The Imagery to add.
Returns:
생성된 프리미티브.
Imagery added to the DitapViewer.

addModel(type, model)object

DitapViewer에 모델 추가.
Add Model to viewer.
Name Type Description
type SplitDirection 추가할 뷰어 방향.
Split direction of DitapViewer.
model Model 추가할 모델.
The Model to add
Returns:
생성된 프리미티브.
Primitives added to the DitapViewer.

addTileset(type, tileset)object

DitapViewer에 타일셋 추가.
Add tileset to viewer.
Name Type Description
type SplitDirection 추가할 뷰어 방향.
Split direction of DitapViewer.
tileset Cesium3DTileset 추가할 타일셋.
The tileset to add.
Returns:
생성된 프리미티브.
Primitives added to the DitapViewer.

destroy(splitDirection)

분할 슬라이더 제거.
Exit the AnalysisSplit
Name Type Description
splitDirection SplitDirection 파라미터가 없을 경우, 분할 뷰어에 생성된 모든 객체가 제거됩니다.
SplitDirection 파라미터를 전달하면 해당 방향의 분할 뷰어 위치에 생성된 객체가 유지됩니다.
When no parameter is provided, all objects created within the split viewer will be removed.
Passing the SplitDirection parameter will maintain the objects created at the position of the split viewer in the specified direction.

on()

분할 슬라이더 실행.
Running the AnalysisSplit

removeAllImageryByType(type)

DitapViewer에 생성된 이미지 삭제.
Remove all Imagery added to the DitapViewer.
Name Type Description
type SplitDirection 추가할 뷰어 방향.
Split direction of DitapViewer.

removeAllModelByType(type)

DitapViewer에 생성된 모델 삭제.
Remove all models added to the DitapViewer.
Name Type Description
type SplitDirection 추가할 뷰어 방향.
Split direction of DitapViewer.

removeAllSplitObjet()

DitapViewer에 생성된 모든 분할 객체 삭제.
Remove All split object added to the DitapViewer.

removeAllTilesetByType(type)

DitapViewer에 생성된 타일셋 삭제.
Remove all tilesets added to the DitapViewer.
Name Type Description
type SplitDirection 추가할 뷰어 방향.
Split direction of DitapViewer.

removeImageries(imageries)

DitapViewer에 생성된 이미지 삭제.
Remove Imageries added to the DitapViewer.
Name Type Description
imageries Array.<ImageryProvider> 삭제할 이미지 배열.
The Imageries to remove.

removePrimitives(primitives)

DitapViewer에 생성된 프리미티브 삭제.
Remove primitieves added to the DitapViewer.
Name Type Description
primitives Array.<Primitive> 삭제할 프리미티브 배열.
The primitives to remove.