コード例 #1
0
        public static KDTree3D ByPointsAndObjects(Point[] points, object[] objects)
        {
            var t = new KDTree3D();

            t.hasObjects = true;

            var data = new List <double[]>();

            foreach (var pt in points)
            {
                data.Add(new double[] { pt.X, pt.Y, pt.Z });
            }

            t._Impl = new KDTreeImpl(3, data.ToArray(), objects, DistanceSquared);

            return(t);
        }
コード例 #2
0
        public static KDTree3D ByPoints(Point[] points)
        {
            var t = new KDTree3D();

            var data = new List <double[]>();

            foreach (var pt in points)
            {
                data.Add(new double[] { pt.X, pt.Y, pt.Z });
            }

            var objects = new List <object>();

            objects.AddRange(System.Linq.Enumerable.Repeat <object>(null, data.Count));

            t._Impl = new KDTreeImpl(3, data.ToArray(), objects.ToArray(), DistanceSquared);

            return(t);
        }