public ScanPointEnumerator(DBSCANCluster cluster) { this.cluster = cluster; index = -1; point = default(ScanPoint); }
private List<DBSCANCluster> DistanceSegmentation(DBSCAN dbscan, DBSCANCluster c, ref int clusterOffset, float eps, int minPoints) { float angle = ScanPoint.MeanCircularAngle0Pi(c); float cos = Mathf.Cos(angle); float sin = Mathf.Sin(angle); foreach (ScanPoint p in c) p.Distance = p.Point.x * cos + p.Point.z * sin; List<DBSCANCluster> clusters=dbscan.Cluster(c, eps, minPoints, new DistanceComparer(), new DistanceMetric()); if (clusters.Count == 0) return new List<DBSCANCluster>(); foreach (DBSCANCluster dc in clusters) foreach (ScanPoint p in dc) p.DistanceCluster = dc.Id + clusterOffset; clusterOffset += clusters[clusters.Count - 1].Id; return clusters; }