Skip to content

Commit

Permalink
make FemResultObject extensible in python as FemSolverObject
Browse files Browse the repository at this point in the history
  • Loading branch information
qingfengxia committed Sep 16, 2016
1 parent 279418f commit 7337720
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Mod/Fem/App/AppFem.cpp
Expand Up @@ -161,6 +161,7 @@ PyMODINIT_FUNC initFem()
Fem::ConstraintFluidBoundary ::init();

Fem::FemResultObject ::init();
Fem::FemResultObjectPython ::init();
Fem::FemSolverObject ::init();
Fem::FemSolverObjectPython ::init();

Expand Down
9 changes: 9 additions & 0 deletions src/Mod/Fem/App/FemResultObject.cpp
Expand Up @@ -27,6 +27,7 @@
#endif

#include "FemResultObject.h"
#include <App/FeaturePythonPyImp.h>
#include <App/DocumentObjectPy.h>

using namespace Fem;
Expand Down Expand Up @@ -96,6 +97,14 @@ template<> const char* Fem::FemResultObjectPython::getViewProviderName(void) con
}
/// @endcond

template<> PyObject* Fem::FemResultObjectPython::getPyObject(void) {
if (PythonObject.is(Py::_None())) {
// ref counter is set to 1
PythonObject = Py::Object(new App::FeaturePythonPyT<App::DocumentObjectPy>(this),true);
}
return Py::new_reference_to(PythonObject);
}

// explicit template instantiation
template class AppFemExport FeaturePythonT<Fem::FemResultObject>;

Expand Down

0 comments on commit 7337720

Please sign in to comment.