+// Copyright (C) 2005 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 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include "StdMeshersGUI_DistrPreview.h"
+#include "CASCatch.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 ),
delete[] y;
x = y = 0;
- OSD::SetSignal( true );
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
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()
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() );
}
- 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;
}
- aCatchSignals.Deactivate();
bool syntax = false, args = false;
if( parsed_ok && myExpr->IsDone() )
double StdMeshersGUI_DistrPreview::calc( bool& ok )
{
- OSD::SetSignal( true );
double res = 0.0;
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
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;
}
- aCatchSignals.Deactivate();
+
return res;
}
bool StdMeshersGUI_DistrPreview::convert( double& v ) const
{
- CASCatch_CatchSignals aCatchSignals;
- aCatchSignals.Activate();
-
bool ok = true;
switch( myConv )
{
{
CASCatch_TRY
{
+ // in StdMeshers_NumberOfSegments.cc
+ // const double PRECISION = 1e-7;
+ //
+ if(v < -7) v = -7.0;
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;
break;
}
- aCatchSignals.Deactivate();
+
return ok;
}