KernelCollectionTypes.h
Go to the documentation of this file.
1 // (C) Copyright Renaud Detry 2007-2015.
2 // Distributed under the GNU General Public License and under the
3 // BSD 3-Clause License (See accompanying file LICENSE.txt).
4 
5 /** @file */
6 
7 #ifndef NUKLEI_KERNEL_COLLECTION_TYPES_H
8 #define NUKLEI_KERNEL_COLLECTION_TYPES_H
9 
10 #ifdef NUKLEI_USE_CGAL
11 // CGAL search tree
12 #include <CGAL/basic.h>
13 #include <CGAL/Search_traits.h>
14 #include <CGAL/Search_traits_3.h>
15 #include <CGAL/Search_traits_d.h>
16 #include <CGAL/Orthogonal_k_neighbor_search.h>
17 #include <CGAL/Simple_cartesian.h>
18 #include <CGAL/Cartesian_d.h>
19 #endif
20 
21 #ifdef NUKLEI_USE_CGAL_DEPRECATED
22 // CGAL hull
23 #include <CGAL/Homogeneous.h>
24 #include <CGAL/Convex_hull_d.h>
25 #include <CGAL/Convex_hull_d_traits_3.h>
26 // NOTE: the choice of double here for a number type may cause problems
27 // for degenerate point sets
28 #endif
29 
30 #ifdef NUKLEI_USE_CGAL
31 # include <CGAL/double.h>
32 //#include <CGAL/Gmpz.h>
33 
34 // CGAL PCA
35 #include <CGAL/Cartesian.h>
36 #include <CGAL/linear_least_squares_fitting_3.h>
37 #endif
38 
39 
40 // libkdtree++
41 #include "kdtree++/kdtree.hpp"
42 
44 
45 #ifdef NUKLEI_USE_CGAL
46 
47 namespace CGAL {
48  template <>
49  struct Kernel_traits< ::nuklei::FlexiblePoint > {
50  struct Kernel {
51  typedef ::nuklei::FlexiblePoint::value_type FT;
52  typedef ::nuklei::FlexiblePoint::value_type RT;
53  };
54  };
55 }
56 
57 #endif
58 
59 namespace nuklei
60 {
61  namespace libkdtree_types
62  {
63  typedef KDTree::KDTree< 3, FlexiblePoint, FlexiblePoint::Accessor > Tree;
64  }
65 
66 #ifdef NUKLEI_USE_CGAL_DEPRECATED
67  namespace cgal_convex_hull_types
68  {
69  //typedef CGAL::Gmpz RT;
70  typedef double RT;
71 
72  typedef CGAL::Homogeneous<RT> K;
73  typedef K::Point_3 Point_3;
74 
75  typedef CGAL::Convex_hull_d_traits_3<K> Hull_traits_3;
76  typedef CGAL::Convex_hull_d< Hull_traits_3 > Convex_hull_3;
77  }
78 #endif
79 
80 #ifdef NUKLEI_USE_CGAL
81 
82  namespace cgal_neighbor_search_types
83  {
84  typedef CGAL::Simple_cartesian<coord_t> K;
85  typedef K::Point_3 Point_d;
86  typedef CGAL::Search_traits_3<K> Traits;
87  typedef CGAL::Orthogonal_k_neighbor_search<Traits> K_neighbor_search;
88  typedef K_neighbor_search::Tree Tree;
89  }
90 
91  namespace cgal_userdef_neighbor_search_types
92  {
93  typedef CGAL::Search_traits<
94  FlexiblePoint::value_type,
95  FlexiblePoint,
96  const FlexiblePoint::value_type*,
97  FlexiblePoint::Construct_coord_iterator
98  > Traits;
99  typedef CGAL::Orthogonal_k_neighbor_search<
100  Traits,
101  FlexiblePoint::Distance
102  > K_neighbor_search;
103  typedef K_neighbor_search::Tree Tree;
104  }
105 
106  namespace cgal_pca_types
107  {
108  typedef coord_t FT;
109  typedef CGAL::Cartesian<FT> K;
110  typedef K::Plane_3 Plane_3;
111  typedef K::Line_3 Line_3;
112  typedef K::Point_3 Point_3;
113  }
114 #endif
115 
116 }
117 
118 
119 
120 #endif
Public namespace.
Definition: Color.cpp:9
double coord_t
Type for point coordinates.
Definition: Definitions.h:25
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:06.