From: eap Date: Tue, 16 Sep 2008 08:45:09 +0000 (+0000) Subject: [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D... X-Git-Tag: V5_1_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=21cd6e11b8aa42c3cf95a94681743f0aa39eaebd;p=modules%2Fsmesh.git [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D const SMESH_Hypothesis * GetHypothesis(const TopoDS_Shape & aSubShape, const SMESH_HypoFilter& aFilter, - const bool andAncestors) const; + const bool andAncestors, + TopoDS_Shape* assignedTo=0) const; --- diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 4648b5a3d..02383cb28 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -596,24 +596,28 @@ SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const //======================================================================= /*! * \brief Return the hypothesis assigned to the shape - * \param aSubShape - the shape to check - * \param aFilter - the hypothesis filter - * \param andAncestors - flag to check hypos assigned to ancestors of the shape - * \retval SMESH_Hypothesis* - the first hypo passed through aFilter + * \param aSubShape - the shape to check + * \param aFilter - the hypothesis filter + * \param andAncestors - flag to check hypos assigned to ancestors of the shape + * \param assignedTo - to return the shape the found hypo is assigned to + * \retval SMESH_Hypothesis* - the first hypo passed through aFilter */ //======================================================================= const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubShape, const SMESH_HypoFilter& aFilter, - const bool andAncestors) const + const bool andAncestors, + TopoDS_Shape* assignedTo) const { { const std::list& hypList = _myMeshDS->GetHypothesis(aSubShape); std::list::const_iterator hyp = hypList.begin(); for ( ; hyp != hypList.end(); hyp++ ) { const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp ); - if ( aFilter.IsOk( h, aSubShape)) + if ( aFilter.IsOk( h, aSubShape)) { + if ( assignedTo ) *assignedTo = aSubShape; return h; + } } } if ( andAncestors ) @@ -625,8 +629,10 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubS std::list::const_iterator hyp = hypList.begin(); for ( ; hyp != hypList.end(); hyp++ ) { const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp ); - if (aFilter.IsOk( h, it.Value() )) + if (aFilter.IsOk( h, it.Value() )) { + if ( assignedTo ) *assignedTo = it.Value(); return h; + } } } } diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index b67593db6..5fb1c0ab4 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -109,7 +109,8 @@ public: const SMESH_Hypothesis * GetHypothesis(const TopoDS_Shape & aSubShape, const SMESH_HypoFilter& aFilter, - const bool andAncestors) const; + const bool andAncestors, + TopoDS_Shape* assignedTo=0) const; int GetHypotheses(const TopoDS_Shape & aSubShape, const SMESH_HypoFilter& aFilter,