MEPP2 Project
properties_pcl_point_cloud.h
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 
13 
14 #if defined _MSC_VER
15 // DON'T PUSH the '#pragma warning' here
16 // AND SO, DON'T POP too !!!
17 #pragma warning(disable : 4267) // for VS-2015 // MANDATORY when PCL is ON !!!
18 #endif
19 
20 
24 
25 #include <boost/property_map/property_map.hpp> // for boost property maps
26 
27 
28 namespace FEVV {
29 
30 // _PMap_traits specialization for FEVV::PCLPointCloud
31 // use boost::vector_property_map except for NormalMap
32 // and ColorMap ; NormalMap and ColorMap are mapping
33 // over PCL datastructure
34 
35 
36 // define default property map type (associative property map,
37 // vector property map...) for each cell type (vertex, face...) ;
38 
39 // vertex desciptor already is an index, so we can use it
40 // as boost::vector_property_map key
41 inline
42 boost::identity_property_map
43 get(const boost::vertex_index_t&, const FEVV::PCLPointCloud&)
44 {
45  return boost::identity_property_map();
46 }
47 
48 // default vertex property map
49 template< typename ValueT >
51 {
52  typedef typename boost::property_map< FEVV::PCLPointCloud,
53  boost::vertex_index_t >::const_type
55  typedef typename boost::vector_property_map< ValueT, vertex_index_map_type >
57 
59  {
60  auto index_map = get(boost::vertex_index, pc);
61  pmap_type pmap(index_map);
62  return pmap;
63  }
64 };
65 
66 
67 // define standard property map types for (property,cell) pair,
68 // for example vertex-normal
69 
70 // specialize the property maps traits for vertex-normal
71 template<>
73 {
75 
77  {
78  return pmap_type(const_cast< FEVV::PCLPointCloud& >(pc));
79  }
80 };
81 
82 #if 0 //TODO-elo-rm
83 // specialize the property maps traits for vertex-tangent
84 template< typename PointT >
85 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_tangent_t >
86 {
88  value_type;
89  typedef typename Vertex_pmap_traits< CGAL::Surface_mesh< PointT >,
90  value_type >::pmap_type pmap_type;
91 
92  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
93  {
94  auto index_map = get(boost::vertex_index, m);
95  pmap_type pmap(index_map);
96  return pmap;
97  }
98 };
99 
100 // specialize the property maps traits for vertex-texcoord
101 template< typename PointT >
102 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_texcoord_t >
103 {
105  value_type;
106  typedef typename Vertex_pmap_traits< CGAL::Surface_mesh< PointT >,
107  value_type >::pmap_type pmap_type;
108 
109  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
110  {
111  auto index_map = get(boost::vertex_index, m);
112  pmap_type pmap(index_map);
113  return pmap;
114  }
115 };
116 #endif
117 
118 // specialize the standard property map for vertex-color
119 template<>
121 {
123 
125  {
126  return pmap_type(const_cast< FEVV::PCLPointCloud& >(pc));
127  }
128 };
129 
130 // specialize the property maps traits for vertex-custom_vector
131 /*template<>
132 struct _PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_custom_vector_t >
133 {
134  typedef FEVV::PCLPointCloudNormalMap pmap_type; // ask ELO
135 
136  static pmap_type create(const FEVV::PCLPointCloud &pc)
137  {
138  return pmap_type(const_cast< FEVV::PCLPointCloud& >(pc));
139  }
140 };*/
141 
142 // specialize the property maps traits for vertex-custom_vector_color
143 /*template<>
144 struct _PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_custom_vector_color_t >
145 {
146  typedef FEVV::PCLPointCloudColorMap pmap_type; // ask ELO
147 
148  static pmap_type create(const FEVV::PCLPointCloud &pc)
149  {
150  return pmap_type(const_cast< FEVV::PCLPointCloud& >(pc));
151  }
152 };*/
153 
154 // specialize the property maps traits for vertex-custom_vector_param
155 /*template<>
156 struct _PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_custom_vector_param_t >
157 {
158  typedef FEVV::PCLPointCloudNormalMap pmap_type; // ask ELO
159 
160  static pmap_type create(const FEVV::PCLPointCloud &pc)
161  {
162  return pmap_type(const_cast< FEVV::PCLPointCloud& >(pc));
163  }
164 };*/
165 
166 } // namespace FEVV
FEVV::_PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_color_t >::create
static pmap_type create(const FEVV::PCLPointCloud &pc)
Definition: properties_pcl_point_cloud.h:124
Geometry_traits_pcl_point_cloud.h
FEVV::_PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_color_t >::pmap_type
FEVV::PCLPointCloudColorMap pmap_type
Definition: properties_pcl_point_cloud.h:122
FEVV::PCLPointCloud
pcl::PointCloud< PCLEnrichedPoint > PCLPointCloud
Definition: DataStructures_pcl_point_cloud.h:28
FEVV::PCLPointCloudColorMap
Definition: Graph_properties_pcl_point_cloud.h:221
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
FEVV::_PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_normal_t >::create
static pmap_type create(const FEVV::PCLPointCloud &pc)
Definition: properties_pcl_point_cloud.h:76
FEVV::vertex_normal_t
vertex_normal_t
Definition: properties.h:35
FEVV::get
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
Definition: Graph_properties_pcl_point_cloud.h:117
FEVV::vertex_tangent_t
vertex_tangent_t
Definition: properties.h:39
FEVV::vertex_color_t
vertex_color_t
Definition: properties.h:47
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Vertex_pmap_traits
Definition: properties.h:315
FEVV::Vertex_pmap_traits< FEVV::PCLPointCloud, ValueT >::vertex_index_map_type
boost::property_map< FEVV::PCLPointCloud, boost::vertex_index_t >::const_type vertex_index_map_type
Definition: properties_pcl_point_cloud.h:54
CGAL
Definition: Graph_properties_cgal_point_set.h:32
FEVV::_PMap_traits< FEVV::PCLPointCloud, FEVV::vertex_normal_t >::pmap_type
FEVV::PCLPointCloudNormalMap pmap_type
Definition: properties_pcl_point_cloud.h:74
Wrappings_pcl_point_cloud.h
FEVV::Vertex_pmap_traits< FEVV::PCLPointCloud, ValueT >::create
static pmap_type create(const FEVV::PCLPointCloud &pc)
Definition: properties_pcl_point_cloud.h:58
FEVV::PCLPointCloudNormalMap
Definition: Graph_properties_pcl_point_cloud.h:138
FEVV::DataStructures::AIF::AIFVector
Definition: AIFProperties.h:173
FEVV::Vertex_pmap_traits< FEVV::PCLPointCloud, ValueT >::pmap_type
boost::vector_property_map< ValueT, vertex_index_map_type > pmap_type
Definition: properties_pcl_point_cloud.h:56
FEVV::_PMap_traits
Definition: properties.h:376
properties.h
FEVV::vertex_texcoord_t
vertex_texcoord_t
Definition: properties.h:43