getitem MeshPoint

This commit is contained in:
Christopher Lackner 2016-08-06 12:55:59 +02:00
parent b53eedbab6
commit 17c4ce6182

View File

@ -105,13 +105,10 @@ DLL_HEADER void ExportNetgenMeshing()
.def(bp::init<Point<3>>())
.def("__str__", &ToString<MeshPoint>)
.def("__repr__", &ToString<MeshPoint>)
.add_property("p", FunctionPointer([](const MeshPoint & self)
{
bp::list l;
l.append ( self[0] );
l.append ( self[1] );
l.append ( self[2] );
return bp::tuple(l);
.def("__getitem__", FunctionPointer([](const MeshPoint & self, int index) {
if(index<0 || index>2)
bp::exec("raise IndexError()\n");
return self[index];
}))
;