2 #include "Python/Vector.hh"
3 #include "Python/Mesh.hh"
4 #include "Python/PropertyManager.hh"
5 #include "Python/InputOutput.hh"
6 #include "Python/Decimater.hh"
17 class_<ArrayItems::Vertex>(
"Vertex");
18 class_<ArrayItems::Halfedge>(
"Halfedge");
19 class_<ArrayItems::Edge>(
"Edge");
20 class_<ArrayItems::Face>(
"Face");
27 class_<BaseHandle>(
"BaseHandle", init<optional<int> >())
37 class_<VertexHandle, bases<BaseHandle> >(
"VertexHandle", init<optional<int> >());
38 class_<HalfedgeHandle, bases<BaseHandle> >(
"HalfedgeHandle", init<optional<int> >());
39 class_<EdgeHandle, bases<BaseHandle> >(
"EdgeHandle", init<optional<int> >());
40 class_<FaceHandle, bases<BaseHandle> >(
"FaceHandle", init<optional<int> >());
42 class_<BasePropHandleT<object>, bases<BaseHandle> >(
"BasePropHandle", init<optional<int> >());
44 class_<VPropHandleT<object>, bases<BasePropHandleT<object> > >(
"VPropHandle", init<optional<int> >())
46 class_<HPropHandleT<object>, bases<BasePropHandleT<object> > >(
"HPropHandle", init<optional<int> >())
48 class_<EPropHandleT<object>, bases<BasePropHandleT<object> > >(
"EPropHandle", init<optional<int> >())
50 class_<FPropHandleT<object>, bases<BasePropHandleT<object> > >(
"FPropHandle", init<optional<int> >())
52 class_<MPropHandleT<object>, bases<BasePropHandleT<object> > >(
"MPropHandle", init<optional<int> >())
64 enum_<StatusBits>(
"StatusBits")
76 class_<StatusInfo>(
"StatusInfo")
77 .def(
"deleted", &StatusInfo::deleted)
78 .def(
"set_deleted", &StatusInfo::set_deleted)
79 .def(
"locked", &StatusInfo::locked)
80 .def(
"set_locked", &StatusInfo::set_locked)
81 .def(
"selected", &StatusInfo::selected)
82 .def(
"set_selected", &StatusInfo::set_selected)
83 .def(
"hidden", &StatusInfo::hidden)
84 .def(
"set_hidden", &StatusInfo::set_hidden)
85 .def(
"feature", &StatusInfo::feature)
86 .def(
"set_feature", &StatusInfo::set_feature)
87 .def(
"tagged", &StatusInfo::tagged)
88 .def(
"set_tagged", &StatusInfo::set_tagged)
89 .def(
"tagged2", &StatusInfo::tagged2)
90 .def(
"set_tagged2", &StatusInfo::set_tagged2)
91 .def(
"fixed_nonmanifold", &StatusInfo::fixed_nonmanifold)
92 .def(
"set_fixed_nonmanifold", &StatusInfo::set_fixed_nonmanifold)
93 .def(
"bits", &StatusInfo::bits)
94 .def(
"set_bits", &StatusInfo::set_bits)
95 .def(
"is_bit_set", &StatusInfo::is_bit_set)
96 .def(
"set_bit", &StatusInfo::set_bit)
97 .def(
"unset_bit", &StatusInfo::unset_bit)
98 .def(
"change_bit", &StatusInfo::change_bit)
102 BOOST_PYTHON_MODULE(openmesh) {
107 expose_vec<float, 2>(
"Vec2f");
108 expose_vec<float, 3>(
"Vec3f");
109 expose_vec<float, 4>(
"Vec4f");
110 expose_vec<double, 2>(
"Vec2d");
111 expose_vec<double, 3>(
"Vec3d");
112 expose_vec<double, 4>(
"Vec4d");
114 expose_mesh<PolyMesh>(
"PolyMesh");
115 expose_mesh<TriMesh>(
"TriMesh");
117 expose_iterator<OpenMesh::PolyConnectivity::VertexIter, &OpenMesh::ArrayKernel::n_vertices>(
"VertexIter");
118 expose_iterator<OpenMesh::PolyConnectivity::HalfedgeIter, &OpenMesh::ArrayKernel::n_halfedges>(
"HalfedgeIter");
119 expose_iterator<OpenMesh::PolyConnectivity::EdgeIter, &OpenMesh::ArrayKernel::n_edges>(
"EdgeIter");
120 expose_iterator<OpenMesh::PolyConnectivity::FaceIter, &OpenMesh::ArrayKernel::n_faces>(
"FaceIter");
122 expose_circulator<OpenMesh::PolyConnectivity::VertexVertexIter, VertexHandle>(
"VertexVertexIter");
123 expose_circulator<OpenMesh::PolyConnectivity::VertexIHalfedgeIter, VertexHandle>(
"VertexIHalfedgeIter");
124 expose_circulator<OpenMesh::PolyConnectivity::VertexOHalfedgeIter, VertexHandle>(
"VertexOHalfedgeIter");
125 expose_circulator<OpenMesh::PolyConnectivity::VertexEdgeIter, VertexHandle>(
"VertexEdgeIter");
126 expose_circulator<OpenMesh::PolyConnectivity::VertexFaceIter, VertexHandle>(
"VertexFaceIter");
128 expose_circulator<OpenMesh::PolyConnectivity::FaceVertexIter, FaceHandle>(
"FaceVertexIter");
129 expose_circulator<OpenMesh::PolyConnectivity::FaceHalfedgeIter, FaceHandle>(
"FaceHalfedgeIter");
130 expose_circulator<OpenMesh::PolyConnectivity::FaceEdgeIter, FaceHandle>(
"FaceEdgeIter");
131 expose_circulator<OpenMesh::PolyConnectivity::FaceFaceIter, FaceHandle>(
"FaceFaceIter");
133 expose_circulator<OpenMesh::PolyConnectivity::HalfedgeLoopIter, HalfedgeHandle>(
"HalfedgeLoopIter");
135 typedef IteratorWrapperT<PolyConnectivity::VertexIter, &ArrayKernel::n_vertices> VertexIterWrapper;
136 typedef IteratorWrapperT<PolyConnectivity::HalfedgeIter, &ArrayKernel::n_halfedges> HalfedgeIterWrapper;
137 typedef IteratorWrapperT<PolyConnectivity::EdgeIter, &ArrayKernel::n_edges> EdgeIterWrapper;
138 typedef IteratorWrapperT<PolyConnectivity::FaceIter, &ArrayKernel::n_faces> FaceIterWrapper;
140 expose_property_manager<VPropHandleT<object>,
VertexHandle, VertexIterWrapper>(
"VPropertyManager");
141 expose_property_manager<HPropHandleT<object>,
HalfedgeHandle, HalfedgeIterWrapper>(
"HPropertyManager");
142 expose_property_manager<EPropHandleT<object>,
EdgeHandle, EdgeIterWrapper>(
"EPropertyManager");
143 expose_property_manager<FPropHandleT<object>,
FaceHandle, FaceIterWrapper>(
"FPropertyManager");
147 expose_decimater<PolyMesh>(
"PolyMesh");
148 expose_decimater<TriMesh>(
"TriMesh");
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Handle for a halfedge entity.
int idx() const
Get the underlying index of this handle.
void expose_status_bits_and_info()
Item is a feature or belongs to a feature.
Handle for a vertex entity.
Handle for a edge entity.
Alternate bit for tagging an item.
Handle for a face entity.
void invalidate()
reset handle to be invalid
Item was non-two-manifold and had to be fixed.
void reset()
reset handle to be invalid