Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Mesh.hh
1 #ifndef OPENMESH_PYTHON_MESH_HH
2 #define OPENMESH_PYTHON_MESH_HH
3
4 #include "Python/Bindings.hh"
5 #include "Python/Iterator.hh"
6 #include "Python/Circulator.hh"
7
8 #include <boost/python/stl_iterator.hpp>
9
10 namespace OpenMesh {
11 namespace Python {
12
13 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(garbage_collection_overloads, garbage_collection, 0, 3)
14 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(add_property_overloads, add_property, 1, 2)
15
16 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(copy_all_properties_overloads, copy_all_properties, 2, 3)
17
18 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(delete_vertex_overloads, delete_vertex, 1, 2)
19 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(delete_edge_overloads, delete_edge, 1, 2)
20 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(delete_face_overloads, delete_face, 1, 2)
21 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(is_boundary_overloads, is_boundary, 1, 2)
22
23 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(find_feature_edges_overloads, find_feature_edges, 0, 1)
24 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(update_normal_overloads, update_normal, 1, 2)
25 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(update_halfedge_normals_overloads, update_halfedge_normals, 0, 1)
26 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(calc_halfedge_normal_overloads, calc_halfedge_normal, 1, 2)
27
42 template <class Mesh, class IndexHandle>
43 void set_status(Mesh& _self, IndexHandle _h, const OpenMesh::Attributes::StatusInfo& _info) {
44 _self.status(_h) = _info;
45 }
46
63 template <class Mesh, class PropHandle, class IndexHandle>
64 void set_property(Mesh& _self, PropHandle _ph, IndexHandle _h, const object& _value) {
65 _self.property(_ph, _h) = _value;
66 }
67
82 template <class Mesh, class PropHandle>
83 void set_property(Mesh& _self, PropHandle _ph, const object& _value) {
84 _self.property(_ph) = _value;
85 }
86
96 template <class Mesh, class OtherMesh>
97 void assign_connectivity(Mesh& _self, const OtherMesh& _other) {
98 _self.assign_connectivity(_other);
99 }
100
104 template <class Mesh, class Iterator, size_t (ArrayKernel::*n_items)() const>
105 IteratorWrapperT<Iterator, n_items> get_iterator(Mesh& _self) {
106 return IteratorWrapperT<Iterator, n_items>(_self, typename Iterator::value_type(0));
107 }
108
112 template <class Mesh, class Iterator, size_t (ArrayKernel::*n_items)() const>
113 IteratorWrapperT<Iterator, n_items> get_skipping_iterator(Mesh& _self) {
114 return IteratorWrapperT<Iterator, n_items>(_self, typename Iterator::value_type(0), true);
115 }
116
127 template <class Mesh, class Circulator, class CenterEntityHandle>
128 CirculatorWrapperT<Circulator, CenterEntityHandle> get_circulator(Mesh& _self, CenterEntityHandle _handle) {
129 return CirculatorWrapperT<Circulator, CenterEntityHandle>(_self, _handle);
130 }
131
146 template <class Mesh>
147 void garbage_collection(Mesh& _self, list& _vh_to_update, list& _hh_to_update, list& _fh_to_update, bool _v = true, bool _e = true, bool _f = true) {
148 // Convert list of handles to vector of pointers
149 stl_input_iterator<VertexHandle*> vh_begin(_vh_to_update);
150 stl_input_iterator<VertexHandle*> vh_end;
151 std::vector<VertexHandle*> vh_vector;
152 vh_vector.insert(vh_vector.end(), vh_begin, vh_end);
153
154 // Convert list of handles to vector of pointers
155 stl_input_iterator<HalfedgeHandle*> hh_begin(_hh_to_update);
156 stl_input_iterator<HalfedgeHandle*> hh_end;
157 std::vector<HalfedgeHandle*> hh_vector;
158 hh_vector.insert(hh_vector.end(), hh_begin, hh_end);
159
160 // Convert list of handles to vector of pointers
161 stl_input_iterator<FaceHandle*> fh_begin(_fh_to_update);
162 stl_input_iterator<FaceHandle*> fh_end;
163 std::vector<FaceHandle*> fh_vector;
164 fh_vector.insert(fh_vector.end(), fh_begin, fh_end);
165
166 // Call garbage collection
167 _self.garbage_collection(vh_vector, hh_vector, fh_vector, _v, _e, _f);
168 }
169
178 template<class Mesh>
179 FaceHandle add_face(Mesh& _self, const list& _vhandles) {
180 stl_input_iterator<VertexHandle> begin(_vhandles);
181 stl_input_iterator<VertexHandle> end;
182
183 std::vector<VertexHandle> vector;
184 vector.insert(vector.end(), begin, end);
185
186 return _self.add_face(vector);
187 }
188
199 template <class Class>
200 void expose_type_specific_functions(Class& _class) {
201 // See the template specializations below
202 }
203
207 template <>
208 void expose_type_specific_functions(class_<PolyMesh>& _class) {
209 typedef PolyMesh::Scalar Scalar;
210 typedef PolyMesh::Point Point;
211 typedef PolyMesh::Normal Normal;
212 typedef PolyMesh::Color Color;
213
214 FaceHandle (PolyMesh::*add_face_3_vh)(VertexHandle, VertexHandle, VertexHandle ) = &PolyMesh::add_face;
215 FaceHandle (PolyMesh::*add_face_4_vh)(VertexHandle, VertexHandle, VertexHandle, VertexHandle) = &PolyMesh::add_face;
216 FaceHandle (*add_face_list)(PolyMesh&, const list&) = &add_face;
217
218 void (PolyMesh::*split_eh_pt)(EdgeHandle, const Point&) = &PolyMesh::split;
219 void (PolyMesh::*split_eh_vh)(EdgeHandle, VertexHandle) = &PolyMesh::split;
220 void (PolyMesh::*split_fh_pt)(FaceHandle, const Point&) = &PolyMesh::split;
221 void (PolyMesh::*split_fh_vh)(FaceHandle, VertexHandle) = &PolyMesh::split;
222
223 Normal (PolyMesh::*calc_face_normal_pt)(const Point&, const Point&, const Point&) const = &PolyMesh::calc_face_normal;
224
225 _class
226 .def("add_face", add_face_3_vh)
227 .def("add_face", add_face_4_vh)
228 .def("add_face", add_face_list)
229
230 .def("split", split_eh_pt)
231 .def("split", split_eh_vh)
232 .def("split", split_fh_pt)
233 .def("split", split_fh_vh)
234
235 .def("split_copy", &PolyMesh::split_copy)
236
237 .def("calc_face_normal", calc_face_normal_pt)
238
239 .def("insert_edge", &PolyMesh::insert_edge)
240 ;
241 }
242
246 template <>
247 void expose_type_specific_functions(class_<TriMesh>& _class) {
248 typedef TriMesh::Scalar Scalar;
249 typedef TriMesh::Point Point;
250 typedef TriMesh::Normal Normal;
251 typedef TriMesh::Color Color;
252
253 FaceHandle (TriMesh::*add_face_3_vh)(VertexHandle, VertexHandle, VertexHandle) = &TriMesh::add_face;
254 FaceHandle (*add_face_list)(TriMesh&, const list&) = &add_face;
255
256 VertexHandle (TriMesh::*split_eh_pt)(EdgeHandle, const Point&) = &TriMesh::split;
257 void (TriMesh::*split_eh_vh)(EdgeHandle, VertexHandle) = &TriMesh::split;
258 VertexHandle (TriMesh::*split_fh_pt)(FaceHandle, const Point&) = &TriMesh::split;
259 void (TriMesh::*split_fh_vh)(FaceHandle, VertexHandle) = &TriMesh::split;
260
261 VertexHandle (TriMesh::*split_copy_eh_pt)(EdgeHandle, const Point&) = &TriMesh::split_copy;
262 void (TriMesh::*split_copy_eh_vh)(EdgeHandle, VertexHandle) = &TriMesh::split_copy;
263 VertexHandle (TriMesh::*split_copy_fh_pt)(FaceHandle, const Point&) = &TriMesh::split_copy;
264 void (TriMesh::*split_copy_fh_vh)(FaceHandle, VertexHandle) = &TriMesh::split_copy;
265
266 HalfedgeHandle (TriMesh::*vertex_split_pt)(Point, VertexHandle, VertexHandle, VertexHandle) = &TriMesh::vertex_split;
267 HalfedgeHandle (TriMesh::*vertex_split_vh)(VertexHandle, VertexHandle, VertexHandle, VertexHandle) = &TriMesh::vertex_split;
268
269 _class
270 .def("add_face", add_face_3_vh)
271 .def("add_face", add_face_list)
272
273 .def("split", split_eh_pt)
274 .def("split", split_eh_vh)
275 .def("split", split_fh_pt)
276 .def("split", split_fh_vh)
277
278 .def("split_copy", split_copy_eh_pt)
279 .def("split_copy", split_copy_eh_vh)
280 .def("split_copy", split_copy_fh_pt)
281 .def("split_copy", split_copy_fh_vh)
282
283 .def("opposite_vh", &TriMesh::opposite_vh)
284 .def("opposite_he_opposite_vh", &TriMesh::opposite_he_opposite_vh)
285
286 .def("vertex_split", vertex_split_pt)
287 .def("vertex_split", vertex_split_vh)
288
289 .def("is_flip_ok", &TriMesh::is_flip_ok)
290 .def("flip", &TriMesh::flip)
291 ;
292 }
293
294
302 template <class Mesh>
303 void expose_mesh(const char *_name) {
304 using OpenMesh::Attributes::StatusInfo;
305
306 typedef typename Mesh::Scalar Scalar;
307 typedef typename Mesh::Point Point;
308 typedef typename Mesh::Normal Normal;
309 typedef typename Mesh::Color Color;
310
311 //======================================================================
312 // KernelT Function Pointers
313 //======================================================================
314
315 // Get the i'th item
316 VertexHandle (Mesh::*vertex_handle_uint )(unsigned int) const = &Mesh::vertex_handle;
317 HalfedgeHandle (Mesh::*halfedge_handle_uint)(unsigned int) const = &Mesh::halfedge_handle;
318 EdgeHandle (Mesh::*edge_handle_uint )(unsigned int) const = &Mesh::edge_handle;
319 FaceHandle (Mesh::*face_handle_uint )(unsigned int) const = &Mesh::face_handle;
320
321 // Delete items
322 void (Mesh::*garbage_collection_bools)(bool, bool, bool) = &Mesh::garbage_collection;
323 void (*garbage_collection_lists_bools)(Mesh&, list&, list&, list&, bool, bool, bool) = &garbage_collection;
324
325 // Vertex connectivity
326 HalfedgeHandle (Mesh::*halfedge_handle_vh)(VertexHandle) const = &Mesh::halfedge_handle;
327 HalfedgeHandle (Mesh::*halfedge_handle_fh)(FaceHandle ) const = &Mesh::halfedge_handle;
328
329 // Halfedge connectivity
330 FaceHandle (Mesh::*face_handle_hh )(HalfedgeHandle) const = &Mesh::face_handle;
331 HalfedgeHandle (Mesh::*prev_halfedge_handle_hh)(HalfedgeHandle) const = &Mesh::prev_halfedge_handle;
332 EdgeHandle (Mesh::*edge_handle_hh )(HalfedgeHandle) const = &Mesh::edge_handle;
333
334 // Edge connectivity
335 HalfedgeHandle (Mesh::*halfedge_handle_eh_uint)(EdgeHandle, unsigned int) const = &Mesh::halfedge_handle;
336
337 // Set halfedge
338 void (Mesh::*set_halfedge_handle_vh_hh)(VertexHandle, HalfedgeHandle) = &Mesh::set_halfedge_handle;
339 void (Mesh::*set_halfedge_handle_fh_hh)(FaceHandle, HalfedgeHandle ) = &Mesh::set_halfedge_handle;
340
341 // Handle -> Item
342 const typename Mesh::Vertex& (Mesh::*vertex )(VertexHandle ) const = &Mesh::vertex;
343 const typename Mesh::Halfedge& (Mesh::*halfedge)(HalfedgeHandle) const = &Mesh::halfedge;
344 const typename Mesh::Edge& (Mesh::*edge )(EdgeHandle ) const = &Mesh::edge;
345 const typename Mesh::Face& (Mesh::*face )(FaceHandle ) const = &Mesh::face;
346
347 // Item -> Handle
348 VertexHandle (Mesh::*handle_v)(const typename Mesh::Vertex& ) const = &Mesh::handle;
349 HalfedgeHandle (Mesh::*handle_h)(const typename Mesh::Halfedge&) const = &Mesh::handle;
350 EdgeHandle (Mesh::*handle_e)(const typename Mesh::Edge& ) const = &Mesh::handle;
351 FaceHandle (Mesh::*handle_f)(const typename Mesh::Face& ) const = &Mesh::handle;
352
353 // Get value of a standard property (point, normal, color)
354 const typename Mesh::Point& (Mesh::*point_vh )(VertexHandle ) const = &Mesh::point;
355 const typename Mesh::Normal& (Mesh::*normal_vh)(VertexHandle ) const = &Mesh::normal;
356 const typename Mesh::Normal& (Mesh::*normal_hh)(HalfedgeHandle) const = &Mesh::normal;
357 const typename Mesh::Normal& (Mesh::*normal_fh)(FaceHandle ) const = &Mesh::normal;
358 const typename Mesh::Color& (Mesh::*color_vh )(VertexHandle ) const = &Mesh::color;
359 const typename Mesh::Color& (Mesh::*color_hh )(HalfedgeHandle) const = &Mesh::color;
360 const typename Mesh::Color& (Mesh::*color_eh )(EdgeHandle ) const = &Mesh::color;
361 const typename Mesh::Color& (Mesh::*color_fh )(FaceHandle ) const = &Mesh::color;
362
363 // Get value of a standard property (texture coordinate)
364 const typename Mesh::TexCoord1D& (Mesh::*texcoord1D_vh)(VertexHandle ) const = &Mesh::texcoord1D;
365 const typename Mesh::TexCoord1D& (Mesh::*texcoord1D_hh)(HalfedgeHandle) const = &Mesh::texcoord1D;
366 const typename Mesh::TexCoord2D& (Mesh::*texcoord2D_vh)(VertexHandle ) const = &Mesh::texcoord2D;
367 const typename Mesh::TexCoord2D& (Mesh::*texcoord2D_hh)(HalfedgeHandle) const = &Mesh::texcoord2D;
368 const typename Mesh::TexCoord3D& (Mesh::*texcoord3D_vh)(VertexHandle ) const = &Mesh::texcoord3D;
369 const typename Mesh::TexCoord3D& (Mesh::*texcoord3D_hh)(HalfedgeHandle) const = &Mesh::texcoord3D;
370
371 // Get value of a standard property (status)
372 const StatusInfo& (Mesh::*status_vh)(VertexHandle ) const = &Mesh::status;
373 const StatusInfo& (Mesh::*status_hh)(HalfedgeHandle) const = &Mesh::status;
374 const StatusInfo& (Mesh::*status_eh)(EdgeHandle ) const = &Mesh::status;
375 const StatusInfo& (Mesh::*status_fh)(FaceHandle ) const = &Mesh::status;
376
377 // Set value of a standard property (point, normal, color)
378 void (Mesh::*set_normal_vh)(VertexHandle, const typename Mesh::Normal&) = &Mesh::set_normal;
379 void (Mesh::*set_normal_hh)(HalfedgeHandle, const typename Mesh::Normal&) = &Mesh::set_normal;
380 void (Mesh::*set_normal_fh)(FaceHandle, const typename Mesh::Normal&) = &Mesh::set_normal;
381 void (Mesh::*set_color_vh )(VertexHandle, const typename Mesh::Color& ) = &Mesh::set_color;
382 void (Mesh::*set_color_hh )(HalfedgeHandle, const typename Mesh::Color& ) = &Mesh::set_color;
383 void (Mesh::*set_color_eh )(EdgeHandle, const typename Mesh::Color& ) = &Mesh::set_color;
384 void (Mesh::*set_color_fh )(FaceHandle, const typename Mesh::Color& ) = &Mesh::set_color;
385
386 // Set value of a standard property (texture coordinate)
387 void (Mesh::*set_texcoord1D_vh)(VertexHandle, const typename Mesh::TexCoord1D&) = &Mesh::set_texcoord1D;
388 void (Mesh::*set_texcoord1D_hh)(HalfedgeHandle, const typename Mesh::TexCoord1D&) = &Mesh::set_texcoord1D;
389 void (Mesh::*set_texcoord2D_vh)(VertexHandle, const typename Mesh::TexCoord2D&) = &Mesh::set_texcoord2D;
390 void (Mesh::*set_texcoord2D_hh)(HalfedgeHandle, const typename Mesh::TexCoord2D&) = &Mesh::set_texcoord2D;
391 void (Mesh::*set_texcoord3D_vh)(VertexHandle, const typename Mesh::TexCoord3D&) = &Mesh::set_texcoord3D;
392 void (Mesh::*set_texcoord3D_hh)(HalfedgeHandle, const typename Mesh::TexCoord3D&) = &Mesh::set_texcoord3D;
393
394 // Set value of a standard property (status)
395 void (*set_status_vh)(Mesh&, VertexHandle, const StatusInfo&) = &set_status;
396 void (*set_status_hh)(Mesh&, HalfedgeHandle, const StatusInfo&) = &set_status;
397 void (*set_status_eh)(Mesh&, EdgeHandle, const StatusInfo&) = &set_status;
398 void (*set_status_fh)(Mesh&, FaceHandle, const StatusInfo&) = &set_status;
399
400 // Property management - add property
401 void (Mesh::*add_property_vph)(VPropHandleT<object>&, const std::string&) = &Mesh::add_property;
402 void (Mesh::*add_property_eph)(EPropHandleT<object>&, const std::string&) = &Mesh::add_property;
403 void (Mesh::*add_property_hph)(HPropHandleT<object>&, const std::string&) = &Mesh::add_property;
404 void (Mesh::*add_property_fph)(FPropHandleT<object>&, const std::string&) = &Mesh::add_property;
405 void (Mesh::*add_property_mph)(MPropHandleT<object>&, const std::string&) = &Mesh::add_property;
406
407 // Property management - remove property
408 void (Mesh::*remove_property_vph)(VPropHandleT<object>&) = &Mesh::remove_property;
409 void (Mesh::*remove_property_eph)(EPropHandleT<object>&) = &Mesh::remove_property;
410 void (Mesh::*remove_property_hph)(HPropHandleT<object>&) = &Mesh::remove_property;
411 void (Mesh::*remove_property_fph)(FPropHandleT<object>&) = &Mesh::remove_property;
412 void (Mesh::*remove_property_mph)(MPropHandleT<object>&) = &Mesh::remove_property;
413
414 // Property management - get property by name
415 bool (Mesh::*get_property_handle_vph)(VPropHandleT<object>&, const std::string&) const = &Mesh::get_property_handle;
416 bool (Mesh::*get_property_handle_eph)(EPropHandleT<object>&, const std::string&) const = &Mesh::get_property_handle;
417 bool (Mesh::*get_property_handle_hph)(HPropHandleT<object>&, const std::string&) const = &Mesh::get_property_handle;
418 bool (Mesh::*get_property_handle_fph)(FPropHandleT<object>&, const std::string&) const = &Mesh::get_property_handle;
419 bool (Mesh::*get_property_handle_mph)(MPropHandleT<object>&, const std::string&) const = &Mesh::get_property_handle;
420
421 // Property management - get property value for an item
422 const object& (Mesh::*property_vertex )(VPropHandleT<object>, VertexHandle ) const = &Mesh::property;
423 const object& (Mesh::*property_edge )(EPropHandleT<object>, EdgeHandle ) const = &Mesh::property;
424 const object& (Mesh::*property_halfedge)(HPropHandleT<object>, HalfedgeHandle) const = &Mesh::property;
425 const object& (Mesh::*property_face )(FPropHandleT<object>, FaceHandle ) const = &Mesh::property;
426 const object& (Mesh::*property_mesh )(MPropHandleT<object> ) const = &Mesh::property;
427
428 // Property management - set property value for an item
429 void (*set_property_vertex )(Mesh&, VPropHandleT<object>, VertexHandle, const object&) = &set_property;
430 void (*set_property_edge )(Mesh&, EPropHandleT<object>, EdgeHandle, const object&) = &set_property;
431 void (*set_property_halfedge)(Mesh&, HPropHandleT<object>, HalfedgeHandle, const object&) = &set_property;
432 void (*set_property_face )(Mesh&, FPropHandleT<object>, FaceHandle, const object&) = &set_property;
433 void (*set_property_mesh )(Mesh&, MPropHandleT<object>, const object&) = &set_property;
434
435 // Low-level adding new items
436 VertexHandle (Mesh::*new_vertex_void )(void ) = &Mesh::new_vertex;
437 VertexHandle (Mesh::*new_vertex_point)(const typename Mesh::Point& ) = &Mesh::new_vertex;
438 FaceHandle (Mesh::*new_face_void )(void ) = &Mesh::new_face;
439 FaceHandle (Mesh::*new_face_face )(const typename Mesh::Face& ) = &Mesh::new_face;
440
441 // Kernel item iterators
442 IteratorWrapperT<typename Mesh::VertexIter, &Mesh::n_vertices > (*vertices )(Mesh&) = &get_iterator;
443 IteratorWrapperT<typename Mesh::HalfedgeIter, &Mesh::n_halfedges> (*halfedges)(Mesh&) = &get_iterator;
444 IteratorWrapperT<typename Mesh::EdgeIter, &Mesh::n_edges > (*edges )(Mesh&) = &get_iterator;
445 IteratorWrapperT<typename Mesh::FaceIter, &Mesh::n_faces > (*faces )(Mesh&) = &get_iterator;
446
447 IteratorWrapperT<typename Mesh::VertexIter, &Mesh::n_vertices > (*svertices )(Mesh&) = &get_skipping_iterator;
448 IteratorWrapperT<typename Mesh::HalfedgeIter, &Mesh::n_halfedges> (*shalfedges)(Mesh&) = &get_skipping_iterator;
449 IteratorWrapperT<typename Mesh::EdgeIter, &Mesh::n_edges > (*sedges )(Mesh&) = &get_skipping_iterator;
450 IteratorWrapperT<typename Mesh::FaceIter, &Mesh::n_faces > (*sfaces )(Mesh&) = &get_skipping_iterator;
451
452 //======================================================================
453 // BaseKernel Function Pointers
454 //======================================================================
455
456 // Copy property
457 void (Mesh::*copy_property_vprop)(VPropHandleT<object>&, VertexHandle, VertexHandle ) = &Mesh::copy_property;
458 void (Mesh::*copy_property_hprop)(HPropHandleT<object>, HalfedgeHandle, HalfedgeHandle) = &Mesh::copy_property;
459 void (Mesh::*copy_property_eprop)(EPropHandleT<object>, EdgeHandle, EdgeHandle ) = &Mesh::copy_property;
460 void (Mesh::*copy_property_fprop)(FPropHandleT<object>, FaceHandle, FaceHandle ) = &Mesh::copy_property;
461
462 // Copy all properties
463 void (Mesh::*copy_all_properties_vh_vh_bool)(VertexHandle, VertexHandle, bool) = &Mesh::copy_all_properties;
464 void (Mesh::*copy_all_properties_hh_hh_bool)(HalfedgeHandle, HalfedgeHandle, bool) = &Mesh::copy_all_properties;
465 void (Mesh::*copy_all_properties_eh_eh_bool)(EdgeHandle, EdgeHandle, bool) = &Mesh::copy_all_properties;
466 void (Mesh::*copy_all_properties_fh_fh_bool)(FaceHandle, FaceHandle, bool) = &Mesh::copy_all_properties;
467
468 //======================================================================
469 // PolyConnectivity Function Pointers
470 //======================================================================
471
472 // Assign connectivity
473 void (*assign_connectivity_poly)(Mesh&, const PolyMesh&) = &assign_connectivity;
474 void (*assign_connectivity_tri )(Mesh&, const TriMesh& ) = &assign_connectivity;
475
476 // Vertex and face valence
477 unsigned int (Mesh::*valence_vh)(VertexHandle) const = &Mesh::valence;
478 unsigned int (Mesh::*valence_fh)(FaceHandle ) const = &Mesh::valence;
479
480 // Triangulate face or mesh
481 void (Mesh::*triangulate_fh )(FaceHandle) = &Mesh::triangulate;
482 void (Mesh::*triangulate_void)( ) = &Mesh::triangulate;
483
484 // Deleting mesh items and other connectivity/topology modifications
485 void (Mesh::*delete_vertex)(VertexHandle, bool) = &Mesh::delete_vertex;
486 void (Mesh::*delete_edge )(EdgeHandle, bool) = &Mesh::delete_edge;
487 void (Mesh::*delete_face )(FaceHandle, bool) = &Mesh::delete_face;
488
489 // Vertex and Face circulators
490 CirculatorWrapperT<typename Mesh::VertexVertexIter, VertexHandle > (*vv )(Mesh&, VertexHandle ) = &get_circulator;
491 CirculatorWrapperT<typename Mesh::VertexIHalfedgeIter, VertexHandle > (*vih)(Mesh&, VertexHandle ) = &get_circulator;
492 CirculatorWrapperT<typename Mesh::VertexOHalfedgeIter, VertexHandle > (*voh)(Mesh&, VertexHandle ) = &get_circulator;
493 CirculatorWrapperT<typename Mesh::VertexEdgeIter, VertexHandle > (*ve )(Mesh&, VertexHandle ) = &get_circulator;
494 CirculatorWrapperT<typename Mesh::VertexFaceIter, VertexHandle > (*vf )(Mesh&, VertexHandle ) = &get_circulator;
495 CirculatorWrapperT<typename Mesh::FaceVertexIter, FaceHandle > (*fv )(Mesh&, FaceHandle ) = &get_circulator;
496 CirculatorWrapperT<typename Mesh::FaceHalfedgeIter, FaceHandle > (*fh )(Mesh&, FaceHandle ) = &get_circulator;
497 CirculatorWrapperT<typename Mesh::FaceEdgeIter, FaceHandle > (*fe )(Mesh&, FaceHandle ) = &get_circulator;
498 CirculatorWrapperT<typename Mesh::FaceFaceIter, FaceHandle > (*ff )(Mesh&, FaceHandle ) = &get_circulator;
499 CirculatorWrapperT<typename Mesh::HalfedgeLoopIter, HalfedgeHandle> (*hl )(Mesh&, HalfedgeHandle) = &get_circulator;
500
501 // Boundary and manifold tests
502 bool (Mesh::*is_boundary_hh)(HalfedgeHandle ) const = &Mesh::is_boundary;
503 bool (Mesh::*is_boundary_eh)(EdgeHandle ) const = &Mesh::is_boundary;
504 bool (Mesh::*is_boundary_vh)(VertexHandle ) const = &Mesh::is_boundary;
505 bool (Mesh::*is_boundary_fh)(FaceHandle, bool) const = &Mesh::is_boundary;
506
507 // Generic handle derefertiation
508 const typename Mesh::Vertex& (Mesh::*deref_vh)(VertexHandle ) const = &Mesh::deref;
509 const typename Mesh::Halfedge& (Mesh::*deref_hh)(HalfedgeHandle) const = &Mesh::deref;
510 const typename Mesh::Edge& (Mesh::*deref_eh)(EdgeHandle ) const = &Mesh::deref;
511 const typename Mesh::Face& (Mesh::*deref_fh)(FaceHandle ) const = &Mesh::deref;
512
513 //======================================================================
514 // PolyMeshT Function Pointers
515 //======================================================================
516
517 void (Mesh::*calc_edge_vector_eh_normal)(EdgeHandle, Normal&) const = &Mesh::calc_edge_vector;
518 void (Mesh::*calc_edge_vector_hh_normal)(HalfedgeHandle, Normal&) const = &Mesh::calc_edge_vector;
519
520 Normal (Mesh::*calc_edge_vector_eh)(EdgeHandle ) const = &Mesh::calc_edge_vector;
521 Normal (Mesh::*calc_edge_vector_hh)(HalfedgeHandle) const = &Mesh::calc_edge_vector;
522
523 Scalar (Mesh::*calc_edge_length_eh)(EdgeHandle ) const = &Mesh::calc_edge_length;
524 Scalar (Mesh::*calc_edge_length_hh)(HalfedgeHandle) const = &Mesh::calc_edge_length;
525
526 Scalar (Mesh::*calc_edge_sqr_length_eh)(EdgeHandle ) const = &Mesh::calc_edge_sqr_length;
527 Scalar (Mesh::*calc_edge_sqr_length_hh)(HalfedgeHandle) const = &Mesh::calc_edge_sqr_length;
528
529 Scalar (Mesh::*calc_dihedral_angle_fast_hh)(HalfedgeHandle) const = &Mesh::calc_dihedral_angle_fast;
530 Scalar (Mesh::*calc_dihedral_angle_fast_eh)(EdgeHandle ) const = &Mesh::calc_dihedral_angle_fast;
531
532 Scalar (Mesh::*calc_dihedral_angle_hh)(HalfedgeHandle) const = &Mesh::calc_dihedral_angle;
533 Scalar (Mesh::*calc_dihedral_angle_eh)(EdgeHandle ) const = &Mesh::calc_dihedral_angle;
534
535 unsigned int (Mesh::*find_feature_edges)(Scalar) = &Mesh::find_feature_edges;
536
537 void (Mesh::*split_fh_vh)(FaceHandle, VertexHandle) = &Mesh::split;
538 void (Mesh::*split_eh_vh)(EdgeHandle, VertexHandle) = &Mesh::split;
539
540 void (Mesh::*update_normal_fh)(FaceHandle ) = &Mesh::update_normal;
541 void (Mesh::*update_normal_hh)(HalfedgeHandle, double) = &Mesh::update_normal;
542 void (Mesh::*update_normal_vh)(VertexHandle ) = &Mesh::update_normal;
543
544 void (Mesh::*update_halfedge_normals)(double) = &Mesh::update_halfedge_normals;
545
546 Normal (Mesh::*calc_face_normal )(FaceHandle ) const = &Mesh::calc_face_normal;
547 Normal (Mesh::*calc_halfedge_normal)(HalfedgeHandle, double) const = &Mesh::calc_halfedge_normal;
548
549 void (Mesh::*calc_face_centroid_fh_point)(FaceHandle, Point&) const = &Mesh::calc_face_centroid;
550 Point (Mesh::*calc_face_centroid_fh )(FaceHandle ) const = &Mesh::calc_face_centroid;
551
552 //======================================================================
553 // Mesh Type
554 //======================================================================
555
556 class_<Mesh> class_mesh(_name);
557
558 class_mesh
559
560 //======================================================================
561 // KernelT
562 //======================================================================
563
564 .def("reserve", &Mesh::reserve)
565
566 .def("vertex", vertex, return_value_policy<reference_existing_object>())
567 .def("halfedge", halfedge, return_value_policy<reference_existing_object>())
568 .def("edge", edge, return_value_policy<reference_existing_object>())
569 .def("face", face, return_value_policy<reference_existing_object>())
570
571 .def("handle", handle_v)
572 .def("handle", handle_h)
573 .def("handle", handle_e)
574 .def("handle", handle_f)
575
576 .def("vertex_handle", vertex_handle_uint)
577 .def("halfedge_handle", halfedge_handle_uint)
578 .def("edge_handle", edge_handle_uint)
579 .def("face_handle", face_handle_uint)
580
581 .def("clear", &Mesh::clear)
582 .def("clean", &Mesh::clean)
583 .def("garbage_collection", garbage_collection_bools, garbage_collection_overloads())
584 .def("garbage_collection", garbage_collection_lists_bools)
585
586 .def("n_vertices", &Mesh::n_vertices)
587 .def("n_halfedges", &Mesh::n_halfedges)
588 .def("n_edges", &Mesh::n_edges)
589 .def("n_faces", &Mesh::n_faces)
590 .def("vertices_empty", &Mesh::vertices_empty)
591 .def("halfedges_empty", &Mesh::halfedges_empty)
592 .def("edges_empty", &Mesh::edges_empty)
593 .def("faces_empty", &Mesh::faces_empty)
594
595 .def("halfedge_handle", halfedge_handle_vh)
596 .def("set_halfedge_handle", set_halfedge_handle_vh_hh)
597
598 .def("to_vertex_handle", &Mesh::to_vertex_handle)
599 .def("from_vertex_handle", &Mesh::from_vertex_handle)
600 .def("set_vertex_handle", &Mesh::set_vertex_handle)
601 .def("face_handle", face_handle_hh)
602 .def("set_face_handle", &Mesh::set_face_handle)
603 .def("next_halfedge_handle", &Mesh::next_halfedge_handle)
604 .def("set_next_halfedge_handle", &Mesh::set_next_halfedge_handle)
605 .def("prev_halfedge_handle", prev_halfedge_handle_hh)
606 .def("opposite_halfedge_handle", &Mesh::opposite_halfedge_handle)
607 .def("ccw_rotated_halfedge_handle", &Mesh::ccw_rotated_halfedge_handle)
608 .def("cw_rotated_halfedge_handle", &Mesh::cw_rotated_halfedge_handle)
609 .def("edge_handle", edge_handle_hh)
610
611 .def("halfedge_handle", halfedge_handle_eh_uint)
612
613 .def("halfedge_handle", halfedge_handle_fh)
614 .def("set_halfedge_handle", set_halfedge_handle_fh_hh)
615
616 .def("point", point_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
617 .def("set_point", &Mesh::set_point)
618 .def("normal", normal_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
619 .def("set_normal", set_normal_vh)
620 .def("normal", normal_hh, OPENMESH_PYTHON_DEFAULT_POLICY)
621 .def("set_normal", set_normal_hh)
622 .def("color", color_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
623 .def("set_color", set_color_vh)
624 .def("texcoord1D", texcoord1D_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
625 .def("set_texcoord1D", set_texcoord1D_vh)
626 .def("texcoord2D", texcoord2D_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
627 .def("set_texcoord2D", set_texcoord2D_vh)
628 .def("texcoord3D", texcoord3D_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
629 .def("set_texcoord3D", set_texcoord3D_vh)
630 .def("texcoord1D", texcoord1D_hh, OPENMESH_PYTHON_DEFAULT_POLICY)
631 .def("set_texcoord1D", set_texcoord1D_hh)
632 .def("texcoord2D", texcoord2D_hh, OPENMESH_PYTHON_DEFAULT_POLICY)
633 .def("set_texcoord2D", set_texcoord2D_hh)
634 .def("texcoord3D", texcoord3D_hh, OPENMESH_PYTHON_DEFAULT_POLICY)
635 .def("set_texcoord3D", set_texcoord3D_hh)
636 .def("status", status_vh, OPENMESH_PYTHON_DEFAULT_POLICY)
637 .def("set_status", set_status_vh)
638 .def("status", status_hh, OPENMESH_PYTHON_DEFAULT_POLICY)
639 .def("set_status", set_status_hh)
640 .def("color", color_hh, OPENMESH_PYTHON_DEFAULT_POLICY)
641 .def("set_color", set_color_hh)
642 .def("color", color_eh, OPENMESH_PYTHON_DEFAULT_POLICY)
643 .def("set_color", set_color_eh)
644 .def("status", status_eh, OPENMESH_PYTHON_DEFAULT_POLICY)
645 .def("set_status", set_status_eh)
646 .def("normal", normal_fh, OPENMESH_PYTHON_DEFAULT_POLICY)
647 .def("set_normal", set_normal_fh)
648 .def("color", color_fh, OPENMESH_PYTHON_DEFAULT_POLICY)
649 .def("set_color", set_color_fh)
650 .def("status", status_fh, OPENMESH_PYTHON_DEFAULT_POLICY)
651 .def("set_status", set_status_fh)
652
653 .def("request_vertex_normals", &Mesh::request_vertex_normals)
654 .def("request_vertex_colors", &Mesh::request_vertex_colors)
655 .def("request_vertex_texcoords1D", &Mesh::request_vertex_texcoords1D)
656 .def("request_vertex_texcoords2D", &Mesh::request_vertex_texcoords2D)
657 .def("request_vertex_texcoords3D", &Mesh::request_vertex_texcoords3D)
658 .def("request_vertex_status", &Mesh::request_vertex_status)
659 .def("request_halfedge_status", &Mesh::request_halfedge_status)
660 .def("request_halfedge_normals", &Mesh::request_halfedge_normals)
661 .def("request_halfedge_colors", &Mesh::request_halfedge_colors)
662 .def("request_halfedge_texcoords1D", &Mesh::request_halfedge_texcoords1D)
663 .def("request_halfedge_texcoords2D", &Mesh::request_halfedge_texcoords2D)
664 .def("request_halfedge_texcoords3D", &Mesh::request_halfedge_texcoords3D)
665 .def("request_edge_status", &Mesh::request_edge_status)
666 .def("request_edge_colors", &Mesh::request_edge_colors)
667 .def("request_face_normals", &Mesh::request_face_normals)
668 .def("request_face_colors", &Mesh::request_face_colors)
669 .def("request_face_status", &Mesh::request_face_status)
670 .def("request_face_texture_index", &Mesh::request_face_texture_index)
671
672 .def("release_vertex_normals", &Mesh::release_vertex_normals)
673 .def("release_vertex_colors", &Mesh::release_vertex_colors)
674 .def("release_vertex_texcoords1D", &Mesh::release_vertex_texcoords1D)
675 .def("release_vertex_texcoords2D", &Mesh::release_vertex_texcoords2D)
676 .def("release_vertex_texcoords3D", &Mesh::release_vertex_texcoords3D)
677 .def("release_vertex_status", &Mesh::release_vertex_status)
678 .def("release_halfedge_status", &Mesh::release_halfedge_status)
679 .def("release_halfedge_normals", &Mesh::release_halfedge_normals)
680 .def("release_halfedge_colors", &Mesh::release_halfedge_colors)
681 .def("release_halfedge_texcoords1D", &Mesh::release_halfedge_texcoords1D)
682 .def("release_halfedge_texcoords2D", &Mesh::release_halfedge_texcoords2D)
683 .def("release_halfedge_texcoords3D", &Mesh::release_halfedge_texcoords3D)
684 .def("release_edge_status", &Mesh::release_edge_status)
685 .def("release_edge_colors", &Mesh::release_edge_colors)
686 .def("release_face_normals", &Mesh::release_face_normals)
687 .def("release_face_colors", &Mesh::release_face_colors)
688 .def("release_face_status", &Mesh::release_face_status)
689 .def("release_face_texture_index", &Mesh::release_face_texture_index)
690
691 .def("has_vertex_normals", &Mesh::has_vertex_normals)
692 .def("has_vertex_colors", &Mesh::has_vertex_colors)
693 .def("has_vertex_texcoords1D", &Mesh::has_vertex_texcoords1D)
694 .def("has_vertex_texcoords2D", &Mesh::has_vertex_texcoords2D)
695 .def("has_vertex_texcoords3D", &Mesh::has_vertex_texcoords3D)
696 .def("has_vertex_status", &Mesh::has_vertex_status)
697 .def("has_halfedge_status", &Mesh::has_halfedge_status)
698 .def("has_halfedge_normals", &Mesh::has_halfedge_normals)
699 .def("has_halfedge_colors", &Mesh::has_halfedge_colors)
700 .def("has_halfedge_texcoords1D", &Mesh::has_halfedge_texcoords1D)
701 .def("has_halfedge_texcoords2D", &Mesh::has_halfedge_texcoords2D)
702 .def("has_halfedge_texcoords3D", &Mesh::has_halfedge_texcoords3D)
703 .def("has_edge_status", &Mesh::has_edge_status)
704 .def("has_edge_colors", &Mesh::has_edge_colors)
705 .def("has_face_normals", &Mesh::has_face_normals)
706 .def("has_face_colors", &Mesh::has_face_colors)
707 .def("has_face_status", &Mesh::has_face_status)
708 .def("has_face_texture_index", &Mesh::has_face_texture_index)
709
710 .def("add_property", add_property_vph, add_property_overloads())
711 .def("add_property", add_property_eph, add_property_overloads())
712 .def("add_property", add_property_hph, add_property_overloads())
713 .def("add_property", add_property_fph, add_property_overloads())
714 .def("add_property", add_property_mph, add_property_overloads())
715
716 .def("remove_property", remove_property_vph)
717 .def("remove_property", remove_property_eph)
718 .def("remove_property", remove_property_hph)
719 .def("remove_property", remove_property_fph)
720 .def("remove_property", remove_property_mph)
721
722 .def("get_property_handle", get_property_handle_vph)
723 .def("get_property_handle", get_property_handle_eph)
724 .def("get_property_handle", get_property_handle_hph)
725 .def("get_property_handle", get_property_handle_fph)
726 .def("get_property_handle", get_property_handle_mph)
727
728 .def("property", property_vertex, OPENMESH_PYTHON_DEFAULT_POLICY)
729 .def("property", property_edge, OPENMESH_PYTHON_DEFAULT_POLICY)
730 .def("property", property_halfedge, OPENMESH_PYTHON_DEFAULT_POLICY)
731 .def("property", property_face, OPENMESH_PYTHON_DEFAULT_POLICY)
732 .def("property", property_mesh, OPENMESH_PYTHON_DEFAULT_POLICY)
733
734 .def("set_property", set_property_vertex)
735 .def("set_property", set_property_edge)
736 .def("set_property", set_property_halfedge)
737 .def("set_property", set_property_face)
738 .def("set_property", set_property_mesh)
739
740 .def("new_vertex", new_vertex_void)
741 .def("new_vertex", new_vertex_point)
742 .def("new_edge", &Mesh::new_edge)
743 .def("new_face", new_face_void)
744 .def("new_face", new_face_face)
745
746 .def("vertices", vertices)
747 .def("halfedges", halfedges)
748 .def("edges", edges)
749 .def("faces", faces)
750
751 .def("svertices", svertices)
752 .def("shalfedges", shalfedges)
753 .def("sedges", sedges)
754 .def("sfaces", sfaces)
755
756 //======================================================================
757 // BaseKernel
758 //======================================================================
759
760 .def("copy_property", copy_property_vprop)
761 .def("copy_property", copy_property_hprop)
762 .def("copy_property", copy_property_eprop)
763 .def("copy_property", copy_property_fprop)
764
765 .def("copy_all_properties", copy_all_properties_vh_vh_bool, copy_all_properties_overloads())
766 .def("copy_all_properties", copy_all_properties_hh_hh_bool, copy_all_properties_overloads())
767 .def("copy_all_properties", copy_all_properties_eh_eh_bool, copy_all_properties_overloads())
768 .def("copy_all_properties", copy_all_properties_fh_fh_bool, copy_all_properties_overloads())
769
770 //======================================================================
771 // PolyConnectivity
772 //======================================================================
773
774 .def("assign_connectivity", assign_connectivity_poly)
775 .def("assign_connectivity", assign_connectivity_tri)
776
777 .def("opposite_face_handle", &Mesh::opposite_face_handle)
778 .def("adjust_outgoing_halfedge", &Mesh::adjust_outgoing_halfedge)
779 .def("find_halfedge", &Mesh::find_halfedge)
780 .def("valence", valence_vh)
781 .def("valence", valence_fh)
782 .def("collapse", &Mesh::collapse)
783 .def("is_simple_link", &Mesh::is_simple_link)
784 .def("is_simply_connected", &Mesh::is_simply_connected)
785 .def("remove_edge", &Mesh::remove_edge)
786 .def("reinsert_edge", &Mesh::reinsert_edge)
787 .def("triangulate", triangulate_fh)
788 .def("triangulate", triangulate_void)
789 .def("split_edge", &Mesh::split_edge)
790 .def("split_edge_copy", &Mesh::split_edge_copy)
791
792 .def("add_vertex", &Mesh::add_vertex)
793
794 .def("is_collapse_ok", &Mesh::is_collapse_ok)
795 .def("delete_vertex", delete_vertex, delete_vertex_overloads())
796 .def("delete_edge", delete_edge, delete_edge_overloads())
797 .def("delete_face", delete_face, delete_face_overloads())
798
799 .def("vv", vv)
800 .def("vih", vih)
801 .def("voh", voh)
802 .def("ve", ve)
803 .def("vf", vf)
804
805 .def("fv", fv)
806 .def("fh", fh)
807 .def("fe", fe)
808 .def("ff", ff)
809
810 .def("hl", hl)
811
812 .def("is_boundary", is_boundary_hh)
813 .def("is_boundary", is_boundary_eh)
814 .def("is_boundary", is_boundary_vh)
815 .def("is_boundary", is_boundary_fh, is_boundary_overloads())
816 .def("is_manifold", &Mesh::is_manifold)
817
818 .def("deref", deref_vh, return_value_policy<reference_existing_object>())
819 .def("deref", deref_hh, return_value_policy<reference_existing_object>())
820 .def("deref", deref_eh, return_value_policy<reference_existing_object>())
821 .def("deref", deref_fh, return_value_policy<reference_existing_object>())
822
823 .def("is_triangles", &Mesh::is_triangles)
824 .staticmethod("is_triangles")
825
826 .def_readonly("InvalidVertexHandle", &Mesh::InvalidVertexHandle)
827 .def_readonly("InvalidHalfedgeHandle", &Mesh::InvalidHalfedgeHandle)
828 .def_readonly("InvalidEdgeHandle", &Mesh::InvalidEdgeHandle)
829 .def_readonly("InvalidFaceHandle", &Mesh::InvalidFaceHandle)
830
831 //======================================================================
832 // PolyMeshT
833 //======================================================================
834
835 .def("add_vertex", &Mesh::add_vertex)
836
837 .def("calc_edge_vector", calc_edge_vector_eh_normal)
838 .def("calc_edge_vector", calc_edge_vector_eh)
839 .def("calc_edge_vector", calc_edge_vector_hh_normal)
840 .def("calc_edge_vector", calc_edge_vector_hh)
841
842 .def("calc_edge_length", calc_edge_length_eh)
843 .def("calc_edge_length", calc_edge_length_hh)
844 .def("calc_edge_sqr_length", calc_edge_sqr_length_eh)
845 .def("calc_edge_sqr_length", calc_edge_sqr_length_hh)
846
847 .def("calc_sector_vectors", &Mesh::calc_sector_vectors)
848 .def("calc_sector_angle", &Mesh::calc_sector_angle)
849 .def("calc_sector_normal", &Mesh::calc_sector_normal)
850 .def("calc_sector_area", &Mesh::calc_sector_area)
851
852 .def("calc_dihedral_angle_fast", calc_dihedral_angle_fast_hh)
853 .def("calc_dihedral_angle_fast", calc_dihedral_angle_fast_eh)
854 .def("calc_dihedral_angle", calc_dihedral_angle_hh)
855 .def("calc_dihedral_angle", calc_dihedral_angle_eh)
856
857 .def("find_feature_edges", find_feature_edges, find_feature_edges_overloads())
858
859 .def("split", split_fh_vh)
860 .def("split", split_eh_vh)
861
862 .def("update_normals", &Mesh::update_normals)
863 .def("update_normal", update_normal_fh)
864 .def("update_face_normals", &Mesh::update_face_normals)
865
866 .def("calc_face_normal", calc_face_normal)
867
868 .def("calc_face_centroid", calc_face_centroid_fh_point)
869 .def("calc_face_centroid", calc_face_centroid_fh)
870
871 .def("update_normal", update_normal_hh, update_normal_overloads())
872 .def("update_halfedge_normals", update_halfedge_normals, update_halfedge_normals_overloads())
873
874 .def("calc_halfedge_normal", calc_halfedge_normal, calc_halfedge_normal_overloads())
875
876 .def("is_estimated_feature_edge", &Mesh::is_estimated_feature_edge)
877
878 .def("update_normal", update_normal_vh)
879 .def("update_vertex_normals", &Mesh::update_vertex_normals)
880
881 .def("calc_vertex_normal", &Mesh::calc_vertex_normal)
882 .def("calc_vertex_normal_fast", &Mesh::calc_vertex_normal_fast)
883 .def("calc_vertex_normal_correct", &Mesh::calc_vertex_normal_correct)
884 .def("calc_vertex_normal_loop", &Mesh::calc_vertex_normal_loop)
885
886 .def("is_polymesh", &Mesh::is_polymesh)
887 .staticmethod("is_polymesh")
888
889 .def("is_trimesh", &Mesh::is_trimesh)
890 .staticmethod("is_trimesh")
891 ;
892
893 expose_type_specific_functions(class_mesh);
894
895 //======================================================================
896 // Nested Types
897 //======================================================================
898
899 // Enter mesh scope
900 scope scope_mesh = class_mesh;
901
902 // Point
903 const boost::python::type_info point_info = type_id<typename Mesh::Point>();
904 const converter::registration * point_registration = converter::registry::query(point_info);
905 scope_mesh.attr("Point") = handle<>(point_registration->m_class_object);
906
907 // Normal
908 const boost::python::type_info normal_info = type_id<typename Mesh::Normal>();
909 const converter::registration * normal_registration = converter::registry::query(normal_info);
910 scope_mesh.attr("Normal") = handle<>(normal_registration->m_class_object);
911
912 // Color
913 const boost::python::type_info color_info = type_id<typename Mesh::Color>();
914 const converter::registration * color_registration = converter::registry::query(color_info);
915 scope_mesh.attr("Color") = handle<>(color_registration->m_class_object);
916
917 // TexCoord2D
918 const boost::python::type_info texcoord2d_info = type_id<typename Mesh::TexCoord2D>();
919 const converter::registration * texcoord2d_registration = converter::registry::query(texcoord2d_info);
920 scope_mesh.attr("TexCoord2D") = handle<>(texcoord2d_registration->m_class_object);
921
922 // TexCoord3D
923 const boost::python::type_info texcoord3d_info = type_id<typename Mesh::TexCoord3D>();
924 const converter::registration * texcoord3d_registration = converter::registry::query(texcoord3d_info);
925 scope_mesh.attr("TexCoord3D") = handle<>(texcoord3d_registration->m_class_object);
926 }
927
928 } // namespace OpenMesh
929 } // namespace Python
930
931 #endif
OpenMesh::Attributes::Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:88
OpenMesh::Python::set_property
void set_property(Mesh &_self, PropHandle _ph, IndexHandle _h, const object &_value)
Definition: Mesh.hh:64
OpenMesh::HPropHandleT
Definition: Property.hh:501
OpenMesh::PolyMeshT::new_vertex
VertexHandle new_vertex()
Adds a new default-initialized vertex.
Definition: PolyMeshT.hh:202
OpenMesh::PolyMesh_ArrayKernelT
Definition: PolyMesh_ArrayKernelT.hh:98
OpenMesh::TriMeshT::split_copy
VertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:280
OpenMesh::Python::IteratorWrapperT
Definition: Iterator.hh:21
OpenMesh::PolyMeshT::Color
Kernel::Color Color
Color type.
Definition: PolyMeshT.hh:119
OpenMesh::TriMeshT::is_trimesh
static bool is_trimesh()
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex ...
Definition: TriMeshT.hh:110
OpenMesh
Definition: MeshItems.hh:64
OpenMesh::PolyMeshT::calc_face_centroid
void calc_face_centroid(FaceHandle _fh, Point &_pt) const
calculates the average of the vertices defining _fh
Definition: PolyMeshT.hh:276
OpenMesh::Python::expose_mesh
void expose_mesh(const char *_name)
Definition: Mesh.hh:303
OpenMesh::PolyMeshT::calc_halfedge_normal
virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle=0.8) const
Calculate halfedge normal for one specific halfedge.
Definition: PolyMeshT.cc:289
OpenMesh::PolyMeshT::Face
Kernel::Face Face
Face type.
Definition: PolyMeshT.hh:133
OpenMesh::PolyMeshT::update_halfedge_normals
void update_halfedge_normals(const double _feature_angle=0.8)
Update normal vectors for all halfedges.
Definition: PolyMeshT.cc:274
OpenMesh::PolyMeshT::Vertex
Kernel::Vertex Vertex
Vertex type.
Definition: PolyMeshT.hh:127
OpenMesh::PolyMeshT::update_normal
void update_normal(FaceHandle _fh)
Update normal for face _fh.
Definition: PolyMeshT.hh:259
OpenMesh::PolyMeshT::Point
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:115
OpenMesh::HalfedgeHandle
Handle for a halfedge entity.
Definition: Handles.hh:132
OpenMesh::Python::expose_type_specific_functions
void expose_type_specific_functions(Class &_class)
Definition: Mesh.hh:200
OpenMesh::PolyMeshT::add_vertex
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Definition: PolyMeshT.hh:236
OpenMesh::TriMeshT::is_polymesh
static bool is_polymesh()
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex ...
Definition: TriMeshT.hh:109
OpenMesh::EPropHandleT
Definition: Property.hh:515
OpenMesh::PolyMeshT::calc_vertex_normal
Normal calc_vertex_normal(VertexHandle _vh) const
Calculate vertex normal for one specific vertex.
Definition: PolyMeshT.cc:373
OpenMesh::TriMesh_ArrayKernelT< CustomTraits >
OpenMesh::Python::CirculatorWrapperT
Definition: Circulator.hh:19
OpenMesh::PolyMeshT::find_feature_edges
unsigned int find_feature_edges(Scalar _angle_tresh=OpenMesh::deg_to_rad(44.0))
Definition: PolyMeshT.cc:79
OpenMesh::PolyMeshT::TexCoord2D
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition: PolyMeshT.hh:123
OpenMesh::Python::garbage_collection
void garbage_collection(Mesh &_self, list &_vh_to_update, list &_hh_to_update, list &_fh_to_update, bool _v=true, bool _e=true, bool _f=true)
Definition: Mesh.hh:147
OpenMesh::Python::get_skipping_iterator
IteratorWrapperT< Iterator, n_items > get_skipping_iterator(Mesh &_self)
Definition: Mesh.hh:113
OpenMesh::PolyMeshT::calc_sector_normal
void calc_sector_normal(HalfedgeHandle _in_heh, Normal &_sector_normal) const
Definition: PolyMeshT.hh:470
OpenMesh::VPropHandleT
Definition: Property.hh:487
OPENMESH_PYTHON_DEFAULT_POLICY
#define OPENMESH_PYTHON_DEFAULT_POLICY
Definition: Bindings.hh:29
OpenMesh::PolyMeshT::calc_sector_area
Scalar calc_sector_area(HalfedgeHandle _in_heh) const
Definition: PolyMeshT.hh:480
OpenMesh::Attributes::StatusInfo
Definition: Status.hh:99
OpenMesh::VertexHandle
Handle for a vertex entity.
Definition: Handles.hh:125
OpenMesh::PolyMeshT::update_vertex_normals
void update_vertex_normals()
Update normal vectors for all vertices.
Definition: PolyMeshT.cc:448
OpenMesh::PolyMeshT::calc_vertex_normal_fast
void calc_vertex_normal_fast(VertexHandle _vh, Normal &_n) const
Definition: PolyMeshT.cc:387
OpenMesh::PolyMeshT::update_face_normals
void update_face_normals()
Update normal vectors for all faces.
Definition: PolyMeshT.cc:259
OpenMesh::PolyMeshT::Edge
Kernel::Edge Edge
Edge type.
Definition: PolyMeshT.hh:131
OpenMesh::EdgeHandle
Handle for a edge entity.
Definition: Handles.hh:139
OpenMesh::PolyMeshT::calc_vertex_normal_loop
void calc_vertex_normal_loop(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition: PolyMeshT.cc:425
OpenMesh::PolyMeshT::TexCoord3D
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition: PolyMeshT.hh:125
OpenMesh::FaceHandle
Handle for a face entity.
Definition: Handles.hh:146
OpenMesh::PolyMeshT::Scalar
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:113
OpenMesh::PolyMeshT::calc_vertex_normal_correct
void calc_vertex_normal_correct(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition: PolyMeshT.cc:397
OpenMesh::TriMeshT::split
VertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:266
OpenMesh::PolyMeshT::TexCoord1D
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition: PolyMeshT.hh:121
Bindings.hh
OpenMesh::FPropHandleT
Definition: Property.hh:529
OpenMesh::PolyMeshT::update_normals
void update_normals()
Compute normals for all primitives.
Definition: PolyMeshT.cc:241
OpenMesh::Python::assign_connectivity
void assign_connectivity(Mesh &_self, const OtherMesh &_other)
Definition: Mesh.hh:97
OpenMesh::Attributes::Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
OpenMesh::Python::set_status
void set_status(Mesh &_self, IndexHandle _h, const OpenMesh::Attributes::StatusInfo &_info)
Definition: Mesh.hh:43
OpenMesh::PolyMeshT::calc_sector_angle
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
Definition: PolyMeshT.hh:425
OpenMesh::TriMeshT::calc_face_normal
Normal calc_face_normal(FaceHandle _fh) const
Definition: TriMeshT.cc:79
OpenMesh::Python::add_face
FaceHandle add_face(Mesh &_self, const list &_vhandles)
Definition: Mesh.hh:179
OpenMesh::TriMeshT::vertex_split
HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
Definition: TriMeshT.hh:213
OpenMesh::PolyMeshT::calc_edge_vector
void calc_edge_vector(EdgeHandle _eh, Normal &_edge_vec) const
Definition: PolyMeshT.hh:364
OpenMesh::Python::get_iterator
IteratorWrapperT< Iterator, n_items > get_iterator(Mesh &_self)
Definition: Mesh.hh:105
OpenMesh::Python::get_circulator
CirculatorWrapperT< Circulator, CenterEntityHandle > get_circulator(Mesh &_self, CenterEntityHandle _handle)
Definition: Mesh.hh:128
OpenMesh::MPropHandleT
Definition: Property.hh:543
OpenMesh::PolyMeshT::calc_dihedral_angle_fast
Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
Definition: PolyMeshT.hh:489
OpenMesh::PolyMeshT::split
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition: PolyMeshT.hh:545
OpenMesh::PolyMeshT::Halfedge
Kernel::Halfedge Halfedge
Halfedge type.
Definition: PolyMeshT.hh:129
OpenMesh::PolyMeshT::is_estimated_feature_edge
bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const
Definition: PolyMeshT.cc:342
OpenMesh::PolyMeshT::Normal
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:117
OpenMesh::PolyMeshT::calc_sector_vectors
void calc_sector_vectors(HalfedgeHandle _in_heh, Normal &_vec0, Normal &_vec1) const
Definition: PolyMeshT.hh:414
OpenMesh::PolyMeshT::calc_face_normal
virtual Normal calc_face_normal(FaceHandle _fh) const
Definition: PolyMeshT.cc:102