//=============================================================================
void SMESH_Mesh_i::SetShape( GEOM::GEOM_Object_ptr theShapeObject )
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
try {
//================================================================================
CORBA::Boolean SMESH_Mesh_i::HasShapeToMesh()
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
bool res = false;
//================================================================================
GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Object_var aShapeObj;
*/
//================================================================================
-CORBA::Boolean SMESH_Mesh_i::IsLoaded() throw (SALOME::SALOME_Exception)
+CORBA::Boolean SMESH_Mesh_i::IsLoaded()
{
Unexpect aCatch(SALOME_SalomeException);
return !_preMeshInfo;
*/
//================================================================================
-void SMESH_Mesh_i::Load() throw (SALOME::SALOME_Exception)
+void SMESH_Mesh_i::Load()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception)
+void SMESH_Mesh_i::Clear()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//================================================================================
void SMESH_Mesh_i::ClearSubMesh(CORBA::Long ShapeID)
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
SMESH::DriverMED_ReadStatus
SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName )
- throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
int status;
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;
//=============================================================================
int SMESH_Mesh_i::ImportUNVFile( const char* theFileName )
- throw ( SALOME::SALOME_Exception )
{
SMESH_TRY;
//=============================================================================
int SMESH_Mesh_i::ImportSTLFile( const char* theFileName )
- throw ( SALOME::SALOME_Exception )
{
SMESH_TRY;
SMESH::ComputeError* SMESH_Mesh_i::ImportGMFFile( const char* theFileName,
bool theMakeRequiredGroups )
- throw (SALOME::SALOME_Exception)
{
SMESH_ComputeErrorPtr error;
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 int 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();
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 )
SMESH::ListOfHypothesis *
SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShape)
-throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if (MYDEBUG) MESSAGE("GetHypothesisList");
*/
//================================================================================
-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");
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))
//================================================================================
void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType,
const char* theName )
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
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 )
SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType,
const char* theName,
SMESH::Filter_ptr theFilter )
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//================================================================================
void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
- throw (SALOME::SALOME_Exception)
{
if ( theGroup->_is_nil() )
return;
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
//=============================================================================
void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
if ( _preMeshInfo )
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 << " )";
*/
//================================================================================
-SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception)
+SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups()
{
Unexpect aCatch(SALOME_SalomeException);
if (MYDEBUG) MESSAGE("GetGroups");
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::NbGroups() throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbGroups()
{
Unexpect aCatch(SALOME_SalomeException);
return _mapGroups.size();
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;
SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionListOfGroups(const SMESH::ListOfGroups& theGroups,
const char* theName )
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var aResGrp;
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;
SMESH::SMESH_Group_ptr
SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups,
const char* theName )
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var aResGrp;
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;
SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups,
const SMESH::ListOfGroups& theToolGroups,
const char* theName )
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var aResGrp;
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;
}
const char* theName,
SMESH::NB_COMMON_NODES_ENUM theNbCommonNodes,
CORBA::Boolean theUnderlyingOnly)
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var aResGrp;
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",
//================================================================================
void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom)
- throw (SALOME::SALOME_Exception)
{
// check if geometry changed
bool geomChanged = true;
GEOM::GEOM_Object_var oldGeom = GetShapeToMesh();
if ( !theNewGeom->_is_nil() && !oldGeom->_is_nil() )
- geomChanged = ( //oldGeom->_is_equivalent( theNewGeom ) ||
- oldGeom->GetTick() < theNewGeom->GetTick() );
+ geomChanged = ( oldGeom->GetTick() != theNewGeom->GetTick() );
TopoDS_Shape S = _impl->GetShapeToMesh();
GEOM_Client* geomClient = _gen_i->GetShapeReader();
TCollection_AsciiString aIOR;
- CORBA::String_var ior;
if ( geomClient->Find( S, aIOR ))
geomClient->RemoveShapeFromBuffer( aIOR );
// clear buffer also for sub-groups
- const std::set<SMESHDS_GroupBase*>& groups = _impl->GetMeshDS()->GetGroups();
+ SMESHDS_Mesh* meshDS = _impl->GetMeshDS();
+ const std::set<SMESHDS_GroupBase*>& groups = meshDS->GetGroups();
std::set<SMESHDS_GroupBase*>::const_iterator g = groups.begin();
for (; g != groups.end(); ++g)
if (const SMESHDS_GroupOnGeom* group = dynamic_cast<SMESHDS_GroupOnGeom*>(*g))
geomClient->RemoveShapeFromBuffer( aIOR );
}
+ // clear buffer also for sub-meshes
+ std::map<int, SMESH_subMesh_i*>::const_iterator aSubMeshIter = _mapSubMesh_i.cbegin();
+ for(; aSubMeshIter != _mapSubMesh_i.cend(); aSubMeshIter++) {
+ int aShapeID = aSubMeshIter->first;
+ const TopoDS_Shape& aSubShape = meshDS->IndexToShape(aShapeID);
+ TCollection_AsciiString aShapeIOR;
+ if ( geomClient->Find( aSubShape, aShapeIOR ))
+ geomClient->RemoveShapeFromBuffer( aShapeIOR );
+ }
+
typedef struct {
int shapeID, 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
- SMESHDS_Mesh* meshDS = _impl->GetMeshDS();
if ( !geomChanged )
{
// store positions of elements on geometry
//=============================================================================
SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase_ptr theGroup )
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var aGroup;
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 );
// 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 )
//================================================================================
SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
- throw(SALOME::SALOME_Exception)
{
SMESH::log_array_var aLog;
*/
//================================================================================
-void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
+void SMESH_Mesh_i::ClearLog()
{
SMESH_TRY;
_impl->ClearLog();
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::GetId()
{
return _id;
}
{
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 );
+ }
};
}
//=============================================================================
SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_MeshEditor_var aMeshEdVar;
//=============================================================================
SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditPreviewer()
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_MeshEditor_var aMeshEdVar;
*/
//================================================================================
-CORBA::Boolean SMESH_Mesh_i::HasModificationsToDiscard() throw(SALOME::SALOME_Exception)
+CORBA::Boolean SMESH_Mesh_i::HasModificationsToDiscard()
{
Unexpect aCatch(SALOME_SalomeException);
return _impl->HasModificationsToDiscard();
*/
//=============================================================================
-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);
*/
//=============================================================================
-CORBA::Boolean SMESH_Mesh_i::GetAutoColor() throw(SALOME::SALOME_Exception)
+CORBA::Boolean SMESH_Mesh_i::GetAutoColor()
{
Unexpect aCatch(SALOME_SalomeException);
return _impl->GetAutoColor();
// 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() ) {
CORBA::Long version,
CORBA::Boolean overwrite,
CORBA::Boolean autoDimension)
- throw(SALOME::SALOME_Exception)
{
//MESSAGE("MED minor version: "<< minor);
SMESH_TRY;
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportMED( r'"
<< file << "', "
<< "auto_groups=" <<auto_groups << ", "
- << "minor=" << version << ", "
+ << "version=" << version << ", "
<< "overwrite=" << overwrite << ", "
<< "meshPart=None, "
<< "autoDimension=" << autoDimension << " )";
void SMESH_Mesh_i::ExportSAUV (const char* file,
CORBA::Boolean auto_groups)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//================================================================================
void SMESH_Mesh_i::ExportDAT (const char *file)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//================================================================================
void SMESH_Mesh_i::ExportUNV (const char *file)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//================================================================================
void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
const GEOM::ListOfFields& fields,
const char* geomAssocFields,
CORBA::Double ZTolerance)
- throw (SALOME::SALOME_Exception)
{
MESSAGE("MED version: "<< version);
SMESH_TRY;
void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart,
const char* file)
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart,
const char* file)
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart,
const char* file,
::CORBA::Boolean isascii)
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
const char* file,
CORBA::Boolean overwrite,
CORBA::Boolean groupElemsByType)
- throw (SALOME::SALOME_Exception)
{
#ifdef WITH_CGNS
Unexpect aCatch(SALOME_SalomeException);
void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart,
const char* file,
bool withRequiredGroups)
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbNodes()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbElements()throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbElements()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::Nb0DElements()throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::Nb0DElements()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbBalls() throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbBalls()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbEdges()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//================================================================================
CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbFaces()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbTriangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbBiQuadTriangles();
}
-CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbQuadrangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbBiQuadQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbPolygons() throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolygons()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPolygons();
}
-CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//=============================================================================
-CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbVolumes()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbVolumes();
}
-CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbTetras()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbTetras();
}
-CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbHexas()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbHexas();
}
-CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbTriQuadraticHexas();
}
-CORBA::Long SMESH_Mesh_i::NbPyramids()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPyramids()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPyramids();
}
-CORBA::Long SMESH_Mesh_i::NbPrisms()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPrisms()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPrisms();
}
-CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbHexagonalPrisms();
}
-CORBA::Long SMESH_Mesh_i::NbPolyhedrons()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolyhedrons()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
}
CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order)
- throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::NbSubMesh()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbSubMesh()
{
Unexpect aCatch(SALOME_SalomeException);
return _mapSubMesh_i.size();
//=============================================================================
SMESH::long_array* SMESH_Mesh_i::GetElementsId()
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//=============================================================================
SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType )
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//=============================================================================
SMESH::long_array* SMESH_Mesh_i::GetNodesId()
- throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//=============================================================================
SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
- throw (SALOME::SALOME_Exception)
{
SMESH::ElementType type = SMESH::ALL;
SMESH_TRY;
//=============================================================================
SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id )
- throw (SALOME::SALOME_Exception)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
//=============================================================================
SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id )
- throw (SALOME::SALOME_Exception)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
//=============================================================================
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::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::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID)
- throw (SALOME::SALOME_Exception)
{
SMESH::ElementType type = SMESH::ALL;
SMESH::ListOfGroups*
SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID,
const char* theGroupName )
- throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
// 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 );
_gen_i->PublishGroup( aMesh, groupVar, shapeVar, group->GetName());
}
+
if ( !addedIDs.empty() )
{
// python dump
- set<int>::iterator id = addedIDs.begin();
- for ( ; id != addedIDs.end(); ++id )
+ map<int, SMESH::SMESH_GroupBase_ptr>::iterator i_grp = _mapGroups.begin();
+ for ( int index = 0; i_grp != _mapGroups.end(); ++index, ++i_grp )
{
- map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.find(*id);
- int i = std::distance( _mapGroups.begin(), it );
- TPythonDump() << it->second << " = " << aMesh << ".GetGroups()[ "<< i << " ]";
+ set<int>::iterator it = addedIDs.find( i_grp->first );
+ if ( it != addedIDs.end() )
+ {
+ TPythonDump() << i_grp->second << " = " << aMesh << ".GetGroups()[ "<< index << " ]";
+ addedIDs.erase( it );
+ if ( addedIDs.empty() )
+ break;
+ }
}
}
}
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() );
//! fields
int _dim; //!< a dimension the algo can build (concurrent dimension)
int _ownDim; //!< dimension of shape of _subMesh (>=_dim)
- TopTools_MapOfShape _shapeMap; //!< [sub-]shapes of dimension == _dim
- SMESH_subMesh* _subMesh;
+ TopTools_MapOfShape _shapeMap; //!< [sub-]shapes of dimension == _dim
+ const SMESH_subMesh* _subMesh;
list<const SMESHDS_Hypothesis*> _hypotheses; //!< algo is first, then its parameters
//-----------------------------------------------------------------------------
const int theDim,
const TopoDS_Shape& theShape)
{
- _subMesh = (SMESH_subMesh*)theSubMesh;
+ _subMesh = theSubMesh;
SetShape( theDim, theShape );
}
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
theAlgo->NeedLowerHyps( theDim )) // IPAL54678
return;
TDimHypList& listOfdimHyp = theDimHypListArr[theDim];
- if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh ) {
+ if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh )
+ {
SMESH_DimHyp* dimHyp = new SMESH_DimHyp( theSubMesh, theDim, theShape );
dimHyp->_hypotheses.push_front(theAlgo);
listOfdimHyp.push_back( dimHyp );
}
//-----------------------------------------------------------------------------
-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++ ) {
+ for ( int i = 0; it != theListOfListOfId.end(); it++, i++ )
+ {
if ( i < theIndx )
continue; //skip already treated lists
// check if other list has any same submesh object
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;
}
//-----------------------------------------------------------------------------
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
{
TListOfListOfInt anOrder;
::SMESH_Mesh& mesh = GetImpl();
- {
- // collect submeshes and detect concurrent algorithms and hypothesises
- TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
-
- map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
- for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) {
- ::SMESH_subMesh* sm = (*i_sm).second;
- // shape of submesh
- const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
-
- // list of assigned hypothesises
- const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
- // Find out dimensions where the submesh can be concurrent.
- // We define the dimensions by algo of each of hypotheses in hypList
- list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
- for( ; hypIt != hypList.end(); hypIt++ ) {
- SMESH_Algo* anAlgo = 0;
- const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
- if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
- // hyp it-self is algo
- anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
- else {
- // try to find algorithm with help of sub-shapes
- TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
- for ( ; !anAlgo && anExp.More(); anExp.Next() )
- anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
- }
- if (!anAlgo)
- continue; // no algorithm assigned to a current submesh
- int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
- // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDiscreteBoundary()
- // and !anAlgo->NeedLowerHyps( dim ))
+ // collect submeshes and detect concurrent algorithms and hypothesises
+ TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
- // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
- for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
- addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
+ map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
+ for ( ; i_sm != _mapSubMesh.end(); i_sm++ )
+ {
+ ::SMESH_subMesh* sm = (*i_sm).second;
+ // shape of submesh
+ const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
+
+ // list of assigned hypothesises
+ const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
+ // Find out dimensions where the submesh can be concurrent.
+ // We define the dimensions by algo of each of hypotheses in hypList
+ list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
+ for( ; hypIt != hypList.end(); hypIt++ )
+ {
+ SMESH_Algo* anAlgo = 0;
+ const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
+ if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
+ // hyp it-self is algo
+ anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
+ else {
+ // try to find algorithm with help of sub-shapes
+ TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
+ for ( ; !anAlgo && anExp.More(); anExp.Next() )
+ anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
}
- } // end iterations on submesh
+ if (!anAlgo)
+ continue; // no algorithm assigned to a current submesh
+
+ int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
+ // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDiscreteBoundary()
+ // and !anAlgo->NeedLowerHyps( dim ))
+
+ // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
+ for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
+ addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
+ }
+ } // end iterations on submesh
// iterate on created dimension-hypotheses and check for concurrents
- for ( int i = 0; i < 4; i++ ) {
- const TDimHypList& listOfDimHyp = dimHypListArr[i];
- // check for concurrents in own and other dimensions (step-by-step)
- TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
- for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) {
- const SMESH_DimHyp* dimHyp = *dhIt;
- TDimHypList listOfConcurr;
- set<int> setOfConcurrIds;
- // looking for concurrents and collect into own list
- for ( int j = i; j < 4; j++ )
- findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds );
- // check if any concurrents found
- if ( listOfConcurr.size() > 0 ) {
- // add own submesh to list of concurrent
- addInOrderOfPriority( dimHyp, listOfConcurr );
- list<int> listOfConcurrIds;
- TDimHypList::iterator hypIt = listOfConcurr.begin();
- for ( ; hypIt != listOfConcurr.end(); ++hypIt )
- listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() );
- anOrder.push_back( listOfConcurrIds );
- }
+ for ( int i = 0; i < 4; i++ )
+ {
+ const TDimHypList& listOfDimHyp = dimHypListArr[i];
+ // check for concurrents in own and other dimensions (step-by-step)
+ TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
+ for ( ; dhIt != listOfDimHyp.end(); dhIt++ )
+ {
+ const SMESH_DimHyp* dimHyp = *dhIt;
+ TDimHypList listOfConcurr;
+ set<int> setOfConcurrIds;
+ // looking for concurrents and collect into own list
+ for ( int j = i; j < 4; j++ )
+ findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds );
+ // check if any concurrents found
+ if ( listOfConcurr.size() > 0 )
+ {
+ // add own submesh to list of concurrent
+ addInOrderOfPriority( dimHyp, listOfConcurr );
+ list<int> listOfConcurrIds;
+ TDimHypList::iterator hypIt = listOfConcurr.begin();
+ for ( ; hypIt != listOfConcurr.end(); ++hypIt )
+ listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() );
+ anOrder.push_back( listOfConcurrIds );
}
}
+ }
- removeDimHyps(dimHypListArr);
+ removeDimHyps(dimHypListArr);
- // now, minimize the number of concurrent groups
- // Here we assume that lists of submeshes can have same submesh
- // in case of multi-dimension algorithms, as result
- // list with common submesh has to be united into one list
- int listIndx = 0;
- TListOfListOfInt::iterator listIt = anOrder.begin();
- for(; listIt != anOrder.end(); listIt++, listIndx++ )
- unionLists( *listIt, anOrder, listIndx + 1 );
- }
+ // now, minimize the number of concurrent groups
+ // Here we assume that lists of submeshes can have same submesh
+ // in case of multi-dimension algorithms, as result
+ // list with common submesh has to be united into one list
+ int listIndx = 0;
+ TListOfListOfInt::iterator listIt = anOrder.begin();
+ for(; listIt != anOrder.end(); listIt++, listIndx++ )
+ unionLists( *listIt, anOrder, listIndx + 1 );
return anOrder;
}
theResOrder.length(nbSet);
TListOfListOfInt::const_iterator it = theIdsOrder.begin();
int listIndx = 0;
- for( ; it != theIdsOrder.end(); it++ ) {
+ for( ; it != theIdsOrder.end(); it++ )
+ {
// translate submesh identificators into submesh objects
// takeing into account real number of concurrent lists
const TListOfInt& aSubOrder = (*it);
aResSubSet->length(aSubOrder.size());
TListOfInt::const_iterator subIt = aSubOrder.begin();
int j;
- for( j = 0; subIt != aSubOrder.end(); subIt++ ) {
+ for( j = 0; subIt != aSubOrder.end(); subIt++ )
+ {
if ( _mapSubMeshIor.find(*subIt) == _mapSubMeshIor.end() )
continue;
SMESH::SMESH_subMesh_var subMesh =