From: eap Date: Fri, 23 Jun 2017 12:08:46 +0000 (+0300) Subject: 54250: Wrong group contents after SplitQuad() X-Git-Tag: V8_4_0a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=76470331971b8ffbc5f8cfc1a4a71857d508fc28;p=modules%2Fsmesh.git 54250: Wrong group contents after SplitQuad() + fix a bug that in Split Quadrangles dialog it's impossible to add a quadrangle from a group --- diff --git a/src/SMDS/SMDS_MeshGroup.cxx b/src/SMDS/SMDS_MeshGroup.cxx index eb2331f98..f61079353 100644 --- a/src/SMDS/SMDS_MeshGroup.cxx +++ b/src/SMDS/SMDS_MeshGroup.cxx @@ -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(); } //======================================================================= diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index 7d4d10fdf..95a91cd0c 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -51,7 +51,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID, //============================================================================= /*! - * + * Don't use it! */ //============================================================================= diff --git a/src/SMESHDS/SMESHDS_GroupBase.hxx b/src/SMESHDS/SMESHDS_GroupBase.hxx index bb0bf250f..625e64a51 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.hxx +++ b/src/SMESHDS/SMESHDS_GroupBase.hxx @@ -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; diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index f31874bb0..5651284ab 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -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 } } diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index d9c4b0961..d580262de 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -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 );