Expose global placement calculation to python API
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
// inclusion of the generated files (generated out of GeoFeaturePy.xml)
|
||||
#include "GeoFeaturePy.h"
|
||||
#include "GeoFeaturePy.cpp"
|
||||
#include <Base/PlacementPy.h>
|
||||
#include <CXX/Objects.hxx>
|
||||
|
||||
using namespace App;
|
||||
@@ -44,6 +45,20 @@ PyObject* GeoFeaturePy::getPaths(PyObject * /*args*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* GeoFeaturePy::getGlobalPlacement(PyObject * args) {
|
||||
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
|
||||
try {
|
||||
Base::Placement p = static_cast<GeoFeature*>(getDocumentObjectPtr())->globalPlacement();
|
||||
return new Base::PlacementPy(new Base::Placement(p));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::RuntimeError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* GeoFeaturePy::getPropertyNameOfGeometry(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
|
||||
Reference in New Issue
Block a user