]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
- Merge from V6_main_20110302
authorgdd <gdd>
Tue, 22 Mar 2011 17:20:22 +0000 (17:20 +0000)
committergdd <gdd>
Tue, 22 Mar 2011 17:20:22 +0000 (17:20 +0000)
- Bug fix
- Small imps

adm_local/unix/config_files/check_BLSURF.m4
configure.ac
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx

index 98e4f05b558e473b684548a87f0622bee63394d7..42dbe794baeed7e0ba42c28a79d19fbb1d989746 100644 (file)
@@ -61,6 +61,11 @@ if test "$with_blsurf" != "no" ; then
 
     BLSURF_INCLUDES="-I$BLSURF_HOME/include"
     BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSurf"
+    if test $(/bin/arch) = x86_64 ; then
+      if test -f $BLSURF_HOME/lib/Linux_64/libBLSurf.so ; then
+        BLSURF_LIBS="-L$BLSURF_HOME/lib/Linux_64 -lBLSurf"
+      fi
+    fi
 
     CPPFLAGS_old="$CPPFLAGS"
     CXXFLAGS_old="$CXXFLAGS"
index fe01836b816e3e6dfd5b7c681203e03b177d8651..fcc7640cabdbb1e9b1e57a74dc91a0dff3bc4c5a 100644 (file)
@@ -391,6 +391,9 @@ else
    AC_SUBST(SETX) SETX="set -x"
 fi
 
+dnl Build with SMESH cancel compute feature
+AC_DEFINE(WITH_SMESH_CANCEL_COMPUTE)
+
 dnl copy shells and utilities contained in the bin directory
 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
 dnl directory
index 6ddda401cdb992be179303dfedd33c613c074fb1..0ddcb93967977dbd795567156ca0941ddb3877df 100644 (file)
@@ -287,6 +287,10 @@ BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, int studyId,
   FaceId2EnforcedVertexCoords.clear();
   EnfVertexCoords2ProjVertex.clear();
   EnfVertexCoords2EnfVertexList.clear();
+
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+  _compute_canceled = false;
+#endif
 }
 
 //=============================================================================
@@ -1001,7 +1005,12 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
   
   /* Set the message callback in the working context */
   context_set_message_callback(ctx, message_cb, &_comment);
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+  _compute_canceled = false;
+  context_set_interrupt_callback(ctx, interrupt_cb, this);
+#else
   context_set_interrupt_callback(ctx, interrupt_cb, NULL);
+#endif
 
   /* create the CAD object we will work on. It is associated to the context ctx. */
   cad_t *c = cad_new(ctx);
@@ -1592,6 +1601,13 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
   return true;
 }
 
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+void BLSURFPlugin_BLSURF::CancelCompute()
+{
+  _compute_canceled = true;
+}
+#endif
+
 //=============================================================================
 /*!
  *  SetNodeOnEdge
@@ -1925,13 +1941,21 @@ status_t message_cb(message_t *msg, void *user_data)
 status_t interrupt_cb(integer *interrupt_status, void *user_data)
 {
   integer you_want_to_continue = 1;
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+  BLSURFPlugin_BLSURF* tmp = (BLSURFPlugin_BLSURF*)user_data;
+  you_want_to_continue = !tmp->computeCanceled();
+#endif
 
   if(you_want_to_continue)
+  {
     *interrupt_status = INTERRUPT_CONTINUE;
+    return STATUS_OK;
+  }
   else /* you want to stop BLSurf */
+  {
     *interrupt_status = INTERRUPT_STOP;
-  
-  return STATUS_OK;
+    return STATUS_ERROR;
+  }
 }
 
 //=============================================================================
index 70ebef1bcf937aeff568fcc6d49c974a6d2fbd91..c8c34bc5ada05a579ab055f6bfbe456bb9a54248 100644 (file)
@@ -74,6 +74,11 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
 
     virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
 
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+    virtual void CancelCompute();
+    bool computeCanceled() { return _compute_canceled;};
+#endif
+
     virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
                           MapShapeNbElems& aResMap);
 
@@ -96,6 +101,10 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
       PyObject *          main_dict;
       SALOMEDS::Study_var myStudy;
       SMESH_Gen_i*        smeshGen_i;
+
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+      volatile bool _compute_canceled;
+#endif
 };
 
 #endif
index a482a60c5eec234dbe0bfa78a3e24d410554e4c8..281230c48a2da90401060da7fd2772e3604fa703 100644 (file)
@@ -1764,7 +1764,6 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntr
       enfVertex->faceEntries = faceEntryList;
 
       vertexList[i] = enfVertex;
-      MESSAGE("Enforced vertex #" << i << ": " << enfVertex->name << " = " << coords[0] << ", " << coords[1] << ", " << coords[2]);
     }
     MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
     return vertexList._retn();