Salome HOME
54250: Wrong group contents after SplitQuad()
authoreap <eap@opencascade.com>
Fri, 23 Jun 2017 12:08:46 +0000 (15:08 +0300)
committereap <eap@opencascade.com>
Fri, 23 Jun 2017 12:08:46 +0000 (15:08 +0300)
+ fix a bug that in Split Quadrangles dialog it's impossible to add a
  quadrangle from a group

src/SMDS/SMDS_MeshGroup.cxx
src/SMESHDS/SMESHDS_GroupBase.cxx
src/SMESHDS/SMESHDS_GroupBase.hxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESH_I/SMESH_Group_i.cxx

index eb2331f989e42b7c6b311800cd53700300658e23..f61079353f7a78bbd240f86eae85c1e02d572f1a 100644 (file)
@@ -163,7 +163,7 @@ bool SMDS_MeshGroup::Remove(const SMDS_MeshElement * theElem)
 
 bool SMDS_MeshGroup::Contains(const SMDS_MeshElement * theElem) const
 {
-        return myElements.find(theElem)!=myElements.end();
+  return myElements.find(theElem) != myElements.end();
 }
 
 //=======================================================================
index 7d4d10fdfc9f41f8fff17b1f3db466370501b952..95a91cd0c7f5e40f09de0e75b18e9cfb528b67b2 100644 (file)
@@ -51,7 +51,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int                 theID,
 
 //=============================================================================
 /*!
- *  
+ *  Don't use it!
  */
 //=============================================================================
 
index bb0bf250f413682ecf642e61fc4fd9a75bca8ce8..625e64a51f4fe4a7674b315534c7f6f16f2269dd 100644 (file)
@@ -69,7 +69,7 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
   virtual SMDS_ElemIteratorPtr GetElements() const = 0;
 
   virtual int GetID (const int theIndex);
-  // use it for iterations 1..Extent()
+  // DON'T use it for iterations 1..Extent()
 
   virtual int GetTic() const = 0;
 
index f31874bb0be88e298906d82c13ece5201a2dbc36..5651284ab2c1ea77e9b8665bc1ee0ae98ad7456f 100755 (executable)
@@ -974,18 +974,18 @@ void SMESHGUI_MultiEditDlg::setSelectionMode()
   }
 
   if (entityType()) {
-    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-      aViewWindow->SetSelectionMode(VolumeSelection);
     SMESH::SetFilter(new SMESHGUI_VolumesFilter());
-  } else {
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
-      aViewWindow->SetSelectionMode(FaceSelection);
+      aViewWindow->SetSelectionMode(VolumeSelection); // here myActor set to a filter
+  } else {
     if (myFilterType == SMESH::TriaFilter)
       SMESH::SetFilter(new SMESHGUI_TriangleFilter());
     else if (myFilterType == SMESH::QuadFilter)
       SMESH::SetFilter(new SMESHGUI_QuadrangleFilter());
     else
       SMESH::SetFilter(new SMESHGUI_FacesFilter());
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(FaceSelection); // here myActor set to a filter
   }
 }
 
index d9c4b0961d208e34d40bcacc65d9bff6804a6e37..d580262ded1d33b8a9dc214ee0e14d6ed3e21475 100644 (file)
@@ -474,8 +474,9 @@ SMESH::long_array* SMESH_GroupBase_i::GetListOfID()
   {
     int aSize = aGroupDS->Extent();
     aRes->length(aSize);
-    for (int i = 0; i < aSize; i++)
-      aRes[i] = aGroupDS->GetID(i+1);
+    SMDS_ElemIteratorPtr it = aGroupDS->GetElements();
+    for (int i = 0; it->more(); i++)
+      aRes[i] = it->next()->GetID();
 
     if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;)
       std::sort( &aRes[0], &aRes[0]+aSize );