+ make float assignment more pythonic
This commit is contained in:
parent
26837381ac
commit
1e860356e7
|
@ -1503,12 +1503,12 @@ Py::Int MeshPy::getCountFacets(void) const
|
|||
|
||||
Py::Float MeshPy::getArea(void) const
|
||||
{
|
||||
return Py::Float((long)getMeshObjectPtr()->getSurface());
|
||||
return Py::Float(getMeshObjectPtr()->getSurface());
|
||||
}
|
||||
|
||||
Py::Float MeshPy::getVolume(void) const
|
||||
{
|
||||
return Py::Float((long)getMeshObjectPtr()->getVolume());
|
||||
return Py::Float(getMeshObjectPtr()->getVolume());
|
||||
}
|
||||
|
||||
PyObject *MeshPy::getCustomAttributes(const char* attr) const
|
||||
|
|
|
@ -502,7 +502,11 @@ int @self.export.Name@::staticCallback_set@i.Name@ (PyObject *self, PyObject *va
|
|||
}
|
||||
|
||||
try {
|
||||
+ if (i.Parameter.Type == "Float"):
|
||||
((@self.export.Name@*)self)->set@i.Name@(Py::@i.Parameter.Type@(PyNumber_Float(value),true));
|
||||
= else:
|
||||
((@self.export.Name@*)self)->set@i.Name@(Py::@i.Parameter.Type@(value,false));
|
||||
-
|
||||
return 0;
|
||||
} catch (const Py::Exception&) {
|
||||
// The exception text is already set
|
||||
|
|
Loading…
Reference in New Issue
Block a user