Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
        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;
        }
Example #4
0
 public FingerPoint(Point location)
 {
     this.location = location;
     this.FrameCount = 1;
 }
Example #5
0
 public double Calc2DDistance(Point point)
 {
     return Point.Distance(point, this.center);
 }
Example #6
0
 public void AddPoint(Point point)
 {
     this.temporaryPoints.Add(point);
 }
Example #7
0
 public ClusterPrototype(Point center, IList<Point> points)
 {
     this.center = center;
     this.points = points;
     this.CalculateCenter();
 }
Example #8
0
 public ClusterPrototype(Point center)
 {
     this.center = center;
     this.points = new List<Point>();
 }
Example #9
0
        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;
            }
        }
Example #10
0
 public void SetCenter(int x, int y, int z)
 {
     this.center = new Point(x, y, z);
 }
Example #11
0
 private int FindIndex(Point point, Contour contour)
 {
     return Point.FindIndexOfNearestPoint(point, contour.Points);
 }
Example #12
0
 public Palm(Point location, double distanceToContour)
 {
     this.location = location;
     this.distanceToContour = distanceToContour;
 }
Example #13
0
 private bool DistanceIsTooSmall(Point sourcePoint, Point destPoint)
 {
     return Point.Distance(sourcePoint, destPoint) < this.mindDistBetweenPoints;
 }