- anIdsOfNodes->length(aNodesIds.Extent());
-
- int aNbIdsOfNodes = 0;
- TColStd_ListIteratorOfListOfInteger It;
- It.Initialize(aNodesIds);
- for( ;It.More();It.Next())
- anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
-
- try{
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
- }catch(SALOME::SALOME_Exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.details.text);
- }catch(std::exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was cought !!!");
+ if (GetConstructorId() == 0)
+ {
+ SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
+ SMESH::long_array_var aQuantities = new SMESH::long_array;
+
+ aQuantities->length( myFacesByNodes->count() );
+
+ TColStd_ListOfInteger aNodesIds;
+
+ int aNbQuantities = 0;
+ for (int i = 0; i < myFacesByNodes->count(); i++ ) {
+ QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
+ for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
+ aNodesIds.Append( (*it).toInt() );
+
+ aQuantities[aNbQuantities++] = anIds.count();
+ }
+
+ anIdsOfNodes->length(aNodesIds.Extent());
+
+ int aNbIdsOfNodes = 0;
+ TColStd_ListIteratorOfListOfInteger It;
+ It.Initialize(aNodesIds);
+ for( ;It.More();It.Next())
+ anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
+
+ try{
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ anElemId = aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
+ }catch(SALOME::SALOME_Exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.details.text);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was cought !!!");
+ }
+ }
+ else if (GetConstructorId() == 1)
+ {
+ SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
+
+ QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+ anIdsOfFaces->length(aListId.count());
+ for ( int i = 0; i < aListId.count(); i++ )
+ anIdsOfFaces[i] = aListId[i].toInt();
+
+ try{
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ anElemId = aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
+ }catch(SALOME::SALOME_Exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.details.text);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was cought !!!");
+ }
+ }
+
+ if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) {
+ SMESH::SMESH_Group_var aGroupUsed;
+ if ( aGroup->_is_nil() ) {
+ // create new group
+ aGroupUsed = SMESH::AddGroup( myMesh, SMESH::VOLUME, aGroupName );
+ if ( !aGroupUsed->_is_nil() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed));
+ ComboBox_GroupName->addItem( aGroupName );