]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
- Modifing Geometry and Mesh Python scripts from SALOME 6 and before
authormpa <mpa@opencascade.com>
Tue, 19 Nov 2013 11:32:06 +0000 (11:32 +0000)
committermpa <mpa@opencascade.com>
Tue, 19 Nov 2013 11:32:06 +0000 (11:32 +0000)
src/NETGENPlugin/NETGENPluginBuilder.py
src/NETGENPlugin/NETGENPlugin_Mesher.cxx

index 11369c7331505ab4569080f286dc829de1c6121f..66e897fdaed95c04647972a0c290d74604302b1a 100644 (file)
@@ -27,7 +27,7 @@ from salome.smesh.smeshBuilder import AssureGeomPublished, ParseParameters, IsEq
 # import NETGENPlugin module if possible
 noNETGENPlugin = 0
 try:
 # import NETGENPlugin module if possible
 noNETGENPlugin = 0
 try:
-    import NETGENPlugin
+    from salome.NETGENPlugin import NETGENPluginBuilder
 except ImportError:
     noNETGENPlugin = 1
     pass
 except ImportError:
     noNETGENPlugin = 1
     pass
index 6b4310c29903bd8b0941c71c41c22dfae3763714..05149390fac476065319eb96e7b479675bab259c 100644 (file)
@@ -1283,8 +1283,10 @@ void NETGENPlugin_Mesher::AddIntVerticesInSolids(const netgen::OCCGeometry&
 #ifdef DUMP_TRIANGLES_SCRIPT
   // create a python script making a mesh containing triangles added for internal vertices
   ofstream py(DUMP_TRIANGLES_SCRIPT);
 #ifdef DUMP_TRIANGLES_SCRIPT
   // create a python script making a mesh containing triangles added for internal vertices
   ofstream py(DUMP_TRIANGLES_SCRIPT);
-  py << "from smesh import * "<< endl
-     << "m = Mesh(name='triangles')" << endl;
+  py << "import SMESH"<< endl
+     << "from salome.smesh import smeshBuilder"<<endl
+     << "smesh = smeshBuilder.New(salome.myStudy)"
+     << "m = smesh.Mesh(name='triangles')" << endl;
 #endif
   if ( nodeVec.size() < ngMesh.GetNP() )
     nodeVec.resize( ngMesh.GetNP(), 0 );
 #endif
   if ( nodeVec.size() < ngMesh.GetNP() )
     nodeVec.resize( ngMesh.GetNP(), 0 );
@@ -3124,7 +3126,9 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh,
   ofstream outfile(pyFile.c_str(), ios::out);
   if ( !outfile ) return;
 
   ofstream outfile(pyFile.c_str(), ios::out);
   if ( !outfile ) return;
 
-  outfile << "import smesh, SMESH" << endl
+  outfile << "import SMESH" << endl
+          << "from salome.smesh import smeshBuilder" << endl
+          << "smesh = smeshBuilder.New(salome.myStudy)" << endl
           << "mesh = smesh.Mesh()" << endl << endl;
 
   using namespace netgen;
           << "mesh = smesh.Mesh()" << endl << endl;
 
   using namespace netgen;