X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_HypothesesUtils.cxx;h=2d45966ed0e57c053497f9b1af845a4817ba8d18;hb=62e1c11b6d2a6a5e7a808a96cbc678158ca6b4c6;hp=d7e3e6ce685f63dad94af3d2e0016404a1ae7048;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index d7e3e6ce6..2d45966ed 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -55,13 +55,13 @@ // Other includes -#ifdef WNT +#ifdef WIN32 #include #else #include #endif -#ifdef WNT +#ifdef WIN32 #define LibHandle HMODULE #define LoadLib( name ) LoadLibrary( name ) #define GetProc GetProcAddress @@ -74,7 +74,7 @@ #endif #ifdef _DEBUG_ -static int MYDEBUG = 0; +static int MYDEBUG = 1; #else static int MYDEBUG = 0; #endif @@ -224,18 +224,17 @@ namespace SMESH for( ;it1 != aXmlHandler->myHypothesesMap.end(); it1++) myHypothesesMap.insert( it1.key(), it1.value() ); - it1 = aXmlHandler->myAlgorithmsMap.begin(); for( ;it1 != aXmlHandler->myAlgorithmsMap.end(); it1++) myAlgorithmsMap.insert( it1.key(), it1.value() ); - QList::iterator it, pos = myListOfHypothesesSets.begin(); + QList::iterator it; for ( it = aXmlHandler->myListOfHypothesesSets.begin(); it != aXmlHandler->myListOfHypothesesSets.end(); ++it ) { (*it)->setIsCustom( i == 0 ); - myListOfHypothesesSets.insert( pos, *it ); + myListOfHypothesesSets.append( *it ); } } else { @@ -316,6 +315,7 @@ namespace SMESH aSetNameList.append( mangledHypoSetName( aSet )); } } + aSetNameList.removeDuplicates(); aSetNameList.sort(); // reverse order of aSetNameList @@ -420,13 +420,13 @@ namespace SMESH LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() ); if (!libHandle) { // report any error, if occured - if ( MYDEBUG ) { + { #ifdef WIN32 const char* anError = "Can't load client meshers plugin library"; #else const char* anError = dlerror(); #endif - MESSAGE(anError); + INFOS(anError); // always display this kind of error ! } } else { @@ -452,11 +452,11 @@ namespace SMESH // BUG 0020378 //myHypCreatorMap[aHypType] = aCreator; - //rnv : This dynamic property of the QObject stores the name of the plugin. - // It is used to obtain plugin root dir environment variable + //rnv : This dynamic property of the QObject stores the name of the plugin. + // It is used to obtain plugin root dir environment variable // in the SMESHGUI_HypothesisDlg class. Plugin root dir environment - // variable is used to display documentation. - aCreator->setProperty(PLUGIN_NAME,aHypData->PluginName); + // variable is used to display documentation. + aCreator->setProperty(PLUGIN_NAME,aHypData->PluginName); } } } @@ -612,23 +612,21 @@ namespace SMESH return res < SMESH::HYP_UNKNOWN_FATAL; } - bool RemoveHypothesisOrAlgorithmOnMesh (_PTR(SObject) MorSM, + bool RemoveHypothesisOrAlgorithmOnMesh (_PTR(SObject) MorSM, SMESH::SMESH_Hypothesis_ptr anHyp) { - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; int res = SMESH::HYP_UNKNOWN_FATAL; SUIT_OverrideCursor wc; if (MorSM) { try { GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(MorSM); - SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface(MorSM); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface(MorSM); - + SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface(MorSM); + SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface(MorSM); + if (!aSubMesh->_is_nil()) aMesh = aSubMesh->GetFather(); - + if (!aMesh->_is_nil()) { if (aMesh->HasShapeToMesh() && !aShapeObject->_is_nil()) { res = aMesh->RemoveHypothesis(aShapeObject, anHyp);