X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=d9c404cd93a4b90b4425cbecf6cb4fc7b82a0e42;hb=20911863d85832bef476bac4c7133c88e5b654f3;hp=b6cc5826573ccf86949bd3ef5fbed5fc63e0fb5c;hpb=4791f5b30ea7a9c1247aa551750dc71cb83b99aa;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index b6cc58265..d9c404cd9 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; using namespace std; #include #include @@ -54,6 +53,7 @@ using namespace std; #include "SMESH_LocalLength_i.hxx" #include "SMESH_NumberOfSegments_i.hxx" #include "SMESH_MaxElementArea_i.hxx" +#include "SMESH_MaxElementVolume_i.hxx" #include "SMESHDS_Document.hxx" @@ -466,7 +466,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, //************branch 1 : hypothesis if (gotBranch->Tag()==Tag_HypothesisRoot) { //hypothesis = tag 1 - double length,maxElementsArea; + double length,maxElementsArea,maxElementsVolume; int numberOfSegments; destFile = fopen( hypofile.ToCString() ,"w"); @@ -496,6 +496,11 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, maxElementsArea = MEA->GetMaxElementArea(); fprintf(destFile,"%f\n",maxElementsArea); } + else if (strcmp(myHyp->GetName(),"MaxElementVolume")==0) { + SMESH::SMESH_MaxElementVolume_var MEV = SMESH::SMESH_MaxElementVolume::_narrow( myHyp ); + maxElementsVolume = MEV->GetMaxElementVolume(); + fprintf(destFile,"%f\n",maxElementsVolume); + } } } fclose(destFile); @@ -572,7 +577,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, int meshId = myMesh->GetId(); SMESH_Mesh_i* meshServant = myStudyContext->mapMesh_i[meshId]; ::SMESH_Mesh& myLocMesh = meshServant->GetImpl(); - Handle(SMESHDS_Mesh) mySMESHDSMesh = myLocMesh.GetMeshDS(); + SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); SCRUTE(mySMESHDSMesh->NbNodes()); if (mySMESHDSMesh->NbNodes()>0) {//checks if the mesh is not empty @@ -903,7 +908,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, _NS->init_orb( _orb ) ; SALOME_LifeCycleCORBA* myEnginesLifeCycle = new SALOME_LifeCycleCORBA(_NS); Engines::Component_var geomEngine = - myEnginesLifeCycle->FindOrLoad_Component("FactoryServer","Geometry"); + myEnginesLifeCycle->FindOrLoad_Component("FactoryServer","GEOM"); GEOM::GEOM_Gen_var myGeomEngine = GEOM::GEOM_Gen::_narrow(geomEngine); @@ -946,7 +951,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, //*************** if (strcmp(name,"Hypothesis")==0) { - double length,maxElementsArea; + double length,maxElementsArea,maxElementsVolume; int numberOfSegments; hdf_group[Tag_HypothesisRoot] = new HDFgroup(name,hdf_file); @@ -1001,6 +1006,16 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, sprintf(objectId,"%d",MEA->GetId()); _SMESHCorbaObj[string("Hypo_")+string(objectId)] = iorString; } + else if (strcmp(aLine,"MaxElementVolume")==0) { + SMESH::SMESH_Hypothesis_var myHyp = this->CreateHypothesis(aLine,studyId); + SMESH::SMESH_MaxElementVolume_var MEV = SMESH::SMESH_MaxElementVolume::_narrow( myHyp ); + fscanf(loadedFile,"%s",aLine); + maxElementsVolume = atof(aLine); + MEV->SetMaxElementVolume(maxElementsVolume); + string iorString = _orb->object_to_string(MEV); + sprintf(objectId,"%d",MEV->GetId()); + _SMESHCorbaObj[string("Hypo_")+string(objectId)] = iorString; + } } @@ -1137,7 +1152,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, int meshId = myNewMesh->GetId(); SMESH_Mesh_i* meshServant = myStudyContext->mapMesh_i[meshId]; ::SMESH_Mesh& myLocMesh = meshServant->GetImpl(); - Handle(SMESHDS_Mesh) mySMESHDSMesh = myLocMesh.GetMeshDS(); + SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); DriverMED_R_SMESHDS_Mesh* myReader = new DriverMED_R_SMESHDS_Mesh;