1 #ifndef OPENMESH_PYTHON_MESH_HH
2 #define OPENMESH_PYTHON_MESH_HH
5 #include "Python/Iterator.hh"
6 #include "Python/Circulator.hh"
8 #include <boost/python/stl_iterator.hpp>
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)
16 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(copy_all_properties_overloads, copy_all_properties, 2, 3)
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)
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)
42 template <class
Mesh, class IndexHandle>
44 _self.status(_h) = _info;
63 template <
class Mesh,
class PropHandle,
class IndexHandle>
65 _self.property(_ph, _h) = _value;
82 template <
class Mesh,
class PropHandle>
84 _self.property(_ph) = _value;
96 template <
class Mesh,
class OtherMesh>
98 _self.assign_connectivity(_other);
104 template <
class Mesh,
class Iterator,
size_t (ArrayKernel::*n_items)() const>
112 template <
class Mesh,
class Iterator,
size_t (ArrayKernel::*n_items)() const>
127 template <
class Mesh,
class Circulator,
class CenterEntityHandle>
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) {
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);
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);
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);
167 _self.garbage_collection(vh_vector, hh_vector, fh_vector, _v, _e, _f);
180 stl_input_iterator<VertexHandle> begin(_vhandles);
181 stl_input_iterator<VertexHandle> end;
183 std::vector<VertexHandle> vector;
184 vector.insert(vector.end(), begin, end);
186 return _self.add_face(vector);
199 template <
class Class>
215 FaceHandle (
PolyMesh::*add_face_4_vh)(VertexHandle, VertexHandle, VertexHandle, VertexHandle) = &PolyMesh::add_face;
226 .def(
"add_face", add_face_3_vh)
227 .def(
"add_face", add_face_4_vh)
228 .def(
"add_face", add_face_list)
230 .def(
"split", split_eh_pt)
231 .def(
"split", split_eh_vh)
232 .def(
"split", split_fh_pt)
233 .def(
"split", split_fh_vh)
235 .def(
"split_copy", &PolyMesh::split_copy)
237 .def(
"calc_face_normal", calc_face_normal_pt)
239 .def(
"insert_edge", &PolyMesh::insert_edge)
270 .def(
"add_face", add_face_3_vh)
271 .def(
"add_face", add_face_list)
273 .def(
"split", split_eh_pt)
274 .def(
"split", split_eh_vh)
275 .def(
"split", split_fh_pt)
276 .def(
"split", split_fh_vh)
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)
283 .def(
"opposite_vh", &TriMesh::opposite_vh)
284 .def(
"opposite_he_opposite_vh", &TriMesh::opposite_he_opposite_vh)
286 .def(
"vertex_split", vertex_split_pt)
287 .def(
"vertex_split", vertex_split_vh)
289 .def(
"is_flip_ok", &TriMesh::is_flip_ok)
290 .def(
"flip", &TriMesh::flip)
302 template <
class Mesh>
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;
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;
374 const StatusInfo& (
Mesh::*status_eh)(
EdgeHandle )
const = &Mesh::status;
375 const StatusInfo& (
Mesh::*status_fh)(
FaceHandle )
const = &Mesh::status;
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;
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;
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;
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;
477 unsigned int (Mesh::*valence_vh)(VertexHandle)
const = &Mesh::valence;
478 unsigned int (Mesh::*valence_fh)(FaceHandle )
const = &Mesh::valence;
481 void (Mesh::*triangulate_fh )(FaceHandle) = &Mesh::triangulate;
482 void (Mesh::*triangulate_void)( ) = &Mesh::triangulate;
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;
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;
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;
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;
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;
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;
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;
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;
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;
535 unsigned int (Mesh::*find_feature_edges)(Scalar) = &Mesh::find_feature_edges;
537 void (Mesh::*split_fh_vh)(FaceHandle, VertexHandle) = &Mesh::split;
538 void (Mesh::*split_eh_vh)(EdgeHandle, VertexHandle) = &Mesh::split;
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;
544 void (Mesh::*update_halfedge_normals)(double) = &Mesh::update_halfedge_normals;
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;
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;
556 class_<Mesh> class_mesh(_name);
564 .def(
"reserve", &Mesh::reserve)
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>())
571 .def(
"handle", handle_v)
572 .def(
"handle", handle_h)
573 .def(
"handle", handle_e)
574 .def(
"handle", handle_f)
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)
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)
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)
595 .def(
"halfedge_handle", halfedge_handle_vh)
596 .def(
"set_halfedge_handle", set_halfedge_handle_vh_hh)
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)
611 .def(
"halfedge_handle", halfedge_handle_eh_uint)
613 .def(
"halfedge_handle", halfedge_handle_fh)
614 .def(
"set_halfedge_handle", set_halfedge_handle_fh_hh)
617 .def(
"set_point", &Mesh::set_point)
619 .def(
"set_normal", set_normal_vh)
621 .def(
"set_normal", set_normal_hh)
623 .def(
"set_color", set_color_vh)
625 .def(
"set_texcoord1D", set_texcoord1D_vh)
627 .def(
"set_texcoord2D", set_texcoord2D_vh)
629 .def(
"set_texcoord3D", set_texcoord3D_vh)
631 .def(
"set_texcoord1D", set_texcoord1D_hh)
633 .def(
"set_texcoord2D", set_texcoord2D_hh)
635 .def(
"set_texcoord3D", set_texcoord3D_hh)
637 .def(
"set_status", set_status_vh)
639 .def(
"set_status", set_status_hh)
641 .def(
"set_color", set_color_hh)
643 .def(
"set_color", set_color_eh)
645 .def(
"set_status", set_status_eh)
647 .def(
"set_normal", set_normal_fh)
649 .def(
"set_color", set_color_fh)
651 .def(
"set_status", set_status_fh)
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)
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)
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)
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())
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)
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)
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)
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)
746 .def(
"vertices", vertices)
747 .def(
"halfedges", halfedges)
751 .def(
"svertices", svertices)
752 .def(
"shalfedges", shalfedges)
753 .def(
"sedges", sedges)
754 .def(
"sfaces", sfaces)
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)
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())
774 .def(
"assign_connectivity", assign_connectivity_poly)
775 .def(
"assign_connectivity", assign_connectivity_tri)
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)
792 .def(
"add_vertex", &Mesh::add_vertex)
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())
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)
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>())
823 .def(
"is_triangles", &Mesh::is_triangles)
824 .staticmethod(
"is_triangles")
826 .def_readonly(
"InvalidVertexHandle", &Mesh::InvalidVertexHandle)
827 .def_readonly(
"InvalidHalfedgeHandle", &Mesh::InvalidHalfedgeHandle)
828 .def_readonly(
"InvalidEdgeHandle", &Mesh::InvalidEdgeHandle)
829 .def_readonly(
"InvalidFaceHandle", &Mesh::InvalidFaceHandle)
835 .def(
"add_vertex", &Mesh::add_vertex)
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)
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)
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)
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)
857 .def(
"find_feature_edges", find_feature_edges, find_feature_edges_overloads())
859 .def(
"split", split_fh_vh)
860 .def(
"split", split_eh_vh)
862 .def(
"update_normals", &Mesh::update_normals)
863 .def(
"update_normal", update_normal_fh)
864 .def(
"update_face_normals", &Mesh::update_face_normals)
866 .def(
"calc_face_normal", calc_face_normal)
868 .def(
"calc_face_centroid", calc_face_centroid_fh_point)
869 .def(
"calc_face_centroid", calc_face_centroid_fh)
871 .def(
"update_normal", update_normal_hh, update_normal_overloads())
872 .def(
"update_halfedge_normals", update_halfedge_normals, update_halfedge_normals_overloads())
874 .def(
"calc_halfedge_normal", calc_halfedge_normal, calc_halfedge_normal_overloads())
876 .def(
"is_estimated_feature_edge", &Mesh::is_estimated_feature_edge)
878 .def(
"update_normal", update_normal_vh)
879 .def(
"update_vertex_normals", &Mesh::update_vertex_normals)
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)
886 .def(
"is_polymesh", &Mesh::is_polymesh)
887 .staticmethod(
"is_polymesh")
889 .def(
"is_trimesh", &Mesh::is_trimesh)
890 .staticmethod(
"is_trimesh")
900 scope scope_mesh = class_mesh;
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);
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);
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);
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);
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);
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:115
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:88
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:117
virtual Normal calc_face_normal(FaceHandle _fh) const
Calculate normal vector for face _fh.
Definition: PolyMeshT.cc:102
Kernel::Halfedge Halfedge
Halfedge type.
Definition: PolyMeshT.hh:129
void set_status(Mesh &_self, IndexHandle _h, const OpenMesh::Attributes::StatusInfo &_info)
Set the status of an item.
Definition: Mesh.hh:43
IteratorWrapperT< Iterator, n_items > get_iterator(Mesh &_self)
Get an iterator.
Definition: Mesh.hh:105
Handle representing an edge property.
Definition: Property.hh:515
Handle representing a vertex property.
Definition: Property.hh:487
Handle representing a mesh property.
Definition: Property.hh:543
Kernel::Edge Edge
Edge type.
Definition: PolyMeshT.hh:131
#define OPENMESH_PYTHON_DEFAULT_POLICY
Return value policy for functions that return references to objects that are managed by OpenMesh...
Definition: Bindings.hh:29
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition: PolyMeshT.hh:123
HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
Definition: TriMeshT.hh:213
Kernel::Face Face
Face type.
Definition: PolyMeshT.hh:133
CirculatorWrapperT< Circulator, CenterEntityHandle > get_circulator(Mesh &_self, CenterEntityHandle _handle)
Get a circulator.
Definition: Mesh.hh:128
IteratorWrapperT< Iterator, n_items > get_skipping_iterator(Mesh &_self)
Get a skipping iterator.
Definition: Mesh.hh:113
Kernel::Vertex Vertex
Vertex type.
Definition: PolyMeshT.hh:127
Add status information to a base class.
Definition: Status.hh:99
void expose_mesh(const char *_name)
Expose a mesh type to Python.
Definition: Mesh.hh:303
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition: PolyMeshT.hh:121
Handle representing a halfedge property.
Definition: Property.hh:501
Handle for a vertex entity.
Definition: Handles.hh:123
Wrapper for mesh item iterators.
Definition: Iterator.hh:21
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition: PolyMeshT.hh:545
FaceHandle add_face(Mesh &_self, const list &_vhandles)
Add a new face from a Python list of vertex handles.
Definition: Mesh.hh:179
Triangle mesh based on the ArrayKernel.
Definition: TriMesh_ArrayKernelT.hh:98
Handle for a edge entity.
Definition: Handles.hh:137
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)
Garbage collection using lists instead of vectors to keep track of a set of handles.
Definition: Mesh.hh:147
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:113
Polygonal mesh based on the ArrayKernel.
Definition: PolyMesh_ArrayKernelT.hh:98
void assign_connectivity(Mesh &_self, const OtherMesh &_other)
Thin wrapper for assign_connectivity.
Definition: Mesh.hh:97
Handle representing a face property.
Definition: Property.hh:529
Kernel::Color Color
Color type.
Definition: PolyMeshT.hh:119
VertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:280
VertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:266
void set_property(Mesh &_self, PropHandle _ph, IndexHandle _h, const object &_value)
Set the value of a property of an item.
Definition: Mesh.hh:64
Handle for a halfedge entity.
Definition: Handles.hh:130
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition: PolyMeshT.hh:125
Handle for a face entity.
Definition: Handles.hh:144
void expose_type_specific_functions(Class &_class)
This function template is used to expose mesh member functions that are only available for a specific...
Definition: Mesh.hh:200
Wrapper for circulators.
Definition: Circulator.hh:19