X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Distribution.cxx;h=574466cc7ef1ba00de342a8b69f53ff2d9c32f5b;hp=f2e591f342928e4b2cb4d414d94a0a1f88956e8c;hb=59627b07d70f4caa4c768be6805334d2610fa54c;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070 diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index f2e591f34..574466cc7 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 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 +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // SMESH StdMeshers : implementaion of point distribution algorithm // File : StdMeshers_Distribution.cxx // Author : Alexandre SOLOVYOV @@ -42,6 +43,8 @@ using namespace std; +namespace StdMeshers { + Function::Function( const int conv ) : myConv( conv ) { @@ -129,8 +132,8 @@ bool FunctionTable::value( const double t, double& f ) const double FunctionTable::integral( const int i ) const { - if( i>=0 && i= 0 && i < (int)myData.size()-1 ) + return integral( i, myData[2*(i+1)] - myData[2*i] ); else return 0; } @@ -303,21 +306,21 @@ double dihotomySolve( Function& f, const double val, const double _start, const } bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end, - const int nbSeg, vector& data, const double eps ) + const int nbSeg, vector& data, const double eps ) { FunctionExpr F( f.ToCString(), conv ); return buildDistribution( F, start, end, nbSeg, data, eps ); } bool buildDistribution( const std::vector& f, const int conv, const double start, const double end, - const int nbSeg, vector& data, const double eps ) + const int nbSeg, vector& data, const double eps ) { FunctionTable F( f, conv ); return buildDistribution( F, start, end, nbSeg, data, eps ); } bool buildDistribution( const Function& func, const double start, const double end, const int nbSeg, - vector& data, const double eps ) + vector& data, const double eps ) { if( nbSeg<=0 ) return false; @@ -344,3 +347,4 @@ bool buildDistribution( const Function& func, const double start, const double e data[nbSeg] = end; return true; } +}