public Shape(Point center, Volume volume, Contour contour, ConvexHull convexHull, IList<Point> points) { this.center = center; this.volume = volume; this.contour = contour; this.convexHull = convexHull; this.points = points; }
private Point ReturnMinPoint(Point p1, Point p2) { if (p1.Y < p2.Y) { return p1; } else if (p1.Y == p2.Y) { if (p1.X < p2.X) { return p1; } } return p2; }
public IList<Point> Filter(IList<Point> points) { IList<Point> result = new List<Point>(); if (points.Count == 0) { return result; } var point = new Point(points.First()); result.Add(point); foreach (var currentSourcePoint in points.Skip(1)) { if (!this.DistanceIsTooSmall(currentSourcePoint, point)) { point = new Point(currentSourcePoint); result.Add(point); } } if (this.checkBoundary && result.Count > 1) { CheckFirstAndLastPoint(result); } return result; }
public FingerPoint(Point location) { this.location = location; this.FrameCount = 1; }
public double Calc2DDistance(Point point) { return Point.Distance(point, this.center); }
public void AddPoint(Point point) { this.temporaryPoints.Add(point); }
public ClusterPrototype(Point center, IList<Point> points) { this.center = center; this.points = points; this.CalculateCenter(); }
public ClusterPrototype(Point center) { this.center = center; this.points = new List<Point>(); }
private void CalculateCenter() { if (this.points.Count > 0) { this.center = this.points[0]; for (int index = 1; index < this.points.Count; index++) { var p = this.points[index]; center.X += p.X; center.Y += p.Y; center.Z += p.Z; } center.X /= this.points.Count; center.Y /= this.points.Count; center.Z /= this.points.Count; } }
public void SetCenter(int x, int y, int z) { this.center = new Point(x, y, z); }
private int FindIndex(Point point, Contour contour) { return Point.FindIndexOfNearestPoint(point, contour.Points); }
public Palm(Point location, double distanceToContour) { this.location = location; this.distanceToContour = distanceToContour; }
private bool DistanceIsTooSmall(Point sourcePoint, Point destPoint) { return Point.Distance(sourcePoint, destPoint) < this.mindDistBetweenPoints; }