return false;
}
-//=======================================================================
-//function : IsSubShape
-//purpose :
-//=======================================================================
-
-bool StdMeshers_ProjectionUtils::IsSubShape( const TopoDS_Shape& shape,
- SMESH_Mesh* aMesh )
-{
- if ( shape.IsNull() || !aMesh )
- return false;
- return
- aMesh->GetMeshDS()->ShapeToIndex( shape ) ||
- // PAL16202
- shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape );
-}
-
-//=======================================================================
-//function : IsSubShape
-//purpose :
-//=======================================================================
-
-bool StdMeshers_ProjectionUtils::IsSubShape( const TopoDS_Shape& shape,
- const TopoDS_Shape& mainShape )
-{
- if ( !shape.IsNull() && !mainShape.IsNull() )
- {
- for ( TopExp_Explorer exp( mainShape, shape.ShapeType());
- exp.More();
- exp.Next() )
- if ( shape.IsSame( exp.Current() ))
- return true;
- }
- SCRUTE((shape.IsNull()));
- SCRUTE((mainShape.IsNull()));
- return false;
-}
-
-
//=======================================================================
/*!
* \brief Finds an edge by its vertices in a main shape of the mesh
if ( !assocMap.IsBound( e2 ))
RETURN_BAD_RESULT("Association not found for edge " << meshDS2->ShapeToIndex( e2 ));
TopoDS_Edge e1 = TopoDS::Edge( assocMap( e2 ));
- if ( !IsSubShape( e1, face1 ))
+ if ( !helper1.IsSubShape( e1, face1 ))
RETURN_BAD_RESULT("Wrong association, edge " << meshDS1->ShapeToIndex( e1 ) <<
" isn't a subshape of face " << meshDS1->ShapeToIndex( face1 ));
// check that there are nodes on edges
TShapeShapeMap & theAssociationMap,
const bool theBidirectional=true);
- static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh );
-
- static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape );
-
/*!
* \brief Finds an edge by its vertices in a main shape of the mesh
*/
if ( _sourceHypo->HasVertexAssociation() )
{
// source and target vertices
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) ||
- !TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) ||
- !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(),
- _sourceHypo->GetSourceEdge() ))
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(),
+ _sourceHypo->GetSourceEdge() ))
{
aStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh )));
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh )));
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(),
- _sourceHypo->GetSourceEdge() )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(),
+ _sourceHypo->GetSourceEdge() )));
}
// PAL16202
- else
+ else
{
- bool isSub = TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
+ bool isSub = SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
if ( !_sourceHypo->IsCompoundSource() ) {
if ( !isSub ) {
aStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
}
}
else if ( isSub ) {
{
const TopoDS_Shape& ancestor = ancestIt.Value();
if ( ancestor.ShapeType() == TopAbs_EDGE &&
- TAssocTool::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
+ SMESH_MesherHelper::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
{
if ( sharingEdge.IsNull() || ancestor.IsSame( sharingEdge ))
sharingEdge = ancestor;
}
}
// check source edge
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) ||
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) ||
( srcMesh == tgtMesh && aShape == _sourceHypo->GetSourceEdge() ))
{
aStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh )));
SCRUTE((srcMesh == tgtMesh));
SCRUTE(( aShape == _sourceHypo->GetSourceEdge() ));
}
TopoDS_Shape edge = TAssocTool::GetEdgeByVertices
( srcMesh, _sourceHypo->GetSourceVertex(1), _sourceHypo->GetSourceVertex(2) );
if ( edge.IsNull() ||
- !TAssocTool::IsSubShape( edge, srcMesh ) ||
- !TAssocTool::IsSubShape( edge, _sourceHypo->GetSourceFace() ))
+ !SMESH_MesherHelper::IsSubShape( edge, srcMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSourceFace() ))
{
theStatus = HYP_BAD_PARAMETER;
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, srcMesh )));
- SCRUTE((TAssocTool::IsSubShape( edge, _sourceHypo->GetSourceFace() )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSourceFace() )));
}
else
{
// target vertices
edge = TAssocTool::GetEdgeByVertices
( tgtMesh, _sourceHypo->GetTargetVertex(1), _sourceHypo->GetTargetVertex(2) );
- if ( edge.IsNull() || !TAssocTool::IsSubShape( edge, tgtMesh ))
+ if ( edge.IsNull() || !SMESH_MesherHelper::IsSubShape( edge, tgtMesh ))
{
theStatus = HYP_BAD_PARAMETER;
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, tgtMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, tgtMesh )));
}
// PAL16203
else if ( !_sourceHypo->IsCompoundSource() &&
- !TAssocTool::IsSubShape( edge, theShape ))
+ !SMESH_MesherHelper::IsSubShape( edge, theShape ))
{
theStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( edge, theShape )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, theShape )));
}
}
}
// check a source face
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh ) ||
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh ) ||
( srcMesh == tgtMesh && theShape == _sourceHypo->GetSourceFace() ))
{
theStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh )));
SCRUTE((srcMesh == tgtMesh));
SCRUTE(( theShape == _sourceHypo->GetSourceFace() ));
}
namespace {
-
//================================================================================
/*!
* \brief define if a node is new or old
- * \param node - node to check
- * \retval bool - true if the node existed before Compute() is called
+ * \param node - node to check
+ * \retval bool - true if the node existed before Compute() is called
*/
//================================================================================
RETURN_BAD_RESULT("Not associated vertices, srcV1 " << srcV1.TShape().operator->() );
TopoDS_Vertex tgtV1 = TopoDS::Vertex( shape2ShapeMap( srcV1 ));
- if ( !TAssocTool::IsSubShape( srcV1, srcFace ))
+ if ( !SMESH_MesherHelper::IsSubShape( srcV1, srcFace ))
RETURN_BAD_RESULT("Wrong srcV1 " << srcV1.TShape().operator->());
- if ( !TAssocTool::IsSubShape( tgtV1, tgtFace ))
+ if ( !SMESH_MesherHelper::IsSubShape( tgtV1, tgtFace ))
RETURN_BAD_RESULT("Wrong tgtV1 " << tgtV1.TShape().operator->());
// try to find out orientation by order of edges
TopoDS_Shape edge = TAssocTool::GetEdgeByVertices
( srcMesh, _sourceHypo->GetSourceVertex(1), _sourceHypo->GetSourceVertex(2) );
if ( edge.IsNull() ||
- !TAssocTool::IsSubShape( edge, srcMesh ) ||
- !TAssocTool::IsSubShape( edge, _sourceHypo->GetSource3DShape() ))
+ !SMESH_MesherHelper::IsSubShape( edge, srcMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSource3DShape() ))
{
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, srcMesh )));
- SCRUTE((TAssocTool::IsSubShape( edge, _sourceHypo->GetSource3DShape() )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSource3DShape() )));
aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
}
else
edge = TAssocTool::GetEdgeByVertices
( tgtMesh, _sourceHypo->GetTargetVertex(1), _sourceHypo->GetTargetVertex(2) );
if ( edge.IsNull() ||
- !TAssocTool::IsSubShape( edge, tgtMesh ) ||
- !TAssocTool::IsSubShape( edge, aShape ))
+ !SMESH_MesherHelper::IsSubShape( edge, tgtMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( edge, aShape ))
{
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, tgtMesh )));
- SCRUTE((TAssocTool::IsSubShape( edge, aShape )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, tgtMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, aShape )));
aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
}
}
}
// check a source shape
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh ) ||
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh ) ||
( srcMesh == tgtMesh && aShape == _sourceHypo->GetSource3DShape()))
{
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh)));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh)));
SCRUTE((srcMesh == tgtMesh));
SCRUTE((aShape == _sourceHypo->GetSource3DShape()));
aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
return error("Association of subshapes failed" );
srcV000 = TopoDS::Vertex( shape2ShapeMap( tgtV000 ));
srcV100 = TopoDS::Vertex( shape2ShapeMap( tgtV100 ));
- if ( !TAssocTool::IsSubShape( srcV000, srcShell ) ||
- !TAssocTool::IsSubShape( srcV100, srcShell ))
+ if ( !SMESH_MesherHelper::IsSubShape( srcV000, srcShell ) ||
+ !SMESH_MesherHelper::IsSubShape( srcV100, srcShell ))
return error("Incorrect association of subshapes" );
}