X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Gen.cxx;h=5be63b4a9ff765c419be4e622b352a438bb957d2;hp=ec40c71ff9a7d3335fdee3cb5a09e6687dd55897;hb=7b70ad87bf8f5c46b2751f94cd196932b9ae7122;hpb=c9d641a57d36631526955b0c213a07854d403d8f diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index ec40c71ff..5be63b4a9 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -30,6 +30,7 @@ #include "SMESH_subMesh.hxx" #include "SMDS_MeshElement.hxx" #include "SMDS_MeshNode.hxx" +#include "SMESHDriver.h" #include #include @@ -126,7 +127,8 @@ throw(SALOME_Exception) //============================================================================= /*! - * + * @TODO Doing a full update after computation is not optimal when doing a local + * remeshing. */ //============================================================================= @@ -138,7 +140,7 @@ throw(SALOME_Exception) /* Algo : s'appuie ou non sur une geometrie Si geometrie: -Vertex : rien à faire (range le point) +Vertex : rien �faire (range le point) Edge, Wire, collection d'edge et wire : 1D Face, Shell, collection de Face et Shells : 2D Solid, Collection de Solid : 3D @@ -183,6 +185,8 @@ Solid, Collection de Solid : 3D smToCompute = sm->GetFirstToCompute(); } + aMesh.GetMeshDS()->logFullUpdate(); + return ret; } @@ -404,3 +408,40 @@ int SMESH_Gen::GetShapeDim(const TopoDS_Shape & aShape) // SCRUTE(shapeDim); return shapeDim; } + +/** + * Import a mesh from a file + * @param fileName file name to be imported + * @param fileType Currently it could be either "DAT", "UNV" or "MED". + * @todo + */ +SMESH_Mesh * SMESH_Gen::Import(int studyId, const char * fileName, + const char * fileType) +{ + MESSAGE("SMESH_Gen::Import("<SetDocument(myStudyContext->myDocument); + reader->SetFile(string(fileName)); + reader->Read();*/ + // currently we only read one mesh from a file (limitation on MED files). + + // create a new SMESH_mesh object + SMESH_Mesh *mesh = new SMESH_Mesh(_localId++, studyId, this, + myStudyContext->myDocument); + myStudyContext->mapMesh[_localId] = mesh; + + Mesh_Reader * reader = SMESHDriver::GetMeshReader(string(fileType)); + reader->SetMesh(mesh->GetMeshDS()); + reader->SetFile(string(fileName)); + reader->Read(); + + mesh->GetMeshDS()->logFullUpdate(); + + return mesh; +} +