18
18
19
19
#include < CGAL/license/Surface_mesh.h>
20
20
21
- #include < CGAL/assertions.h>
22
21
#include < pmp/SurfaceMesh.h>
23
- #include < CGAL/Kernel_traits.h>
24
- #include < CGAL/squared_distance_3.h>
25
- #include < CGAL/number_utils.h>
26
22
23
+ #include < CGAL/assertions.h>
24
+ #include < CGAL/number_utils.h>
27
25
#include < CGAL/boost/graph/properties.h>
28
-
29
26
#include < CGAL/Exact_predicates_inexact_constructions_kernel.h>
30
27
31
28
#include < boost/cstdint.hpp>
@@ -39,7 +36,7 @@ class pmp_edge_weight_pmap
39
36
typedef pmp::SurfaceMesh SM;
40
37
public:
41
38
typedef boost::readable_property_map_tag category;
42
- typedef double value_type;
39
+ typedef double value_type;
43
40
typedef value_type reference;
44
41
typedef typename boost::graph_traits<pmp::SurfaceMesh>::edge_descriptor key_type;
45
42
@@ -101,15 +98,12 @@ get(boost::edge_weight_t, const SurfaceMesh& sm)
101
98
}
102
99
103
100
104
-
105
101
Scalar
106
102
get (boost::edge_weight_t , const SurfaceMesh& sm,
107
103
const boost::graph_traits<SurfaceMesh>::edge_descriptor& e)
108
104
{
109
105
return CGAL::pmp_edge_weight_pmap (sm)[e];
110
106
}
111
-
112
-
113
107
114
108
}
115
109
//
@@ -125,48 +119,54 @@ struct property_map<pmp::SurfaceMesh, boost::vertex_index_t >
125
119
};
126
120
}
127
121
128
- namespace pmp {
129
122
123
+ namespace pmp {
130
124
131
125
CGAL::SM_index_pmap<Vertex>
132
126
get (const boost::vertex_index_t &, const SurfaceMesh&)
133
127
{
134
128
return CGAL::SM_index_pmap<Vertex>();
135
129
}
130
+
136
131
}
132
+
137
133
//
138
134
// face_index
139
135
//
140
136
namespace boost {
141
137
142
- template <>
138
+ template <>
143
139
struct property_map <pmp::SurfaceMesh, boost::face_index_t >
144
140
{
145
141
typedef CGAL::SM_index_pmap<pmp::Face> type;
146
142
typedef CGAL::SM_index_pmap<pmp::Face> const_type;
147
143
};
144
+
148
145
}
149
146
150
147
namespace pmp {
151
148
152
-
153
149
CGAL::SM_index_pmap<Face>
154
150
get (const boost::face_index_t &, const SurfaceMesh&)
155
151
{
156
152
return CGAL::SM_index_pmap<pmp::Face>();
157
153
}
158
154
}
155
+
159
156
//
160
157
// edge_index
161
158
//
162
159
namespace boost {
160
+
163
161
template <>
164
162
struct property_map <pmp::SurfaceMesh, boost::edge_index_t >
165
163
{
166
164
typedef CGAL::SM_index_pmap<CGAL::internal::PMP_edge> type;
167
165
typedef CGAL::SM_index_pmap<CGAL::internal::PMP_edge> const_type;
168
166
};
167
+
169
168
}
169
+
170
170
namespace pmp {
171
171
172
172
CGAL::SM_index_pmap<CGAL::internal::PMP_edge>
@@ -175,33 +175,37 @@ get(const boost::edge_index_t&, const SurfaceMesh&)
175
175
return CGAL::SM_index_pmap<CGAL::internal::PMP_edge>();
176
176
}
177
177
}
178
+
178
179
//
179
180
// halfedge_index
180
181
//
181
182
namespace boost {
183
+
182
184
template <>
183
185
struct property_map <pmp::SurfaceMesh, boost::halfedge_index_t >
184
186
{
185
187
typedef CGAL::SM_index_pmap<pmp::Halfedge> type;
186
188
typedef CGAL::SM_index_pmap<pmp::Halfedge> const_type;
187
189
};
190
+
188
191
}
189
- namespace pmp {
190
192
193
+ namespace pmp {
191
194
192
195
CGAL::SM_index_pmap<Halfedge>
193
196
get (const boost::halfedge_index_t &, const SurfaceMesh&)
194
197
{
195
198
return CGAL::SM_index_pmap<Halfedge>();
196
199
}
200
+
197
201
}
202
+
198
203
//
199
204
// vertex_point
200
205
//
201
-
202
206
namespace pmp {
203
207
204
- template <typename P>
208
+ template <typename P>
205
209
struct VertexPointMap {
206
210
typedef P value_type;
207
211
typedef P reference;
@@ -214,8 +218,7 @@ struct VertexPointMap {
214
218
inline friend value_type get (const VertexPointMap& pm, key_type v)
215
219
{
216
220
const Point & p = pm.sm ->position (v);
217
- return P (p[0 ],p[1 ],p[2 ]);
218
-
221
+ return P (p[0 ],p[1 ],p[2 ]);
219
222
}
220
223
221
224
inline friend void put (const VertexPointMap& pm, key_type v, const value_type& p)
@@ -225,10 +228,12 @@ struct VertexPointMap {
225
228
226
229
SurfaceMesh* sm;
227
230
};
231
+
228
232
}
229
233
230
234
231
235
namespace boost {
236
+
232
237
template <>
233
238
struct property_map <pmp::SurfaceMesh, CGAL::vertex_point_t >
234
239
{
@@ -237,6 +242,7 @@ struct property_map<pmp::SurfaceMesh, CGAL::vertex_point_t >
237
242
typedef pmp::VertexPointMap<P> type;
238
243
typedef type const_type;
239
244
};
245
+
240
246
}
241
247
242
248
@@ -247,8 +253,6 @@ get(CGAL::vertex_point_t, const SurfaceMesh& g) {
247
253
return boost::property_map<SurfaceMesh, CGAL::vertex_point_t >::type (g);
248
254
}
249
255
250
-
251
-
252
256
253
257
// get for intrinsic properties
254
258
#define CGAL_SM_INTRINSIC_PROPERTY (RET, PROP, TYPE ) \
@@ -273,7 +277,6 @@ CGAL_SM_INTRINSIC_PROPERTY(CGAL::Exact_predicates_inexact_constructions_kernel::
273
277
// only available for vertex_point
274
278
275
279
276
-
277
280
void
278
281
put (CGAL::vertex_point_t p, pmp::SurfaceMesh& sm,
279
282
typename boost::graph_traits< pmp::SurfaceMesh >::vertex_descriptor v,
@@ -284,6 +287,15 @@ put(CGAL::vertex_point_t p, pmp::SurfaceMesh& sm,
284
287
285
288
} // namespace pmp
286
289
290
+ namespace boost {
291
+
292
+ struct edge_property_type <pmp::SurfaceMesh>
293
+ {
294
+ typedef boost::edge_weight_t type;
295
+ };
296
+
297
+ }
298
+
287
299
namespace CGAL {
288
300
289
301
template <>
@@ -315,8 +327,7 @@ struct graph_has_property<pmp::SurfaceMesh, boost::edge_weight_t>
315
327
316
328
317
329
// dynamic properties
318
- namespace boost
319
- {
330
+ namespace boost {
320
331
321
332
template <typename T>
322
333
struct property_map <pmp::SurfaceMesh, CGAL::dynamic_vertex_property_t <T> >
0 commit comments