mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
property
This commit is contained in:
parent
17c4ce6182
commit
a1496ea645
@ -105,6 +105,14 @@ 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)
|
||||||
|
{
|
||||||
|
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) {
|
.def("__getitem__", FunctionPointer([](const MeshPoint & self, int index) {
|
||||||
if(index<0 || index>2)
|
if(index<0 || index>2)
|
||||||
bp::exec("raise IndexError()\n");
|
bp::exec("raise IndexError()\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user