int SMESH_Mesh_i::myIdGenerator = 0;
+
+
//=============================================================================
/*!
* Constructor
// Read mesh with name = <theMeshName> into SMESH_Mesh
_impl->UNVToMesh( theFileName );
+ CreateGroupServants();
+
+ SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
+ if ( !aStudy->_is_nil() ) {
+ // publishing of the groups in the study (sub-meshes are out of scope of UNV import)
+ map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.begin();
+ for (; it != _mapGroups.end(); it++ ) {
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_duplicate( it->second );
+ _gen_i->PublishGroup( aStudy, _this(), aGroup,
+ GEOM::GEOM_Object::_nil(), aGroup->GetName());
+ }
+ }
return 1;
}
{
// Read mesh with name = <theMeshName> and all its groups into SMESH_Mesh
int status = _impl->MEDToMesh( theFileName, theMeshName );
-
- // Create group servants, if any groups were imported
- list<int> aGroupIds = _impl->GetGroupIds();
- for ( list<int>::iterator it = aGroupIds.begin(); it != aGroupIds.end(); it++ ) {
- SMESH_Group_i* aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, *it );
-
- // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
- SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl );
- aGroupImpl->Register();
- // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
-
- SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( aGroupImpl->_this() );
- _mapGroups[*it] = SMESH::SMESH_Group::_duplicate( aGroup );
-
- // register CORBA object for persistence
- int nextId = _gen_i->RegisterObject( aGroup );
- if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);
- }
+ CreateGroupServants();
return status;
}
res = SMESH::HYP_ALREADY_EXIST; break;
case SMESH_Hypothesis::HYP_BAD_DIM:
res = SMESH::HYP_BAD_DIM; break;
+ case SMESH_Hypothesis::HYP_BAD_SUBSHAPE:
+ res = SMESH::HYP_BAD_SUBSHAPE; break;
default:
res = SMESH::HYP_UNKNOWN_FATAL;
}
*/
//=============================================================================
+CORBA::Boolean SMESH_Mesh_i::HasDuplicatedGroupNamesMED()
+{
+ return _impl->HasDuplicatedGroupNamesMED();
+}
+
static void PrepareForWriting (const char* file)
{
TCollection_AsciiString aFullName ((char*)file);
return _impl->NbEdges();
}
+CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbEdges( (::SMESH_Mesh::ElementOrder) order);
+}
+
//=============================================================================
/*!
*
return _impl->NbPolygons();
}
+CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbFaces( (::SMESH_Mesh::ElementOrder) order);
+}
+
+CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbTriangles( (::SMESH_Mesh::ElementOrder) order);
+}
+
+CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbQuadrangles( (::SMESH_Mesh::ElementOrder) order);
+}
+
//=============================================================================
/*!
*
return _impl->NbPolyhedrons();
}
+CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbVolumes( (::SMESH_Mesh::ElementOrder) order);
+}
+
+CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbTetras( (::SMESH_Mesh::ElementOrder) order);
+}
+
+CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbHexas( (::SMESH_Mesh::ElementOrder) order);
+}
+
+CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbPyramids( (::SMESH_Mesh::ElementOrder) order);
+}
+
+CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order)
+ throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ return _impl->NbPrisms( (::SMESH_Mesh::ElementOrder) order);
+}
+
//=============================================================================
/*!
*
{
return ( SMESH::ElementType )_impl->GetElementType( id, iselem );
}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+CORBA::Long SMESH_Mesh_i::GetMeshPtr()
+{
+ return CORBA::Long(size_t(_impl));
+}
+
+
+void SMESH_Mesh_i::CreateGroupServants()
+{
+ // Create group servants, if any groups were imported
+ list<int> aGroupIds = _impl->GetGroupIds();
+ for ( list<int>::iterator it = aGroupIds.begin(); it != aGroupIds.end(); it++ ) {
+ SMESH_Group_i* aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, *it );
+
+ // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
+ SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl );
+ aGroupImpl->Register();
+ // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
+
+ SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( aGroupImpl->_this() );
+ _mapGroups[*it] = SMESH::SMESH_Group::_duplicate( aGroup );
+
+ // register CORBA object for persistence
+ int nextId = _gen_i->RegisterObject( aGroup );
+ if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);
+ }
+}
+