mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-02 04:24:28 +05:00
Add missing try/catch using SMESH_TryCatch.hxx
This commit is contained in:
parent
c3597c66f0
commit
bd7cecec9a
@ -81,6 +81,8 @@
|
||||
#include <sstream>
|
||||
#include <limits>
|
||||
|
||||
#include "SMESH_TryCatch.hxx" // include after OCCT headers!
|
||||
|
||||
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
|
||||
|
||||
using namespace std;
|
||||
@ -856,6 +858,8 @@ CORBA::Long SMESH_MeshEditor_i::AddBall(CORBA::Long IDOfNode, CORBA::Double diam
|
||||
if ( diameter < std::numeric_limits<double>::min() )
|
||||
THROW_SALOME_CORBA_EXCEPTION("Invalid diameter", SALOME::BAD_PARAM);
|
||||
|
||||
SMESH_TRY;
|
||||
|
||||
const SMDS_MeshNode* aNode = getMeshDS()->FindNode(IDOfNode);
|
||||
SMDS_MeshElement* elem = getMeshDS()->AddBall(aNode, diameter);
|
||||
|
||||
@ -869,6 +873,8 @@ CORBA::Long SMESH_MeshEditor_i::AddBall(CORBA::Long IDOfNode, CORBA::Double diam
|
||||
if (elem)
|
||||
return elem->GetID();
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1137,6 +1143,8 @@ SMESH_MeshEditor_i::Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObje
|
||||
SMESH::SMESH_IDSource_var result;
|
||||
TPythonDump pyDump;
|
||||
|
||||
SMESH_TRY;
|
||||
|
||||
TIDSortedElemSet elements, elems0D;
|
||||
if ( idSourceToSet( theObject, getMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
|
||||
getEditor().Create0DElementsOnAllNodes( elements, elems0D );
|
||||
@ -1183,6 +1191,8 @@ SMESH_MeshEditor_i::Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObje
|
||||
pyDump << " = " << this << ".Create0DElementsOnAllNodes( "
|
||||
<< theObject << ", '" << theGroupName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return result._retn();
|
||||
}
|
||||
|
||||
@ -6192,8 +6202,10 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::Li
|
||||
CORBA::Boolean createJointElems )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
initData();
|
||||
bool aResult = false;
|
||||
|
||||
SMESH_TRY;
|
||||
initData();
|
||||
|
||||
SMESHDS_Mesh* aMeshDS = getMeshDS();
|
||||
|
||||
@ -6215,7 +6227,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::Li
|
||||
}
|
||||
}
|
||||
|
||||
bool aResult = getEditor().DoubleNodesOnGroupBoundaries( domains, createJointElems );
|
||||
aResult = getEditor().DoubleNodesOnGroupBoundaries( domains, createJointElems );
|
||||
// TODO publish the groups of flat elements in study
|
||||
|
||||
myMesh->GetMeshDS()->Modified();
|
||||
@ -6223,6 +6235,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::Li
|
||||
// Update Python script
|
||||
TPythonDump() << "isDone = " << this << ".DoubleNodesOnGroupBoundaries( " << &theDomains
|
||||
<< ", " << createJointElems << " )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResult;
|
||||
}
|
||||
|
||||
@ -6284,6 +6299,8 @@ void SMESH_MeshEditor_i::CreateHoleSkin(CORBA::Double radius,
|
||||
SMESH::array_of_long_array_out GroupsOfNodes)
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH_TRY;
|
||||
|
||||
initData();
|
||||
std::vector<std::vector<int> > aListOfListOfNodes;
|
||||
::SMESH_MeshEditor aMeshEditor( myMesh );
|
||||
@ -6299,7 +6316,8 @@ throw (SALOME::SALOME_Exception)
|
||||
}
|
||||
|
||||
TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theShape );
|
||||
aMeshEditor.CreateHoleSkin(radius, aShape, theNodeSearcher, groupName, nodesCoords, aListOfListOfNodes);
|
||||
aMeshEditor.CreateHoleSkin(radius, aShape, theNodeSearcher, groupName,
|
||||
nodesCoords, aListOfListOfNodes);
|
||||
|
||||
GroupsOfNodes = new SMESH::array_of_long_array;
|
||||
GroupsOfNodes->length( aListOfListOfNodes.size() );
|
||||
@ -6314,7 +6332,12 @@ throw (SALOME::SALOME_Exception)
|
||||
aGroup[ j ] = (*lIt);
|
||||
}
|
||||
TPythonDump() << "lists_nodes = " << this << ".CreateHoleSkin( "
|
||||
<< radius << ", " << theShape << ", " << ", " << groupName << ", " << theNodesCoords << " )";
|
||||
<< radius << ", "
|
||||
<< theShape
|
||||
<< ", '" << groupName << "', "
|
||||
<< theNodesCoords << " )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,6 @@
|
||||
#include <SALOMEDS_Attributes_wrap.hxx>
|
||||
#include <SALOMEDS_wrap.hxx>
|
||||
#include <SALOME_NamingService.hxx>
|
||||
#include <Utils_CorbaException.hxx>
|
||||
#include <Utils_ExceptHandlers.hxx>
|
||||
#include <Utils_SINGLETON.hxx>
|
||||
#include <utilities.h>
|
||||
@ -80,11 +79,14 @@
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
|
||||
#include "SMESH_TryCatch.hxx" // include after OCCT headers!
|
||||
|
||||
// STL Includes
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef _DEBUG_
|
||||
@ -98,7 +100,6 @@ using SMESH::TPythonDump;
|
||||
|
||||
int SMESH_Mesh_i::_idGenerator = 0;
|
||||
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* Constructor
|
||||
@ -449,11 +450,15 @@ char* SMESH_Mesh_i::GetVersionString(SMESH::MED_VERSION version, CORBA::Short nb
|
||||
int SMESH_Mesh_i::ImportUNVFile( const char* theFileName )
|
||||
throw ( SALOME::SALOME_Exception )
|
||||
{
|
||||
SMESH_TRY;
|
||||
|
||||
// Read mesh with name = <theMeshName> into SMESH_Mesh
|
||||
_impl->UNVToMesh( theFileName );
|
||||
|
||||
CreateGroupServants();
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -467,12 +472,30 @@ int SMESH_Mesh_i::ImportUNVFile( const char* theFileName )
|
||||
int SMESH_Mesh_i::ImportSTLFile( const char* theFileName )
|
||||
throw ( SALOME::SALOME_Exception )
|
||||
{
|
||||
SMESH_TRY;
|
||||
|
||||
// Read mesh with name = <theMeshName> into SMESH_Mesh
|
||||
_impl->STLToMesh( theFileName );
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Function used in SMESH_CATCH by ImportGMFFile()
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
namespace
|
||||
{
|
||||
SMESH_ComputeErrorPtr exceptionToComputeError(const char* excText)
|
||||
{
|
||||
return SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, excText );
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Imports data from a GMF file and returns an error description
|
||||
@ -484,29 +507,16 @@ SMESH::ComputeError* SMESH_Mesh_i::ImportGMFFile( const char* theFileName,
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH_ComputeErrorPtr error;
|
||||
try {
|
||||
|
||||
#undef SMESH_CAUGHT
|
||||
#define SMESH_CAUGHT error =
|
||||
SMESH_TRY;
|
||||
|
||||
error = _impl->GMFToMesh( theFileName, theMakeRequiredGroups );
|
||||
}
|
||||
catch ( std::bad_alloc& exc ) {
|
||||
error = SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, "std::bad_alloc raised" );
|
||||
}
|
||||
catch ( Standard_OutOfMemory& exc ) {
|
||||
error = SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, "Standard_OutOfMemory raised" );
|
||||
}
|
||||
catch (Standard_Failure& ex) {
|
||||
error = SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, ex.DynamicType()->Name() );
|
||||
if ( ex.GetMessageString() && strlen( ex.GetMessageString() ))
|
||||
error->myComment += string(": ") + ex.GetMessageString();
|
||||
}
|
||||
catch ( SALOME_Exception& S_ex ) {
|
||||
error = SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, S_ex.what() );
|
||||
}
|
||||
catch ( std::exception& exc ) {
|
||||
error = SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, exc.what() );
|
||||
}
|
||||
catch (...) {
|
||||
error = SMESH_ComputeError::New( Driver_Mesh::DRS_FAIL, "Unknown exception" );
|
||||
}
|
||||
|
||||
SMESH_CATCH( exceptionToComputeError );
|
||||
#undef SMESH_CAUGHT
|
||||
#define SMESH_CAUGHT
|
||||
|
||||
CreateGroupServants();
|
||||
|
||||
@ -846,7 +856,8 @@ 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)
|
||||
{
|
||||
if(MYDEBUG) MESSAGE("SMESH_Mesh_i::RemoveSubMesh");
|
||||
SMESH_TRY;
|
||||
|
||||
if ( theSubMesh->_is_nil() )
|
||||
return;
|
||||
|
||||
@ -878,6 +889,8 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
|
||||
if ( removeSubMesh( theSubMesh, aSubShapeObject.in() ))
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->ForgetOrLoad();
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -1010,6 +1023,8 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
|
||||
if ( theGroup->_is_nil() )
|
||||
return;
|
||||
|
||||
SMESH_TRY;
|
||||
|
||||
SMESH_GroupBase_i* aGroup =
|
||||
dynamic_cast<SMESH_GroupBase_i*>( SMESH_Gen_i::GetServant( theGroup ).in() );
|
||||
if ( !aGroup )
|
||||
@ -1031,6 +1046,8 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
|
||||
|
||||
// Remove the group from SMESH data structures
|
||||
removeGroup( aGroup->GetLocalID() );
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -1042,6 +1059,7 @@ 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 )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
@ -1069,6 +1087,8 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup
|
||||
|
||||
// Remove group
|
||||
RemoveGroup( theGroup );
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
@ -1137,11 +1157,12 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the
|
||||
const char* theName )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
try
|
||||
{
|
||||
if ( theGroup1->_is_nil() || theGroup2->_is_nil() ||
|
||||
theGroup1->GetType() != theGroup2->GetType() )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
@ -1149,7 +1170,7 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the
|
||||
TPythonDump pyDump;
|
||||
|
||||
// Create Union
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( theGroup1->GetType(), theName );
|
||||
aResGrp = CreateGroup( theGroup1->GetType(), theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
@ -1179,13 +1200,10 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the
|
||||
<< theGroup1 << ", " << theGroup2 << ", '"
|
||||
<< theName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
@ -1206,8 +1224,10 @@ throw (SALOME::SALOME_Exception)
|
||||
if ( !theName )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
try
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
|
||||
vector< int > anIds;
|
||||
SMESH::ElementType aType = SMESH::ALL;
|
||||
for ( int g = 0, n = theGroups.length(); g < n; g++ )
|
||||
@ -1238,7 +1258,7 @@ throw (SALOME::SALOME_Exception)
|
||||
TPythonDump pyDump;
|
||||
|
||||
// Create group
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( aType, theName );
|
||||
aResGrp = CreateGroup( aType, theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
@ -1254,13 +1274,10 @@ throw (SALOME::SALOME_Exception)
|
||||
pyDump << aResGrp << " = " << _this() << ".UnionListOfGroups( "
|
||||
<< &theGroups << ", '" << theName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*! IntersectGroups
|
||||
@ -1273,6 +1290,9 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr
|
||||
const char* theName )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
@ -1283,7 +1303,7 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr
|
||||
TPythonDump pyDump;
|
||||
|
||||
// Create Intersection
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( theGroup1->GetType(), theName );
|
||||
aResGrp = CreateGroup( theGroup1->GetType(), theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return aResGrp;
|
||||
|
||||
@ -1310,6 +1330,8 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr
|
||||
pyDump << aResGrp << " = " << _this() << ".IntersectGroups( "
|
||||
<< theGroup1 << ", " << theGroup2 << ", '" << theName << "')";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
|
||||
@ -1327,14 +1349,15 @@ SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups,
|
||||
const char* theName )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
if ( !theName )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
try
|
||||
{
|
||||
NCollection_DataMap< int, int > anIdToCount;
|
||||
SMESH::ElementType aType = SMESH::ALL;
|
||||
for ( int g = 0, n = theGroups.length(); g < n; g++ )
|
||||
@ -1380,7 +1403,7 @@ SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups,
|
||||
TPythonDump pyDump;
|
||||
|
||||
// Create group
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( aType, theName );
|
||||
aResGrp = CreateGroup( aType, theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
@ -1396,13 +1419,10 @@ SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups,
|
||||
pyDump << aResGrp << " = " << _this() << ".IntersectListOfGroups( "
|
||||
<< &theGroups << ", '" << theName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*! CutGroups
|
||||
@ -1415,6 +1435,9 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups( SMESH::SMESH_GroupBase_ptr theGr
|
||||
const char* theName )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
@ -1425,7 +1448,7 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups( SMESH::SMESH_GroupBase_ptr theGr
|
||||
TPythonDump pyDump;
|
||||
|
||||
// Perform Cutting
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( theGroup1->GetType(), theName );
|
||||
aResGrp = CreateGroup( theGroup1->GetType(), theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return aResGrp;
|
||||
|
||||
@ -1454,6 +1477,8 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups( SMESH::SMESH_GroupBase_ptr theGr
|
||||
<< theGroup1 << ", " << theGroup2 << ", '"
|
||||
<< theName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
|
||||
@ -1473,14 +1498,15 @@ SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups,
|
||||
const char* theName )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
if ( !theName )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
try
|
||||
{
|
||||
set< int > aToolIds;
|
||||
SMESH::ElementType aType = SMESH::ALL;
|
||||
int g, n;
|
||||
@ -1542,7 +1568,7 @@ SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups,
|
||||
TPythonDump pyDump;
|
||||
|
||||
// Create group
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( aType, theName );
|
||||
aResGrp = CreateGroup( aType, theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
@ -1559,13 +1585,10 @@ SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups,
|
||||
<< &theMainGroups << ", " << &theToolGroups << ", '"
|
||||
<< theName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
@ -1588,6 +1611,9 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfGroups& theGroups,
|
||||
const char* theName )
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::SMESH_Group_var aResGrp;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
@ -1602,7 +1628,7 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfGroups& theGroups,
|
||||
|
||||
TPythonDump pyDump;
|
||||
|
||||
SMESH::SMESH_Group_var aResGrp = CreateGroup( theElemType, theName );
|
||||
aResGrp = CreateGroup( theElemType, theName );
|
||||
if ( aResGrp->_is_nil() )
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
|
||||
@ -1610,8 +1636,6 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfGroups& theGroups,
|
||||
SMESH::DownCast<SMESH_GroupBase_i*>( aResGrp )->GetGroupDS();
|
||||
SMDS_MeshGroup& resGroupCore = static_cast< SMESHDS_Group* >( groupBaseDS )->SMDSGroup();
|
||||
|
||||
try
|
||||
{
|
||||
for ( int g = 0, n = theGroups.length(); g < n; g++ ) // loop on theGroups
|
||||
{
|
||||
SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ];
|
||||
@ -1664,13 +1688,10 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfGroups& theGroups,
|
||||
pyDump << aResGrp << " = " << _this() << ".CreateDimGroup( "
|
||||
<< &theGroups << ", " << theElemType << ", '" << theName << "' )";
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResGrp._retn();
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
return SMESH::SMESH_Group::_nil();
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
@ -2034,16 +2055,18 @@ 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;
|
||||
|
||||
SMESH_TRY;
|
||||
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
SMESH::SMESH_Group_var aGroup;
|
||||
if ( theGroup->_is_nil() )
|
||||
return aGroup._retn();
|
||||
|
||||
Unexpect aCatch(SALOME_SalomeException);
|
||||
|
||||
SMESH_GroupBase_i* aGroupToRem =
|
||||
dynamic_cast<SMESH_GroupBase_i*>( SMESH_Gen_i::GetServant( theGroup ).in() );
|
||||
if ( !aGroupToRem )
|
||||
@ -2105,6 +2128,8 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase
|
||||
CORBA::String_var ior = _gen_i->GetORB()->object_to_string( aGroup );
|
||||
builder->SetIOR( aGroupSO, ior.in() );
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aGroup._retn();
|
||||
}
|
||||
|
||||
@ -2289,11 +2314,12 @@ 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;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
SMESH::log_array_var aLog;
|
||||
try{
|
||||
list < SMESHDS_Command * >logDS = _impl->GetLog();
|
||||
aLog = new SMESH::log_array;
|
||||
int indexLog = 0;
|
||||
@ -2334,10 +2360,9 @@ throw(SALOME::SALOME_Exception)
|
||||
}
|
||||
if(clearAfterGet)
|
||||
_impl->ClearLog();
|
||||
}
|
||||
catch(SALOME_Exception & S_ex){
|
||||
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
|
||||
}
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aLog._retn();
|
||||
}
|
||||
|
||||
@ -2350,8 +2375,9 @@ throw(SALOME::SALOME_Exception)
|
||||
|
||||
void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
|
||||
{
|
||||
if(MYDEBUG) MESSAGE("SMESH_Mesh_i::ClearLog");
|
||||
SMESH_TRY;
|
||||
_impl->ClearLog();
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -2362,7 +2388,6 @@ void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
|
||||
|
||||
CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
|
||||
{
|
||||
if(MYDEBUG) MESSAGE("SMESH_Mesh_i::GetId");
|
||||
return _id;
|
||||
}
|
||||
|
||||
@ -2438,18 +2463,24 @@ 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;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
// Create MeshEditor
|
||||
SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( this, false );
|
||||
SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
|
||||
aMeshEdVar = aMeshEditor->_this();
|
||||
|
||||
// Update Python script
|
||||
TPythonDump() << aMeshEditor << " = " << _this() << ".GetMeshEditor()";
|
||||
|
||||
return aMesh._retn();
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aMeshEdVar._retn();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -2459,13 +2490,20 @@ 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;
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( this, true );
|
||||
SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
|
||||
return aMesh._retn();
|
||||
aMeshEdVar = aMeshEditor->_this();
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aMeshEdVar._retn();
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
@ -3374,10 +3412,17 @@ 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 type;
|
||||
SMESH_TRY;
|
||||
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
return ( SMESH::ElementType )_impl->GetElementType( id, iselem );
|
||||
type = ( SMESH::ElementType ) _impl->GetElementType( id, iselem );
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -3407,11 +3452,12 @@ SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id )
|
||||
SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID)
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
SMESH::long_array_var aResult = new SMESH::long_array();
|
||||
|
||||
SMESH_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
SMESH::long_array_var aResult = new SMESH::long_array();
|
||||
|
||||
SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID);
|
||||
if(!SM) return aResult._retn();
|
||||
|
||||
@ -3426,6 +3472,8 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID)
|
||||
aResult[i++] = eIt->next()->GetID();
|
||||
}
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResult._retn();
|
||||
}
|
||||
|
||||
@ -3441,11 +3489,12 @@ SMESH::long_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_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
SMESH::long_array_var aResult = new SMESH::long_array();
|
||||
|
||||
SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID);
|
||||
if(!SM) return aResult._retn();
|
||||
|
||||
@ -3478,6 +3527,8 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID,
|
||||
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
|
||||
aResult[i++] = *itElem;
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return aResult._retn();
|
||||
}
|
||||
|
||||
@ -3490,6 +3541,9 @@ 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_TRY;
|
||||
if ( _preMeshInfo )
|
||||
_preMeshInfo->FullLoadFromFile();
|
||||
|
||||
@ -3504,7 +3558,12 @@ SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID
|
||||
|
||||
SMDS_ElemIteratorPtr eIt = SDSM->GetElements();
|
||||
const SMDS_MeshElement* anElem = eIt->next();
|
||||
return ( SMESH::ElementType ) anElem->GetType();
|
||||
|
||||
type = ( SMESH::ElementType ) anElem->GetType();
|
||||
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user