Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[modules/smesh.git]
/
src
/
StdMeshersGUI
/
StdMeshersGUI_DistrPreview.cxx
diff --git
a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
index ead8d1c3d72d7dea4eed6032a2de6896501cfebe..a723fdbef364eae9767b5705ef39c31204aa05fd 100644
(file)
--- a/
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
+++ b/
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
08
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
10
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
@@
-19,6
+19,7
@@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_DistrPreview.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
// File : StdMeshersGUI_DistrPreview.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
@@
-49,6
+50,10
@@
#ifdef WIN32
# include <algorithm>
#endif
#ifdef WIN32
# include <algorithm>
#endif
+#include <math.h>
+#include <limits>
+
+#include <Basics_Utils.hxx>
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
: QwtPlot( p ),
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
: QwtPlot( p ),
@@
-60,6
+65,7
@@
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::
myIsDone( true ),
myNbSeg( 1 )
{
myIsDone( true ),
myNbSeg( 1 )
{
+ Kernel_Utils::Localizer loc;
myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
myVars.ChangeValue( 1 ) = new Expr_NamedUnknown( "t" );
myDensity = new QwtPlotCurve( QString() );
myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
myVars.ChangeValue( 1 ) = new Expr_NamedUnknown( "t" );
myDensity = new QwtPlotCurve( QString() );
@@
-200,6
+206,7
@@
bool StdMeshersGUI_DistrPreview::createTable( SMESH::double_array& func )
void StdMeshersGUI_DistrPreview::update()
{
void StdMeshersGUI_DistrPreview::update()
{
+ Kernel_Utils::Localizer loc;
SMESH::double_array graph, distr;
if( isTableFunc() )
{
SMESH::double_array graph, distr;
if( isTableFunc() )
{
@@
-218,13
+225,13
@@
void StdMeshersGUI_DistrPreview::update()
{
SMESH::double_array* arr = 0;
if( isTableFunc() )
{
SMESH::double_array* arr = 0;
if( isTableFunc() )
- arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
+
arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
else
else
- arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
+
arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
if( arr )
{
if( arr )
{
- distr = *arr;
- delete arr;
+
distr = *arr;
+
delete arr;
}
}
}
}
}
}
@@
-257,6
+264,10
@@
void StdMeshersGUI_DistrPreview::update()
showError();
return;
}
showError();
return;
}
+ if ( isinf(y[i]))
+ y[i] = std::numeric_limits<double>::max()/100.;
+// if ( y[i] > 1e3 )
+// y[i] = 1e3;
if( i==0 || y[i]<min_y )
min_y = y[i];
if( i==0 || y[i]>max_y )
if( i==0 || y[i]<min_y )
min_y = y[i];
if( i==0 || y[i]>max_y )
@@
-333,7
+344,7
@@
bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
if( !name.IsNull() )
{
if( name->GetName()!="t" )
if( !name.IsNull() )
{
if( name->GetName()!="t" )
- res = false;
+
res = false;
}
else
res = isCorrectArg( sub );
}
else
res = isCorrectArg( sub );
@@
-343,6
+354,7
@@
bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
bool StdMeshersGUI_DistrPreview::init( const QString& str )
{
bool StdMeshersGUI_DistrPreview::init( const QString& str )
{
+ Kernel_Utils::Localizer loc;
bool parsed_ok = true;
try {
#ifdef NO_CAS_CATCH
bool parsed_ok = true;
try {
#ifdef NO_CAS_CATCH
@@
-416,15
+428,15
@@
bool StdMeshersGUI_DistrPreview::convert( double& v ) const
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS;
#endif
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS;
#endif
- // in StdMeshers_NumberOfSegments.cc
- // const double PRECISION = 1e-7;
- //
- if(v < -7) v = -7.0;
- v = pow( 10.0, v );
+
// in StdMeshers_NumberOfSegments.cc
+
// const double PRECISION = 1e-7;
+
//
+
if(v < -7) v = -7.0;
+
v = pow( 10.0, v );
} catch(Standard_Failure) {
} catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- v = 0.0;
- ok = false;
+
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+
v = 0.0;
+
ok = false;
}
}
break;
}
}
break;