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
PAL11398. Generalize access to interfaces wrapped by python class
[modules/smesh.git]
/
src
/
StdMeshersGUI
/
StdMeshersGUI_DistrPreview.cxx
diff --git
a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
index 0d66dc53aa903a601113b0c772855057ee3a08f0..e58be313b07e36bafe76793c031bc1e4c1465789 100644
(file)
--- a/
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
+++ b/
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
@@
-1,11
+1,9
@@
#include "StdMeshersGUI_DistrPreview.h"
#include "StdMeshersGUI_DistrPreview.h"
+#include "CASCatch.hxx"
+
#include <Expr_NamedUnknown.hxx>
#include <Expr_GeneralExpression.hxx>
#include <Expr_NamedUnknown.hxx>
#include <Expr_GeneralExpression.hxx>
-#include <CASCatch_CatchSignals.hxx>
-#include <CASCatch_Failure.hxx>
-#include <CASCatch_ErrorHandler.hxx>
-#include <OSD.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 ),
@@
-223,20
+221,14
@@
void StdMeshersGUI_DistrPreview::update()
delete[] y;
x = y = 0;
delete[] y;
x = y = 0;
- OSD::SetSignal( true );
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
CASCatch_TRY
{
replot();
}
CASCatch_TRY
{
replot();
}
- CASCatch_CATCH(
CASCatch
_Failure)
+ CASCatch_CATCH(
Standard
_Failure)
{
{
- aCatchSignals.Deactivate();
- Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
}
}
- aCatchSignals.Deactivate();
}
void StdMeshersGUI_DistrPreview::showError()
}
void StdMeshersGUI_DistrPreview::showError()
@@
-273,22
+265,17
@@
bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
bool StdMeshersGUI_DistrPreview::init( const QString& str )
{
bool StdMeshersGUI_DistrPreview::init( const QString& str )
{
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
bool parsed_ok = true;
CASCatch_TRY
{
myExpr = ExprIntrp_GenExp::Create();
myExpr->Process( ( Standard_CString ) str.latin1() );
}
bool parsed_ok = true;
CASCatch_TRY
{
myExpr = ExprIntrp_GenExp::Create();
myExpr->Process( ( Standard_CString ) str.latin1() );
}
- CASCatch_CATCH(
CASCatch
_Failure)
+ CASCatch_CATCH(
Standard
_Failure)
{
{
- aCatchSignals.Deactivate();
- Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
parsed_ok = false;
}
parsed_ok = false;
}
- aCatchSignals.Deactivate();
bool syntax = false, args = false;
if( parsed_ok && myExpr->IsDone() )
bool syntax = false, args = false;
if( parsed_ok && myExpr->IsDone() )
@@
-318,23
+305,18
@@
double StdMeshersGUI_DistrPreview::funcValue( const double t, bool& ok )
double StdMeshersGUI_DistrPreview::calc( bool& ok )
{
double StdMeshersGUI_DistrPreview::calc( bool& ok )
{
- OSD::SetSignal( true );
double res = 0.0;
double res = 0.0;
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
ok = true;
CASCatch_TRY {
res = myExpr->Expression()->Evaluate( myVars, myValues );
}
ok = true;
CASCatch_TRY {
res = myExpr->Expression()->Evaluate( myVars, myValues );
}
- CASCatch_CATCH(CASCatch_Failure) {
- aCatchSignals.Deactivate();
- Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught();
+ CASCatch_CATCH(Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
ok = false;
res = 0.0;
}
ok = false;
res = 0.0;
}
- aCatchSignals.Deactivate();
+
return res;
}
return res;
}
@@
-345,9
+327,6
@@
bool StdMeshersGUI_DistrPreview::isDone() const
bool StdMeshersGUI_DistrPreview::convert( double& v ) const
{
bool StdMeshersGUI_DistrPreview::convert( double& v ) const
{
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
bool ok = true;
switch( myConv )
{
bool ok = true;
switch( myConv )
{
@@
-355,12
+334,15
@@
bool StdMeshersGUI_DistrPreview::convert( double& v ) const
{
CASCatch_TRY
{
{
CASCatch_TRY
{
+ // in StdMeshers_NumberOfSegments.cc
+ // const double PRECISION = 1e-7;
+ //
+ if(v < -7) v = -7.0;
v = pow( 10.0, v );
}
v = pow( 10.0, v );
}
- CASCatch_CATCH(
CASCatch
_Failure)
+ CASCatch_CATCH(
Standard
_Failure)
{
{
- aCatchSignals.Deactivate();
- Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
v = 0.0;
ok = false;
}
v = 0.0;
ok = false;
}
@@
-372,6
+354,6
@@
bool StdMeshersGUI_DistrPreview::convert( double& v ) const
v = 0;
break;
}
v = 0;
break;
}
- aCatchSignals.Deactivate();
+
return ok;
}
return ok;
}