import 'package:fis_measure/interfaces/process/viewports/viewport.dart';
import 'package:fis_measure/interfaces/process/workspace/application.dart';
import 'package:fis_measure/interfaces/process/workspace/point_info.dart';

class MeasurePointInfoHandler {
  final IApplication application;

  MeasurePointInfoHandler(this.application);

  void handlePointInfo(PointInfo pointInfo) {
    switch (pointInfo.pointType) {
      case PointInfoType.mouseUp:
        // TODO: Handle this case.
        break;
      case PointInfoType.mouseDown:
        _handleMouseDown(pointInfo);
        break;
      case PointInfoType.mouseMove:
        _handleMouseMove(pointInfo);
        break;
      case PointInfoType.touchUp:
        // TODO: Handle this case.
        break;
      case PointInfoType.touchDown:
        // TODO: Handle this case.
        break;
      case PointInfoType.touchMove:
        // TODO: Handle this case.
        break;
    }
  }

  void _handleMouseDown(PointInfo pointInfo) {}
  void _handleMouseMove(PointInfo pointInfo) {}

  IViewPort _findViewPort(double x, double y) {
    final viewPort = application.visuals.first.visualAreas.first.viewport;
    return viewPort!;
  }
}
