porting to OOCT 6.4.0

This commit is contained in:
dkv 2010-11-13 08:29:43 +00:00
parent a4e82b3769
commit 574a764e94
2 changed files with 36 additions and 0 deletions

View File

@ -48,6 +48,12 @@
#include "utilities.h"
#include <Standard_Version.hxx>
#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 <BRepAdaptor_Surface.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BRep_Tool.hxx>
@ -93,6 +99,12 @@
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( 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
{

View File

@ -26,6 +26,12 @@
//
#include "SMESH_Pattern.hxx"
#include <Standard_Version.hxx>
#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 <BRepAdaptor_Curve.hxx>
#include <BRepTools.hxx>
#include <BRepTools_WireExplorer.hxx>
@ -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 );
}