From: abd Date: Tue, 25 Apr 2006 12:56:28 +0000 (+0000) Subject: Improve crossplatform library name of plugin X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=38412444f93bf5f3bdb52d1da1f26688ae3d70c6;p=modules%2Fsmesh.git Improve crossplatform library name of plugin --- diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx index d6d875e75..dfd448576 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx @@ -90,12 +90,15 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&, myPluginName = atts.value("name"); myServerLib = atts.value("server-lib"); myClientLib = atts.value("gui-lib"); - +/* It's Need to tranlate lib name for WIN32 or X platform + * (only client lib, because server lib translates in SMESH_Gen_i::createHypothesis + * for normal work of *.py files ) + */ #ifdef WNT - myServerLib += ".dll"; + //myServerLib += ".dll"; myClientLib += ".dll"; #else - myServerLib = "lib" + myServerLib + ".so"; + //myServerLib = "lib" + myServerLib + ".so"; myClientLib = "lib" + myClientLib + ".so"; #endif diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 96f436a2b..420ce7a7c 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -307,8 +307,28 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName const char* theLibName) throw (SALOME::SALOME_Exception) { + /* It's Need to tranlate lib name for WIN32 or X platform */ + char* aPlatformLibName = 0; + if ( theLibName && theLibName[0] != '\0' ) + { +#ifdef WNT + aPlatformLibName = new char[ strlen(theLibName) + 5 ]; + aPlatformLibName[0] = '\0'; + aPlatformLibName = strcat( aPlatformLibName, theLibName ); + aPlatformLibName = strcat( aPlatformLibName, ".dll" ); +#else + aPlatformLibName = new char[ strlen(theLibName) + 7 ]; + aPlatformLibName[0] = '\0'; + aPlatformLibName = strcat( aPlatformLibName, "lib" ); + aPlatformLibName = strcat( aPlatformLibName, theLibName ); + aPlatformLibName = strcat( aPlatformLibName, ".dll" ); +#endif + } + + + Unexpect aCatch(SALOME_SalomeException); - if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << theLibName); + if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << aPlatformLibName/*theLibName*/); // create a new hypothesis object servant SMESH_Hypothesis_i* myHypothesis_i = 0; @@ -321,7 +341,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName { // load plugin library if(MYDEBUG) MESSAGE("Loading server meshers plugin library ..."); - LibHandle libHandle = LoadLib( theLibName ); + LibHandle libHandle = LoadLib( aPlatformLibName/*theLibName*/ ); if (!libHandle) { // report any error, if occured @@ -362,20 +382,23 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName myHypCreatorMap[string(theHypName)]->Create (myPoa, GetCurrentStudyID(), &myGen); // _CS_gbo Explicit activation (no longer made in the constructor). myHypothesis_i->Activate(); - myHypothesis_i->SetLibName(theLibName); // for persistency assurance + myHypothesis_i->SetLibName(aPlatformLibName/*theLibName*/); // for persistency assurance } catch (SALOME_Exception& S_ex) { THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); } + if ( aPlatformLibName ) + delete[] aPlatformLibName; + if (!myHypothesis_i) return hypothesis_i._retn(); // activate the CORBA servant of hypothesis hypothesis_i = SMESH::SMESH_Hypothesis::_narrow( myHypothesis_i->_this() ); int nextId = RegisterObject( hypothesis_i ); - if(MYDEBUG) MESSAGE( "Add hypo to map with id = "<< nextId ); + if(MYDEBUG) MESSAGE( "Add hypo to map with id = "<< nextId ); return hypothesis_i._retn(); } diff --git a/src/SMESH_SWIG/PAL_MESH_041_mesh.py b/src/SMESH_SWIG/PAL_MESH_041_mesh.py index 8585c9f6f..d097bcd48 100755 --- a/src/SMESH_SWIG/PAL_MESH_041_mesh.py +++ b/src/SMESH_SWIG/PAL_MESH_041_mesh.py @@ -53,7 +53,7 @@ print"---------------------Hypothesis" #---------------- NumberOfSegments numberOfSegment = 9 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) +hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" ) hypNbSeg.SetNumberOfSegments( numberOfSegment ) print hypNbSeg.GetName() @@ -64,7 +64,7 @@ smeshgui.SetName(salome.ObjectToID(hypNbSeg), "Nb. Segments") #--------------------------Max. Element Area maxElementArea = 200 -hypArea200 = smesh.CreateHypothesis("MaxElementArea","libStdMeshersEngine.so") +hypArea200 = smesh.CreateHypothesis("MaxElementArea","StdMeshersEngine") hypArea200.SetMaxElementArea( maxElementArea ) print hypArea200.GetName() print hypArea200.GetMaxElementArea() @@ -74,14 +74,14 @@ smeshgui.SetName(salome.ObjectToID(hypArea200), "Max. Element Area") print"---------------------Algorithms" #----------------------------Wire discretisation -algoWireDes = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) +algoWireDes = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" ) listHyp = algoWireDes.GetCompatibleHypothesis() print algoWireDes.GetName() smeshgui.SetName(salome.ObjectToID(algoWireDes), "Ware descritisation") #----------------------------Triangle (Mefisto) -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) +algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" ) listHyp = algoMef.GetCompatibleHypothesis() print algoMef.GetName() diff --git a/src/SMESH_SWIG/PAL_MESH_043_2D.py b/src/SMESH_SWIG/PAL_MESH_043_2D.py index 76ab25924..4cfeac36b 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_2D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_2D.py @@ -60,18 +60,18 @@ smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId) # create hypoteses -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg1.SetNumberOfSegments(18) id_hypNbSeg1 = salome.ObjectToID(hypNbSeg1) smeshgui.SetName(id_hypNbSeg1, "NumberOfSegments 1"); -hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg2.SetNumberOfSegments(34) id_hypNbSeg2 = salome.ObjectToID(hypNbSeg2) smeshgui.SetName(id_hypNbSeg2, "NumberOfSegments 2"); # create algorithmes -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") id_algoReg = salome.ObjectToID(algoReg) smeshgui.SetName(id_algoReg, "Regular_1D"); diff --git a/src/SMESH_SWIG/PAL_MESH_043_3D.py b/src/SMESH_SWIG/PAL_MESH_043_3D.py index cfd0f45c4..73b211e8b 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_3D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_3D.py @@ -57,22 +57,22 @@ smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId) # create hypoteses -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(12) idseg = salome.ObjectToID(hypNbSeg) smeshgui.SetName(idseg, "NumberOfSegments_10"); -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea.SetMaxElementArea(30) idarea = salome.ObjectToID(hypArea) smeshgui.SetName(idarea, "MaxElementArea_20"); # create algorithmes -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") idreg = salome.ObjectToID(algoReg) smeshgui.SetName(idreg, "Regular_1D"); -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") idmef = salome.ObjectToID(algoMef) smeshgui.SetName(idmef, "MEFISTO_2D"); diff --git a/src/SMESH_SWIG/SMESH_Nut.py b/src/SMESH_SWIG/SMESH_Nut.py index a4f5017cf..4b2fb7a35 100755 --- a/src/SMESH_SWIG/SMESH_Nut.py +++ b/src/SMESH_SWIG/SMESH_Nut.py @@ -89,7 +89,7 @@ smeshgui.SetName( idmesh, "Nut" ) #HYPOTHESIS CREATION print "-------------------------- Average length" theAverageLength = 5 -hAvLength = smesh.CreateHypothesis( "LocalLength", "libStdMeshersEngine.so" ) +hAvLength = smesh.CreateHypothesis( "LocalLength", "StdMeshersEngine" ) hAvLength.SetLength( theAverageLength ) print hAvLength.GetName() print hAvLength.GetId() @@ -97,7 +97,7 @@ smeshgui.SetName(salome.ObjectToID(hAvLength), "AverageLength_5") print "-------------------------- MaxElementArea" theMaxElementArea = 20 -hArea20 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) +hArea20 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" ) hArea20.SetMaxElementArea( theMaxElementArea ) print hArea20.GetName() print hArea20.GetId() @@ -106,7 +106,7 @@ smeshgui.SetName(salome.ObjectToID(hArea20), "MaxElementArea_20") print "-------------------------- MaxElementVolume" theMaxElementVolume = 150 -hVolume150 = smesh.CreateHypothesis( "MaxElementVolume", "libStdMeshersEngine.so" ) +hVolume150 = smesh.CreateHypothesis( "MaxElementVolume", "StdMeshersEngine" ) hVolume150.SetMaxElementVolume( theMaxElementVolume ) print hVolume150.GetName() print hVolume150.GetId() @@ -119,7 +119,7 @@ mesh.AddHypothesis(shape_mesh, hVolume150) print "-------------------------- Regular_1D" -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) +algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" ) listHyp = algoReg1D.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -128,7 +128,7 @@ print algoReg1D.GetId() smeshgui.SetName(salome.ObjectToID(algoReg1D), "Wire discretisation") print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) +algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" ) listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp diff --git a/src/SMESH_SWIG/SMESH_Partition1_tetra.py b/src/SMESH_SWIG/SMESH_Partition1_tetra.py index e9bb55fa7..c4b1b25c5 100644 --- a/src/SMESH_SWIG/SMESH_Partition1_tetra.py +++ b/src/SMESH_SWIG/SMESH_Partition1_tetra.py @@ -112,7 +112,7 @@ print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() @@ -124,7 +124,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 0.1 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() @@ -136,7 +136,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 0.5 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") +hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() @@ -148,12 +148,12 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- MEFISTO_2D" -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") print "-------------------------- NETGEN_3D" diff --git a/src/SMESH_SWIG/SMESH_box.py b/src/SMESH_SWIG/SMESH_box.py index 2902c739b..5fc7f2969 100755 --- a/src/SMESH_SWIG/SMESH_box.py +++ b/src/SMESH_SWIG/SMESH_box.py @@ -36,22 +36,22 @@ smeshgui.Init(salome.myStudyId) # Hypothesis -hypL1=meshgenerator.CreateHypothesis("LocalLength","libStdMeshersEngine.so") +hypL1=meshgenerator.CreateHypothesis("LocalLength","StdMeshersEngine") hypL1.SetLength(0.25) hypL1Id = salome.ObjectToID(hypL1) smeshgui.SetName(hypL1Id, "LocalLength") # Algorithm -alg1D=meshgenerator.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +alg1D=meshgenerator.CreateHypothesis("Regular_1D", "StdMeshersEngine") alg1DId = salome.ObjectToID(alg1D) smeshgui.SetName(alg1DId, "algo1D") -alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") +alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine") alg2DId = salome.ObjectToID(alg2D) smeshgui.SetName(alg2DId, "algo2D") -alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") +alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "StdMeshersEngine") alg3DId = salome.ObjectToID(alg3D) smeshgui.SetName(alg3DId, "algo3D") diff --git a/src/SMESH_SWIG/SMESH_box2_tetra.py b/src/SMESH_SWIG/SMESH_box2_tetra.py index e8a4afd9f..054c9e64a 100644 --- a/src/SMESH_SWIG/SMESH_box2_tetra.py +++ b/src/SMESH_SWIG/SMESH_box2_tetra.py @@ -68,7 +68,7 @@ print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() @@ -81,7 +81,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 500 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() @@ -94,7 +94,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 500 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") +hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() @@ -109,12 +109,12 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- MEFISTO_2D" -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") print "-------------------------- NETGEN_3D" diff --git a/src/SMESH_SWIG/SMESH_box3_tetra.py b/src/SMESH_SWIG/SMESH_box3_tetra.py index af4082774..9891bb9e8 100644 --- a/src/SMESH_SWIG/SMESH_box3_tetra.py +++ b/src/SMESH_SWIG/SMESH_box3_tetra.py @@ -79,7 +79,7 @@ print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() @@ -92,7 +92,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 500 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() @@ -105,7 +105,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 500 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") +hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() @@ -120,12 +120,12 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- MEFISTO_2D" -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") print "-------------------------- NETGEN_3D" diff --git a/src/SMESH_SWIG/SMESH_box_tetra.py b/src/SMESH_SWIG/SMESH_box_tetra.py index 72b45e12b..1a06cfde3 100644 --- a/src/SMESH_SWIG/SMESH_box_tetra.py +++ b/src/SMESH_SWIG/SMESH_box_tetra.py @@ -40,7 +40,7 @@ print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() @@ -53,7 +53,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 500 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() @@ -66,7 +66,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 500 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") +hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() @@ -81,12 +81,12 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- MEFISTO_2D" -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") print "-------------------------- NETGEN_3D" diff --git a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py index 755214a59..68e299187 100755 --- a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py +++ b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py @@ -119,7 +119,7 @@ print "-------------------------- NumberOfSegments the global one" numberOfSegments = 10 -hypNbSeg=smesh.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so") +hypNbSeg=smesh.CreateHypothesis("NumberOfSegments","StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) hypNbSegID = hypNbSeg.GetId() print hypNbSeg.GetName() @@ -132,7 +132,7 @@ print "-------------------------- NumberOfSegments in the Z direction" numberOfSegmentsZ = 40 -hypNbSegZ=smesh.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so") +hypNbSegZ=smesh.CreateHypothesis("NumberOfSegments","StdMeshersEngine") hypNbSegZ.SetNumberOfSegments(numberOfSegmentsZ) hypNbSegZID = hypNbSegZ.GetId() print hypNbSegZ.GetName() @@ -147,17 +147,17 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D=smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- Quadrangle_2D" -quad2D=smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") +quad2D=smesh.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D") print "-------------------------- Hexa_3D" -hexa3D=smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") +hexa3D=smesh.CreateHypothesis("Hexa_3D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D") # ---- init a Mesh with the volume diff --git a/src/SMESH_SWIG/SMESH_fixation_hexa.py b/src/SMESH_SWIG/SMESH_fixation_hexa.py index 1845b2218..22db40f5d 100644 --- a/src/SMESH_SWIG/SMESH_fixation_hexa.py +++ b/src/SMESH_SWIG/SMESH_fixation_hexa.py @@ -37,7 +37,7 @@ print "-------------------------- NumberOfSegments" numberOfSegments = 5 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() @@ -50,19 +50,19 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- Quadrangle_2D" -quad2D = smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") +quad2D = smesh.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D") print "-------------------------- Hexa_3D" -hexa3D = smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") +hexa3D = smesh.CreateHypothesis("Hexa_3D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D") diff --git a/src/SMESH_SWIG/SMESH_fixation_tetra.py b/src/SMESH_SWIG/SMESH_fixation_tetra.py index 2d588bbd9..821a3d149 100644 --- a/src/SMESH_SWIG/SMESH_fixation_tetra.py +++ b/src/SMESH_SWIG/SMESH_fixation_tetra.py @@ -37,7 +37,7 @@ print "-------------------------- NumberOfSegments" numberOfSegments = 5 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() @@ -57,7 +57,7 @@ print "-------------------------- MaxElementArea" ## print hypArea.GetMaxElementArea() ## smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_160") -hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so") +hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(hypLengthFromEdges), "LengthFromEdges") @@ -65,7 +65,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 1000 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") +hypVolume = smesh.CreateHypothesis("MaxElementVolume", "StdMeshersEngine") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() @@ -78,13 +78,13 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- MEFISTO_2D" -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") diff --git a/src/SMESH_SWIG/SMESH_flight_skin.py b/src/SMESH_SWIG/SMESH_flight_skin.py index 25a4b2d14..7969df995 100644 --- a/src/SMESH_SWIG/SMESH_flight_skin.py +++ b/src/SMESH_SWIG/SMESH_flight_skin.py @@ -48,7 +48,7 @@ print "-------------------------- LocalLength" lengthOfSegments = 0.3 -hypLength = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") +hypLength = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine") hypLength.SetLength(lengthOfSegments) print hypLength.GetName() @@ -59,7 +59,7 @@ smeshgui.SetName(salome.ObjectToID(hypLength), "LocalLength_0.3") print "-------------------------- LengthFromEdges" -hypLengthFromEdge = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so") +hypLengthFromEdge = smesh.CreateHypothesis("LengthFromEdges", "StdMeshersEngine") print hypLengthFromEdge.GetName() print hypLengthFromEdge.GetId() @@ -70,13 +70,13 @@ print "-------------------------- create Algorithms" print "-------------------------- Regular_1D" -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +regular1D = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- MEFISTO_2D" -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") diff --git a/src/SMESH_SWIG/SMESH_freebord.py b/src/SMESH_SWIG/SMESH_freebord.py index d240a354f..c6881c825 100644 --- a/src/SMESH_SWIG/SMESH_freebord.py +++ b/src/SMESH_SWIG/SMESH_freebord.py @@ -1,66 +1,66 @@ -import salome -import geompy -import SMESH -import StdMeshers - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -# Create box without one plane - -box = geompy.MakeBox(0., 0., 0., 10., 20., 30.) -subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) - -FaceList = [] -for i in range( 5 ): - FaceList.append( subShapeList[ i ] ) - -aComp = geompy.MakeCompound( FaceList ) -aBox = geompy.Sew( aComp, 1. ) -idbox = geompy.addToStudy( aBox, "box" ) - -aBox = salome.IDToObject( idbox ) - -# Create mesh - -hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hyp1.SetNumberOfSegments(5) -hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hyp2.SetMaxElementArea(20) -hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hyp3.SetMaxElementArea(50) - -algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") - -mesh = smesh.CreateMesh(aBox) -mesh.AddHypothesis(aBox,hyp1) -mesh.AddHypothesis(aBox,hyp2) -mesh.AddHypothesis(aBox,algo1) -mesh.AddHypothesis(aBox,algo2) - -smesh.Compute(mesh,aBox) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId); -smeshgui.SetName( salome.ObjectToID( mesh ), "Mesh_freebord" ); - -# Criterion : Free edges -aFilterMgr = smesh.CreateFilterManager() -aPredicate = aFilterMgr.CreateFreeBorders() -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) - -# print result -print "Criterion: Free edges Nb = ", len( anIds ) -for i in range( len( anIds ) ): - print anIds[ i ] - -# create group -aGroup = mesh.CreateGroup( SMESH.EDGE, "Free edges" ) -aGroup.Add( anIds ) - - -salome.sg.updateObjBrowser(1) +import salome +import geompy +import SMESH +import StdMeshers + +smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") +smesh.SetCurrentStudy(salome.myStudy) + +# Create box without one plane + +box = geompy.MakeBox(0., 0., 0., 10., 20., 30.) +subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) + +FaceList = [] +for i in range( 5 ): + FaceList.append( subShapeList[ i ] ) + +aComp = geompy.MakeCompound( FaceList ) +aBox = geompy.Sew( aComp, 1. ) +idbox = geompy.addToStudy( aBox, "box" ) + +aBox = salome.IDToObject( idbox ) + +# Create mesh + +hyp1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") +hyp1.SetNumberOfSegments(5) +hyp2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") +hyp2.SetMaxElementArea(20) +hyp3 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") +hyp3.SetMaxElementArea(50) + +algo1 = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") +algo2 = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") + +mesh = smesh.CreateMesh(aBox) +mesh.AddHypothesis(aBox,hyp1) +mesh.AddHypothesis(aBox,hyp2) +mesh.AddHypothesis(aBox,algo1) +mesh.AddHypothesis(aBox,algo2) + +smesh.Compute(mesh,aBox) + +smeshgui = salome.ImportComponentGUI("SMESH") +smeshgui.Init(salome.myStudyId); +smeshgui.SetName( salome.ObjectToID( mesh ), "Mesh_freebord" ); + +# Criterion : Free edges +aFilterMgr = smesh.CreateFilterManager() +aPredicate = aFilterMgr.CreateFreeBorders() +aFilter = aFilterMgr.CreateFilter() +aFilter.SetPredicate( aPredicate ) + +anIds = aFilter.GetElementsId( mesh ) + +# print result +print "Criterion: Free edges Nb = ", len( anIds ) +for i in range( len( anIds ) ): + print anIds[ i ] + +# create group +aGroup = mesh.CreateGroup( SMESH.EDGE, "Free edges" ) +aGroup.Add( anIds ) + + +salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_hexaedre.py b/src/SMESH_SWIG/SMESH_hexaedre.py index 1b93e1c08..0bee28c32 100755 --- a/src/SMESH_SWIG/SMESH_hexaedre.py +++ b/src/SMESH_SWIG/SMESH_hexaedre.py @@ -84,20 +84,20 @@ smesh.SetCurrentStudy(salome.myStudy) # ---- create Hypothesis print "-------------------------- create Hypothesis" numberOfSegments = 4 -hypNbSegA=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSegA=smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSegA.SetNumberOfSegments(numberOfSegments) numberOfSegments = 10 -hypNbSegB=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSegB=smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSegB.SetNumberOfSegments(numberOfSegments) numberOfSegments = 15 -hypNbSegC=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSegC=smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSegC.SetNumberOfSegments(numberOfSegments) # ---- create Algorithms print "-------------------------- create Algorithms" -regular1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -quad2D=smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") -hexa3D=smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") +regular1D=smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") +quad2D=smesh.CreateHypothesis("Quadrangle_2D", "StdMeshersEngine") +hexa3D=smesh.CreateHypothesis("Hexa_3D", "StdMeshersEngine") # ---- init a Mesh with the geom shape shape_mesh = blob diff --git a/src/SMESH_SWIG/SMESH_mechanic.py b/src/SMESH_SWIG/SMESH_mechanic.py index 7c1fdbd22..7beb5eece 100644 --- a/src/SMESH_SWIG/SMESH_mechanic.py +++ b/src/SMESH_SWIG/SMESH_mechanic.py @@ -140,7 +140,7 @@ print "-------------------------- NumberOfSegments" numberOfSegment = 10 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) +hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" ) hypNbSeg.SetNumberOfSegments( numberOfSegment ) print hypNbSeg.GetName() print hypNbSeg.GetId() @@ -152,7 +152,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 25 -hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) +hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" ) hypArea25.SetMaxElementArea( maxElementArea ) print hypArea25.GetName() print hypArea25.GetId() @@ -164,7 +164,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 35 -hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) +hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" ) hypArea35.SetMaxElementArea( maxElementArea ) print hypArea35.GetName() print hypArea35.GetId() @@ -174,7 +174,7 @@ smeshgui.SetName(salome.ObjectToID(hypArea35), "MaxElementArea_35") print "-------------------------- Regular_1D" -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) +algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" ) listHyp = algoReg1D.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -185,7 +185,7 @@ smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D") print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) +algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" ) listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -196,7 +196,7 @@ smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D") print "-------------------------- SMESH_Quadrangle_2D" -algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "libStdMeshersEngine.so" ) +algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "StdMeshersEngine" ) listHyp = algoQuad.GetCompatibleHypothesis() for hyp in listHyp: print hyp diff --git a/src/SMESH_SWIG/SMESH_mechanic_editor.py b/src/SMESH_SWIG/SMESH_mechanic_editor.py index 596786ed9..25599d75d 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_editor.py +++ b/src/SMESH_SWIG/SMESH_mechanic_editor.py @@ -142,7 +142,7 @@ print "-------------------------- NumberOfSegments" numberOfSegment = 10 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) +hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" ) hypNbSeg.SetNumberOfSegments( numberOfSegment ) print hypNbSeg.GetName() print hypNbSeg.GetId() @@ -154,7 +154,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 25 -hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) +hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" ) hypArea25.SetMaxElementArea( maxElementArea ) print hypArea25.GetName() print hypArea25.GetId() @@ -166,7 +166,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 35 -hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) +hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" ) hypArea35.SetMaxElementArea( maxElementArea ) print hypArea35.GetName() print hypArea35.GetId() @@ -176,7 +176,7 @@ smeshgui.SetName(salome.ObjectToID(hypArea35), "MaxElementArea_35") print "-------------------------- Regular_1D" -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) +algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" ) listHyp = algoReg1D.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -187,7 +187,7 @@ smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D") print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) +algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" ) listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -198,7 +198,7 @@ smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D") print "-------------------------- SMESH_Quadrangle_2D" -algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "libStdMeshersEngine.so" ) +algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "StdMeshersEngine" ) listHyp = algoQuad.GetCompatibleHypothesis() for hyp in listHyp: print hyp diff --git a/src/SMESH_SWIG/SMESH_mechanic_tetra.py b/src/SMESH_SWIG/SMESH_mechanic_tetra.py index eee3f87d8..247cf97bc 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_tetra.py +++ b/src/SMESH_SWIG/SMESH_mechanic_tetra.py @@ -115,7 +115,7 @@ print "-------------------------- NumberOfSegments" numberOfSegment = 10 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) +hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "StdMeshersEngine" ) hypNbSeg.SetNumberOfSegments( numberOfSegment ) print hypNbSeg.GetName() print hypNbSeg.GetId() @@ -127,7 +127,7 @@ print "-------------------------- MaxElementArea" maxElementArea = 20 -hypArea = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) +hypArea = smesh.CreateHypothesis( "MaxElementArea", "StdMeshersEngine" ) hypArea.SetMaxElementArea( maxElementArea ) print hypArea.GetName() print hypArea.GetId() @@ -139,7 +139,7 @@ print "-------------------------- MaxElementVolume" maxElementVolume = 20 -hypVolume = smesh.CreateHypothesis( "MaxElementVolume", "libStdMeshersEngine.so" ) +hypVolume = smesh.CreateHypothesis( "MaxElementVolume", "StdMeshersEngine" ) hypVolume.SetMaxElementVolume( maxElementVolume ) print hypVolume.GetName() print hypVolume.GetId() @@ -149,7 +149,7 @@ smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_20") print "-------------------------- Regular_1D" -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) +algoReg1D = smesh.CreateHypothesis( "Regular_1D", "StdMeshersEngine" ) listHyp =algoReg1D.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -160,7 +160,7 @@ smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D") print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) +algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "StdMeshersEngine" ) listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp diff --git a/src/SMESH_SWIG/SMESH_reg.py b/src/SMESH_SWIG/SMESH_reg.py index 3a2f74ae8..ed5455d44 100644 --- a/src/SMESH_SWIG/SMESH_reg.py +++ b/src/SMESH_SWIG/SMESH_reg.py @@ -63,7 +63,7 @@ smeshgui.Init(salome.myStudyId) print "-------------------------- create Hypothesis" print "-------------------------- LocalLength" -hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") +hypLen1 = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine") hypLen1.SetLength(100) print hypLen1.GetName() print hypLen1.GetId() @@ -74,7 +74,7 @@ smeshgui.SetName(idlength, "Local_Length_100"); hypNbSeg = [] print "-------------------------- NumberOfSegments" -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg1.SetDistrType(0) hypNbSeg1.SetNumberOfSegments(7) print hypNbSeg1.GetName() @@ -84,7 +84,7 @@ idseg1 = salome.ObjectToID(hypNbSeg1) smeshgui.SetName(idseg1, "NumberOfSegmentsReg"); hypNbSeg.append(hypNbSeg1) -hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg2.SetDistrType(1) hypNbSeg2.SetNumberOfSegments(7) hypNbSeg2.SetScaleFactor(2) @@ -95,7 +95,7 @@ idseg2 = salome.ObjectToID(hypNbSeg2) smeshgui.SetName(idseg2, "NumberOfSegmentsScale"); hypNbSeg.append(hypNbSeg2) -hypNbSeg3 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg3 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg3.SetDistrType(2) hypNbSeg3.SetNumberOfSegments(7) hypNbSeg3.SetTableFunction( [0, 0.1, 0.5, 1.0, 1.0, 0.1] ) @@ -107,7 +107,7 @@ idseg3 = salome.ObjectToID(hypNbSeg3) smeshgui.SetName(idseg3, "NumberOfSegmentsTable"); hypNbSeg.append(hypNbSeg3) -hypNbSeg4 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg4 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg4.SetDistrType(3) hypNbSeg4.SetNumberOfSegments(10) hypNbSeg4.SetExpressionFunction("sin(3*t)") @@ -120,7 +120,7 @@ smeshgui.SetName(idseg4, "NumberOfSegmentsExpr"); hypNbSeg.append(hypNbSeg4) print "-------------------------- MaxElementArea" -hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea1 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea1.SetMaxElementArea(2500) print hypArea1.GetName() print hypArea1.GetId() @@ -130,7 +130,7 @@ idarea1 = salome.ObjectToID(hypArea1) smeshgui.SetName(idarea1, "MaxElementArea_2500"); print "-------------------------- MaxElementArea" -hypArea2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea2.SetMaxElementArea(500) print hypArea2.GetName() print hypArea2.GetId() @@ -140,7 +140,7 @@ idarea2 = salome.ObjectToID(hypArea2) smeshgui.SetName(idarea2, "MaxElementArea_500"); print "-------------------------- Regular_1D" -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") listHyp = algoReg.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -151,7 +151,7 @@ idreg = salome.ObjectToID(algoReg) smeshgui.SetName(idreg, "Regular_1D"); print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp diff --git a/src/SMESH_SWIG/SMESH_test.py b/src/SMESH_SWIG/SMESH_test.py index d2385f3a9..cdaae7eb6 100644 --- a/src/SMESH_SWIG/SMESH_test.py +++ b/src/SMESH_SWIG/SMESH_test.py @@ -66,7 +66,7 @@ print "-------------------------- create Hypothesis" print "-------------------------- LocalLength" -hypo1 = gen.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") +hypo1 = gen.CreateHypothesis("LocalLength", "StdMeshersEngine") print hypo1.GetName() print hypo1.GetId() print hypo1.GetLength() @@ -79,7 +79,7 @@ hyp3 = gen.CreateHypothesis("bidon", "") print "-------------------------- NumberOfSegments" -hypo3 = gen.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypo3 = gen.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypo3.SetNumberOfSegments(7) print hypo3.GetName() print hypo3.GetNumberOfSegments() @@ -87,7 +87,7 @@ print hypo3.GetId() print "-------------------------- MaxElementArea" -hypo4 = gen.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypo4 = gen.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypo4.SetMaxElementArea(5000) print hypo4.GetName() print hypo4.GetMaxElementArea() @@ -95,7 +95,7 @@ print hypo4.GetId() print "-------------------------- Regular_1D" -algo_1 = gen.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +algo_1 = gen.CreateHypothesis("Regular_1D", "StdMeshersEngine") print algo_1.GetName() print algo_1.GetId() listHyp = algo_1.GetCompatibleHypothesis() @@ -105,7 +105,7 @@ print algo_1.GetId() print "-------------------------- MEFISTO_2D" -algo_2 = gen.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +algo_2 = gen.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") print algo_2.GetName() print algo_2.GetId() listHyp = algo_2.GetCompatibleHypothesis() diff --git a/src/SMESH_SWIG/SMESH_test1.py b/src/SMESH_SWIG/SMESH_test1.py index c0b04299a..96792bf55 100644 --- a/src/SMESH_SWIG/SMESH_test1.py +++ b/src/SMESH_SWIG/SMESH_test1.py @@ -67,7 +67,7 @@ smeshgui.Init(salome.myStudyId) print "-------------------------- create Hypothesis" print "-------------------------- LocalLength" -hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") +hypLen1 = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine") hypLen1.SetLength(100) print hypLen1.GetName() print hypLen1.GetId() @@ -77,7 +77,7 @@ idlength = salome.ObjectToID(hypLen1) smeshgui.SetName(idlength, "Local_Length_100"); print "-------------------------- NumberOfSegments" -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg1.SetNumberOfSegments(7) print hypNbSeg1.GetName() print hypNbSeg1.GetId() @@ -87,7 +87,7 @@ idseg = salome.ObjectToID(hypNbSeg1) smeshgui.SetName(idseg, "NumberOfSegments_7"); print "-------------------------- MaxElementArea" -hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea1 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea1.SetMaxElementArea(2500) print hypArea1.GetName() print hypArea1.GetId() @@ -97,7 +97,7 @@ idarea1 = salome.ObjectToID(hypArea1) smeshgui.SetName(idarea1, "MaxElementArea_2500"); print "-------------------------- MaxElementArea" -hypArea2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hypArea2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea2.SetMaxElementArea(500) print hypArea2.GetName() print hypArea2.GetId() @@ -107,7 +107,7 @@ idarea2 = salome.ObjectToID(hypArea2) smeshgui.SetName(idarea2, "MaxElementArea_500"); print "-------------------------- Regular_1D" -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") +algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") listHyp = algoReg.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -118,7 +118,7 @@ idreg = salome.ObjectToID(algoReg) smeshgui.SetName(idreg, "Regular_1D"); print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp diff --git a/src/SMESH_SWIG/SMESH_test4.py b/src/SMESH_SWIG/SMESH_test4.py index 09271b6f1..fe50f9fbe 100755 --- a/src/SMESH_SWIG/SMESH_test4.py +++ b/src/SMESH_SWIG/SMESH_test4.py @@ -17,15 +17,15 @@ idface = geompy.addToStudyInFather(box, face, name) box = salome.IDToObject(idbox) face = salome.IDToObject(idface) -hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") +hyp1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hyp1.SetNumberOfSegments(10) -hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hyp2 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hyp2.SetMaxElementArea(10) -hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") +hyp3 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hyp3.SetMaxElementArea(100) -algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +algo1 = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") +algo2 = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") mesh = smesh.CreateMesh(box) mesh.AddHypothesis(box,hyp1) diff --git a/src/SMESH_SWIG/batchmode_mefisto.py b/src/SMESH_SWIG/batchmode_mefisto.py index 203b1602e..2166077f5 100644 --- a/src/SMESH_SWIG/batchmode_mefisto.py +++ b/src/SMESH_SWIG/batchmode_mefisto.py @@ -34,7 +34,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): print "-------------------------- create Hypothesis" if (len is not None): print "-------------------------- LocalLength" - hypLength1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") + hypLength1 = smesh.CreateHypothesis("LocalLength", "StdMeshersEngine") hypLength1.SetLength(len) print "Hypothesis type : ", hypLength1.GetName() print "Hypothesis ID : ", hypLength1.GetId() @@ -42,7 +42,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): if (nbseg is not None): print "-------------------------- NumberOfSegments" - hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") + hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "StdMeshersEngine") hypNbSeg1.SetNumberOfSegments(nbseg) print "Hypothesis type : ", hypNbSeg1.GetName() print "Hypothesis ID : ", hypNbSeg1.GetId() @@ -50,7 +50,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): if (area == "LengthFromEdges"): print "-------------------------- LengthFromEdges" - hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so") + hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "StdMeshersEngine") hypLengthFromEdges.SetMode(1) print "Hypothesis type : ", hypLengthFromEdges.GetName() print "Hypothesis ID : ", hypLengthFromEdges.GetId() @@ -58,7 +58,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): else: print "-------------------------- MaxElementArea" - hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") + hypArea1 = smesh.CreateHypothesis("MaxElementArea", "StdMeshersEngine") hypArea1.SetMaxElementArea(area) print "Hypothesis type : ", hypArea1.GetName() print "Hypothesis ID : ", hypArea1.GetId() @@ -66,7 +66,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): print "-------------------------- Regular_1D" - algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") + algoReg = smesh.CreateHypothesis("Regular_1D", "StdMeshersEngine") listHyp = algoReg.GetCompatibleHypothesis() for hyp in listHyp: @@ -76,7 +76,7 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): print "Algo ID : ", algoReg.GetId() print "-------------------------- MEFISTO_2D" - algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") + algoMef = smesh.CreateHypothesis("MEFISTO_2D", "StdMeshersEngine") listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index fe237e511..92ccb7567 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -92,7 +92,7 @@ class Mesh_Algorithm: """ return self.algo - def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"): + def Create(self, mesh, geom, hypo, so="StdMeshersEngine"): """ Private method """ @@ -113,7 +113,7 @@ class Mesh_Algorithm: SetName(self.algo, name + "/" + hypo) mesh.mesh.AddHypothesis(self.geom, self.algo) - def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so"): + def Hypothesis(self, hyp, args=[], so="StdMeshersEngine"): """ Private method """