- if ( IsValid() )
- {
- bool toMerge = CheckBoxMerge->isChecked();
-
- try
- {
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- int aConstructorId = GetConstructorId();
- SMESH::SMESH_MeshEditor::Sew_Error anError;
-
- if (aConstructorId == 0)
- anError = aMeshEditor->SewFreeBorders(LineEdit1->text().toLong(),
- LineEdit2->text().toLong(),
- LineEdit3->text().toLong(),
- LineEdit4->text().toLong(),
- LineEdit5->text().toLong(),
- LineEdit6->text().toLong());
- else if (aConstructorId == 1)
- anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
- LineEdit2->text().toLong(),
- LineEdit3->text().toLong(),
- LineEdit4->text().toLong(),
- LineEdit5->text().toLong());
- else if (aConstructorId == 2)
- anError = aMeshEditor->SewBorderToSide(LineEdit1->text().toLong(),
- LineEdit2->text().toLong(),
- LineEdit3->text().toLong(),
- LineEdit4->text().toLong(),
- LineEdit6->text().toLong());
- else if (aConstructorId == 3)
- {
- QStringList aListElementsId1 = QStringList::split( " ", LineEdit1->text(), false);
- QStringList aListElementsId2 = QStringList::split( " ", LineEdit4->text(), false);
-
- SMESH::long_array_var anElementsId1 = new SMESH::long_array;
- SMESH::long_array_var anElementsId2 = new SMESH::long_array;
-
- anElementsId1->length( aListElementsId1.count() );
- anElementsId2->length( aListElementsId2.count() );
-
- for ( int i = 0; i < aListElementsId1.count(); i++ )
- anElementsId1[i] = aListElementsId1[i].toInt();
- for ( int i = 0; i < aListElementsId2.count(); i++ )
- anElementsId2[i] = aListElementsId2[i].toInt();
-
- anError = aMeshEditor->SewSideElements(anElementsId1.inout(),
- anElementsId2.inout(),
- LineEdit2->text().toLong(),
- LineEdit5->text().toLong(),
- LineEdit3->text().toLong(),
- LineEdit6->text().toLong());
- }
- aResult = ( anError == SMESH::SMESH_MeshEditor::SEW_OK );
-
- if (toMerge && aResult)
- aMeshEditor->MergeEqualElements();
-
- QApplication::restoreOverrideCursor();
-
- if ( !aResult ) {
- QString msg = tr(QString("ERROR_%1").arg(anError));
- QAD_MessageBox::warn1(QAD_Application::getDesktop(),
- tr("SMESH_WRN_WARNING"),msg,tr("SMESH_BUT_OK"));
- }
- }
- catch( ... )
- {
- }
-
- if ( aResult )
- {
- Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- mySelection->ClearIObjects();
- SMESH::UpdateView();
- mySelection->AddIObject( anIO, false );
- Init();
- ConstructorsClicked(GetConstructorId());
- }
+ if (IsValid()) {
+ bool toMerge = CheckBoxMerge->isChecked();
+ bool toCreatePolygons = CheckBoxPolygons->isChecked();
+ bool toCreatePolyedrs = CheckBoxPolyedrs->isChecked();
+
+ try {
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ int aConstructorId = GetConstructorId();
+ SMESH::SMESH_MeshEditor::Sew_Error anError;
+
+ if (aConstructorId == 0)
+ anError = aMeshEditor->SewFreeBorders(LineEdit1->text().toLong(),
+ LineEdit2->text().toLong(),
+ LineEdit3->text().toLong(),
+ LineEdit4->text().toLong(),
+ LineEdit5->text().toLong(),
+ LineEdit6->text().toLong(),
+ toCreatePolygons,
+ toCreatePolyedrs);
+ else if (aConstructorId == 1)
+ anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
+ LineEdit2->text().toLong(),
+ LineEdit3->text().toLong(),
+ LineEdit4->text().toLong(),
+ LineEdit5->text().toLong());
+ else if (aConstructorId == 2)
+ anError = aMeshEditor->SewBorderToSide(LineEdit1->text().toLong(),
+ LineEdit2->text().toLong(),
+ LineEdit3->text().toLong(),
+ LineEdit4->text().toLong(),
+ LineEdit6->text().toLong(),
+ toCreatePolygons,
+ toCreatePolyedrs);
+ else if (aConstructorId == 3) {
+ QStringList aListElementsId1 = QStringList::split(" ", LineEdit1->text(), false);
+ QStringList aListElementsId2 = QStringList::split(" ", LineEdit4->text(), false);
+
+ SMESH::long_array_var anElementsId1 = new SMESH::long_array;
+ SMESH::long_array_var anElementsId2 = new SMESH::long_array;
+
+ anElementsId1->length(aListElementsId1.count());
+ anElementsId2->length(aListElementsId2.count());
+
+ for (int i = 0; i < aListElementsId1.count(); i++)
+ anElementsId1[i] = aListElementsId1[i].toInt();
+ for (int i = 0; i < aListElementsId2.count(); i++)
+ anElementsId2[i] = aListElementsId2[i].toInt();
+
+ anError = aMeshEditor->SewSideElements(anElementsId1.inout(),
+ anElementsId2.inout(),
+ LineEdit2->text().toLong(),
+ LineEdit5->text().toLong(),
+ LineEdit3->text().toLong(),
+ LineEdit6->text().toLong());
+ }
+ aResult = (anError == SMESH::SMESH_MeshEditor::SEW_OK);
+
+ if (toMerge && aResult)
+ aMeshEditor->MergeEqualElements();
+
+ QApplication::restoreOverrideCursor();
+
+ if (!aResult) {
+ QString msg = tr(QString("ERROR_%1").arg(anError));
+ SUIT_MessageBox::warn1(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
+ msg, tr("SMESH_BUT_OK"));
+ }
+ } catch (...) {