mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 02:40:35 +05:00
SMH: Version ported on new OCT6.1.1
This commit is contained in:
parent
9ab6519add
commit
057dae0b9e
@ -17,7 +17,7 @@
|
|||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// 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
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -1265,6 +1265,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
|
|||||||
RemoveSubMeshElementsAndNodes();
|
RemoveSubMeshElementsAndNodes();
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput())
|
if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput())
|
||||||
ret = ApplyToCollection( algo, GetCollection( gen, algo ) );
|
ret = ApplyToCollection( algo, GetCollection( gen, algo ) );
|
||||||
else
|
else
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// 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
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -37,7 +37,6 @@
|
|||||||
#include "SMESH_Gen_i.hxx"
|
#include "SMESH_Gen_i.hxx"
|
||||||
#include "SMESH_Filter_i.hxx"
|
#include "SMESH_Filter_i.hxx"
|
||||||
#include "SMESH_PythonDump.hxx"
|
#include "SMESH_PythonDump.hxx"
|
||||||
#include "CASCatch.hxx"
|
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
@ -45,6 +44,9 @@
|
|||||||
#include <gp_Ax2.hxx>
|
#include <gp_Ax2.hxx>
|
||||||
#include <gp_Vec.hxx>
|
#include <gp_Vec.hxx>
|
||||||
|
|
||||||
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
typedef map<const SMDS_MeshElement*,
|
typedef map<const SMDS_MeshElement*,
|
||||||
@ -1052,7 +1054,8 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
|
|||||||
myLastCreatedElems = new SMESH::long_array();
|
myLastCreatedElems = new SMESH::long_array();
|
||||||
myLastCreatedNodes = new SMESH::long_array();
|
myLastCreatedNodes = new SMESH::long_array();
|
||||||
|
|
||||||
CASCatch_TRY {
|
try {
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
SMESHDS_Mesh* aMesh = GetMeshDS();
|
SMESHDS_Mesh* aMesh = GetMeshDS();
|
||||||
|
|
||||||
map<int,const SMDS_MeshElement*> elements;
|
map<int,const SMDS_MeshElement*> elements;
|
||||||
@ -1073,7 +1076,7 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
|
|||||||
<< theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
|
<< theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
|
||||||
|
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure) {
|
catch(Standard_Failure) {
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
|
INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
|
||||||
}
|
}
|
||||||
|
@ -27,11 +27,13 @@
|
|||||||
// $Header$
|
// $Header$
|
||||||
|
|
||||||
#include "StdMeshers_Distribution.hxx"
|
#include "StdMeshers_Distribution.hxx"
|
||||||
#include "CASCatch.hxx"
|
|
||||||
|
|
||||||
#include <math_GaussSingleIntegration.hxx>
|
#include <math_GaussSingleIntegration.hxx>
|
||||||
#include <utilities.h>
|
#include <utilities.h>
|
||||||
|
|
||||||
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
|
||||||
Function::Function( const int conv )
|
Function::Function( const int conv )
|
||||||
: myConv( conv )
|
: myConv( conv )
|
||||||
{
|
{
|
||||||
@ -46,11 +48,11 @@ bool Function::value( const double, double& f ) const
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
if( myConv==0 )
|
if( myConv==0 )
|
||||||
{
|
{
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
f = pow( 10, f );
|
f = pow( 10, f );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
f = 0.0;
|
f = 0.0;
|
||||||
@ -170,12 +172,12 @@ FunctionExpr::FunctionExpr( const char* str, const int conv )
|
|||||||
myValues( 1, 1 )
|
myValues( 1, 1 )
|
||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
myExpr = ExprIntrp_GenExp::Create();
|
myExpr = ExprIntrp_GenExp::Create();
|
||||||
myExpr->Process( ( Standard_CString )str );
|
myExpr->Process( ( Standard_CString )str );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
ok = false;
|
ok = false;
|
||||||
@ -206,10 +208,11 @@ bool FunctionExpr::value( const double t, double& f ) const
|
|||||||
|
|
||||||
( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t;
|
( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
CASCatch_TRY {
|
try {
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
f = myExpr->Expression()->Evaluate( myVars, myValues );
|
f = myExpr->Expression()->Evaluate( myVars, myValues );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure) {
|
catch(Standard_Failure) {
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
f = 0.0;
|
f = 0.0;
|
||||||
ok = false;
|
ok = false;
|
||||||
@ -222,13 +225,13 @@ bool FunctionExpr::value( const double t, double& f ) const
|
|||||||
double FunctionExpr::integral( const double a, const double b ) const
|
double FunctionExpr::integral( const double a, const double b ) const
|
||||||
{
|
{
|
||||||
double res = 0.0;
|
double res = 0.0;
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
math_GaussSingleIntegration _int( ( math_Function& )*this, a, b, 20 );
|
math_GaussSingleIntegration _int( ( math_Function& )*this, a, b, 20 );
|
||||||
if( _int.IsDone() )
|
if( _int.IsDone() )
|
||||||
res = _int.Value();
|
res = _int.Value();
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
res = 0.0;
|
res = 0.0;
|
||||||
MESSAGE( "Exception in integral calculating" );
|
MESSAGE( "Exception in integral calculating" );
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
#include "SMESHDS_SubMesh.hxx"
|
#include "SMESHDS_SubMesh.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
|
|
||||||
#include "CASCatch.hxx"
|
|
||||||
|
|
||||||
#include <ExprIntrp_GenExp.hxx>
|
#include <ExprIntrp_GenExp.hxx>
|
||||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||||
#include <Expr_NamedUnknown.hxx>
|
#include <Expr_NamedUnknown.hxx>
|
||||||
@ -43,6 +41,9 @@
|
|||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
|
||||||
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
const double PRECISION = 1e-7;
|
const double PRECISION = 1e-7;
|
||||||
@ -218,11 +219,11 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector<double>& ta
|
|||||||
double val = table[i*2+1];
|
double val = table[i*2+1];
|
||||||
if( _convMode==0 )
|
if( _convMode==0 )
|
||||||
{
|
{
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
val = pow( 10.0, val );
|
val = pow( 10.0, val );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
throw SALOME_Exception( LOCALIZED( "invalid value"));
|
throw SALOME_Exception( LOCALIZED( "invalid value"));
|
||||||
@ -312,12 +313,12 @@ bool process( const TCollection_AsciiString& str, int convMode,
|
|||||||
{
|
{
|
||||||
bool parsed_ok = true;
|
bool parsed_ok = true;
|
||||||
Handle( ExprIntrp_GenExp ) myExpr;
|
Handle( ExprIntrp_GenExp ) myExpr;
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
myExpr = ExprIntrp_GenExp::Create();
|
myExpr = ExprIntrp_GenExp::Create();
|
||||||
myExpr->Process( str.ToCString() );
|
myExpr->Process( str.ToCString() );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
parsed_ok = false;
|
parsed_ok = false;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// 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
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -31,10 +31,6 @@ using namespace std;
|
|||||||
|
|
||||||
#include "StdMeshers_Regular_1D.hxx"
|
#include "StdMeshers_Regular_1D.hxx"
|
||||||
#include "StdMeshers_Distribution.hxx"
|
#include "StdMeshers_Distribution.hxx"
|
||||||
#include "SMESH_Gen.hxx"
|
|
||||||
#include "SMESH_Mesh.hxx"
|
|
||||||
#include "SMESH_HypoFilter.hxx"
|
|
||||||
#include "SMESH_subMesh.hxx"
|
|
||||||
|
|
||||||
#include "StdMeshers_LocalLength.hxx"
|
#include "StdMeshers_LocalLength.hxx"
|
||||||
#include "StdMeshers_NumberOfSegments.hxx"
|
#include "StdMeshers_NumberOfSegments.hxx"
|
||||||
@ -43,6 +39,11 @@ using namespace std;
|
|||||||
#include "StdMeshers_Deflection1D.hxx"
|
#include "StdMeshers_Deflection1D.hxx"
|
||||||
#include "StdMeshers_AutomaticLength.hxx"
|
#include "StdMeshers_AutomaticLength.hxx"
|
||||||
|
|
||||||
|
#include "SMESH_Gen.hxx"
|
||||||
|
#include "SMESH_Mesh.hxx"
|
||||||
|
#include "SMESH_HypoFilter.hxx"
|
||||||
|
#include "SMESH_subMesh.hxx"
|
||||||
|
|
||||||
#include "SMDS_MeshElement.hxx"
|
#include "SMDS_MeshElement.hxx"
|
||||||
#include "SMDS_MeshNode.hxx"
|
#include "SMDS_MeshNode.hxx"
|
||||||
#include "SMDS_EdgePosition.hxx"
|
#include "SMDS_EdgePosition.hxx"
|
||||||
@ -58,15 +59,17 @@ using namespace std;
|
|||||||
#include <GCPnts_AbscissaPoint.hxx>
|
#include <GCPnts_AbscissaPoint.hxx>
|
||||||
#include <GCPnts_UniformAbscissa.hxx>
|
#include <GCPnts_UniformAbscissa.hxx>
|
||||||
#include <GCPnts_UniformDeflection.hxx>
|
#include <GCPnts_UniformDeflection.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <Expr_GeneralExpression.hxx>
|
#include <Expr_GeneralExpression.hxx>
|
||||||
#include <Expr_NamedUnknown.hxx>
|
#include <Expr_NamedUnknown.hxx>
|
||||||
#include <Expr_Array1OfNamedUnknown.hxx>
|
#include <Expr_Array1OfNamedUnknown.hxx>
|
||||||
#include <TColStd_Array1OfReal.hxx>
|
|
||||||
#include <ExprIntrp_GenExp.hxx>
|
#include <ExprIntrp_GenExp.hxx>
|
||||||
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
#include <OSD.hxx>
|
#include <OSD.hxx>
|
||||||
|
|
||||||
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
#include <Standard_Failure.hxx>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@ -572,6 +575,7 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh
|
|||||||
if ( !_mainEdge.IsNull() )
|
if ( !_mainEdge.IsNull() )
|
||||||
reversed = aMesh.IsReversedInChain( EE, _mainEdge );
|
reversed = aMesh.IsReversedInChain( EE, _mainEdge );
|
||||||
try {
|
try {
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
if ( ! computeInternalParameters( E, params, reversed )) {
|
if ( ! computeInternalParameters( E, params, reversed )) {
|
||||||
//cout << "computeInternalParameters() failed" <<endl;
|
//cout << "computeInternalParameters() failed" <<endl;
|
||||||
return false;
|
return false;
|
||||||
|
@ -19,11 +19,13 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "StdMeshersGUI_DistrPreview.h"
|
#include "StdMeshersGUI_DistrPreview.h"
|
||||||
#include "CASCatch.hxx"
|
|
||||||
|
|
||||||
#include <Expr_NamedUnknown.hxx>
|
#include <Expr_NamedUnknown.hxx>
|
||||||
#include <Expr_GeneralExpression.hxx>
|
#include <Expr_GeneralExpression.hxx>
|
||||||
|
|
||||||
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
|
||||||
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
|
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
|
||||||
: QwtPlot( p ),
|
: QwtPlot( p ),
|
||||||
myPoints( 50 ),
|
myPoints( 50 ),
|
||||||
@ -240,11 +242,11 @@ void StdMeshersGUI_DistrPreview::update()
|
|||||||
delete[] y;
|
delete[] y;
|
||||||
x = y = 0;
|
x = y = 0;
|
||||||
|
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
replot();
|
replot();
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
}
|
}
|
||||||
@ -285,12 +287,12 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
|
|||||||
bool StdMeshersGUI_DistrPreview::init( const QString& str )
|
bool StdMeshersGUI_DistrPreview::init( const QString& str )
|
||||||
{
|
{
|
||||||
bool parsed_ok = true;
|
bool parsed_ok = true;
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
myExpr = ExprIntrp_GenExp::Create();
|
myExpr = ExprIntrp_GenExp::Create();
|
||||||
myExpr->Process( ( Standard_CString ) str.latin1() );
|
myExpr->Process( ( Standard_CString ) str.latin1() );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
parsed_ok = false;
|
parsed_ok = false;
|
||||||
@ -327,10 +329,11 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok )
|
|||||||
double res = 0.0;
|
double res = 0.0;
|
||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
CASCatch_TRY {
|
try {
|
||||||
|
OCC_CATCH_SIGNALS;
|
||||||
res = myExpr->Expression()->Evaluate( myVars, myValues );
|
res = myExpr->Expression()->Evaluate( myVars, myValues );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure) {
|
catch(Standard_Failure) {
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
ok = false;
|
ok = false;
|
||||||
res = 0.0;
|
res = 0.0;
|
||||||
@ -351,15 +354,15 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const
|
|||||||
{
|
{
|
||||||
case EXPONENT:
|
case EXPONENT:
|
||||||
{
|
{
|
||||||
CASCatch_TRY
|
try {
|
||||||
{
|
OCC_CATCH_SIGNALS;
|
||||||
// in StdMeshers_NumberOfSegments.cc
|
// in StdMeshers_NumberOfSegments.cc
|
||||||
// const double PRECISION = 1e-7;
|
// const double PRECISION = 1e-7;
|
||||||
//
|
//
|
||||||
if(v < -7) v = -7.0;
|
if(v < -7) v = -7.0;
|
||||||
v = pow( 10.0, v );
|
v = pow( 10.0, v );
|
||||||
}
|
}
|
||||||
CASCatch_CATCH(Standard_Failure)
|
catch(Standard_Failure)
|
||||||
{
|
{
|
||||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
v = 0.0;
|
v = 0.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user