]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
porting to OOCT 6.4.0 PORTING_OCC64
authordkv <dkv@opencascade.com>
Sat, 13 Nov 2010 08:29:43 +0000 (08:29 +0000)
committerdkv <dkv@opencascade.com>
Sat, 13 Nov 2010 08:29:43 +0000 (08:29 +0000)
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_Pattern.cxx

index b802540f09405bf6c1902001f5da04a41d31a499..a6c7e6a6dd6de637c17fe827c6f7f790071a4d56 100644 (file)
 
 #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>
 
 #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
     {
index 43ee8669da9ececd57a090d44061d2f76c73c105..b692b9fdab6432af44a12bea5bdf136ed3203cbf 100644 (file)
 //
 #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 );
 }