1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_MeshEditor_i.cxx
25 // Author : Nicolas REJNERI
29 #include "SMESH_MeshEditor_i.hxx"
31 #include "SMDS_MeshEdge.hxx"
32 #include "SMDS_MeshFace.hxx"
33 #include "SMDS_MeshVolume.hxx"
35 #include "SMESH_MeshEditor.hxx"
37 #include "SMESH_Gen_i.hxx"
38 #include "SMESH_Filter_i.hxx"
40 #include "utilities.h"
48 //=============================================================================
52 //=============================================================================
54 SMESH_MeshEditor_i::SMESH_MeshEditor_i(SMESH_Mesh* theMesh)
59 //=============================================================================
63 //=============================================================================
65 CORBA::Boolean SMESH_MeshEditor_i::RemoveElements(const SMESH::
66 long_array & IDsOfElements)
68 ::SMESH_MeshEditor anEditor( _myMesh );
70 for (int i = 0; i < IDsOfElements.length(); i++)
71 IdList.push_back( IDsOfElements[i] );
73 return anEditor.Remove( IdList, false );
76 //=============================================================================
80 //=============================================================================
82 CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::
83 long_array & IDsOfNodes)
85 ::SMESH_MeshEditor anEditor( _myMesh );
87 for (int i = 0; i < IDsOfNodes.length(); i++)
88 IdList.push_back( IDsOfNodes[i] );
90 return anEditor.Remove( IdList, true );
93 //=============================================================================
97 //=============================================================================
99 CORBA::Boolean SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes)
101 int NbNodes = IDsOfNodes.length();
104 CORBA::Long index1 = IDsOfNodes[0];
105 CORBA::Long index2 = IDsOfNodes[1];
106 GetMeshDS()->AddEdge(GetMeshDS()->FindNode(index1), GetMeshDS()->FindNode(index2));
111 //=============================================================================
115 //=============================================================================
117 CORBA::Boolean SMESH_MeshEditor_i::AddNode(CORBA::Double x,
118 CORBA::Double y, CORBA::Double z)
120 MESSAGE(" AddNode " << x << " , " << y << " , " << z)
121 int idNode = GetMeshDS()->AddNode(x, y, z)->GetID();
122 MESSAGE(" idNode " << idNode) return true;
125 //=============================================================================
129 //=============================================================================
131 CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
133 int NbNodes = IDsOfNodes.length();
134 const SMDS_MeshNode* nodes[4];
135 for(int i=0;i<NbNodes;i++) nodes[i]=GetMeshDS()->FindNode(IDsOfNodes[i]);
138 GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2]);
140 else if (NbNodes == 4)
142 GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3]);
147 //=============================================================================
151 //=============================================================================
153 CORBA::Boolean SMESH_MeshEditor_i::AddVolume(const SMESH::
154 long_array & IDsOfNodes)
156 int NbNodes = IDsOfNodes.length();
157 const SMDS_MeshNode* n[8];
158 for(int i=0;i<NbNodes;i++) n[i]=GetMeshDS()->FindNode(IDsOfNodes[i]);
162 case 4:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3]); break;
163 case 5:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4]); break;
164 case 6:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5]); break;
165 case 8:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]); break;
170 //=============================================================================
174 //=============================================================================
176 CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID,
181 const SMDS_MeshNode * node = GetMeshDS()->FindNode( NodeID );
185 GetMeshDS()->MoveNode(node, x, y, z);
190 //=============================================================================
194 //=============================================================================
196 CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1,
199 const SMDS_MeshNode * n1 = GetMeshDS()->FindNode( NodeID1 );
200 const SMDS_MeshNode * n2 = GetMeshDS()->FindNode( NodeID2 );
204 ::SMESH_MeshEditor aMeshEditor( _myMesh );
205 return aMeshEditor.InverseDiag ( n1, n2 );
208 //=============================================================================
212 //=============================================================================
214 CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1,
217 const SMDS_MeshNode * n1 = GetMeshDS()->FindNode( NodeID1 );
218 const SMDS_MeshNode * n2 = GetMeshDS()->FindNode( NodeID2 );
222 ::SMESH_MeshEditor aMeshEditor( _myMesh );
223 return aMeshEditor.DeleteDiag ( n1, n2 );
226 //=============================================================================
230 //=============================================================================
232 CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfElements)
234 ::SMESH_MeshEditor anEditor( _myMesh );
235 for (int i = 0; i < IDsOfElements.length(); i++)
237 CORBA::Long index = IDsOfElements[i];
238 const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index);
240 anEditor.Reorient( elem );
245 //=============================================================================
249 //=============================================================================
252 SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfElements,
253 SMESH::NumericalFunctor_ptr Criterion,
254 CORBA::Double MaxAngle)
256 set<const SMDS_MeshElement*> faces;
257 for (int i = 0; i < IDsOfElements.length(); i++)
259 CORBA::Long index = IDsOfElements[i];
260 const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index);
261 if ( elem && elem->GetType() == SMDSAbs_Face)
262 faces.insert( elem );
264 SMESH::NumericalFunctor_i* aNumericalFunctor =
265 dynamic_cast<SMESH::NumericalFunctor_i*>( SMESH_Gen_i::GetServant( Criterion ).in() );
266 SMESH::Controls::NumericalFunctorPtr aCrit;
267 if ( !aNumericalFunctor )
268 aCrit.reset( new SMESH::Controls::AspectRatio() );
270 aCrit = aNumericalFunctor->GetNumericalFunctor();
272 ::SMESH_MeshEditor anEditor( _myMesh );
273 return anEditor.TriToQuad( faces, aCrit, MaxAngle );
276 //=============================================================================
280 //=============================================================================
283 SMESH_MeshEditor_i::QuadToTri(const SMESH::long_array & IDsOfElements,
284 SMESH::NumericalFunctor_ptr Criterion)
286 set<const SMDS_MeshElement*> faces;
287 for (int i = 0; i < IDsOfElements.length(); i++)
289 CORBA::Long index = IDsOfElements[i];
290 const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index);
291 if ( elem && elem->GetType() == SMDSAbs_Face)
292 faces.insert( elem );
294 SMESH::NumericalFunctor_i* aNumericalFunctor =
295 dynamic_cast<SMESH::NumericalFunctor_i*>( SMESH_Gen_i::GetServant( Criterion ).in() );
296 SMESH::Controls::NumericalFunctorPtr aCrit;
297 if ( !aNumericalFunctor )
298 aCrit.reset( new SMESH::Controls::AspectRatio() );
300 aCrit = aNumericalFunctor->GetNumericalFunctor();
302 ::SMESH_MeshEditor anEditor( _myMesh );
303 return anEditor.QuadToTri( faces, aCrit );
306 //=============================================================================
310 //=============================================================================
313 SMESH_MeshEditor_i::SplitQuad(const SMESH::long_array & IDsOfElements,
314 CORBA::Boolean Diag13)
316 set<const SMDS_MeshElement*> faces;
317 for (int i = 0; i < IDsOfElements.length(); i++)
319 CORBA::Long index = IDsOfElements[i];
320 const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index);
321 if ( elem && elem->GetType() == SMDSAbs_Face)
322 faces.insert( elem );
325 ::SMESH_MeshEditor anEditor( _myMesh );
326 return anEditor.QuadToTri( faces, Diag13 );
329 //=============================================================================
333 //=============================================================================
336 SMESH_MeshEditor_i::Smooth(const SMESH::long_array & IDsOfElements,
337 const SMESH::long_array & IDsOfFixedNodes,
338 CORBA::Long MaxNbOfIterations,
339 CORBA::Double MaxAspectRatio,
340 SMESH::SMESH_MeshEditor::Smooth_Method Method)
342 SMESHDS_Mesh* aMesh = GetMeshDS();
344 set<const SMDS_MeshElement*> elements;
345 for (int i = 0; i < IDsOfElements.length(); i++)
347 CORBA::Long index = IDsOfElements[i];
348 const SMDS_MeshElement * elem = aMesh->FindElement(index);
349 if ( elem && elem->GetType() == SMDSAbs_Face)
350 elements.insert( elem );
353 set<const SMDS_MeshNode*> fixedNodes;
354 for (int i = 0; i < IDsOfFixedNodes.length(); i++)
356 CORBA::Long index = IDsOfFixedNodes[i];
357 const SMDS_MeshNode * node = aMesh->FindNode(index);
359 fixedNodes.insert( node );
361 ::SMESH_MeshEditor::SmoothMethod method = ::SMESH_MeshEditor::LAPLACIAN;
362 if ( Method != SMESH::SMESH_MeshEditor::LAPLACIAN_SMOOTH )
363 method = ::SMESH_MeshEditor::CENTROIDAL;
365 ::SMESH_MeshEditor anEditor( _myMesh );
366 anEditor.Smooth( elements, fixedNodes, method, MaxNbOfIterations, MaxAspectRatio );
371 //=============================================================================
375 //=============================================================================
377 void SMESH_MeshEditor_i::RenumberNodes()
379 GetMeshDS()->Renumber( true );
382 //=============================================================================
386 //=============================================================================
388 void SMESH_MeshEditor_i::RenumberElements()
390 GetMeshDS()->Renumber( false );
393 //=======================================================================
394 //function : RotationSweep
396 //=======================================================================
398 void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElements,
399 const SMESH::AxisStruct & theAxis,
400 CORBA::Double theAngleInRadians,
401 CORBA::Long theNbOfSteps,
402 CORBA::Double theTolerance)
404 SMESHDS_Mesh* aMesh = GetMeshDS();
406 set<const SMDS_MeshElement*> elements;
407 for (int i = 0; i < theIDsOfElements.length(); i++)
409 CORBA::Long index = theIDsOfElements[i];
410 const SMDS_MeshElement * elem = aMesh->FindElement(index);
412 elements.insert( elem );
414 gp_Ax1 Ax1 (gp_Pnt( theAxis.x, theAxis.y, theAxis.z ),
415 gp_Vec( theAxis.vx, theAxis.vy, theAxis.vz ));
417 ::SMESH_MeshEditor anEditor( _myMesh );
418 anEditor.RotationSweep (elements, Ax1, theAngleInRadians,
419 theNbOfSteps, theTolerance);
422 //=======================================================================
423 //function : ExtrusionSweep
425 //=======================================================================
427 void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElements,
428 const SMESH::DirStruct & theStepVector,
429 CORBA::Long theNbOfSteps)
431 SMESHDS_Mesh* aMesh = GetMeshDS();
433 set<const SMDS_MeshElement*> elements;
434 for (int i = 0; i < theIDsOfElements.length(); i++)
436 CORBA::Long index = theIDsOfElements[i];
437 const SMDS_MeshElement * elem = aMesh->FindElement(index);
439 elements.insert( elem );
441 const SMESH::PointStruct * P = &theStepVector.PS;
442 gp_Vec stepVec( P->x, P->y, P->z );
444 ::SMESH_MeshEditor anEditor( _myMesh );
445 anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps);
448 //=======================================================================
451 //=======================================================================
453 void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElements,
454 const SMESH::AxisStruct & theAxis,
455 SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
456 CORBA::Boolean theCopy)
458 SMESHDS_Mesh* aMesh = GetMeshDS();
460 set<const SMDS_MeshElement*> elements;
461 for (int i = 0; i < theIDsOfElements.length(); i++)
463 CORBA::Long index = theIDsOfElements[i];
464 const SMDS_MeshElement * elem = aMesh->FindElement(index);
466 elements.insert( elem );
468 gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
469 gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
472 switch ( theMirrorType ) {
473 case SMESH::SMESH_MeshEditor::POINT:
474 aTrsf.SetMirror( P );
476 case SMESH::SMESH_MeshEditor::AXIS:
477 aTrsf.SetMirror( gp_Ax1( P, V ));
480 aTrsf.SetMirror( gp_Ax2( P, V ));
483 ::SMESH_MeshEditor anEditor( _myMesh );
484 anEditor.Transform (elements, aTrsf, theCopy);
487 //=======================================================================
488 //function : Translate
490 //=======================================================================
492 void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
493 const SMESH::DirStruct & theVector,
494 CORBA::Boolean theCopy)
496 SMESHDS_Mesh* aMesh = GetMeshDS();
498 set<const SMDS_MeshElement*> elements;
499 for (int i = 0; i < theIDsOfElements.length(); i++)
501 CORBA::Long index = theIDsOfElements[i];
502 const SMDS_MeshElement * elem = aMesh->FindElement(index);
504 elements.insert( elem );
507 const SMESH::PointStruct * P = &theVector.PS;
508 aTrsf.SetTranslation( gp_Vec( P->x, P->y, P->z ));
510 ::SMESH_MeshEditor anEditor( _myMesh );
511 anEditor.Transform (elements, aTrsf, theCopy);
514 //=======================================================================
517 //=======================================================================
519 void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
520 const SMESH::AxisStruct & theAxis,
521 CORBA::Double theAngle,
522 CORBA::Boolean theCopy)
524 SMESHDS_Mesh* aMesh = GetMeshDS();
526 set<const SMDS_MeshElement*> elements;
527 for (int i = 0; i < theIDsOfElements.length(); i++)
529 CORBA::Long index = theIDsOfElements[i];
530 const SMDS_MeshElement * elem = aMesh->FindElement(index);
532 elements.insert( elem );
534 gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
535 gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
538 aTrsf.SetRotation( gp_Ax1( P, V ), theAngle);
541 ::SMESH_MeshEditor anEditor( _myMesh );
542 anEditor.Transform (elements, aTrsf, theCopy);
545 //=======================================================================
546 //function : FindCoincidentNodes
548 //=======================================================================
550 void SMESH_MeshEditor_i::FindCoincidentNodes (CORBA::Double Tolerance,
551 SMESH::array_of_long_array_out GroupsOfNodes)
553 ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
554 ::SMESH_MeshEditor anEditor( _myMesh );
555 anEditor.FindCoincidentNodes( Tolerance, aListOfListOfNodes );
557 GroupsOfNodes = new SMESH::array_of_long_array;
558 GroupsOfNodes->length( aListOfListOfNodes.size() );
559 ::SMESH_MeshEditor::TListOfListOfNodes::iterator llIt = aListOfListOfNodes.begin();
560 for ( CORBA::Long i = 0; llIt != aListOfListOfNodes.end(); llIt++, i++ )
562 list< const SMDS_MeshNode* >& aListOfNodes = *llIt;
563 list< const SMDS_MeshNode* >::iterator lIt = aListOfNodes.begin();;
564 SMESH::long_array& aGroup = GroupsOfNodes[ i ];
565 aGroup.length( aListOfNodes.size() );
566 for ( int j = 0; lIt != aListOfNodes.end(); lIt++, j++ )
567 aGroup[ j ] = (*lIt)->GetID();
571 //=======================================================================
572 //function : MergeNodes
574 //=======================================================================
576 void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes)
578 SMESHDS_Mesh* aMesh = GetMeshDS();
580 ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
581 list<const SMDS_MeshElement*> elements;
582 for (int i = 0; i < GroupsOfNodes.length(); i++)
584 const SMESH::long_array& aNodeGroup = GroupsOfNodes[ i ];
585 aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() );
586 list< const SMDS_MeshNode* >& aListOfNodes = aListOfListOfNodes.back();
587 for ( int j = 0; j < aNodeGroup.length(); j++ )
589 CORBA::Long index = aNodeGroup[ j ];
590 const SMDS_MeshNode * node = aMesh->FindNode(index);
592 aListOfNodes.push_back( node );
594 if ( aListOfNodes.size() < 2 )
595 aListOfListOfNodes.pop_back();
597 ::SMESH_MeshEditor anEditor( _myMesh );
598 anEditor.MergeNodes( aListOfListOfNodes );
601 //=======================================================================
602 //function : MergeEqualElements
604 //=======================================================================
606 void SMESH_MeshEditor_i::MergeEqualElements()
608 ::SMESH_MeshEditor anEditor( _myMesh );
609 anEditor.MergeEqualElements();
612 //=======================================================================
613 //function : SewFreeBorders
615 //=======================================================================
617 CORBA::Boolean SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1,
618 CORBA::Long SecondNodeID1,
619 CORBA::Long LastNodeID1,
620 CORBA::Long FirstNodeID2,
621 CORBA::Long SecondNodeID2,
622 CORBA::Long LastNodeID2)
624 SMESHDS_Mesh* aMesh = GetMeshDS();
626 const SMDS_MeshNode* aBorderFirstNode = aMesh->FindNode( FirstNodeID1 );
627 const SMDS_MeshNode* aBorderSecondNode = aMesh->FindNode( SecondNodeID1 );
628 const SMDS_MeshNode* aBorderLastNode = aMesh->FindNode( LastNodeID1 );
629 const SMDS_MeshNode* aSide2FirstNode = aMesh->FindNode( FirstNodeID2 );
630 const SMDS_MeshNode* aSide2SecondNode = aMesh->FindNode( SecondNodeID2 );
631 const SMDS_MeshNode* aSide2ThirdNode = aMesh->FindNode( LastNodeID2 );
633 if (!aBorderFirstNode ||
641 ::SMESH_MeshEditor anEditor( _myMesh );
642 return anEditor.SewFreeBorder (aBorderFirstNode,
651 //=======================================================================
652 //function : SewConformFreeBorders
654 //=======================================================================
656 CORBA::Boolean SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1,
657 CORBA::Long SecondNodeID1,
658 CORBA::Long LastNodeID1,
659 CORBA::Long FirstNodeID2,
660 CORBA::Long SecondNodeID2)
662 SMESHDS_Mesh* aMesh = GetMeshDS();
664 const SMDS_MeshNode* aBorderFirstNode = aMesh->FindNode( FirstNodeID1 );
665 const SMDS_MeshNode* aBorderSecondNode = aMesh->FindNode( SecondNodeID1 );
666 const SMDS_MeshNode* aBorderLastNode = aMesh->FindNode( LastNodeID1 );
667 const SMDS_MeshNode* aSide2FirstNode = aMesh->FindNode( FirstNodeID2 );
668 const SMDS_MeshNode* aSide2SecondNode = aMesh->FindNode( SecondNodeID2 );
669 const SMDS_MeshNode* aSide2ThirdNode = 0;
671 if (!aBorderFirstNode ||
678 ::SMESH_MeshEditor anEditor( _myMesh );
679 return anEditor.SewFreeBorder (aBorderFirstNode,
688 //=======================================================================
689 //function : SewBorderToSide
691 //=======================================================================
693 CORBA::Boolean SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
694 CORBA::Long SecondNodeIDOnFreeBorder,
695 CORBA::Long LastNodeIDOnFreeBorder,
696 CORBA::Long FirstNodeIDOnSide,
697 CORBA::Long LastNodeIDOnSide)
699 SMESHDS_Mesh* aMesh = GetMeshDS();
701 const SMDS_MeshNode* aBorderFirstNode = aMesh->FindNode( FirstNodeIDOnFreeBorder );
702 const SMDS_MeshNode* aBorderSecondNode = aMesh->FindNode( SecondNodeIDOnFreeBorder );
703 const SMDS_MeshNode* aBorderLastNode = aMesh->FindNode( LastNodeIDOnFreeBorder );
704 const SMDS_MeshNode* aSide2FirstNode = aMesh->FindNode( FirstNodeIDOnSide );
705 const SMDS_MeshNode* aSide2SecondNode = aMesh->FindNode( LastNodeIDOnSide );
706 const SMDS_MeshNode* aSide2ThirdNode = 0;
708 if (!aBorderFirstNode ||
715 ::SMESH_MeshEditor anEditor( _myMesh );
716 return anEditor.SewFreeBorder (aBorderFirstNode,
725 //=======================================================================
726 //function : SewSideElements
728 //=======================================================================
730 CORBA::Boolean SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
731 const SMESH::long_array& IDsOfSide2Elements,
732 CORBA::Long NodeID1OfSide1ToMerge,
733 CORBA::Long NodeID1OfSide2ToMerge,
734 CORBA::Long NodeID2OfSide1ToMerge,
735 CORBA::Long NodeID2OfSide2ToMerge)
737 SMESHDS_Mesh* aMesh = GetMeshDS();
739 const SMDS_MeshNode* aFirstNode1ToMerge = aMesh->FindNode( NodeID1OfSide1ToMerge );
740 const SMDS_MeshNode* aFirstNode2ToMerge = aMesh->FindNode( NodeID1OfSide2ToMerge );
741 const SMDS_MeshNode* aSecondNode1ToMerge = aMesh->FindNode( NodeID2OfSide1ToMerge );
742 const SMDS_MeshNode* aSecondNode2ToMerge = aMesh->FindNode( NodeID2OfSide2ToMerge );
744 if (!aFirstNode1ToMerge ||
745 !aFirstNode2ToMerge ||
746 !aSecondNode1ToMerge||
747 !aSecondNode2ToMerge)
750 set<const SMDS_MeshElement*> aSide1Elems, aSide2Elems;
751 for (int i = 0; i < IDsOfSide1Elements.length(); i++)
753 CORBA::Long index = IDsOfSide1Elements[i];
754 const SMDS_MeshElement * elem = aMesh->FindElement(index);
757 aSide1Elems.insert( elem );
759 for (int i = 0; i < IDsOfSide2Elements.length(); i++)
761 CORBA::Long index = IDsOfSide2Elements[i];
762 const SMDS_MeshElement * elem = aMesh->FindElement(index);
765 aSide2Elems.insert( elem );
767 ::SMESH_MeshEditor anEditor( _myMesh );
768 return anEditor.SewSideElements (aSide1Elems, aSide2Elems,
772 aSecondNode2ToMerge);