void initExternalModule() { static bool first = true; if (first) { first = false; component::collision::CompliantSolverMerger::add(); // previous Eigen versions have a critical bug (v.noalias()+=w does not work in some situations) BOOST_STATIC_ASSERT( EIGEN_WORLD_VERSION>=3 && EIGEN_MAJOR_VERSION>=2 && EIGEN_MINOR_VERSION>=5 ); // adding _Compliant python module if( PythonFactory::s_sofaPythonModule ) // add the module only if the Sofa module exists (SofaPython is loaded) { static PyObject *s__CompliantPythonModule = SP_INIT_MODULE(_Compliant); // adding more bindings to the _Compliant module SP_ADD_CLASS( s__CompliantPythonModule, AssembledSystem ); } } }
#include "Binding_BaseMapping.h" //#include "Binding_Mapping.h" //#include "Binding_RigidMapping.h" //#include "Binding_MultiMapping.h" #include "Binding_SubsetMultiMapping.h" PyObject *SofaPythonModule = 0; void bindSofaPythonModule() { //PyImport_AppendInittab( (char*)"Sofa", &initSofa ); SofaPythonModule = SP_INIT_MODULE(Sofa) SP_ADD_CLASS(SofaPythonModule,Data) SP_ADD_CLASS(SofaPythonModule,DisplayFlagsData) SP_ADD_CLASS(SofaPythonModule,Vector3) SP_ADD_CLASS(SofaPythonModule,LinearSpring) SP_ADD_CLASS(SofaPythonModule,Base) SP_ADD_CLASS(SofaPythonModule,BaseContext) SP_ADD_CLASS(SofaPythonModule,Context) SP_ADD_CLASS(SofaPythonModule,Node) SP_ADD_CLASS(SofaPythonModule,BaseObject) SP_ADD_CLASS(SofaPythonModule,BaseState) SP_ADD_CLASS(SofaPythonModule,BaseMechanicalState)