X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Regular_1D.cxx;h=391bd38c3c11df989aa6073ca8e7585582870acd;hp=8e50b059ba88c416dbc24ed7be91199d7e6b5f79;hb=6650dea1f85dd5c640829d6e0391d703a304a152;hpb=3add66f2196c5b8e04e69d87c9f6a28e9a9a2eb2 diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 8e50b059b..391bd38c3 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,12 +19,13 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // SMESH SMESH : implementaion of SMESH idl descriptions // File : StdMeshers_Regular_1D.cxx // Moved here from SMESH_Regular_1D.cxx // Author : Paul RASCLE, EDF // Module : SMESH - +// #include "StdMeshers_Regular_1D.hxx" #include "StdMeshers_Distribution.hxx" @@ -63,6 +64,7 @@ #include #include +#include using namespace std; @@ -324,6 +326,8 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last, return false; prevU = U; } + if ( theReverse ) + theParams.reverse(); return true; } @@ -757,7 +761,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, double an = _value[ END_LENGTH_IND ]; double q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 ); - int n = int( 1 + ( an - a1 ) / q ); + int n = int(fabs(q) > numeric_limits::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 )); double U1 = theReverse ? l : f; double Un = theReverse ? f : l; @@ -803,38 +807,83 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, } if(!IsExist) Params.InsertBefore(j,aPnts[i]); } - double pf, pl, par2, par1, psize; - if (theReverse) { - pf = l; - pl = f; + double par2, par1, lp; + par1 = f; + lp = l; + double sign = 1.0; + if(theReverse) { + par1 = l; + lp = f; + sign = -1.0; } - else { - pf = f; - pl = l; - } - psize = pl - pf; - par1 = pf; - //cout<<"aPnts.size() = "< tmpParams; + for(int i=2; i::iterator itP = tmpParams.begin(); + for(; itP != tmpParams.end(); itP++) { + theParams.push_back( *(itP) ); } + theParams.push_back( par2 ); + par1 = par2; } // add for last int nbseg = ( nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0]; - double dp = (pl-par1)/nbseg; - int j = 1; - for(; j tmpParams; + for(int i=2; i::iterator itP = tmpParams.begin(); + for(; itP != tmpParams.end(); itP++) { + theParams.push_back( *(itP) ); + } + if (theReverse) { theParams.reverse(); // NPAL18025 } @@ -1032,7 +1081,7 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh, if ( _hypType == NONE ) return false; - SMESHDS_Mesh * meshDS = theMesh.GetMeshDS(); + //SMESHDS_Mesh * meshDS = theMesh.GetMeshDS(); const TopoDS_Edge & EE = TopoDS::Edge(theShape); TopoDS_Edge E = TopoDS::Edge(EE.Oriented(TopAbs_FORWARD)); @@ -1047,8 +1096,7 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh, ASSERT(!VFirst.IsNull()); ASSERT(!VLast.IsNull()); - std::vector aVec(SMDSEntity_Last); - for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last,0); if (!Curve.IsNull()) { list< double > params;