X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_HypothesesUtils.cxx;h=255d2f5751554fa993c6a6e571e4c38dd1f64566;hp=33baabf0beee9064dcdf6ed4cc1939b0f95a32de;hb=6df8817c1a9827149025cc942249d7083f504d3d;hpb=a1920ff31054e2c882bd94d4f3c04abe53980ce0 diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 33baabf0b..255d2f575 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -63,16 +63,20 @@ #endif #ifdef WIN32 -#define LibHandle HMODULE -#define LoadLib( name ) LoadLibrary( name ) -#define GetProc GetProcAddress -#define UnLoadLib( handle ) FreeLibrary( handle ); -#else -#define LibHandle void* -#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL ) -#define GetProc dlsym -#define UnLoadLib( handle ) dlclose( handle ); -#endif + #define LibHandle HMODULE + #define LoadLib( name ) LoadLibrary( name ) + #define GetProc GetProcAddress + #define UnLoadLib( handle ) FreeLibrary( handle ); +#else // WIN32 + #define LibHandle void* + #ifdef DYNLOAD_LOCAL + #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_LOCAL ) + #else // DYNLOAD_LOCAL + #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL ) + #endif // DYNLOAD_LOCAL + #define GetProc dlsym + #define UnLoadLib( handle ) dlclose( handle ); +#endif // WIN32 #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -517,9 +521,21 @@ namespace SMESH try { // load plugin library if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); - LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() ); +#ifdef WIN32 +#ifdef UNICODE + LPTSTR path = new TCHAR[aClientLibName.length() + 1]; + path[aClientLibName.toWCharArray(path)] = '\0'; +#else + QByteArray baPath = aClientLibName.toUtf8(); + const char* path = baPath.data(); +#endif +#else + QByteArray baPath = aClientLibName.toUtf8(); + char* path = baPath.data(); +#endif + LibHandle libHandle = LoadLib( path ); if (!libHandle) { - // report any error, if occured + // report any error, if occurred { #ifdef WIN32 const char* anError = "Can't load client meshers plugin library"; @@ -581,7 +597,7 @@ namespace SMESH try { SMESH::SMESH_Hypothesis_var aHypothesis; aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(), - aServLib.toLatin1().data()); + aServLib.toUtf8().data()); if (!aHypothesis->_is_nil()) { _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in()); if (aHypSObject) { @@ -609,7 +625,7 @@ namespace SMESH HypothesisData* aHypData = GetHypothesisData(aHypType); QString aServLib = aHypData->ServerLibName; return SMESHGUI::GetSMESHGen()->IsApplicable( aHypType.toLatin1().data(), - aServLib.toLatin1().data(), + aServLib.toUtf8().data(), theGeomObject, toCheckAll); } @@ -627,12 +643,6 @@ namespace SMESH try { CORBA::String_var error; res = aMesh->AddHypothesis(aShapeObject, aHyp, error.out()); - if (res < SMESH::HYP_UNKNOWN_FATAL) { - _PTR(SObject) aSH = SMESH::FindSObject(aHyp); - if (SM && aSH) { - SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0); - } - } if (res > SMESH::HYP_OK) { wc.suspend(); processHypothesisStatus(res, aHyp, true, error.in() ); @@ -664,11 +674,6 @@ namespace SMESH { CORBA::String_var error; res = aMesh->AddHypothesis( aShapeObject, aHyp, error.out() ); - if (res < SMESH::HYP_UNKNOWN_FATAL) { - _PTR(SObject) meshSO = SMESH::FindSObject(aMesh); - if (meshSO) - SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0); - } if (res > SMESH::HYP_OK) { wc.suspend(); processHypothesisStatus( res, aHyp, true, error.in() ); @@ -701,7 +706,7 @@ namespace SMESH SUIT_OverrideCursor wc; try { - _PTR(Study) aStudy = GetActiveStudyDocument(); + _PTR(Study) aStudy = getStudy(); _PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() ); if( aHypObj ) { @@ -759,9 +764,6 @@ namespace SMESH } if ( _PTR(SObject) meshSO = SMESH::FindSObject(aMesh) ) { - if ( res < SMESH::HYP_UNKNOWN_FATAL ) - SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0); - if ( SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() )) if( actor->GetVisibility() ) actor->Update(); @@ -785,8 +787,7 @@ namespace SMESH if (!AlgoOrHyp->_is_nil()) { _PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp); if (SO_Hypothesis) { - SObjectList listSO = - SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis); + SObjectList listSO = SMESH::getStudy()->FindDependances(SO_Hypothesis); if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<