From: dmv Date: Fri, 20 Feb 2009 11:40:28 +0000 (+0000) Subject: 0020168: EDF SMESH 953: uncomplete selection with filter 'belong on geom' X-Git-Tag: V4_1_5rc1~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eb35bdd99a8ad802ecb522e15d4703c19809f83c;p=modules%2Fsmesh.git 0020168: EDF SMESH 953: uncomplete selection with filter 'belong on geom' --- diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index aeb348b05..932a2473b 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -2882,10 +2882,13 @@ void ElementsOnShape::process (const SMDS_MeshElement* theElemPtr) SMDS_ElemIteratorPtr aNodeItr = theElemPtr->nodesIterator(); bool isSatisfy = myAllNodesFlag; + gp_XYZ centerXYZ (0, 0, 0); + while (aNodeItr->more() && (isSatisfy == myAllNodesFlag)) { SMDS_MeshNode* aNode = (SMDS_MeshNode*)aNodeItr->next(); gp_Pnt aPnt (aNode->X(), aNode->Y(), aNode->Z()); + centerXYZ += aPnt.XYZ(); switch (myCurShapeType) { @@ -2928,6 +2931,14 @@ void ElementsOnShape::process (const SMDS_MeshElement* theElemPtr) } } + if (isSatisfy && myCurShapeType == TopAbs_SOLID) { // Check the center point for volumes MantisBug 0020168 + centerXYZ /= theElemPtr->NbNodes(); + gp_Pnt aCenterPnt (centerXYZ); + myCurSC.Perform(aCenterPnt, myToler); + if ( !(myCurSC.State() == TopAbs_IN || myCurSC.State() == TopAbs_ON)) + isSatisfy = false; + } + if (isSatisfy) myIds.Add(theElemPtr->GetID()); }