From: dkv Date: Sat, 13 Nov 2010 08:29:43 +0000 (+0000) Subject: porting to OOCT 6.4.0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=574a764e9417a8c568defb98446f60e5601986b5;p=modules%2Fsmesh.git porting to OOCT 6.4.0 --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index b802540f0..a6c7e6a6d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -48,6 +48,12 @@ #include "utilities.h" +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif #include #include #include @@ -93,6 +99,12 @@ #define cast2Node(elem) static_cast( elem ) +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif + using namespace std; using namespace SMESH::Controls; @@ -2761,10 +2773,17 @@ static bool getClosestUV (Extrema_GenExtPS& projector, if ( projector.IsDone() ) { double u, v, minVal = DBL_MAX; for ( int i = projector.NbExt(); i > 0; i-- ) +#if OCC_VERSION_LARGE >= 0x06030100 + if ( Sqrt(projector.SquareDistance( i )) < minVal ) { + minVal = Sqrt(projector.SquareDistance( i )); + projector.Point( i ).Parameter( u, v ); + } +#else if ( projector.Value( i ) < minVal ) { minVal = projector.Value( i ); projector.Point( i ).Parameter( u, v ); } +#endif result.SetCoord( u, v ); return true; } @@ -9981,7 +10000,11 @@ namespace { _extremum.Perform(aPnt); if ( _extremum.IsDone() ) for ( int iSol = 1; iSol <= _extremum.NbExt() && _state == TopAbs_OUT; ++iSol) +#if OCC_VERSION_LARGE >= 0x06030100 + _state = ( Sqrt(_extremum.SquareDistance(iSol)) <= theTol ? TopAbs_IN : TopAbs_OUT ); +#else _state = ( _extremum.Value(iSol) <= theTol ? TopAbs_IN : TopAbs_OUT ); +#endif } TopAbs_State State() const { diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 43ee8669d..b692b9fda 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -26,6 +26,12 @@ // #include "SMESH_Pattern.hxx" +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif #include #include #include @@ -443,10 +449,17 @@ static gp_XY project (const SMDS_MeshNode* theNode, } double u, v, minVal = DBL_MAX; for ( int i = theProjectorPS.NbExt(); i > 0; i-- ) +#if OCC_VERSION_LARGE >= 0x06030100 + if ( Sqrt(theProjectorPS.SquareDistance( i )) < minVal ) { + minVal = Sqrt(theProjectorPS.SquareDistance( i )); + theProjectorPS.Point( i ).Parameter( u, v ); + } +#else if ( theProjectorPS.Value( i ) < minVal ) { minVal = theProjectorPS.Value( i ); theProjectorPS.Point( i ).Parameter( u, v ); } +#endif return gp_XY( u, v ); }