MEPP2 Project
properties_surface_mesh.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 General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // 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 namespace FEVV {
18 
19 // _PMap_traits specialization for CGAL::Surface_mesh
20 // use boost::vector_property_map
21 
22 
23 // define default property map type (associative property map,
24 // vector property map...) for each cell type (vertex, face...) ;
25 
26 // default vertex property map
27 template< typename ValueT, typename PointT >
28 struct Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >
29 {
30  typedef typename boost::property_map< CGAL::Surface_mesh< PointT >,
31  boost::vertex_index_t >::const_type
33  typedef typename boost::vector_property_map< ValueT, vertex_index_map_type >
35 
36  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
37  {
38  auto index_map = get(boost::vertex_index, m);
39  pmap_type pmap(index_map);
40  return pmap;
41  }
42 };
43 
44 
45 // default face property map
46 template< typename ValueT, typename PointT >
47 struct Face_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >
48 {
49  typedef typename boost::property_map< CGAL::Surface_mesh< PointT >,
50  boost::face_index_t >::const_type
52  typedef typename boost::vector_property_map< ValueT, face_index_map_type >
54 
55  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
56  {
57  auto index_map = get(boost::face_index, m);
58  pmap_type pmap(index_map);
59  return pmap;
60  }
61 };
62 
63 // default edge property map
64 template< typename ValueT, typename PointT >
65 struct Edge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >
66 {
67  typedef typename boost::property_map< CGAL::Surface_mesh< PointT >,
68  boost::edge_index_t >::const_type
70  typedef typename boost::vector_property_map< ValueT, edge_index_map_type >
72 
73  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
74  {
75  auto index_map = get(boost::edge_index, m);
76  pmap_type pmap(index_map);
77  return pmap;
78  }
79 };
80 
81 // default halfedge property map
82 template< typename ValueT, typename PointT >
83 struct Halfedge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >
84 {
85  typedef typename boost::property_map< CGAL::Surface_mesh< PointT >,
86  boost::halfedge_index_t >::const_type
88  typedef typename boost::vector_property_map< ValueT, halfedge_index_map_type >
90 
91  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
92  {
93  auto index_map = get(boost::halfedge_index, m);
94  pmap_type pmap(index_map);
95  return pmap;
96  }
97 };
98 
99 
100 // define standard property map types for (property,cell) pair,
101 // for example vertex-normal
102 
103 // specialize the property maps traits for vertex-normal
104 template< typename PointT >
105 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_normal_t >
106 {
111 
112  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
113  {
114  auto index_map = get(boost::vertex_index, m);
115  pmap_type pmap(index_map);
116  return pmap;
117  }
118 };
119 
120 // specialize the property maps traits for vertex-tangent
121 template< typename PointT >
122 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_tangent_t >
123 {
128 
129  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
130  {
131  auto index_map = get(boost::vertex_index, m);
132  pmap_type pmap(index_map);
133  return pmap;
134  }
135 };
136 
137 // specialize the property maps traits for vertex-texcoord
138 template< typename PointT >
139 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_texcoord_t >
140 {
145 
146  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
147  {
148  auto index_map = get(boost::vertex_index, m);
149  pmap_type pmap(index_map);
150  return pmap;
151  }
152 };
153 
154 // specialize the standard property map for vertex-color
155 template< typename PointT >
156 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_color_t >
157 {
162 
163  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
164  {
165  auto index_map = get(boost::vertex_index, m);
166  pmap_type pmap(index_map);
167  return pmap;
168  }
169 };
170 
171 // specialize the property maps traits for vertex-custom_vector
172 template< typename PointT >
173 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_t >
174 {
179 
180  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
181  {
182  auto index_map = get(boost::vertex_index, m);
183  pmap_type pmap(index_map);
184  return pmap;
185  }
186 };
187 
188 // specialize the property maps traits for vertex-custom_vector_color
189 template< typename PointT >
190 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_color_t >
191 {
196 
197  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
198  {
199  auto index_map = get(boost::vertex_index, m);
200  pmap_type pmap(index_map);
201  return pmap;
202  }
203 };
204 
205 // specialize the property maps traits for vertex-custom_vector_param
206 template< typename PointT >
207 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_param_t >
208 {
213 
214  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
215  {
216  auto index_map = get(boost::vertex_index, m);
217  pmap_type pmap(index_map);
218  return pmap;
219  }
220 };
221 
222 // specialize the property maps traits for halfedge-normal
223 template< typename PointT >
224 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_normal_t >
225 {
230 
231  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
232  {
233  auto index_map = get(boost::halfedge_index, m);
234  pmap_type pmap(index_map);
235  return pmap;
236  }
237 };
238 
239 // specialize the property maps traits for halfedge-texcoord
240 template< typename PointT >
241 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_texcoord_t >
242 {
247 
248  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
249  {
250  auto index_map = get(boost::halfedge_index, m);
251  pmap_type pmap(index_map);
252  return pmap;
253  }
254 };
255 
256 // specialize the property maps traits for edge-color
257 template< typename PointT >
258 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::edge_color_t >
259 {
264 
265  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
266  {
267  auto index_map = get(boost::edge_index, m);
268  pmap_type pmap(index_map);
269  return pmap;
270  }
271 };
272 
273 // specialize the property maps traits for face-normal
274 template< typename PointT >
275 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_normal_t >
276 {
281 
282  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
283  {
284  auto index_map = get(boost::face_index, m);
285  pmap_type pmap(index_map);
286  return pmap;
287  }
288 };
289 
290 // specialize the property maps traits for face-color
291 template< typename PointT >
292 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_color_t >
293 {
298 
299  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
300  {
301  auto index_map = get(boost::face_index, m);
302  pmap_type pmap(index_map);
303  return pmap;
304  }
305 };
306 
307 // specialize the property maps traits for face-material
308 template< typename PointT >
309 struct _PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_material_t >
310 {
311  typedef size_t value_type;
314 
315  static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
316  {
317  auto index_map = get(boost::face_index, m);
318  pmap_type pmap(index_map);
319  return pmap;
320  }
321 };
322 
323 
324 } // namespace FEVV
325 
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_param_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:210
FEVV::face_normal_t
face_normal_t
Definition: properties.h:77
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_material_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:315
FEVV::Halfedge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:91
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:180
FEVV::face_color_t
face_color_t
Definition: properties.h:81
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_color_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:197
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_tangent_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:125
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_color_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:163
FEVV::Edge_pmap_traits
Definition: properties.h:345
FEVV::Halfedge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::pmap_type
boost::vector_property_map< ValueT, halfedge_index_map_type > pmap_type
Definition: properties_surface_mesh.h:89
FEVV::edge_color_t
edge_color_t
Definition: properties.h:73
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_texcoord_t >::pmap_type
Halfedge_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:246
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_material_t >::value_type
size_t value_type
Definition: properties_surface_mesh.h:311
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< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_param_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:212
Geometry_traits_cgal_surface_mesh.h
FEVV::vertex_custom_vector_color_t
vertex_custom_vector_color_t
Definition: properties.h:57
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_normal_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:278
FEVV::face_material_t
face_material_t
Definition: properties.h:85
FEVV::Face_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::face_index_map_type
boost::property_map< CGAL::Surface_mesh< PointT >, boost::face_index_t >::const_type face_index_map_type
Definition: properties_surface_mesh.h:51
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_tangent_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:129
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::edge_color_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:265
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_color_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:299
Wrappings_cgal_surface_mesh.h
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:176
FEVV::vertex_normal_t
vertex_normal_t
Definition: properties.h:35
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_color_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:295
FEVV::halfedge_texcoord_t
halfedge_texcoord_t
Definition: properties.h:69
FEVV::Assoc_property_map
Definition: properties.h:236
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_texcoord_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:144
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_normal_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:112
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_normal_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:282
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_normal_t >::pmap_type
Halfedge_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:229
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::Face_pmap_traits
Definition: properties.h:331
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_normal_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:108
FEVV::vertex_color_t
vertex_color_t
Definition: properties.h:47
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_normal_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:227
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_param_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:214
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_color_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:195
FEVV::Vertex_pmap_traits
Definition: properties.h:315
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_color_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:159
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_texcoord_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:248
FEVV::Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::vertex_index_map_type
boost::property_map< CGAL::Surface_mesh< PointT >, boost::vertex_index_t >::const_type vertex_index_map_type
Definition: properties_surface_mesh.h:32
CGAL
Definition: Graph_properties_cgal_point_set.h:32
FEVV::vertex_custom_vector_param_t
vertex_custom_vector_param_t
Definition: properties.h:61
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:178
FEVV::Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::pmap_type
boost::vector_property_map< ValueT, vertex_index_map_type > pmap_type
Definition: properties_surface_mesh.h:34
FEVV::Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:36
FEVV::vertex_custom_vector_t
vertex_custom_vector_t
Definition: properties.h:53
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_material_t >::pmap_type
Face_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:313
FEVV::DataStructures::AIF::AIFVector
Definition: AIFProperties.h:173
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_normal_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:110
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_custom_vector_color_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:193
FEVV::Edge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::pmap_type
boost::vector_property_map< ValueT, edge_index_map_type > pmap_type
Definition: properties_surface_mesh.h:71
FEVV::Face_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::pmap_type
boost::vector_property_map< ValueT, face_index_map_type > pmap_type
Definition: properties_surface_mesh.h:53
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::edge_color_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:261
FEVV::Face_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:55
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_normal_t >::pmap_type
Face_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:280
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::face_color_t >::pmap_type
Face_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:297
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_normal_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:231
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_texcoord_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:142
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_tangent_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:127
FEVV::Halfedge_pmap_traits
Definition: properties.h:359
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::halfedge_texcoord_t >::value_type
FEVV::Geometry_traits< CGAL::Surface_mesh< PointT > >::Vector value_type
Definition: properties_surface_mesh.h:244
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::edge_color_t >::pmap_type
Edge_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:263
FEVV::_PMap_traits
Definition: properties.h:376
FEVV::Edge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:73
properties.h
FEVV::vertex_texcoord_t
vertex_texcoord_t
Definition: properties.h:43
FEVV::Edge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::edge_index_map_type
boost::property_map< CGAL::Surface_mesh< PointT >, boost::edge_index_t >::const_type edge_index_map_type
Definition: properties_surface_mesh.h:69
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_color_t >::pmap_type
Vertex_pmap_traits< CGAL::Surface_mesh< PointT >, value_type >::pmap_type pmap_type
Definition: properties_surface_mesh.h:161
FEVV::halfedge_normal_t
halfedge_normal_t
Definition: properties.h:65
FEVV::Halfedge_pmap_traits< CGAL::Surface_mesh< PointT >, ValueT >::halfedge_index_map_type
boost::property_map< CGAL::Surface_mesh< PointT >, boost::halfedge_index_t >::const_type halfedge_index_map_type
Definition: properties_surface_mesh.h:87
FEVV::_PMap_traits< CGAL::Surface_mesh< PointT >, FEVV::vertex_texcoord_t >::create
static pmap_type create(const CGAL::Surface_mesh< PointT > &m)
Definition: properties_surface_mesh.h:146