MEPP2 Project
properties_aif.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 
16 
17 //#include "FEVV/DataStructures/DataStructures_aif.h"
18 
19 #define USE_NATIVE_PM
20 #ifdef USE_NATIVE_PM
22 #endif
23 
24 namespace FEVV {
25 
26 // Here is the place for some specialization for AIF
27 
28 // default vertex property map
29 template< typename ValueT >
31 {
32  typedef typename boost::property_map< FEVV::DataStructures::AIF::AIFMesh,
33  boost::vertex_index_t >::const_type
35  typedef typename boost::vector_property_map< ValueT, vertex_index_map_type >
37 
39  {
40  auto index_map = get(boost::vertex_index, m);
41  pmap_type pmap(index_map);
42  return pmap;
43  }
44 };
45 
46 // default face property map
47 template< typename ValueT >
48 struct Face_pmap_traits< AIFMesh, ValueT >
49 {
50  typedef
51  typename boost::property_map< AIFMesh, boost::face_index_t >::const_type
53  typedef typename boost::vector_property_map< ValueT, face_index_map_type >
55 
56  static pmap_type create(const AIFMesh &m)
57  {
58  auto index_map = get(boost::face_index, m);
59  pmap_type pmap(index_map);
60  return pmap;
61  }
62 };
63 
64 
65 // default edge property map
66 template< typename ValueT >
67 struct Edge_pmap_traits< AIFMesh, ValueT >
68 {
69  typedef
70  typename boost::property_map< AIFMesh, boost::edge_index_t >::const_type
72  typedef typename boost::vector_property_map< ValueT, edge_index_map_type >
74 
75  static pmap_type create(const AIFMesh &m)
76  {
77  auto index_map = get(boost::edge_index, m);
78  pmap_type pmap(index_map);
79  return pmap;
80  }
81 };
82 
84 // define standard property map types for (property,cell) pair,
85 // for example vertex-normal
86 
87 // specialize the property maps traits for vertex-normal
88 template<>
90 {
92 #ifdef USE_NATIVE_PM
95 #else
96  typedef
98 #endif
99  static pmap_type create(const AIFMesh &m)
100  {
101 #ifdef USE_NATIVE_PM
102  pmap_type *pmap =
103  (const_cast< AIFMesh * >(&m))
104  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
105  "v:normal");
106  return *pmap;
107 #else
108  auto index_map = get(boost::vertex_index, m);
109  pmap_type pmap(index_map);
110  return pmap;
111 #endif
112  }
113 };
114 
115 // specialize the property maps traits for vertex-tangent
116 template<>
118 {
120 #ifdef USE_NATIVE_PM
123 #else
124  typedef
126 #endif
127  static pmap_type create(const AIFMesh &m)
128  {
129 #ifdef USE_NATIVE_PM
130  pmap_type *pmap =
131  (const_cast< AIFMesh * >(&m))
132  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
133  "v:tangent");
134  return *pmap;
135 #else
136  auto index_map = get(boost::vertex_index, m);
137  pmap_type pmap(index_map);
138  return pmap;
139 #endif
140  }
141 };
142 
143 // specialize the property maps traits for vertex-texcoord
144 template<>
146 {
148 #ifdef USE_NATIVE_PM
151 #else
152  typedef
154 #endif
155  static pmap_type create(const AIFMesh &m)
156  {
157 #ifdef USE_NATIVE_PM
158  pmap_type *pmap =
159  (const_cast< AIFMesh * >(&m))
160  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
161  "v:texcoord");
162  return *pmap;
163 #else
164  auto index_map = get(boost::vertex_index, m);
165  pmap_type pmap(index_map);
166  return pmap;
167 #endif
168  }
169 };
170 
171 // specialize the standard property map for vertex-color
172 template<>
174 {
176 #ifdef USE_NATIVE_PM
179 #else
180  typedef
182 #endif
183  static pmap_type create(const AIFMesh &m)
184  {
185 #ifdef USE_NATIVE_PM
186  pmap_type *pmap =
187  (const_cast< AIFMesh * >(&m))
188  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
189  "v:color");
190  return *pmap;
191 #else
192  auto index_map = get(boost::vertex_index, m);
193  pmap_type pmap(index_map);
194  return pmap;
195 #endif
196  }
197 };
198 
199 // specialize the property maps traits for vertex-custom_vector
200 template<>
202 {
204 #ifdef USE_NATIVE_PM
207 #else
208  typedef
210 #endif
211  static pmap_type create(const AIFMesh &m)
212  {
213 #ifdef USE_NATIVE_PM
214  pmap_type *pmap =
215  (const_cast< AIFMesh * >(&m))
216  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
217  "v:custom_vector");
218  return *pmap;
219 #else
220  auto index_map = get(boost::vertex_index, m);
221  pmap_type pmap(index_map);
222  return pmap;
223 #endif
224  }
225 };
226 
227 // specialize the property maps traits for vertex-custom_vector_color
228 template<>
230 {
232 #ifdef USE_NATIVE_PM
235 #else
236  typedef
238 #endif
239  static pmap_type create(const AIFMesh &m)
240  {
241 #ifdef USE_NATIVE_PM
242  pmap_type *pmap =
243  (const_cast< AIFMesh * >(&m))
244  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
245  "v:custom_vector_color");
246  return *pmap;
247 #else
248  auto index_map = get(boost::vertex_index, m);
249  pmap_type pmap(index_map);
250  return pmap;
251 #endif
252  }
253 };
254 
255 // specialize the property maps traits for vertex-custom_vector_param
256 template<>
258 {
260 #ifdef USE_NATIVE_PM
263 #else
264  typedef
266 #endif
267  static pmap_type create(const AIFMesh &m)
268  {
269 #ifdef USE_NATIVE_PM
270  pmap_type *pmap =
271  (const_cast< AIFMesh * >(&m))
272  ->AddPropertyMap< AIFMesh::vertex_type::ptr, value_type >(
273  "v:custom_vector_param");
274  return *pmap;
275 #else
276  auto index_map = get(boost::vertex_index, m);
277  pmap_type pmap(index_map);
278  return pmap;
279 #endif
280  }
281 };
282 
283 // specialize the property maps traits for edge-color
284 template<>
286 {
288 #ifdef USE_NATIVE_PM
291 #else
293 #endif
294  static pmap_type create(const AIFMesh &m)
295  {
296 #ifdef USE_NATIVE_PM
297  pmap_type *pmap =
298  (const_cast< AIFMesh * >(&m))
299  ->AddPropertyMap< AIFMesh::edge_type::ptr, value_type >("e:color");
300  return *pmap;
301 #else
302  auto index_map = get(boost::edge_index, m);
303  pmap_type pmap(index_map);
304  return pmap;
305 #endif
306  }
307 };
308 
309 
310 // specialize the property maps traits for face-normal
311 template<>
313 {
315 #ifdef USE_NATIVE_PM
318 #else
320 #endif
321  static pmap_type create(const AIFMesh &m)
322  {
323 #ifdef USE_NATIVE_PM
324  pmap_type *pmap =
325  (const_cast< AIFMesh * >(&m))
326  ->AddPropertyMap< AIFMesh::face_type::ptr, value_type >("f:normal");
327  return *pmap;
328 #else
329  auto index_map = get(boost::face_index, m);
330  pmap_type pmap(index_map);
331  return pmap;
332 #endif
333  }
334 };
335 
336 // specialize the property maps traits for face-color
337 template<>
339 {
341 #ifdef USE_NATIVE_PM
344 #else
346 #endif
347  static pmap_type create(const AIFMesh &m)
348  {
349 #ifdef USE_NATIVE_PM
350  pmap_type *pmap =
351  (const_cast< AIFMesh * >(&m))
352  ->AddPropertyMap< AIFMesh::face_type::ptr, value_type >("f:color");
353  return *pmap;
354 #else
355  auto index_map = get(boost::face_index, m);
356  pmap_type pmap(index_map);
357  return pmap;
358 #endif
359  }
360 };
361 
362 // specialize the property maps traits for face-material
363 template<>
365 {
366  typedef size_t value_type;
367 #ifdef USE_NATIVE_PM
370 #else
372 #endif
373  static pmap_type create(const AIFMesh &m)
374  {
375 #ifdef USE_NATIVE_PM
376  pmap_type *pmap =
377  (const_cast< AIFMesh * >(&m))
378  ->AddPropertyMap< AIFMesh::face_type::ptr, value_type >(
379  "f:material");
380  return *pmap;
381 #else
382  auto index_map = get(boost::face_index, m);
383  pmap_type pmap(index_map);
384  return pmap;
385 #endif
386  }
387 };
388 
389 } // namespace FEVV
390 
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_color_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:175
FEVV::face_normal_t
face_normal_t
Definition: properties.h:77
FEVV::DataStructures::AIF::AIFVertex::ptr
boost::shared_ptr< self > ptr
Definition: AIFVertex.hpp:47
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_color_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:183
FEVV::_PMap_traits< AIFMesh, FEVV::face_color_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:347
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_texcoord_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:147
FEVV::_PMap_traits< AIFMesh, FEVV::face_normal_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:321
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_normal_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:91
FEVV::face_color_t
face_color_t
Definition: properties.h:81
FEVV::Edge_pmap_traits
Definition: properties.h:345
FEVV::Edge_pmap_traits< AIFMesh, ValueT >::pmap_type
boost::vector_property_map< ValueT, edge_index_map_type > pmap_type
Definition: properties_aif.h:73
FEVV::_PMap_traits< AIFMesh, FEVV::face_color_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:343
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_color_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:239
FEVV::edge_color_t
edge_color_t
Definition: properties.h:73
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:206
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_tangent_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:127
FEVV::DataStructures::AIF::AIFFace::ptr
boost::shared_ptr< self > ptr
Definition: AIFFace.hpp:52
FEVV::_PMap_traits< AIFMesh, FEVV::edge_color_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:294
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_normal_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:99
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
FEVV::vertex_custom_vector_color_t
vertex_custom_vector_color_t
Definition: properties.h:57
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:211
FEVV::face_material_t
face_material_t
Definition: properties.h:85
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_texcoord_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:150
FEVV::Edge_pmap_traits< AIFMesh, ValueT >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:75
FEVV::_PMap_traits< AIFMesh, FEVV::face_normal_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:317
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_param_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:262
FEVV::vertex_normal_t
vertex_normal_t
Definition: properties.h:35
FEVV::Assoc_property_map
Definition: properties.h:236
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_color_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:234
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::DataStructures::AIF::PropertyMap
Definition: AIFProperties.h:381
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::_PMap_traits< AIFMesh, FEVV::face_color_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:340
FEVV::Face_pmap_traits< AIFMesh, ValueT >::pmap_type
boost::vector_property_map< ValueT, face_index_map_type > pmap_type
Definition: properties_aif.h:54
FEVV::vertex_custom_vector_param_t
vertex_custom_vector_param_t
Definition: properties.h:61
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_tangent_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:119
FEVV::_PMap_traits< AIFMesh, FEVV::face_material_t >::value_type
size_t value_type
Definition: properties_aif.h:366
FEVV::_PMap_traits< AIFMesh, FEVV::edge_color_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:287
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_tangent_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:122
FEVV::vertex_custom_vector_t
vertex_custom_vector_t
Definition: properties.h:53
FEVV::Face_pmap_traits< AIFMesh, ValueT >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:56
FEVV::DataStructures::AIF::AIFEdge::ptr
boost::shared_ptr< self > ptr
Definition: AIFEdge.hpp:56
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:203
FEVV::_PMap_traits< AIFMesh, FEVV::face_material_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:369
FEVV::Vertex_pmap_traits< FEVV::DataStructures::AIF::AIFMesh, ValueT >::create
static pmap_type create(const FEVV::DataStructures::AIF::AIFMesh &m)
Definition: properties_aif.h:38
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_color_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:178
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_color_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:231
FEVV::_PMap_traits< AIFMesh, FEVV::face_normal_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:314
FEVV::Vertex_pmap_traits< FEVV::DataStructures::AIF::AIFMesh, ValueT >::pmap_type
boost::vector_property_map< ValueT, vertex_index_map_type > pmap_type
Definition: properties_aif.h:36
FEVV::Edge_pmap_traits< AIFMesh, ValueT >::edge_index_map_type
boost::property_map< AIFMesh, boost::edge_index_t >::const_type edge_index_map_type
Definition: properties_aif.h:71
Geometry_traits_aif.h
FEVV::Vertex_pmap_traits< FEVV::DataStructures::AIF::AIFMesh, ValueT >::vertex_index_map_type
boost::property_map< FEVV::DataStructures::AIF::AIFMesh, boost::vertex_index_t >::const_type vertex_index_map_type
Definition: properties_aif.h:34
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_normal_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:94
FEVV::DataStructures::AIF::AIFMesh
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
Definition: AIFMesh.hpp:47
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_param_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:267
FEVV::_PMap_traits
Definition: properties.h:376
Wrappings_aif.h
properties.h
AIFMesh
FEVV::DataStructures::AIF::AIFMesh AIFMesh
Definition: Graph_properties_aif.h:19
AIFProperties.h
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_custom_vector_param_t >::value_type
FEVV::Geometry_traits< AIFMesh >::Vector value_type
Definition: properties_aif.h:259
FEVV::_PMap_traits< AIFMesh, FEVV::edge_color_t >::pmap_type
FEVV::DataStructures::AIF::PropertyMap< value_type > pmap_type
Definition: properties_aif.h:290
FEVV::vertex_texcoord_t
vertex_texcoord_t
Definition: properties.h:43
FEVV::_PMap_traits< AIFMesh, FEVV::face_material_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:373
FEVV::_PMap_traits< AIFMesh, FEVV::vertex_texcoord_t >::create
static pmap_type create(const AIFMesh &m)
Definition: properties_aif.h:155
FEVV::Face_pmap_traits< AIFMesh, ValueT >::face_index_map_type
boost::property_map< AIFMesh, boost::face_index_t >::const_type face_index_map_type
Definition: properties_aif.h:52