initialize the Curve Adaptor using range of the edge

This commit is contained in:
eap 2011-07-01 15:45:09 +00:00
parent ce5494a2c1
commit b6fe67a04f
7 changed files with 10 additions and 8 deletions

View File

@ -214,7 +214,7 @@ bool StdMeshers_Arithmetic1D::SetParametersByMesh(const SMESH_Mesh* theMesh,
{ {
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i )); const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i ));
Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax); Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax);
GeomAdaptor_Curve AdaptCurve(C); GeomAdaptor_Curve AdaptCurve(C, UMin, UMax);
vector< double > params; vector< double > params;
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();

View File

@ -204,7 +204,7 @@ bool StdMeshers_Deflection1D::SetParametersByMesh(const SMESH_Mesh* theMesh,
{ {
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE )); const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE ));
Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax ); 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 ) if ( AdaptCurve.GetType() != GeomAbs_Line )
{ {
vector< double > params; vector< double > params;

View File

@ -147,7 +147,9 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
// check if edge has non-uniform parametrization (issue 0020705) // check if edge has non-uniform parametrization (issue 0020705)
if ( !myC2d[i].IsNull() && myEdgeLength[i] > DBL_MIN) 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 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 d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 ); double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );

View File

@ -216,7 +216,7 @@ bool StdMeshers_LocalLength::SetParametersByMesh(const SMESH_Mesh* theMesh,
{ {
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE )); const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE ));
Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax ); Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax );
GeomAdaptor_Curve AdaptCurve(C); GeomAdaptor_Curve AdaptCurve(C, UMin, UMax);
vector< double > params; vector< double > params;
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();

View File

@ -207,7 +207,7 @@ bool StdMeshers_MaxLength::SetParametersByMesh(const SMESH_Mesh* theMesh,
{ {
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE )); const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( iE ));
Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax ); Handle(Geom_Curve) C = BRep_Tool::Curve( edge, L, UMin, UMax );
GeomAdaptor_Curve AdaptCurve(C); GeomAdaptor_Curve AdaptCurve(C, UMin, UMax);
vector< double > params; vector< double > params;
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();

View File

@ -216,7 +216,7 @@ bool StdMeshers_StartEndLength::SetParametersByMesh(const SMESH_Mesh* theMesh,
{ {
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i )); const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i ));
Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax); Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax);
GeomAdaptor_Curve AdaptCurve(C); GeomAdaptor_Curve AdaptCurve(C, UMin, UMax);
vector< double > params; vector< double > params;
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();

View File

@ -3616,7 +3616,7 @@ void _Shrinker1D::AddEdge( const _LayerEdge* e, SMESH_MesherHelper& helper )
return; return;
TopLoc_Location loc; TopLoc_Location loc;
Handle(Geom_Curve) C = BRep_Tool::Curve(E, loc, f,l); 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); const double totLen = GCPnts_AbscissaPoint::Length(aCurve, f, l);
int nbExpectNodes = eSubMesh->NbNodes() - e->_nodes.size(); int nbExpectNodes = eSubMesh->NbNodes() - e->_nodes.size();
@ -3670,7 +3670,7 @@ void _Shrinker1D::Compute(bool set3D, SMESH_MesherHelper& helper)
if ( set3D || _done ) if ( set3D || _done )
{ {
Handle(Geom_Curve) C = BRep_Tool::Curve(E, f,l); Handle(Geom_Curve) C = BRep_Tool::Curve(E, f,l);
GeomAdaptor_Curve aCurve(C); GeomAdaptor_Curve aCurve(C, f,l);
if ( _edges[0] ) if ( _edges[0] )
f = helper.GetNodeU( E, _edges[0]->_nodes.back(), _nodes[0] ); f = helper.GetNodeU( E, _edges[0]->_nodes.back(), _nodes[0] );