// Module : SMESH
// $Header$
-using namespace std;
using namespace std;
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include "SMESH_LocalLength_i.hxx"
#include "SMESH_NumberOfSegments_i.hxx"
#include "SMESH_MaxElementArea_i.hxx"
+#include "SMESH_MaxElementVolume_i.hxx"
#include "SMESHDS_Document.hxx"
SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames;
aFileSeq->length(NUM_TMP_FILES);
- TCollection_AsciiString aStudyName(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
+ TCollection_AsciiString aStudyName("");
// Set names of temporary files
- TCollection_AsciiString filename = aStudyName + TCollection_AsciiString("SMESH.hdf");
- TCollection_AsciiString hypofile = aStudyName + TCollection_AsciiString("SMESH_Hypo.txt");
- TCollection_AsciiString algofile = aStudyName + TCollection_AsciiString("SMESH_Algo.txt");
- TCollection_AsciiString meshfile = aStudyName + TCollection_AsciiString("SMESH_Mesh.med");
+ TCollection_AsciiString filename = aStudyName + TCollection_AsciiString("_SMESH.hdf");
+ TCollection_AsciiString hypofile = aStudyName + TCollection_AsciiString("_SMESH_Hypo.txt");
+ TCollection_AsciiString algofile = aStudyName + TCollection_AsciiString("_SMESH_Algo.txt");
+ TCollection_AsciiString meshfile = aStudyName + TCollection_AsciiString("_SMESH_Mesh.med");
aFileSeq[0] = CORBA::string_dup(filename.ToCString());
aFileSeq[1] = CORBA::string_dup(hypofile.ToCString());
aFileSeq[2] = CORBA::string_dup(algofile.ToCString());
//************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");
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);
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
aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.ToCString(), aFileSeq.in(), isMultiFile);
// Remove temporary files and directory
- if (isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.ToCString(), aFileSeq.in(), true);
+ if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.ToCString(), aFileSeq.in(), true);
MESSAGE("End SMESH_Gen_i::Save");
tmpDir.ToCString(),
isMultiFile);
+ TCollection_AsciiString aStudyName("");
+ if (isMultiFile) aStudyName = (SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
+
// Set names of temporary files
- TCollection_AsciiString filename = tmpDir + aFileSeq[0];//"SMESH.hdf";
- TCollection_AsciiString hypofile = tmpDir + aFileSeq[1];//"SMESH_Hypo.txt";
- TCollection_AsciiString algofile = tmpDir + aFileSeq[2];//"SMESH_Algo.txt";
- TCollection_AsciiString meshfile = tmpDir + aFileSeq[3];//"SMESH_Mesh.med";
+ TCollection_AsciiString filename = tmpDir + aStudyName + TCollection_AsciiString("_SMESH.hdf");
+ TCollection_AsciiString hypofile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Hypo.txt");
+ TCollection_AsciiString algofile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Algo.txt");
+ TCollection_AsciiString meshfile = tmpDir + aStudyName + TCollection_AsciiString("_SMESH_Mesh.med");
SALOMEDS::Study_var Study = theComponent->GetStudy();
int studyId = Study->StudyId();
_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);
//***************
if (strcmp(name,"Hypothesis")==0) {
- double length,maxElementsArea;
+ double length,maxElementsArea,maxElementsVolume;
int numberOfSegments;
hdf_group[Tag_HypothesisRoot] = new HDFgroup(name,hdf_file);
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;
+ }
}
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;