Salome HOME
Porting to OCCT6.5.1
authorjfa <jfa@opencascade.com>
Thu, 11 Aug 2011 13:54:07 +0000 (13:54 +0000)
committerjfa <jfa@opencascade.com>
Thu, 11 Aug 2011 13:54:07 +0000 (13:54 +0000)
src/SMESH/Makefile.am
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_Pattern.cxx
src/SMESH/SMESH_subMesh.cxx

index 461b4dc00f2535dee75460bece1497acb2dc35a4..9c2ab41308898e54dcafd88b49d6d2844c53b3e3 100644 (file)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
 
 #  SMESH SMESH : implementaion of SMESH idl descriptions
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Modified by : Alexander BORODIN (OCN) - autotools usage
 #  Module : SMESH
-#
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 # header files 
@@ -70,6 +69,7 @@ dist_libSMESHimpl_la_SOURCES = \
 # additionnal information to compile and link file
 libSMESHimpl_la_CPPFLAGS = \
        $(KERNEL_CXXFLAGS) \
+       $(GUI_CXXFLAGS) \
        $(CAS_CPPFLAGS) \
        $(MED_CXXFLAGS) \
        $(GEOM_CXX_FLAGS) \
index e509dd1b9fbe52afabc4d779c685b967b413d1ae..05a84cdcd99610a1645f3106432dc8d57e7a96d2 100644 (file)
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 
 //  SMESH SMESH : implementaion of SMESH idl descriptions
 //  File   : SMESH_Algo.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//
+
 #include "SMESH_Algo.hxx"
 
 #include "SMDS_EdgePosition.hxx"
@@ -40,6 +39,8 @@
 #include "SMESH_Mesh.hxx"
 #include "SMESH_TypeDefs.hxx"
 
+#include <CASCatch_OCCTVersion.hxx>
+
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepLProp.hxx>
 #include <BRep_Tool.hxx>
@@ -512,7 +513,7 @@ GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1,
   Standard_Real tol = BRep_Tool::Tolerance( V );
   Standard_Real angTol = 2e-3;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     return BRepLProp::Continuity(C1, C2, u1, u2, tol, angTol);
index 76432855fe476d48e366cff1bc5fa5211dad0628..9ea2f7d1ec38ad5da285fb746a5ca0a4a08b29b0 100644 (file)
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 
-//  SMESH SMESH : idl implementation based on 'SMESH' unit's classes
+// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
 // File      : SMESH_MeshEditor.cxx
 // Created   : Mon Apr 12 16:10:22 2004
 // Author    : Edward AGAPOV (eap)
-//
+
 #define CHRONODEF
 #include "SMESH_MeshEditor.hxx"
 
@@ -50,6 +49,8 @@
 #include "SMESH_OctreeNode.hxx"
 #include "SMESH_subMesh.hxx"
 
+#include <CASCatch_OCCTVersion.hxx>
+
 #include "utilities.h"
 
 #include <BRepAdaptor_Surface.hxx>
@@ -2829,8 +2830,13 @@ 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 > 0x06040000 // Porting to OCCT6.5.1
+      if ( projector.SquareDistance( i ) < minVal ) {
+        minVal = projector.SquareDistance( i );
+#else
       if ( projector.Value( i ) < minVal ) {
         minVal = projector.Value( i );
+#endif
         projector.Point( i ).Parameter( u, v );
       }
     result.SetCoord( u, v );
@@ -10785,7 +10791,11 @@ namespace {
       _extremum.Perform(aPnt);
       if ( _extremum.IsDone() )
         for ( int iSol = 1; iSol <= _extremum.NbExt() && _state == TopAbs_OUT; ++iSol)
+#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
+          _state = ( _extremum.SquareDistance(iSol) <= theTol ? TopAbs_IN : TopAbs_OUT );
+#else
           _state = ( _extremum.Value(iSol) <= theTol ? TopAbs_IN : TopAbs_OUT );
+#endif
     }
     TopAbs_State State() const
     {
index ba49c219f5545cafc543490f77ced07cc5031bad..61c1ce73b149e2622e643bb7db07cfe25b455b81 100644 (file)
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 
 // File      : SMESH_Pattern.hxx
 // Created   : Mon Aug  2 10:30:00 2004
 // Author    : Edward AGAPOV (eap)
-//
+
 #include "SMESH_Pattern.hxx"
 
 #include <BRepAdaptor_Curve.hxx>
@@ -74,6 +73,8 @@
 #include "SMESH_MesherHelper.hxx"
 #include "SMESH_subMesh.hxx"
 
+#include <CASCatch_OCCTVersion.hxx>
+
 #include <Basics_Utils.hxx>
 #include "utilities.h"
 
@@ -444,8 +445,13 @@ 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 > 0x06040000 // Porting to OCCT6.5.1
+    if ( theProjectorPS.SquareDistance( i ) < minVal ) {
+      minVal = theProjectorPS.SquareDistance( i );
+#else
     if ( theProjectorPS.Value( i ) < minVal ) {
       minVal = theProjectorPS.Value( i );
+#endif
       theProjectorPS.Point( i ).Parameter( u, v );
     }
   return gp_XY( u, v );
index 0b3c98369862f4a68e52e582d36aa1c017d2ff24..ddc7eb39574385761544e2f431242ddf13ff026c 100644 (file)
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 
 //  SMESH SMESH : implementaion of SMESH idl descriptions
 //  File   : SMESH_subMesh.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//
+
 #include "SMESH_subMesh.hxx"
 
 #include "SMESH_Algo.hxx"
@@ -38,6 +37,8 @@
 #include "SMDS_SetIterator.hxx"
 #include "SMDSAbs_ElementType.hxx"
 
+#include <CASCatch_OCCTVersion.hxx>
+
 #include "utilities.h"
 #include "OpUtil.hxx"
 #include "Basics_Utils.hxx"
@@ -1368,7 +1369,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         _computeState = FAILED_TO_COMPUTE;
         _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
         try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
           OCC_CATCH_SIGNALS;
 #endif
           algo->InitComputeError();