Add ScanData Controller

This commit is contained in:
Tim Wundenberg
2021-07-11 10:14:43 +02:00
parent 0cf75695b4
commit f8e2e08886
8 changed files with 260 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PointCloudWeb.Server.Models;
namespace PointCloudWeb.Server.Services
{
public class DataService
{
private readonly PointCloudService _pointCloudService;
private readonly ScanConverterService _scanConverterService;
public DataService(PointCloudService pointCloudService, ScanConverterService scanConverterService)
{
_pointCloudService = pointCloudService;
_scanConverterService = scanConverterService;
}
public void AddScan(ScanDataList scanData)
{
_pointCloudService.AddPoints(scanData.Id, ConvertToPoints(scanData));
}
private IList<Point> ConvertToPoints(ScanDataList scanData)
{
var list = new List<Point>();
foreach (var scan in scanData.List)
{
list.Add(_scanConverterService.Transform(scan));
}
return list;
}
}
}