Make Fem::Analyses object inheritable to python and some fixes in Material

This commit is contained in:
jriegel
2013-08-04 19:22:17 +02:00
parent 1b7acb839b
commit bd6dc08a1b
7 changed files with 59 additions and 22 deletions

View File

@@ -114,6 +114,7 @@ void AppFemExport initFem()
// This function is responsible for adding inherited slots from a type's base class.
Fem::FemAnalysis ::init();
Fem::FemAnalysisPython ::init();
Fem::FemMesh ::init();
Fem::FemMeshObject ::init();
Fem::FemMeshShapeObject ::init();

View File

@@ -66,3 +66,26 @@ void FemAnalysis::onChanged(const Property* prop)
{
App::DocumentObject::onChanged(prop);
}
// Python feature ---------------------------------------------------------
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(Fem::FemAnalysisPython, Fem::FemAnalysis)
template<> const char* Fem::FemAnalysisPython::getViewProviderName(void) const {
return "FemGui::ViewProviderFemAnalysisPython";
}
//template<> PyObject* Fem::FemAnalysisPython::getPyObject(void) {
// if (PythonObject.is(Py::_None())) {
// // ref counter is set to 1
// PythonObject = Py::Object(new App::DocumentObjectPy(this),true);
// }
// return Py::new_reference_to(PythonObject);
//}
/// @endcond
// explicit template instantiation
template class AppFemExport FeaturePythonT<Fem::FemAnalysis>;
}

View File

@@ -27,6 +27,8 @@
#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include <App/FeaturePython.h>
namespace Fem
@@ -62,6 +64,9 @@ protected:
virtual void onChanged (const App::Property* prop);
};
typedef App::FeaturePythonT<FemAnalysis> FemAnalysisPython;
} //namespace Fem