Part: use of factory method of Vector2dPy
This commit is contained in:
@@ -160,26 +160,14 @@ Py::Object Hyperbola2dPy::getFocus1(void) const
|
||||
{
|
||||
Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle());
|
||||
gp_Pnt2d loc = hyperbola->Focus1();
|
||||
|
||||
Py::Module module("__FreeCADBase__");
|
||||
Py::Callable method(module.getAttr("Vector2d"));
|
||||
Py::Tuple arg(2);
|
||||
arg.setItem(0, Py::Float(loc.X()));
|
||||
arg.setItem(1, Py::Float(loc.Y()));
|
||||
return method.apply(arg);
|
||||
return Base::Vector2dPy::create(loc.X(), loc.Y());
|
||||
}
|
||||
|
||||
Py::Object Hyperbola2dPy::getFocus2(void) const
|
||||
{
|
||||
Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle());
|
||||
gp_Pnt2d loc = hyperbola->Focus2();
|
||||
|
||||
Py::Module module("__FreeCADBase__");
|
||||
Py::Callable method(module.getAttr("Vector2d"));
|
||||
Py::Tuple arg(2);
|
||||
arg.setItem(0, Py::Float(loc.X()));
|
||||
arg.setItem(1, Py::Float(loc.Y()));
|
||||
return method.apply(arg);
|
||||
return Base::Vector2dPy::create(loc.X(), loc.Y());
|
||||
}
|
||||
|
||||
PyObject *Hyperbola2dPy::getCustomAttributes(const char* /*attr*/) const
|
||||
|
||||
Reference in New Issue
Block a user