{
std::string * _error;
int _verbosity;
+ double * _progress;
};
/* Set the message callback in the working context */
message_cb_user_data mcud;
mcud._error = & this->SMESH_Algo::_comment;
+ mcud._progress = & this->SMESH_Algo::_progress;
mcud._verbosity =
_hypothesis ? _hypothesis->GetVerbosity() : BLSURFPlugin_Hypothesis::GetDefaultVerbosity();
context_set_message_callback(ctx, message_cb, &mcud);
assert(Py_IsInitialized());
PyGILState_STATE gstate;
- gstate = PyGILState_Ensure();
string theSizeMapStr;
if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
continue;
// Expr To Python function, verification is performed at validation in GUI
+ gstate = PyGILState_Ensure();
PyObject * obj = NULL;
obj= PyRun_String(theSizeMapStr.c_str(), Py_file_input, main_dict, NULL);
Py_DECREF(obj);
func = PyObject_GetAttrString(main_mod, "f");
FaceId2PythonSmp[iface]=func;
FaceId2SizeMap.erase(faceKey);
+ PyGILState_Release(gstate);
}
// Specific size map = Attractor
if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
continue;
// Expr To Python function, verification is performed at validation in GUI
+ gstate = PyGILState_Ensure();
PyObject * obj = NULL;
obj= PyRun_String(theSizeMapStr.c_str(), Py_file_input, main_dict, NULL);
Py_DECREF(obj);
func = PyObject_GetAttrString(main_mod, "f");
EdgeId2PythonSmp[ic]=func;
EdgeId2SizeMap.erase(edgeKey);
+ PyGILState_Release(gstate);
}
}
/* data of nodes existing on the edge */
error(_comment);
}
- PyGILState_Release(gstate);
-
std::cout << std::endl;
std::cout << "End of Surface Mesh generation" << std::endl;
std::cout << std::endl;
len--;
mcud->_error->append( desc, len );
}
- else if ( mcud->_verbosity > 0 ) {
- std::cout << desc << std::endl;
+ else {
+ if ( errnumber == 3009001 )
+ * mcud->_progress = atof( desc + 11 ) / 100.;
+ if ( mcud->_verbosity > 0 )
+ std::cout << desc << std::endl;
}
return STATUS_OK;
}