mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-22 03:25:38 +05:00
020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement / note 0011031
In MakeBoundaryElements(), care of groups belonging to different meshes
This commit is contained in:
parent
85aa8f5a8b
commit
3c206e42f3
@ -5806,20 +5806,37 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim,
|
|||||||
if ( dim > SMESH::BND_1DFROM2D )
|
if ( dim > SMESH::BND_1DFROM2D )
|
||||||
THROW_SALOME_CORBA_EXCEPTION("Invalid boundary dimension", SALOME::BAD_PARAM);
|
THROW_SALOME_CORBA_EXCEPTION("Invalid boundary dimension", SALOME::BAD_PARAM);
|
||||||
|
|
||||||
// check that groups belongs to to this mesh and is not this mesh
|
// separate groups belonging to this and other mesh
|
||||||
const int nbGroups = groups.length();
|
SMESH::ListOfIDSources_var groupsOfThisMesh = new SMESH::ListOfIDSources;
|
||||||
for ( int i = 0; i < nbGroups; ++i )
|
SMESH::ListOfIDSources_var groupsOfOtherMesh = new SMESH::ListOfIDSources;
|
||||||
|
groupsOfThisMesh->length( groups.length() );
|
||||||
|
groupsOfOtherMesh->length( groups.length() );
|
||||||
|
int nbGroups = 0, nbGroupsOfOtherMesh = 0;
|
||||||
|
for ( int i = 0; i < groups.length(); ++i )
|
||||||
{
|
{
|
||||||
SMESH::SMESH_Mesh_var m = groups[i]->GetMesh();
|
SMESH::SMESH_Mesh_var m = groups[i]->GetMesh();
|
||||||
if ( myMesh_i != SMESH::DownCast<SMESH_Mesh_i*>( m ))
|
if ( myMesh_i != SMESH::DownCast<SMESH_Mesh_i*>( m ))
|
||||||
THROW_SALOME_CORBA_EXCEPTION("group does not belong to this mesh", SALOME::BAD_PARAM);
|
groupsOfOtherMesh[ nbGroupsOfOtherMesh++ ] = groups[i];
|
||||||
|
else
|
||||||
|
groupsOfThisMesh[ nbGroups++ ] = groups[i];
|
||||||
if ( SMESH::DownCast<SMESH_Mesh_i*>( groups[i] ))
|
if ( SMESH::DownCast<SMESH_Mesh_i*>( groups[i] ))
|
||||||
THROW_SALOME_CORBA_EXCEPTION("expect a group but recieve a mesh", SALOME::BAD_PARAM);
|
THROW_SALOME_CORBA_EXCEPTION("expect a group but recieve a mesh", SALOME::BAD_PARAM);
|
||||||
}
|
}
|
||||||
|
groupsOfThisMesh->length( nbGroups );
|
||||||
TPythonDump pyDump;
|
groupsOfOtherMesh->length( nbGroupsOfOtherMesh );
|
||||||
|
|
||||||
int nbAdded = 0;
|
int nbAdded = 0;
|
||||||
|
TPythonDump pyDump;
|
||||||
|
|
||||||
|
if ( nbGroupsOfOtherMesh > 0 )
|
||||||
|
{
|
||||||
|
// process groups belonging to another mesh
|
||||||
|
SMESH::SMESH_Mesh_var otherMesh = groupsOfOtherMesh[0]->GetMesh();
|
||||||
|
SMESH::SMESH_MeshEditor_var editor = otherMesh->GetMeshEditor();
|
||||||
|
nbAdded += editor->MakeBoundaryElements( dim, groupName, meshName, toCopyAll,
|
||||||
|
groupsOfOtherMesh, mesh, group );
|
||||||
|
}
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_var mesh_var;
|
SMESH::SMESH_Mesh_var mesh_var;
|
||||||
SMESH::SMESH_Group_var group_var;
|
SMESH::SMESH_Group_var group_var;
|
||||||
|
|
||||||
@ -5856,12 +5873,12 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim,
|
|||||||
|
|
||||||
TIDSortedElemSet elements;
|
TIDSortedElemSet elements;
|
||||||
|
|
||||||
if ( nbGroups > 0 )
|
if ( groups.length() > 0 )
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < nbGroups; ++i )
|
for ( int i = 0; i < nbGroups; ++i )
|
||||||
{
|
{
|
||||||
elements.clear();
|
elements.clear();
|
||||||
if ( idSourceToSet( groups[i], srcMeshDS, elements, elemType,/*emptyIfIsMesh=*/false ))
|
if ( idSourceToSet( groupsOfThisMesh[i], srcMeshDS, elements, elemType,/*emptyIfIsMesh=*/0 ))
|
||||||
{
|
{
|
||||||
SMESH::Bnd_Dimension bdim =
|
SMESH::Bnd_Dimension bdim =
|
||||||
( elemType == SMDSAbs_Volume ) ? SMESH::BND_2DFROM3D : SMESH::BND_1DFROM2D;
|
( elemType == SMDSAbs_Volume ) ? SMESH::BND_2DFROM3D : SMESH::BND_1DFROM2D;
|
||||||
|
Loading…
Reference in New Issue
Block a user