mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
getitem MeshPoint
This commit is contained in:
parent
b53eedbab6
commit
17c4ce6182
@ -105,14 +105,11 @@ DLL_HEADER void ExportNetgenMeshing()
|
|||||||
.def(bp::init<Point<3>>())
|
.def(bp::init<Point<3>>())
|
||||||
.def("__str__", &ToString<MeshPoint>)
|
.def("__str__", &ToString<MeshPoint>)
|
||||||
.def("__repr__", &ToString<MeshPoint>)
|
.def("__repr__", &ToString<MeshPoint>)
|
||||||
.add_property("p", FunctionPointer([](const MeshPoint & self)
|
.def("__getitem__", FunctionPointer([](const MeshPoint & self, int index) {
|
||||||
{
|
if(index<0 || index>2)
|
||||||
bp::list l;
|
bp::exec("raise IndexError()\n");
|
||||||
l.append ( self[0] );
|
return self[index];
|
||||||
l.append ( self[1] );
|
}))
|
||||||
l.append ( self[2] );
|
|
||||||
return bp::tuple(l);
|
|
||||||
}))
|
|
||||||
;
|
;
|
||||||
|
|
||||||
bp::class_<Element>("Element3D")
|
bp::class_<Element>("Element3D")
|
||||||
|
Loading…
Reference in New Issue
Block a user