X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=6b962a028b003449a14ee77f41dc4c2aa5b7b537;hp=200fa90341524dbdff8d25a7ee37a5cd81aa52c6;hb=896b180efc0351e28d18fd39bb948eaa8faf5620;hpb=6aea23b893abc82fbeecf5924d0939370c110271 diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 200fa9034..6b962a028 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -93,7 +93,7 @@ #include "SMESH_Mesh_i.hxx" #include "SMESH_PreMeshInfo.hxx" #include "SMESH_PythonDump.hxx" -//#include "memoire.h" +#include "SMESH_TryCatch.hxx" // to include after OCC headers! #include CORBA_SERVER_HEADER(SMESH_Group) #include CORBA_SERVER_HEADER(SMESH_Filter) @@ -640,7 +640,7 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_wrap so = anIter->Value(); CORBA::Object_var ior = SObjectToObject( so ); if ( SMESH_Mesh_i* mesh = SMESH::DownCast( ior )) - mesh->CheckGeomGroupModif(); + mesh->CheckGeomModif(); } } } @@ -1742,7 +1742,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, ASSERT( meshServant ); if ( meshServant ) { // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation" - meshServant->CheckGeomGroupModif(); + meshServant->CheckGeomModif(); // get local TopoDS_Shape TopoDS_Shape myLocShape; if(theMesh->HasShapeToMesh()) @@ -1824,7 +1824,7 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh ASSERT( meshServant ); if ( meshServant ) { // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation" - meshServant->CheckGeomGroupModif(); + meshServant->CheckGeomModif(); // get local TopoDS_Shape TopoDS_Shape myLocShape; if(theMesh->HasShapeToMesh()) @@ -2020,7 +2020,7 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, ASSERT( meshServant ); if ( meshServant ) { // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation" - meshServant->CheckGeomGroupModif(); + meshServant->CheckGeomModif(); // get local TopoDS_Shape TopoDS_Shape myLocShape; if(theMesh->HasShapeToMesh()) @@ -2654,6 +2654,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, SMESH::array_of_ElementType_var srcElemTypes = meshPart->GetTypes(); if ( SMESH::DownCast( meshPart )) { + srcMesh_i->Load(); srcElemIt = srcMeshDS->elementsIterator(); srcNodeIt = srcMeshDS->nodesIterator(); } @@ -2720,10 +2721,15 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, const SMDS_MeshElement * newElem; switch ( elem->GetEntityType() ) { case SMDSEntity_Polyhedra: - newElem = editor.GetMeshDS()-> - AddPolyhedralVolumeWithID( nodes, - static_cast(elem)->GetQuantities(), - ID); + if ( toKeepIDs ) + newElem = editor.GetMeshDS()-> + AddPolyhedralVolumeWithID( nodes, + static_cast(elem)->GetQuantities(), + ID); + else + newElem = editor.GetMeshDS()-> + AddPolyhedralVolume( nodes, + static_cast(elem)->GetQuantities()); break; case SMDSEntity_Ball: newElem = editor.AddElement( nodes, SMDSAbs_Ball, false, ID, @@ -2899,8 +2905,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, // ASSERT( theComponent->GetStudy()->StudyId() == myCurrentStudy->StudyId() ) // san -- in case differs from theComponent's study, // use that of the component - if ( myCurrentStudy->_is_nil() || - theComponent->GetStudy()->StudyId() != myCurrentStudy->StudyId() ) + if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() ) SetCurrentStudy( theComponent->GetStudy() ); // Store study contents as a set of python commands @@ -3949,8 +3954,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, { INFOS( "SMESH_Gen_i::Load" ); - if ( myCurrentStudy->_is_nil() || - theComponent->GetStudy()->StudyId() != myCurrentStudy->StudyId() ) + if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() ) SetCurrentStudy( theComponent->GetStudy() ); /* if( !theComponent->_is_nil() ) @@ -5070,27 +5074,33 @@ CORBA::Boolean SMESH_Gen_i::IsApplicable ( const char* theAlgoType, GEOM::GEOM_Object_ptr theGeomObject, CORBA::Boolean toCheckAll) { + SMESH_TRY; + std::string aPlatformLibName; typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char*); GenericHypothesisCreator_i* aCreator = getHypothesisCreator(theAlgoType, theLibName, aPlatformLibName); if (aCreator) { TopoDS_Shape shape = GeomObjectToShape( theGeomObject ); - return aCreator->IsApplicable( shape, toCheckAll ); + if ( !shape.IsNull() ) + return aCreator->IsApplicable( shape, toCheckAll ); } else { - if(MYDEBUG) { MESSAGE( "Shape not defined"); } return false; } + + SMESH_CATCH( SMESH::doNothing ); + return true; } //================================================================================= // function : importData // purpose : imports mesh data file (the med one) into the SMESH internal data structure //================================================================================= -Engines::ListOfIdentifiers* SMESH_Gen_i::importData( - CORBA::Long studyId, Engines::DataContainer_ptr data, const Engines::ListOfOptions& options) +Engines::ListOfIdentifiers* SMESH_Gen_i::importData(CORBA::Long studyId, + Engines::DataContainer_ptr data, + const Engines::ListOfOptions& options) { Engines::ListOfIdentifiers_var aResultIds = new Engines::ListOfIdentifiers; list aResultList;