[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;
This commit is contained in:
eap 2008-09-16 08:45:09 +00:00
parent ee5c3ec1b3
commit 21cd6e11b8
2 changed files with 15 additions and 8 deletions

View File

@ -599,23 +599,27 @@ SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const
* \param aSubShape - the shape to check * \param aSubShape - the shape to check
* \param aFilter - the hypothesis filter * \param aFilter - the hypothesis filter
* \param andAncestors - flag to check hypos assigned to ancestors of the shape * \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 * \retval SMESH_Hypothesis* - the first hypo passed through aFilter
*/ */
//======================================================================= //=======================================================================
const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubShape, const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubShape,
const SMESH_HypoFilter& aFilter, const SMESH_HypoFilter& aFilter,
const bool andAncestors) const const bool andAncestors,
TopoDS_Shape* assignedTo) const
{ {
{ {
const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape); const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin(); std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
for ( ; hyp != hypList.end(); hyp++ ) { for ( ; hyp != hypList.end(); hyp++ ) {
const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp ); const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp );
if ( aFilter.IsOk( h, aSubShape)) if ( aFilter.IsOk( h, aSubShape)) {
if ( assignedTo ) *assignedTo = aSubShape;
return h; return h;
} }
} }
}
if ( andAncestors ) if ( andAncestors )
{ {
TopTools_ListIteratorOfListOfShape it( GetAncestors( aSubShape )); TopTools_ListIteratorOfListOfShape it( GetAncestors( aSubShape ));
@ -625,11 +629,13 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubS
std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin(); std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
for ( ; hyp != hypList.end(); hyp++ ) { for ( ; hyp != hypList.end(); hyp++ ) {
const SMESH_Hypothesis * h = cSMESH_Hyp( *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; return h;
} }
} }
} }
}
return 0; return 0;
} }

View File

@ -109,7 +109,8 @@ public:
const SMESH_Hypothesis * GetHypothesis(const TopoDS_Shape & aSubShape, const SMESH_Hypothesis * GetHypothesis(const TopoDS_Shape & aSubShape,
const SMESH_HypoFilter& aFilter, const SMESH_HypoFilter& aFilter,
const bool andAncestors) const; const bool andAncestors,
TopoDS_Shape* assignedTo=0) const;
int GetHypotheses(const TopoDS_Shape & aSubShape, int GetHypotheses(const TopoDS_Shape & aSubShape,
const SMESH_HypoFilter& aFilter, const SMESH_HypoFilter& aFilter,