From b6fe67a04f6b63b1d1b09c333ca140fa2be79ff8 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 1 Jul 2011 15:45:09 +0000 Subject: [PATCH] initialize the Curve Adaptor using range of the edge --- src/StdMeshers/StdMeshers_Arithmetic1D.cxx | 2 +- src/StdMeshers/StdMeshers_Deflection1D.cxx | 2 +- src/StdMeshers/StdMeshers_FaceSide.cxx | 4 +++- src/StdMeshers/StdMeshers_LocalLength.cxx | 2 +- src/StdMeshers/StdMeshers_MaxLength.cxx | 2 +- src/StdMeshers/StdMeshers_StartEndLength.cxx | 2 +- src/StdMeshers/StdMeshers_ViscousLayers.cxx | 4 ++-- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx index d89056562..4f6a0527c 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx @@ -214,7 +214,7 @@ bool StdMeshers_Arithmetic1D::SetParametersByMesh(const SMESH_Mesh* theMesh, { const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i )); Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax); - GeomAdaptor_Curve AdaptCurve(C); + GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); vector< double > params; SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_Deflection1D.cxx b/src/StdMeshers/StdMeshers_Deflection1D.cxx index aa503e79c..a8716d189 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.cxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.cxx @@ -204,7 +204,7 @@ bool StdMeshers_Deflection1D::SetParametersByMesh(const SMESH_Mesh* theMesh, { const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE )); Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax ); - GeomAdaptor_Curve AdaptCurve(C); + GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); if ( AdaptCurve.GetType() != GeomAbs_Line ) { vector< double > params; diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 57e84ae9d..87af665b6 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -147,7 +147,9 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, // check if edge has non-uniform parametrization (issue 0020705) if ( !myC2d[i].IsNull() && myEdgeLength[i] > DBL_MIN) { - Geom2dAdaptor_Curve A2dC( myC2d[i] ); + Geom2dAdaptor_Curve A2dC( myC2d[i], + std::min( myFirst[i], myLast[i] ), + std::max( myFirst[i], myLast[i] )); double p2 = myFirst[i]+(myLast[i]-myFirst[i])/2., p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.; double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 ); double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 ); diff --git a/src/StdMeshers/StdMeshers_LocalLength.cxx b/src/StdMeshers/StdMeshers_LocalLength.cxx index ba47e72be..5e5cda734 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.cxx +++ b/src/StdMeshers/StdMeshers_LocalLength.cxx @@ -216,7 +216,7 @@ bool StdMeshers_LocalLength::SetParametersByMesh(const SMESH_Mesh* theMesh, { const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE )); Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax ); - GeomAdaptor_Curve AdaptCurve(C); + GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); vector< double > params; SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_MaxLength.cxx b/src/StdMeshers/StdMeshers_MaxLength.cxx index c2e01f66d..2ce20b5d6 100644 --- a/src/StdMeshers/StdMeshers_MaxLength.cxx +++ b/src/StdMeshers/StdMeshers_MaxLength.cxx @@ -207,7 +207,7 @@ bool StdMeshers_MaxLength::SetParametersByMesh(const SMESH_Mesh* theMesh, { const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE )); Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax ); - GeomAdaptor_Curve AdaptCurve(C); + GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); vector< double > params; SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index 0a2fe35b1..d6e5a5431 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -216,7 +216,7 @@ bool StdMeshers_StartEndLength::SetParametersByMesh(const SMESH_Mesh* theMesh, { const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i )); Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax); - GeomAdaptor_Curve AdaptCurve(C); + GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); vector< double > params; SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 634ca3d61..9487a6148 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -3616,7 +3616,7 @@ void _Shrinker1D::AddEdge( const _LayerEdge* e, SMESH_MesherHelper& helper ) return; TopLoc_Location loc; Handle(Geom_Curve) C = BRep_Tool::Curve(E, loc, f,l); - GeomAdaptor_Curve aCurve(C); + GeomAdaptor_Curve aCurve(C, f,l); const double totLen = GCPnts_AbscissaPoint::Length(aCurve, f, l); int nbExpectNodes = eSubMesh->NbNodes() - e->_nodes.size(); @@ -3670,7 +3670,7 @@ void _Shrinker1D::Compute(bool set3D, SMESH_MesherHelper& helper) if ( set3D || _done ) { Handle(Geom_Curve) C = BRep_Tool::Curve(E, f,l); - GeomAdaptor_Curve aCurve(C); + GeomAdaptor_Curve aCurve(C, f,l); if ( _edges[0] ) f = helper.GetNodeU( E, _edges[0]->_nodes.back(), _nodes[0] ); -- 2.39.2