1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 2 5 * of the License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software Foundation, 14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 */ 16 17 #pragma once 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 /** \file 24 * \ingroup bli 25 * \brief A kd-tree for nearest neighbor search. 26 */ 27 28 /* 1D version */ 29 #define KD_DIMS 1 30 #define KDTREE_PREFIX_ID BLI_kdtree_1d 31 #define KDTree KDTree_1d 32 #define KDTreeNearest KDTreeNearest_1d 33 #include "BLI_kdtree_impl.h" 34 #undef KD_DIMS 35 #undef KDTree 36 #undef KDTreeNearest 37 #undef KDTREE_PREFIX_ID 38 39 /* 2D version */ 40 #define KD_DIMS 2 41 #define KDTREE_PREFIX_ID BLI_kdtree_2d 42 #define KDTree KDTree_2d 43 #define KDTreeNearest KDTreeNearest_2d 44 #include "BLI_kdtree_impl.h" 45 #undef KD_DIMS 46 #undef KDTree 47 #undef KDTreeNearest 48 #undef KDTREE_PREFIX_ID 49 50 /* 3D version */ 51 #define KD_DIMS 3 52 #define KDTREE_PREFIX_ID BLI_kdtree_3d 53 #define KDTree KDTree_3d 54 #define KDTreeNearest KDTreeNearest_3d 55 #include "BLI_kdtree_impl.h" 56 #undef KD_DIMS 57 #undef KDTree 58 #undef KDTreeNearest 59 #undef KDTREE_PREFIX_ID 60 61 /* 4D version */ 62 #define KD_DIMS 4 63 #define KDTREE_PREFIX_ID BLI_kdtree_4d 64 #define KDTree KDTree_4d 65 #define KDTreeNearest KDTreeNearest_4d 66 #include "BLI_kdtree_impl.h" 67 #undef KD_DIMS 68 #undef KDTree 69 #undef KDTreeNearest 70 #undef KDTREE_PREFIX_ID 71 72 #ifdef __cplusplus 73 } 74 #endif 75