Esempio n. 1
0
        public bool Build(PointCloud pcTarget)
        {
            Vector3        v     = Vector3.Zero;
            List <Vector3> listV = new List <Vector3>(pcTarget.Vectors);

            float[][] treePoints = v.VectorListToFloatArray(listV);

            string[] treeNodes = new string[listV.Count];

            tree = new KDTreeEricReginaGeneric <float, string>(3, treePoints, UtilitiesRegina.L2Norm_Squared_Float);


            return(true);
        }
        public static Tuple <TDimension[], TNode>[] ToResultSet <TPriority, TDimension, TNode>(
            this BoundedPriorityList <int, TPriority> list,
            KDTreeEricReginaGeneric <TDimension, TNode> tree)
            where TDimension : IComparable <TDimension>
            where TPriority : IComparable <TPriority>
        {
            var array = new Tuple <TDimension[], TNode> [list.Count];

            for (var i = 0; i < list.Count; i++)
            {
                array[i] = new Tuple <TDimension[], TNode>(
                    tree.InternalPointArray[list[i]],
                    tree.InternalNodeArray[list[i]]);
            }

            return(array);
        }