X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Mesh_i.cxx;h=b2551f73933e5839fe24874b95f3f20e688613de;hp=97687ae79842fa0fb4ea98b578c01cf73b674be1;hb=refs%2Ftags%2FV9_7_0a1;hpb=3632886261b4b281b67729a6c9a2be61373e4f4e diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 97687ae79..b2551f739 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -84,8 +84,15 @@ #include -// to pass CORBA exception through SMESH_TRY -#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; } +// to pass CORBA exception and TooLargeForExport exception through SMESH_TRY +#define SMY_OWN_CATCH \ + catch( SALOME::SALOME_Exception& se ) { throw se; } \ + catch( ::SMESH_Mesh::TooLargeForExport& ex ) \ + { SALOME::ExceptionStruct se = { \ + SALOME::COMM, \ + CORBA::string_dup(SMESH_Comment("Mesh is too large for export in format ") << ex.what()), \ + CORBA::string_dup(SMESH_Comment("format=") << ex.what() ), 0 }; \ + throw SALOME::SALOME_Exception( se ); } #include "SMESH_TryCatch.hxx" // include after OCCT headers! @@ -183,7 +190,6 @@ SMESH_Mesh_i::~SMESH_Mesh_i() //============================================================================= void SMESH_Mesh_i::SetShape( GEOM::GEOM_Object_ptr theShapeObject ) - throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); try { @@ -206,7 +212,6 @@ void SMESH_Mesh_i::SetShape( GEOM::GEOM_Object_ptr theShapeObject ) //================================================================================ CORBA::Boolean SMESH_Mesh_i::HasShapeToMesh() - throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); bool res = false; @@ -226,7 +231,6 @@ CORBA::Boolean SMESH_Mesh_i::HasShapeToMesh() //================================================================================ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh() - throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); GEOM::GEOM_Object_var aShapeObj; @@ -263,7 +267,7 @@ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh() */ //================================================================================ -CORBA::Boolean SMESH_Mesh_i::IsLoaded() throw (SALOME::SALOME_Exception) +CORBA::Boolean SMESH_Mesh_i::IsLoaded() { Unexpect aCatch(SALOME_SalomeException); return !_preMeshInfo; @@ -275,7 +279,7 @@ CORBA::Boolean SMESH_Mesh_i::IsLoaded() throw (SALOME::SALOME_Exception) */ //================================================================================ -void SMESH_Mesh_i::Load() throw (SALOME::SALOME_Exception) +void SMESH_Mesh_i::Load() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -288,7 +292,7 @@ void SMESH_Mesh_i::Load() throw (SALOME::SALOME_Exception) */ //================================================================================ -void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception) +void SMESH_Mesh_i::Clear() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -315,7 +319,6 @@ void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception) //================================================================================ void SMESH_Mesh_i::ClearSubMesh(CORBA::Long ShapeID) - throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -394,7 +397,6 @@ static SMESH::ComputeError* ConvertComputeError( SMESH_ComputeErrorPtr errorPtr SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) - throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); int status; @@ -433,7 +435,6 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportCGNSFile( const char* theFileName, const int theMeshIndex, std::string& theMeshName ) - throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); int status; @@ -467,8 +468,7 @@ SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportCGNSFile( const char* theFileNa char* SMESH_Mesh_i::GetVersionString(CORBA::Long minor, CORBA::Short nbDigits) { - string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(minor, - nbDigits); + string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(minor, nbDigits); return CORBA::string_dup( ver.c_str() ); } @@ -499,7 +499,6 @@ SMESH::long_array* SMESH_Mesh_i::GetMEDVersionsCompatibleForAppend() //============================================================================= int SMESH_Mesh_i::ImportUNVFile( const char* theFileName ) - throw ( SALOME::SALOME_Exception ) { SMESH_TRY; @@ -529,7 +528,6 @@ int SMESH_Mesh_i::ImportUNVFile( const char* theFileName ) //============================================================================= int SMESH_Mesh_i::ImportSTLFile( const char* theFileName ) - throw ( SALOME::SALOME_Exception ) { SMESH_TRY; @@ -574,7 +572,6 @@ namespace SMESH::ComputeError* SMESH_Mesh_i::ImportGMFFile( const char* theFileName, bool theMakeRequiredGroups ) - throw (SALOME::SALOME_Exception) { SMESH_ComputeErrorPtr error; @@ -646,14 +643,14 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr aSubShape, SMESH::SMESH_Hypothesis_ptr anHyp, CORBA::String_out anErrorText) - throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); + + const smIdType prevNbMeshEnt = NbNodes() + NbElements(); + if ( _preMeshInfo ) _preMeshInfo->ForgetOrLoad(); - const int prevNbMeshEnt = _impl->NbNodes() + _impl->GetMeshDS()->NbElements(); - std::string error; SMESH_Hypothesis::Hypothesis_Status status = addHypothesis( aSubShape, anHyp, &error ); anErrorText = error.c_str(); @@ -739,7 +736,6 @@ SMESH_Mesh_i::addHypothesis(GEOM::GEOM_Object_ptr aSubShape, SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Object_ptr aSubShape, SMESH::SMESH_Hypothesis_ptr anHyp) - throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -818,7 +814,6 @@ SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShape, SMESH::ListOfHypothesis * SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShape) -throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if (MYDEBUG) MESSAGE("GetHypothesisList"); @@ -858,7 +853,7 @@ throw(SALOME::SALOME_Exception) */ //================================================================================ -SMESH::submesh_array* SMESH_Mesh_i::GetSubMeshes() throw (SALOME::SALOME_Exception) +SMESH::submesh_array* SMESH_Mesh_i::GetSubMeshes() { Unexpect aCatch(SALOME_SalomeException); if (MYDEBUG) MESSAGE("GetSubMeshes"); @@ -902,7 +897,6 @@ SMESH::submesh_array* SMESH_Mesh_i::GetSubMeshes() throw (SALOME::SALOME_Excepti SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShape, const char* theName ) - throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if (CORBA::is_nil(aSubShape)) @@ -954,7 +948,6 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap //================================================================================ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh ) - throw (SALOME::SALOME_Exception) { SMESH_TRY; @@ -998,7 +991,6 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh ) SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType, const char* theName ) - throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -1030,7 +1022,6 @@ SMESH::SMESH_GroupOnGeom_ptr SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementType theElemType, const char* theName, GEOM::GEOM_Object_ptr theGeomObj) - throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -1072,7 +1063,6 @@ SMESH::SMESH_GroupOnFilter_ptr SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType, const char* theName, SMESH::Filter_ptr theFilter ) - throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -1112,7 +1102,6 @@ SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType, //================================================================================ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup ) - throw (SALOME::SALOME_Exception) { if ( theGroup->_is_nil() ) return; @@ -1134,7 +1123,7 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup ) TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )"; // Remove group's SObject - SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder(); + SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->NewBuilder(); builder->RemoveObjectWithChildren( aGroupSO ); } aGroup->Modified(/*removed=*/true); // notify dependent Filter with FT_BelongToMeshGroup criterion @@ -1152,7 +1141,6 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup ) //============================================================================= void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup ) - throw (SALOME::SALOME_Exception) { SMESH_TRY; if ( _preMeshInfo ) @@ -1166,11 +1154,11 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup THROW_SALOME_CORBA_EXCEPTION( "RemoveGroupWithContents(): group does not belong to this mesh", SALOME::BAD_PARAM); - vector nodeIds; // to remove nodes becoming free + vector nodeIds; // to remove nodes becoming free bool isNodal = ( theGroup->GetType() == SMESH::NODE ); if ( !isNodal && !theGroup->IsEmpty() ) { - CORBA::Long elemID = theGroup->GetID( 1 ); + SMESH::smIdType elemID = theGroup->GetID( 1 ); int nbElemNodes = GetElemNbNodes( elemID ); if ( nbElemNodes > 0 ) nodeIds.reserve( theGroup->Size() * nbElemNodes ); @@ -1212,6 +1200,9 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup if ( n->NbInverseElements() == 0 ) _impl->GetMeshDS()->RemoveFreeNode( n, /*sm=*/0 ); + _impl->GetMeshDS()->Modified(); + _impl->SetIsModified( true ); + // Update Python script (theGroup must be alive for this) pyDump << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroupWithContents( " << theGroup << " )"; @@ -1226,7 +1217,7 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup */ //================================================================================ -SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception) +SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() { Unexpect aCatch(SALOME_SalomeException); if (MYDEBUG) MESSAGE("GetGroups"); @@ -1265,7 +1256,7 @@ SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::NbGroups() throw (SALOME::SALOME_Exception) +CORBA::Long SMESH_Mesh_i::NbGroups() { Unexpect aCatch(SALOME_SalomeException); return _mapGroups.size(); @@ -1280,7 +1271,6 @@ CORBA::Long SMESH_Mesh_i::NbGroups() throw (SALOME::SALOME_Exception) SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char* theName ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1324,7 +1314,6 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionListOfGroups(const SMESH::ListOfGroups& theGroups, const char* theName ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1387,7 +1376,6 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionListOfGroups(const SMESH::ListOfGroups SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char* theName ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1453,7 +1441,6 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups, const char* theName ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1537,7 +1524,6 @@ SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups, SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char* theName ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1604,7 +1590,6 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups, const SMESH::ListOfGroups& theToolGroups, const char* theName ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1693,25 +1678,25 @@ SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups, namespace // functions making checks according to SMESH::NB_COMMON_NODES_ENUM { - bool isAllNodesCommon(int nbChecked, int nbCommon, int nbNodes, int nbCorners, + bool isAllNodesCommon(int nbChecked, int nbCommon, int nbNodes, int /*nbCorners*/, bool & toStopChecking ) { toStopChecking = ( nbCommon < nbChecked ); return nbCommon == nbNodes; } - bool isMainNodesCommon(int nbChecked, int nbCommon, int nbNodes, int nbCorners, + bool isMainNodesCommon(int nbChecked, int nbCommon, int /*nbNodes*/, int nbCorners, bool & toStopChecking ) { toStopChecking = ( nbCommon < nbChecked || nbChecked >= nbCorners ); return nbCommon == nbCorners; } - bool isAtLeastOneNodeCommon(int nbChecked, int nbCommon, int nbNodes, int nbCorners, - bool & toStopChecking ) + bool isAtLeastOneNodeCommon(int /*nbChecked*/, int nbCommon, int /*nbNodes*/, int /*nbCorners*/, + bool & /*toStopChecking*/ ) { return nbCommon > 0; } - bool isMajorityOfNodesCommon(int nbChecked, int nbCommon, int nbNodes, int nbCorners, - bool & toStopChecking ) + bool isMajorityOfNodesCommon(int /*nbChecked*/, int nbCommon, int nbNodes, int /*nbCorners*/, + bool & /*toStopChecking*/ ) { return nbCommon >= (nbNodes+1) / 2; } @@ -1737,7 +1722,6 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfIDSources& theGroups, const char* theName, SMESH::NB_COMMON_NODES_ENUM theNbCommonNodes, CORBA::Boolean theUnderlyingOnly) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1879,7 +1863,7 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfIDSources& theGroups, SMDS_ElemIteratorPtr nIt = elOfType->nodesIterator(); for ( nbChecked = 1; nIt->more() && !toStopChecking; ++nbChecked ) { - const int nID = nIt->next()->GetID(); + const smIdType nID = nIt->next()->GetID(); if ( nID < isNodeInGroupsSize && isNodeInGroups[ nID ] && isToInclude( nbChecked, ++nbCommon, nbNodes, nbCorners, toStopChecking )) { @@ -1918,7 +1902,6 @@ SMESH::ListOfGroups* SMESH_Mesh_i::FaceGroupsSeparatedByEdges( CORBA::Double theSharpAngle, CORBA::Boolean theCreateEdges, CORBA::Boolean theUseExistingEdges ) - throw (SALOME::SALOME_Exception) { if ( theSharpAngle < 0 || theSharpAngle > 180 ) THROW_SALOME_CORBA_EXCEPTION("Invalid sharp angle, it must be between 0 and 180 degrees", @@ -2046,7 +2029,6 @@ void SMESH_Mesh_i::removeGeomGroupData(CORBA::Object_ptr theSmeshObj) //================================================================================ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) - throw (SALOME::SALOME_Exception) { // check if geometry changed bool geomChanged = true; @@ -2083,7 +2065,7 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) } typedef struct { - int shapeID, fromID, toID; // indices of elements of a sub-mesh + int shapeID; smIdType fromID, toID; // indices of elements of a sub-mesh } TRange; std::vector< TRange > elemRanges, nodeRanges; // elements of sub-meshes std::vector< SMDS_PositionPtr > positions; // node positions @@ -2114,7 +2096,7 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) while ( elemIt->more() ) { const SMDS_MeshElement* e = elemIt->next(); - const int elemID = e->GetID(); + const smIdType elemID = e->GetID(); const int shapeID = e->GetShapeID(); TRange & lastRange = ranges.back(); if ( lastRange.shapeID != shapeID || @@ -2431,7 +2413,7 @@ void SMESH_Mesh_i::CheckGeomModif( bool theIsBreakLink ) if ( !theIsBreakLink ) if ( mainGO->GetType() == GEOM_GROUP || !geomChanged ) // is group or not modified { - int nb = NbNodes() + NbElements(); + smIdType nb = NbNodes() + NbElements(); CheckGeomGroupModif(); if ( nb != NbNodes() + NbElements() ) // something removed due to hypotheses change _gen_i->UpdateIcons( me ); @@ -2819,7 +2801,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif() if ( !_impl->HasShapeToMesh() ) return; - CORBA::Long nbEntities = NbNodes() + NbElements(); + SMESH::smIdType nbEntities = NbNodes() + NbElements(); // Check if group contents changed @@ -3021,7 +3003,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif() // Update icons - CORBA::Long newNbEntities = NbNodes() + NbElements(); + SMESH::smIdType newNbEntities = NbNodes() + NbElements(); list< SALOMEDS::SObject_wrap > soToUpdateIcons; if ( newNbEntities != nbEntities ) { @@ -3049,7 +3031,6 @@ void SMESH_Mesh_i::CheckGeomGroupModif() //============================================================================= SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase_ptr theGroup ) - throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aGroup; @@ -3080,7 +3061,7 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase SALOMEDS::StudyBuilder_var builder; SALOMEDS::SObject_wrap aGroupSO; - SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant(); + SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->getStudyServant(); if ( !aStudy->_is_nil() ) { builder = aStudy->NewBuilder(); aGroupSO = _gen_i->ObjectToSObject( theGroup ); @@ -3172,7 +3153,7 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theS // register CORBA object for persistence int nextId = _gen_i->RegisterObject( subMesh ); if(MYDEBUG) { MESSAGE( "Add submesh to map with id = "<< nextId); } - else { nextId = 0; } // avoid "unused variable" warning + else { (void)nextId; } // avoid "unused variable" warning // to track changes of GEOM groups if ( subMeshId > 0 ) @@ -3351,7 +3332,6 @@ void SMESH_Mesh_i::removeGroup( const int theId ) //================================================================================ SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet) - throw(SALOME::SALOME_Exception) { SMESH::log_array_var aLog; @@ -3368,10 +3348,10 @@ SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet) while(its != logDS.end()){ SMESHDS_Command *com = *its; int comType = com->GetType(); - int lgcom = com->GetNumber(); - const list < int >&intList = com->GetIndexes(); + smIdType lgcom = com->GetNumber(); + const list < smIdType >&intList = com->GetIndexes(); int inum = intList.size(); - list < int >::const_iterator ii = intList.begin(); + list < smIdType >::const_iterator ii = intList.begin(); const list < double >&coordList = com->GetCoords(); int rnum = coordList.size(); list < double >::const_iterator ir = coordList.begin(); @@ -3404,7 +3384,7 @@ SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet) */ //================================================================================ -void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception) +void SMESH_Mesh_i::ClearLog() { SMESH_TRY; _impl->ClearLog(); @@ -3417,7 +3397,7 @@ void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception) +CORBA::Long SMESH_Mesh_i::GetId() { return _id; } @@ -3432,12 +3412,17 @@ namespace { SMESH_Mesh_i* _mesh; TCallUp_i(SMESH_Mesh_i* mesh):_mesh(mesh) {} - virtual void RemoveGroup (const int theGroupID) { _mesh->removeGroup( theGroupID ); } - virtual void HypothesisModified( int hypID, - bool updIcons) { _mesh->onHypothesisModified( hypID, - updIcons ); } - virtual void Load () { _mesh->Load(); } - virtual bool IsLoaded() { return _mesh->IsLoaded(); } + void RemoveGroup (const int theGroupID) override { _mesh->removeGroup( theGroupID ); } + void HypothesisModified( int hypID, + bool updIcons) override { _mesh->onHypothesisModified( hypID, + updIcons ); } + void Load () override { _mesh->Load(); } + bool IsLoaded() override { return _mesh->IsLoaded(); } + TopoDS_Shape GetShapeByEntry(const std::string& entry) override + { + GEOM::GEOM_Object_var go = SMESH_Gen_i::GetGeomObjectByEntry( entry ); + return SMESH_Gen_i::GeomObjectToShape( go ); + } }; } @@ -3518,7 +3503,6 @@ void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl) //============================================================================= SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor() - throw (SALOME::SALOME_Exception) { SMESH::SMESH_MeshEditor_var aMeshEdVar; @@ -3547,7 +3531,6 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor() //============================================================================= SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditPreviewer() - throw (SALOME::SALOME_Exception) { SMESH::SMESH_MeshEditor_var aMeshEdVar; @@ -3571,7 +3554,7 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditPreviewer() */ //================================================================================ -CORBA::Boolean SMESH_Mesh_i::HasModificationsToDiscard() throw(SALOME::SALOME_Exception) +CORBA::Boolean SMESH_Mesh_i::HasModificationsToDiscard() { Unexpect aCatch(SALOME_SalomeException); return _impl->HasModificationsToDiscard(); @@ -3619,7 +3602,7 @@ static SALOMEDS::Color getUniqueColor( const std::list& theRese */ //============================================================================= -void SMESH_Mesh_i::SetAutoColor(CORBA::Boolean theAutoColor) throw(SALOME::SALOME_Exception) +void SMESH_Mesh_i::SetAutoColor(CORBA::Boolean theAutoColor) { Unexpect aCatch(SALOME_SalomeException); _impl->SetAutoColor(theAutoColor); @@ -3643,7 +3626,7 @@ void SMESH_Mesh_i::SetAutoColor(CORBA::Boolean theAutoColor) throw(SALOME::SALOM */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::GetAutoColor() throw(SALOME::SALOME_Exception) +CORBA::Boolean SMESH_Mesh_i::GetAutoColor() { Unexpect aCatch(SALOME_SalomeException); return _impl->GetAutoColor(); @@ -3716,7 +3699,7 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char* file, // Perform Export PrepareForWriting(file, overwrite); string aMeshName = "Mesh"; - SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant(); + SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->getStudyServant(); if ( !aStudy->_is_nil() ) { SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( _this() ); if ( !aMeshSO->_is_nil() ) { @@ -3755,12 +3738,11 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char* file, */ //================================================================================ -void SMESH_Mesh_i::ExportMED(const char* file, - CORBA::Boolean auto_groups, - CORBA::Long version, - CORBA::Boolean overwrite, - CORBA::Boolean autoDimension) - throw(SALOME::SALOME_Exception) +void SMESH_Mesh_i::ExportMED(const char* file, + CORBA::Boolean auto_groups, + CORBA::Long version, + CORBA::Boolean overwrite, + CORBA::Boolean autoDimension) { //MESSAGE("MED minor version: "<< minor); SMESH_TRY; @@ -3773,7 +3755,7 @@ void SMESH_Mesh_i::ExportMED(const char* file, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportMED( r'" << file << "', " << "auto_groups=" <FullLoadFromFile(); @@ -3799,6 +3779,8 @@ void SMESH_Mesh_i::ExportSAUV (const char* file, TPythonDump() << SMESH::SMESH_Mesh_var( _this()) << ".ExportSAUV( r'" << file << "', " << auto_groups << " )"; _impl->ExportSAUV(file, aMeshName.c_str(), auto_groups); + + SMESH_CATCH( SMESH::throwCorbaException ); } @@ -3809,20 +3791,21 @@ void SMESH_Mesh_i::ExportSAUV (const char* file, //================================================================================ void SMESH_Mesh_i::ExportDAT (const char *file) - throw(SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - // Update Python script // check names of groups checkGroupNames(); + // Update Python script TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportDAT( r'" << file << "' )"; // Perform Export PrepareForWriting(file); _impl->ExportDAT(file); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -3832,20 +3815,21 @@ void SMESH_Mesh_i::ExportDAT (const char *file) //================================================================================ void SMESH_Mesh_i::ExportUNV (const char *file) - throw(SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - // Update Python script // check names of groups checkGroupNames(); + // Update Python script TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportUNV( r'" << file << "' )"; // Perform Export PrepareForWriting(file); _impl->ExportUNV(file); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -3855,15 +3839,14 @@ void SMESH_Mesh_i::ExportUNV (const char *file) //================================================================================ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii) - throw(SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - // Update Python script // check names of groups checkGroupNames(); + // Update Python script TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportSTL( r'" << file << "', " << isascii << " )"; @@ -3875,6 +3858,8 @@ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii) // Perform Export PrepareForWriting( file ); _impl->ExportSTL( file, isascii, name.in() ); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -3892,7 +3877,6 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart, const GEOM::ListOfFields& fields, const char* geomAssocFields, CORBA::Double ZTolerance) - throw (SALOME::SALOME_Exception) { MESSAGE("MED version: "<< version); SMESH_TRY; @@ -4277,9 +4261,8 @@ void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field& fieldWriter, void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, const char* file) - throw (SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4290,6 +4273,8 @@ void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToDAT( " << meshPart << ", r'" << file << "' )"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ /*! @@ -4299,9 +4284,8 @@ void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart, const char* file) - throw (SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4312,6 +4296,8 @@ void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToUNV( " << meshPart<< ", r'" << file << "' )"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ /*! @@ -4322,9 +4308,8 @@ void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart, void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart, const char* file, ::CORBA::Boolean isascii) - throw (SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4340,6 +4325,8 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( " << meshPart<< ", r'" << file << "', " << isascii << ")"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -4352,10 +4339,9 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart, const char* file, CORBA::Boolean overwrite, CORBA::Boolean groupElemsByType) - throw (SALOME::SALOME_Exception) { #ifdef WITH_CGNS - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4377,6 +4363,9 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( " << meshPart<< ", r'" << file << "', " << overwrite << ")"; + + SMESH_CATCH( SMESH::throwCorbaException ); + #else THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR); #endif @@ -4391,9 +4380,8 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart, void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart, const char* file, bool withRequiredGroups) - throw (SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4406,6 +4394,8 @@ void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart, << meshPart<< ", r'" << file << "', " << withRequiredGroups << ")"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //============================================================================= @@ -4430,7 +4420,7 @@ CORBA::Double SMESH_Mesh_i::GetComputeProgress() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbNodes() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4445,7 +4435,7 @@ CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbElements()throw (SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbElements() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4460,7 +4450,7 @@ CORBA::Long SMESH_Mesh_i::NbElements()throw (SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::Nb0DElements()throw (SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::Nb0DElements() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4475,7 +4465,7 @@ CORBA::Long SMESH_Mesh_i::Nb0DElements()throw (SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbBalls() throw (SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbBalls() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4490,7 +4480,7 @@ CORBA::Long SMESH_Mesh_i::NbBalls() throw (SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbEdges() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4505,8 +4495,7 @@ CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4521,7 +4510,7 @@ CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbFaces() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4536,7 +4525,7 @@ CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbTriangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4551,7 +4540,7 @@ CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbBiQuadTriangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4560,7 +4549,7 @@ CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles()throw(SALOME::SALOME_Exception) return _impl->NbBiQuadTriangles(); } -CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbQuadrangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4569,7 +4558,7 @@ CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception) return _impl->NbQuadrangles(); } -CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbBiQuadQuadrangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4578,7 +4567,7 @@ CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles()throw(SALOME::SALOME_Exception) return _impl->NbBiQuadQuadrangles(); } -CORBA::Long SMESH_Mesh_i::NbPolygons() throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPolygons() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4587,7 +4576,7 @@ CORBA::Long SMESH_Mesh_i::NbPolygons() throw(SALOME::SALOME_Exception) return _impl->NbPolygons(); } -CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4596,8 +4585,7 @@ CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) throw(SAL return _impl->NbPolygons((SMDSAbs_ElementOrder)order); } -CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4606,8 +4594,7 @@ CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) return _impl->NbFaces( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4616,8 +4603,7 @@ CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) return _impl->NbTriangles( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4628,7 +4614,7 @@ CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) //============================================================================= -CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbVolumes() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4637,7 +4623,7 @@ CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception) return _impl->NbVolumes(); } -CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbTetras() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4646,7 +4632,7 @@ CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception) return _impl->NbTetras(); } -CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbHexas() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4655,7 +4641,7 @@ CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception) return _impl->NbHexas(); } -CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbTriQuadraticHexas() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4664,7 +4650,7 @@ CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas()throw(SALOME::SALOME_Exception) return _impl->NbTriQuadraticHexas(); } -CORBA::Long SMESH_Mesh_i::NbPyramids()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPyramids() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4673,7 +4659,7 @@ CORBA::Long SMESH_Mesh_i::NbPyramids()throw(SALOME::SALOME_Exception) return _impl->NbPyramids(); } -CORBA::Long SMESH_Mesh_i::NbPrisms()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPrisms() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4682,7 +4668,7 @@ CORBA::Long SMESH_Mesh_i::NbPrisms()throw(SALOME::SALOME_Exception) return _impl->NbPrisms(); } -CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbHexagonalPrisms() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4691,7 +4677,7 @@ CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms()throw(SALOME::SALOME_Exception) return _impl->NbHexagonalPrisms(); } -CORBA::Long SMESH_Mesh_i::NbPolyhedrons()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPolyhedrons() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4700,8 +4686,7 @@ CORBA::Long SMESH_Mesh_i::NbPolyhedrons()throw(SALOME::SALOME_Exception) return _impl->NbPolyhedrons(); } -CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4710,8 +4695,7 @@ CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) return _impl->NbVolumes( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4720,8 +4704,7 @@ CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) return _impl->NbTetras( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4730,8 +4713,7 @@ CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) return _impl->NbHexas( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4740,8 +4722,7 @@ CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) return _impl->NbPyramids( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) - throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4756,7 +4737,7 @@ CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::NbSubMesh()throw(SALOME::SALOME_Exception) +SMESH::smIdType SMESH_Mesh_i::NbSubMesh() { Unexpect aCatch(SALOME_SalomeException); return _mapSubMesh_i.size(); @@ -4781,7 +4762,7 @@ char* SMESH_Mesh_i::Dump() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetIDs() +SMESH::smIdType_array* SMESH_Mesh_i::GetIDs() { return GetElementsId(); } @@ -4792,23 +4773,22 @@ SMESH::long_array* SMESH_Mesh_i::GetIDs() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetElementsId() - throw (SALOME::SALOME_Exception) +SMESH::smIdType_array* SMESH_Mesh_i::GetElementsId() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); if ( aSMESHDS_Mesh == NULL ) return aResult._retn(); - long nbElements = NbElements(); + smIdType nbElements = NbElements(); aResult->length( nbElements ); SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator(); - for ( int i = 0, n = nbElements; i < n && anIt->more(); i++ ) + for ( smIdType i = 0, n = nbElements; i < n && anIt->more(); i++ ) aResult[i] = anIt->next()->GetID(); return aResult._retn(); @@ -4821,20 +4801,19 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsId() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType ) - throw (SALOME::SALOME_Exception) +SMESH::smIdType_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType ) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); if ( aSMESHDS_Mesh == NULL ) return aResult._retn(); - long nbElements = NbElements(); + smIdType nbElements = NbElements(); // No sense in returning ids of elements along with ids of nodes: // when theElemType == SMESH::ALL, return node ids only if @@ -4844,7 +4823,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemTy aResult->length( nbElements ); - int i = 0; + smIdType i = 0; SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator( (SMDSAbs_ElementType)theElemType ); while ( i < nbElements && anIt->more() ) @@ -4861,23 +4840,22 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemTy */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetNodesId() - throw (SALOME::SALOME_Exception) +SMESH::smIdType_array* SMESH_Mesh_i::GetNodesId() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS(); if ( aMeshDS == NULL ) return aResult._retn(); - long nbNodes = NbNodes(); + smIdType nbNodes = NbNodes(); aResult->length( nbNodes ); SMDS_NodeIteratorPtr anIt = aMeshDS->nodesIterator(); - for ( int i = 0, n = nbNodes; i < n && anIt->more(); i++ ) + for ( smIdType i = 0, n = nbNodes; i < n && anIt->more(); i++ ) aResult[i] = anIt->next()->GetID(); return aResult._retn(); @@ -4889,8 +4867,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodesId() */ //============================================================================= -SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem ) - throw (SALOME::SALOME_Exception) +SMESH::ElementType SMESH_Mesh_i::GetElementType( const SMESH::smIdType id, const bool iselem ) { SMESH::ElementType type = SMESH::ALL; SMESH_TRY; @@ -4911,8 +4888,7 @@ SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const boo */ //============================================================================= -SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id ) - throw (SALOME::SALOME_Exception) +SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const SMESH::smIdType id ) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4930,8 +4906,7 @@ SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id ) */ //============================================================================= -SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id ) - throw (SALOME::SALOME_Exception) +SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const SMESH::smIdType id ) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4949,10 +4924,9 @@ SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id ) */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) - throw (SALOME::SALOME_Exception) +SMESH::smIdType_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) { - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESH_TRY; if ( _preMeshInfo ) @@ -4967,7 +4941,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) aResult->length(SDSM->NbElements()); SMDS_ElemIteratorPtr eIt = SDSM->GetElements(); - int i = 0; + smIdType i = 0; while ( eIt->more() ) { aResult[i++] = eIt->next()->GetID(); } @@ -4985,11 +4959,10 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, +SMESH::smIdType_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CORBA::Boolean all) - throw (SALOME::SALOME_Exception) { - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESH_TRY; if ( _preMeshInfo ) @@ -5001,7 +4974,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); if(!SDSM) return aResult._retn(); - set theElems; + set theElems; if( !all || (SDSM->NbElements()==0) ) { // internal nodes or vertex submesh SMDS_NodeIteratorPtr nIt = SDSM->GetNodes(); while ( nIt->more() ) { @@ -5022,8 +4995,8 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, } aResult->length(theElems.size()); - set::iterator itElem; - int i = 0; + set::iterator itElem; + smIdType i = 0; for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) aResult[i++] = *itElem; @@ -5039,7 +5012,6 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, //============================================================================= SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID) - throw (SALOME::SALOME_Exception) { SMESH::ElementType type = SMESH::ALL; @@ -5091,7 +5063,7 @@ CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() */ //============================================================================= -SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id) +SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5122,13 +5094,13 @@ SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id) */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id, - SMESH::ElementType elemType) +SMESH::smIdType_array* SMESH_Mesh_i::GetNodeInverseElements(const SMESH::smIdType id, + SMESH::ElementType elemType) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS(); if ( aMeshDS == NULL ) return aResult._retn(); @@ -5142,7 +5114,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id, SMDSAbs_ElementType type = SMDSAbs_ElementType( elemType ); SMDS_ElemIteratorPtr eIt = aNode->GetInverseElementIterator( type ); aResult->length( aNode->NbInverseElements( type )); - for( int i = 0; eIt->more(); ++i ) + for( smIdType i = 0; eIt->more(); ++i ) { const SMDS_MeshElement* elem = eIt->next(); aResult[ i ] = elem->GetID(); @@ -5156,7 +5128,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id, */ //============================================================================= -SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(CORBA::Long NodeID) +SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(SMESH::smIdType NodeID) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5209,7 +5181,7 @@ SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(CORBA::Long NodeID) */ //============================================================================= -SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(CORBA::Long ElemID) +SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(SMESH::smIdType ElemID) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5256,7 +5228,7 @@ SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(CORBA::Long ElemID) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::GetShapeID(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5283,7 +5255,7 @@ CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5313,7 +5285,7 @@ CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id) +CORBA::Short SMESH_Mesh_i::GetElemNbNodes(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5335,7 +5307,7 @@ CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long index) +SMESH::smIdType SMESH_Mesh_i::GetElemNode(const SMESH::smIdType id, const CORBA::Short index) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5354,18 +5326,18 @@ CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long in */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id) +SMESH::smIdType_array* SMESH_Mesh_i::GetElemNodes(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) { if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(id) ) { aResult->length( elem->NbNodes() ); - for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) + for ( SMESH::smIdType i = 0; i < aResult->length(); ++i ) if ( const SMDS_MeshNode* n = elem->GetNode( i )) aResult[ i ] = n->GetID(); } @@ -5380,7 +5352,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id) */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const CORBA::Long ide, const CORBA::Long idn) +CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const SMESH::smIdType ide, const SMESH::smIdType idn) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5405,7 +5377,7 @@ CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const CORBA::Long ide, const CORBA::Lo */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const CORBA::Long idn, +CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const SMESH::smIdType idn, SMESH::ElementType theElemType) { if ( _preMeshInfo ) @@ -5436,7 +5408,7 @@ CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const CORBA::Long idn, */ //============================================================================= -CORBA::Long SMESH_Mesh_i::ElemNbEdges(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::ElemNbEdges(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5455,7 +5427,7 @@ CORBA::Long SMESH_Mesh_i::ElemNbEdges(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::ElemNbFaces(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::ElemNbFaces(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5473,13 +5445,13 @@ CORBA::Long SMESH_Mesh_i::ElemNbFaces(const CORBA::Long id) */ //================================================================================ -SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId, - CORBA::Short faceIndex) +SMESH::smIdType_array* SMESH_Mesh_i::GetElemFaceNodes(SMESH::smIdType elemId, + CORBA::Short faceIndex) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) { if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(elemId) ) @@ -5489,7 +5461,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId, { aResult->length( vtool.NbFaceNodes( faceIndex )); const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex ); - for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) + for ( SMESH::smIdType i = 0; i < aResult->length(); ++i ) aResult[ i ] = nn[ i ]->GetID(); } } @@ -5531,7 +5503,7 @@ SMESH::double_array* SMESH_Mesh_i::GetFaceNormal(CORBA::Long elemId, */ //================================================================================ -CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes) +SMESH::smIdType SMESH_Mesh_i::FindElementByNodes(const SMESH::smIdType_array& nodes) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5561,18 +5533,18 @@ CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes) */ //================================================================================ -SMESH::long_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::long_array& nodes, - SMESH::ElementType elemType) +SMESH::smIdType_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::smIdType_array& nodes, + SMESH::ElementType elemType) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var result = new SMESH::long_array(); + SMESH::smIdType_array_var result = new SMESH::smIdType_array(); if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() ) { vector< const SMDS_MeshNode * > nn( nodes.length() ); - for ( CORBA::ULong i = 0; i < nodes.length(); ++i ) + for ( SMESH::smIdType i = 0; i < nodes.length(); ++i ) nn[i] = mesh->FindNode( nodes[i] ); std::vector elems; @@ -5590,7 +5562,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::long_array& nod */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsPoly(const CORBA::Long id) +CORBA::Boolean SMESH_Mesh_i::IsPoly(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5609,7 +5581,7 @@ CORBA::Boolean SMESH_Mesh_i::IsPoly(const CORBA::Long id) */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const CORBA::Long id) +CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5627,7 +5599,7 @@ CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const CORBA::Long id) */ //============================================================================= -CORBA::Double SMESH_Mesh_i::GetBallDiameter(CORBA::Long id) +CORBA::Double SMESH_Mesh_i::GetBallDiameter(SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5645,7 +5617,7 @@ CORBA::Double SMESH_Mesh_i::GetBallDiameter(CORBA::Long id) */ //============================================================================= -SMESH::double_array* SMESH_Mesh_i::BaryCenter(const CORBA::Long id) +SMESH::double_array* SMESH_Mesh_i::BaryCenter(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5699,7 +5671,6 @@ SMESH::double_array* SMESH_Mesh_i::BaryCenter(const CORBA::Long id) SMESH::ListOfGroups* SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID, const char* theGroupName ) - throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); @@ -5823,7 +5794,7 @@ void SMESH_Mesh_i::CreateGroupServants() // register CORBA object for persistence int nextId = _gen_i->RegisterObject( groupVar ); if(MYDEBUG) { MESSAGE( "Add group to map with id = "<< nextId); } - else { nextId = 0; } // avoid "unused variable" warning in release mode + else { (void)nextId; } // avoid "unused variable" warning in release mode // publishing the groups in the study GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape ); @@ -6008,7 +5979,7 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters() SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen(); if(gen) { CORBA::String_var aParameters = GetParameters(); - SALOMEDS::ListOfListOfStrings_var aSections = SMESH_Gen_i::getStudyServant()->ParseVariables(aParameters); + SALOMEDS::ListOfListOfStrings_var aSections = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->ParseVariables(aParameters); if ( aSections->length() > 0 ) { SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ]; aResult->length( aVars.length() ); @@ -6077,12 +6048,12 @@ bool SMESH_Mesh_i::IsMeshInfoCorrect() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetMeshInfo() +SMESH::smIdType_array* SMESH_Mesh_i::GetMeshInfo() { if ( _preMeshInfo ) return _preMeshInfo->GetMeshInfo(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) aRes[i] = 0; @@ -6101,11 +6072,11 @@ SMESH::long_array* SMESH_Mesh_i::GetMeshInfo() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType() +SMESH::smIdType_array* SMESH_Mesh_i::GetNbElementsByType() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::NB_ELEMENT_TYPES); - for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) + for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[ i ] = 0; const SMDS_MeshInfo* meshInfo = 0; @@ -6115,7 +6086,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType() meshInfo = & meshDS->GetMeshInfo(); if (meshInfo) - for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) + for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[i] = meshInfo->NbElements((SMDSAbs_ElementType)i); return aRes._retn(); @@ -6128,7 +6099,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType() //============================================================================= void SMESH_Mesh_i::CollectMeshInfo(const SMDS_ElemIteratorPtr theItr, - SMESH::long_array& theInfo) + SMESH::smIdType_array& theInfo) { if (!theItr) return; while (theItr->more()) @@ -6208,25 +6179,25 @@ namespace /* Iterators used in SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_v //----------------------------------------------------------------------------- struct IDSourceIterator : public SMDS_ElemIterator { - const CORBA::Long* _idPtr; - const CORBA::Long* _idEndPtr; - SMESH::long_array_var _idArray; - const SMDS_Mesh* _mesh; - const SMDSAbs_ElementType _type; - const SMDS_MeshElement* _elem; - - IDSourceIterator( const SMDS_Mesh* mesh, - const CORBA::Long* ids, - const int nbIds, - SMDSAbs_ElementType type): + const SMESH::smIdType* _idPtr; + const SMESH::smIdType* _idEndPtr; + SMESH::smIdType_array_var _idArray; + const SMDS_Mesh* _mesh; + const SMDSAbs_ElementType _type; + const SMDS_MeshElement* _elem; + + IDSourceIterator( const SMDS_Mesh* mesh, + const SMESH::smIdType* ids, + const smIdType nbIds, + SMDSAbs_ElementType type): _idPtr( ids ), _idEndPtr( ids + nbIds ), _mesh( mesh ), _type( type ), _elem( 0 ) { if ( _idPtr && nbIds && _mesh ) next(); } - IDSourceIterator( const SMDS_Mesh* mesh, - SMESH::long_array* idArray, - SMDSAbs_ElementType type): + IDSourceIterator( const SMDS_Mesh* mesh, + SMESH::smIdType_array* idArray, + SMDSAbs_ElementType type): _idPtr( 0 ), _idEndPtr( 0 ), _idArray( idArray), _mesh( mesh ), _type( type ), _elem( 0 ) { if ( idArray && _mesh ) @@ -6377,13 +6348,13 @@ SMDS_ElemIteratorPtr SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_ptr theObje SMDSAbs_ElementType iterType = isNodes ? SMDSAbs_Node : elemType; if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject )) { - int nbIds; - if ( CORBA::Long* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds )) + SMESH::smIdType nbIds; + if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds )) elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType )); } else { - SMESH::long_array_var ids = theObject->GetIDs(); + SMESH::smIdType_array_var ids = theObject->GetIDs(); elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids._retn(), iterType )); } typeOK = ( isNodes == ( elemType == SMDSAbs_Node )) || ( elemType == SMDSAbs_All ); @@ -6484,7 +6455,7 @@ class SMESH_DimHyp TopTools_MapIteratorOfMapOfShape anItr( theToCheck ); for (; !isShared && anItr.More(); anItr.Next() ) { - const TopoDS_Shape aSubSh = anItr.Key(); + const TopoDS_Shape& aSubSh = anItr.Key(); // check for case when concurrent dimensions are same isShared = theToFind.Contains( aSubSh ); // check for sub-shape with concurrent dimension @@ -6637,10 +6608,13 @@ void findConcurrents(const SMESH_DimHyp* theDimHyp, } //----------------------------------------------------------------------------- -void unionLists(TListOfInt& theListOfId, +bool unionLists(TListOfInt& theListOfId, TListOfListOfInt& theListOfListOfId, const int theIndx ) { + bool changed = false; + if ( theListOfId.empty() ) + return changed; TListOfListOfInt::iterator it = theListOfListOfId.begin(); for ( int i = 0; it != theListOfListOfId.end(); it++, i++ ) { @@ -6656,11 +6630,15 @@ void unionLists(TListOfInt& theListOfId, TListOfInt::iterator it2 = otherListOfId.begin(); for ( ; it2 != otherListOfId.end(); it2++ ) { if ( find( theListOfId.begin(), theListOfId.end(), (*it2) ) == theListOfId.end() ) + { theListOfId.push_back(*it2); + changed = true; + } } // clear source list otherListOfId.clear(); } + return changed; } //----------------------------------------------------------------------------- @@ -6744,10 +6722,15 @@ SMESH::submesh_array_array* SMESH_Mesh_i::GetMeshOrder() TListOfListOfInt allConurrent = findConcurrentSubMeshes(); anOrder.splice( anOrder.end(), allConurrent ); - int listIndx = 0; - TListOfListOfInt::iterator listIt = anOrder.begin(); - for(; listIt != anOrder.end(); listIt++, listIndx++ ) - unionLists( *listIt, anOrder, listIndx + 1 ); + bool changed; + do { + changed = false; + TListOfListOfInt::iterator listIt = anOrder.begin(); + for ( int listIndx = 1; listIt != anOrder.end(); listIt++, listIndx++ ) + if ( unionLists( *listIt, anOrder, listIndx )) + changed = true; + } + while ( changed ); // convert submesh ids into interface instances // and dump command into python @@ -7019,7 +7002,7 @@ SMESH_MeshPartDS::SMESH_MeshPartDS(SMESH::SMESH_IDSource_ptr meshPart): else { TMeshInfo tmpInfo; - SMESH::long_array_var anIDs = meshPart->GetIDs(); + SMESH::smIdType_array_var anIDs = meshPart->GetIDs(); SMESH::array_of_ElementType_var types = meshPart->GetTypes(); if ( types->length() == 1 && types[0] == SMESH::NODE ) // group of nodes { @@ -7098,35 +7081,35 @@ bool SMESH_MeshPartDS::HasNumerationHoles() MaxElementID() != NbElements() ); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MaxNodeID() const +smIdType SMESH_MeshPartDS::MaxNodeID() const { if ( _meshDS ) return _meshDS->MaxNodeID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID(); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MinNodeID() const +smIdType SMESH_MeshPartDS::MinNodeID() const { if ( _meshDS ) return _meshDS->MinNodeID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID(); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MaxElementID() const +smIdType SMESH_MeshPartDS::MaxElementID() const { if ( _meshDS ) return _meshDS->MaxElementID(); - int maxID = 0; + smIdType maxID = 0; for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType ) if ( !_elements[ iType ].empty() ) - maxID = Max( maxID, (*_elements[ iType ].rbegin())->GetID() ); + maxID = std::max( maxID, (*_elements[ iType ].rbegin())->GetID() ); return maxID; } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MinElementID() const +smIdType SMESH_MeshPartDS::MinElementID() const { if ( _meshDS ) return _meshDS->MinElementID(); - int minID = 0; + smIdType minID = 0; for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType ) if ( !_elements[ iType ].empty() ) - minID = Min( minID, (*_elements[ iType ].begin())->GetID() ); + minID = std::min( minID, (*_elements[ iType ].begin())->GetID() ); return minID; } // -------------------------------------------------------------------------------------