0020982: EDF 1547 SMESH: Creation of non-conformal quadratic pyramids / note 0011144

Use GeomAdaptor_Surface instead of BRepAdaptor_Surface which gives
   surface UV limits according to face boundaries (edges) instead of
   the whole surface
This commit is contained in:
eap 2011-05-19 08:09:14 +00:00
parent 71e5158db4
commit 987cc89eb9

View File

@ -40,6 +40,7 @@
#include <GeomAPI_ProjectPointOnCurve.hxx> #include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Geom_Curve.hxx> #include <Geom_Curve.hxx>
//#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Surface.hxx> #include <Geom_Surface.hxx>
#include <ShapeAnalysis.hxx> #include <ShapeAnalysis.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -225,9 +226,15 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
for ( TopExp_Explorer eF( aSh, TopAbs_FACE ); eF.More(); eF.Next() ) for ( TopExp_Explorer eF( aSh, TopAbs_FACE ); eF.More(); eF.Next() )
{ {
const TopoDS_Face& face = TopoDS::Face( eF.Current() ); const TopoDS_Face& face = TopoDS::Face( eF.Current() );
BRepAdaptor_Surface surface( face ); TopLoc_Location loc;
if ( surface.IsUPeriodic() || surface.IsVPeriodic() ) Handle(Geom_Surface) surface = BRep_Tool::Surface( face, loc );
if ( surface->IsUPeriodic() || surface->IsVPeriodic() )
{ {
//while ( surface->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface )))
//surface = Handle(Geom_RectangularTrimmedSurface)::DownCast( surface )->BasisSurface();
GeomAdaptor_Surface surf( surface );
for (TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next()) for (TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next())
{ {
// look for a seam edge // look for a seam edge
@ -239,13 +246,13 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
if ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Abs( uv1.Coord(2) - uv2.Coord(2) )) if ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Abs( uv1.Coord(2) - uv2.Coord(2) ))
{ {
myParIndex |= U_periodic; myParIndex |= U_periodic;
myPar1[0] = surface.FirstUParameter(); myPar1[0] = surf.FirstUParameter();
myPar2[0] = surface.LastUParameter(); myPar2[0] = surf.LastUParameter();
} }
else { else {
myParIndex |= V_periodic; myParIndex |= V_periodic;
myPar1[1] = surface.FirstVParameter(); myPar1[1] = surf.FirstVParameter();
myPar2[1] = surface.LastVParameter(); myPar2[1] = surf.LastVParameter();
} }
// store seam shape indices, negative if shape encounters twice // store seam shape indices, negative if shape encounters twice
int edgeID = meshDS->ShapeToIndex( edge ); int edgeID = meshDS->ShapeToIndex( edge );