import { Component, OnInit } from '@angular/core';
import { ViewerService } from 'src/app/services';

@Component({
  selector: 'app-soil-excavation',
  templateUrl: './soil-excavation.component.html',
  styleUrls: ['./soil-excavation.component.css']
})
export class SoilExcavationComponent implements OnInit {
  public depth = 10;
  private terrainClip;

  constructor(
    private viewerService: ViewerService,
  ) { }

  ngOnInit() {
    const viewer = this.viewerService.viewer;
    this.terrainClip = new smart3d.TerrainClip(viewer);
    this.terrainClip.updateDepth(this.depth);
  }

  handleSoilExcavation() {
    this.terrainClip.updateDepth(this.depth);
    this.terrainClip.start(this.depth);
  }

}
