MEPP2 Project
copy_graph_pcl.hpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
16 
17 
18 namespace FEVV {
19 namespace Filters {
20 
21 
26 template< typename PointCloudT >
27 struct CopyGraphParameters< FEVV::PCLPointCloud, PointCloudT > :
28  CopyPCParameters< FEVV::PCLPointCloud, PointCloudT >
29 { };
30 
31 
36 // note: overloading because function partial specialization is not allowed.
37 template< typename PointCloudT,
38  typename Parameters,
39  // = CopyGraphParameters< FEVV::PCLPointCloud, PointCloudT >
40  typename GeometryTraitsS,
41  typename GeometryTraitsT >
42 void
44  const FEVV::PMapsContainer &pmaps_s,
45  PointCloudT &pc_t,
46  FEVV::PMapsContainer &pmaps_t,
47  const Parameters &params,
48  const GeometryTraitsS &gt_s,
49  const GeometryTraitsT &gt_t)
50 {
52  pc_s, pmaps_s, pc_t, pmaps_t, params, gt_s, gt_t);
53 }
54 
55 
60 template< typename PointCloudT >
61 struct CopyGraphParameters< PointCloudT, FEVV::PCLPointCloud > :
62  CopyPCParameters< PointCloudT, FEVV::PCLPointCloud >
63 { };
64 
65 
70 // note: overloading because function partial specialization is not allowed.
71 template< typename PointCloudT,
72  typename Parameters,
73  // = CopyGraphParameters< PointCloudT, FEVV::PCLPointCloud > >
74  typename GeometryTraitsS,
75  typename GeometryTraitsT >
76 void
77 copy_graph(const PointCloudT &pc_s,
78  const FEVV::PMapsContainer &pmaps_s,
79  FEVV::PCLPointCloud &pc_t,
80  FEVV::PMapsContainer &pmaps_t,
81  const Parameters &params,
82  const GeometryTraitsS &gt_s,
83  const GeometryTraitsT &gt_t)
84 {
86  pc_s, pmaps_s, pc_t, pmaps_t, params, gt_s, gt_t);
87 }
88 
89 
95 template< >
97  CopyPCParameters< FEVV::PCLPointCloud, FEVV::PCLPointCloud >
98 { };
99 
100 
105 // note: overloading because function partial specialization is not allowed.
106 template< typename Parameters,
107  // = CopyGraphParameters< FEVV::PCLPointCloud, FEVV::PCLPointCloud > >
108  typename GeometryTraitsS,
109  typename GeometryTraitsT >
110 void
112  const FEVV::PMapsContainer &pmaps_s,
113  FEVV::PCLPointCloud &pc_t,
114  FEVV::PMapsContainer &pmaps_t,
115  const Parameters &params,
116  const GeometryTraitsS &gt_s,
117  const GeometryTraitsT &gt_t)
118 {
120  pc_s, pmaps_s, pc_t, pmaps_t, params, gt_s, gt_t);
121 }
122 
123 
124 } // namespace Filters
125 } // namespace FEVV
126 
127 
128 // we must explicitely define the cases "copy from PCL to CGALPS" and
129 // "copy from CGALPS to PCL" to avoid an "ambiguous call error" because the
130 // compiler can not choose for example between "copy from PCL" and
131 // "copy to CGALPS" ; this leads to PCL/CGAL mixed code, which is bad, but we
132 // have no other choice
133 #ifdef FEVV_USE_CGAL
134 
136 #include "FEVV/Wrappings/Graph_traits_cgal_point_set.h" // for vertex_decriptor
137 #include "FEVV/Wrappings/Geometry_traits_cgal_point_set.h" // for CGALPS Kernel
138 #include "FEVV/Wrappings/Graph_properties_cgal_point_set.h" // for get(vertex_point_t,...)
139 #include "FEVV/Wrappings/properties_cgal_point_set.h" // for CGALPS prop maps
140 
141 namespace FEVV {
142 namespace Filters {
143 
144 
150 template< >
151 struct CopyGraphParameters< FEVV::PCLPointCloud , FEVV::CGALPointSet > :
152  CopyPCParameters< FEVV::PCLPointCloud, FEVV::CGALPointSet >
153 { };
154 
155 
161 // note: overloading because function partial specialization is not allowed.
162 template< typename Parameters,
163  // = CopyGraphParameters< FEVV::PCLPointCloud, FEVV::CGALPointSet > >
164  typename GeometryTraitsS,
165  typename GeometryTraitsT >
166 void
167 copy_graph(const FEVV::PCLPointCloud &pc_s,
168  const FEVV::PMapsContainer &pmaps_s,
169  FEVV::CGALPointSet &pc_t,
170  FEVV::PMapsContainer &pmaps_t,
171  const Parameters &params,
172  const GeometryTraitsS &gt_s,
173  const GeometryTraitsT &gt_t)
174 {
176  pc_s, pmaps_s, pc_t, pmaps_t, params, gt_s, gt_t);
177 }
178 
179 
185 template< >
186 struct CopyGraphParameters< FEVV::CGALPointSet, FEVV::PCLPointCloud > :
187  CopyPCParameters< FEVV::CGALPointSet, FEVV::PCLPointCloud >
188 { };
189 
190 
196 // note: overloading because function partial specialization is not allowed.
197 template< typename Parameters,
198  // = CopyGraphParameters< FEVV::CGALPointSet, FEVV::PCLPointCloud > >
199  typename GeometryTraitsS,
200  typename GeometryTraitsT >
201 void
202 copy_graph(const FEVV::CGALPointSet &pc_s,
203  const FEVV::PMapsContainer &pmaps_s,
204  FEVV::PCLPointCloud &pc_t,
205  FEVV::PMapsContainer &pmaps_t,
206  const Parameters &params,
207  const GeometryTraitsS &gt_s,
208  const GeometryTraitsT &gt_t)
209 {
211  pc_s, pmaps_s, pc_t, pmaps_t, params, gt_s, gt_t);
212 }
213 
214 
215 } // namespace Filters
216 } // namespace FEVV
217 
218 #endif // FEVV_USE_CGAL
FEVV::Filters::copy_graph
void copy_graph(const FEVV::CGALPointSet &pc_s, const FEVV::PMapsContainer &pmaps_s, PointCloudT &pc_t, FEVV::PMapsContainer &pmaps_t, const Parameters &params, const GeometryTraitsS &gt_s, const GeometryTraitsT &gt_t)
Overloading of copy_graph() for CGAL Point Set copy from.
Definition: copy_graph_cgal_point_set.hpp:43
FEVV::CGALPointSet
CGAL::Point_set_3< CGALPointSetPoint > CGALPointSet
Definition: DataStructures_cgal_point_set.h:71
copy_point_cloud.hpp
DataStructures_cgal_point_set.h
Geometry_traits_cgal_point_set.h
FEVV::PCLPointCloud
pcl::PointCloud< PCLEnrichedPoint > PCLPointCloud
Definition: DataStructures_pcl_point_cloud.h:28
copy_graph.hpp
FEVV::Filters::CopyPCParameters
Definition: copy_point_cloud.hpp:44
FEVV::Filters::CopyGraphParameters
Definition: copy_graph.hpp:55
FEVV::PMapsContainer
std::map< std::string, boost::any > PMapsContainer
Definition: properties.h:99
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
DataStructures_pcl_point_cloud.h
FEVV::Filters::copy_point_cloud
void copy_point_cloud(const PointCloudS &pc_s, const PMapsContainer &pmaps_s, PointCloudT &pc_t, PMapsContainer &pmaps_t, const Parameters &params, const GeometryTraitsS &gt_s, const GeometryTraitsT &)
Copy a source point cloud into a target point cloud. Copy standard properties too.
Definition: copy_point_cloud.hpp:77
Graph_traits_cgal_point_set.h
properties_cgal_point_set.h
FEVV::Filters::Parameters
Parameters contains the compression parameters except the stopping criteria.
Definition: Parameters.h:46
Graph_properties_cgal_point_set.h