]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
authorjfa <jfa@opencascade.com>
Thu, 27 Mar 2008 14:38:52 +0000 (14:38 +0000)
committerjfa <jfa@opencascade.com>
Thu, 27 Mar 2008 14:38:52 +0000 (14:38 +0000)
22 files changed:
BLSURFPLUGIN_version.h.in [new file with mode: 0644]
INSTALL
adm_local/unix/config_files/check_BLSURFPLUGIN.m4
adm_local/unix/make_commence.in
adm_local/unix/make_common_starter.am [new file with mode: 0644]
bin/VERSION
build_configure
configure.in.base
idl/BLSURFPlugin_Algorithm.idl
idl/Makefile.in
resources/BLSURFPlugin.xml
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx
src/BLSURFPlugin/Makefile.in
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPlugin_msg_en.po
src/GUI/Makefile.in

diff --git a/BLSURFPLUGIN_version.h.in b/BLSURFPLUGIN_version.h.in
new file mode 100644 (file)
index 0000000..ee5d1d4
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
+//  File   : BLSURFPLUGIN_version.h
+//  Author : Vadim SANDLER
+//  Module : SALOME
+
+#if !defined(__BLSURFPLUGIN_VERSION_H__)
+#define __BLSURFPLUGIN_VERSION_H__
+
+/*
+  BLSURFPLUGIN_VERSION is (major << 16) + (minor << 8) + patch.
+*/
+
+#define BLSURFPLUGIN_VERSION_STR "@VERSION@"
+#define BLSURFPLUGIN_VERSION     @XVERSION@
+
+#endif // __BLSURFPLUGIN_VERSION_H__
diff --git a/INSTALL b/INSTALL
index 31c3fdab2b191136cd2f03306eea7ba7fe7f19d3..b21c1f4e2da666edc1c60e19fa5299f04851ebd1 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
-This is the version 3.2.0 of BLSURFPLUGIN
+This is the version 4.1.0 of BLSURFPLUGIN
 Compatible with :
-       - KERNEL 3.2.0
-       - GUI 3.2.0
-        - SMESH 3.2.0
+       - KERNEL 4.1.0
+       - GUI 4.1.0
+        - SMESH 4.1.0
index 0af102fc92625aa90947a464e34748b2ec59e951..dd551bed691aa8872e7710c34598e01c32b63d17 100644 (file)
@@ -40,7 +40,7 @@ if test "x$BLSURF_HOME" != "x"; then
   
 
   BLSURF_INCLUDES="-I$BLSURF_HOME/include"
-  BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSURF"
+  BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSurf"
 
   CPPFLAGS_old="$CPPFLAGS"
   CXXFLAGS_old="$CXXFLAGS"
@@ -52,12 +52,12 @@ if test "x$BLSURF_HOME" != "x"; then
 
   AC_MSG_CHECKING(for BLSURF header file)
 
-  AC_CHECK_HEADER(blshare.h,BLSURF_ok=yes,BLSURF_ok=no)
+  AC_CHECK_HEADER(distene/api.h,BLSURF_ok=yes,BLSURF_ok=no)
   if test "x$BLSURF_ok" == "xyes"; then
 
     AC_MSG_CHECKING(for BLSURF library)
 
-    AC_TRY_COMPILE(#include "blshare.h",
+    AC_TRY_COMPILE(#include "distene/api.h",
         BLSURF_init();
      ,BLSURF_ok=yes;
       $CXX -shared -o linopt.o -c
index e2536f19e2312d5a3d14f6d2310c1712fc6a5c92..afa9ef585cd5b489854340a484f8e6d1eeb3319c 100644 (file)
@@ -203,12 +203,12 @@ LN_S=@LN_S@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@/salome
-libdir=@libdir@/salome
+libdir=@libdir@@LIB_LOCATION_SUFFIX@/salome
 # warning : if user give this path in configure we could have salome/salome :-(
 includedir=@includedir@/salome
 datadir=@datadir@/salome
 idldir=$(prefix)/idl/salome
-sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
+sharedpydir=@libdir@@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
 
 docdir=${prefix}/doc/salome
 
diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am
new file mode 100644 (file)
index 0000000..5339413
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# ============================================================
+# This file defines the common definitions used in several
+# Makefile. This file must be included, if needed, by the file
+# Makefile.am.
+# ============================================================
+#
+
+# Standard directory for installation
+salomeincludedir   = $(includedir)/@PACKAGE@
+libdir             = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@
+bindir             = $(prefix)/bin/@PACKAGE@
+salomescriptdir    = $(bindir)
+
+# Directory for installing idl files
+salomeidldir       = $(prefix)/idl/@PACKAGE@
+
+# Directory for installing resource files
+salomeresdir       = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@
+
+# Directories for installing admin files
+admlocaldir       = $(prefix)/adm_local
+admlocalunixdir     = $(admlocaldir)/unix
+admlocalm4dir        = $(admlocaldir)/unix/config_files
+
+# Shared modules installation directory
+sharedpkgpythondir =$(pkgpythondir)/shared_modules
+
+# Documentation directory
+docdir             = $(datadir)/doc/@PACKAGE@
+
+# common rules
+
+# moc-files generation
+%_moc.cxx: %.h
+       $(MOC) $< -o $@
+
+# qm-files generation
+%.qm: %.po
+       $(MSG2QM) $< $@
+
+EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po)
+
+mostlyclean-local:
+       rm -f @builddir@/*_moc.cxx
+       rm -f @builddir@/*.qm
+
+# tests
+tests: unittest
+
+unittest: $(UNIT_TEST_PROG)
+       @if test "x$(UNIT_TEST_PROG)" != "x"; then \
+           $(UNIT_TEST_PROG);                     \
+       fi;
index bd2d125a4622c3ffd248ef282e6f6522cf79c2e5..c6df2bf4da318a40dbcb3f2412fb82387d62de23 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - BLSURFPLUGIN VERSION: 3.2.0
+THIS IS SALOME - BLSURFPLUGIN VERSION: 4.1.0
index 8e183abd3f40f414eb6abe3251bb92c54c5d949c..249463d86dbe0028e9c974e8c03bb8aed8f98b95 100755 (executable)
@@ -235,6 +235,7 @@ else
 fi
 
 aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+                                       -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \
                                        -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
                                        -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
                                        -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
index ec1025632b36b797ff75613f1d1a2883de87090d..2dd3674dac0e0a5b1191e0d21a5b17ec7a73fa9e 100644 (file)
@@ -16,7 +16,7 @@
 #
 
 AC_INIT(src)
-AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
+AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED)
 AC_CANONICAL_HOST
 
 PACKAGE=salome
@@ -140,14 +140,6 @@ echo
 
 CHECK_PYTHON
 
-echo
-echo ---------------------------------------------
-echo BOOST Library
-echo ---------------------------------------------
-echo
-
-CHECK_BOOST
-
 dnl echo
 dnl echo ---------------------------------------------
 dnl echo testing java
@@ -241,6 +233,14 @@ echo
 
 CHECK_HDF5
 
+echo
+echo ---------------------------------------------
+echo BOOST Library
+echo ---------------------------------------------
+echo
+
+CHECK_BOOST
+
 echo
 echo ---------------------------------------------
 echo Testing OpenCascade
index ecc75161b888bbd65729f070af3e86f96787c11b..062a4098ee4c337f8930f1c5054416876b4266ee 100644 (file)
@@ -44,6 +44,9 @@ module BLSURFPlugin
    */
   interface BLSURFPlugin_Hypothesis : SMESH::SMESH_Hypothesis
   {
+    void SetTopology(in long value);
+    long GetTopology();
+
     void SetPhysicalMesh(in long value);
     long GetPhysicalMesh();
 
index 89d037ae084f51da52e3d0fa034ac6c02fd9ee4b..d232a85737a565264ffd7de17f881de23150bed3 100644 (file)
@@ -46,7 +46,7 @@ $(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
 # python wrap
 lib: pyidl
 
-PYTHON_BUILD_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/@PACKAGE@
+PYTHON_BUILD_SITE=$(top_builddir)/lib${LIB_LOCATION_SUFFIX}/python$(PYTHON_VERSION)/site-packages/@PACKAGE@
 
 pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py)
 
index 30bcd8ff31078161167d17bc64fd31b38389ee58..f72a6110826627a6731aa06597e3961c98a3d1ad 100644 (file)
@@ -7,8 +7,8 @@
 
 <meshers-group name="BLSURF"
                resources="BLSURFPlugin"
-               server-lib="libBLSURFEngine.so"
-               gui-lib="libBLSURFPluginGUI.so">
+               server-lib="BLSURFEngine"
+               gui-lib="BLSURFPluginGUI">
   <hypotheses>
     <hypothesis type="BLSURF_Parameters"
                label-id="BLSURF Parameters"
index 9a3e6aa61ca0c730a751737aa55cf187eaef6e0d..51df4966891fadb690eb478e9a0eabc7f068546a 100644 (file)
@@ -21,6 +21,7 @@
 //
 // File    : BLSURFPlugin_BLSURF.cxx
 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
+//           & Aurelien ALLEAUME (DISTENE)
 // Date    : 20/03/2006
 // Project : SALOME
 //=============================================================================
@@ -48,7 +49,24 @@ using namespace std;
 #include <TopoDS.hxx>
 #include <NCollection_Map.hxx>
 
-#include <cad_occ.h>
+extern "C"{
+#include <distene/api.h>
+}
+
+#include <Geom_Surface.hxx>
+#include <Handle_Geom_Surface.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Handle_Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Handle_Geom_Curve.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <gp_Pnt2d.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <BRepTools.hxx>
 
 //=============================================================================
 /*!
@@ -128,9 +146,24 @@ bool BLSURFPlugin_BLSURF::CheckHypothesis
  */
 //=============================================================================
 
-void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp) {
+inline std::string to_string(double d)
+{
+   std::ostringstream o;
+   o << d;
+   return o.str();
+}
+
+inline std::string to_string(int i)
+{
+   std::ostringstream o;
+   o << i;
+   return o.str();
+}
+
+void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls) {
   if (hyp) {
     MESSAGE("BLSURFPlugin_BLSURF::SetParameters");
+    _topology = (int) hyp->GetTopology();
     _physicalMesh = (int) hyp->GetPhysicalMesh();
     _phySize = hyp->GetPhySize();
     _geometricMesh = (int) hyp->GetGeometricMesh();
@@ -138,33 +171,40 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp) {
     _gradation = hyp->GetGradation();
     _quadAllowed = hyp->GetQuadAllowed();
     _decimesh = hyp->GetDecimesh();
-  }
+  } else {
+    MESSAGE("BLSURFPlugin_BLSURF::SetParameters using defaults");
+    _topology = BLSURFPlugin_Hypothesis::GetDefaultTopology();
+    _physicalMesh = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh();
+    _phySize = BLSURFPlugin_Hypothesis::GetDefaultPhySize();
+    _geometricMesh = BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh();
+    _angleMeshS = BLSURFPlugin_Hypothesis::GetDefaultAngleMeshS();
+    _gradation = BLSURFPlugin_Hypothesis::GetDefaultGradation();
+    _quadAllowed = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed();
+    _decimesh = BLSURFPlugin_Hypothesis::GetDefaultDecimesh();
 
-  bool BlsurfEnvFile = true;
-
-  if ( BlsurfEnvFile ) {
-    TCollection_AsciiString SalomeExecDir;
-
-    char * Dir = getenv("PWD");
-    SalomeExecDir = Dir;
-    SalomeExecDir += "/blsurf.env";
-
-    ofstream theBlsurfEnv  ( SalomeExecDir.ToCString()  , ios::out);
-    theBlsurfEnv << "verb 10"                          << endl;
-    theBlsurfEnv << "hphy_flag "     << _physicalMesh  << endl;
-    theBlsurfEnv << "hphydef "       << _phySize       << endl;
-    theBlsurfEnv << "hgeo_flag "     << _geometricMesh << endl;
-    theBlsurfEnv << "angle_meshs "   << _angleMeshS    << endl;
-    theBlsurfEnv << "gradation "     << _gradation     << endl;
-    theBlsurfEnv << "topo_points 1"                    << endl;
-    theBlsurfEnv << "topo_project 1"                   << endl;
-    theBlsurfEnv << "topo_curves 1"                    << endl;
-    theBlsurfEnv << "surforient 1"                     << endl;
-    theBlsurfEnv << "decim "         << _decimesh      << endl;
-    theBlsurfEnv.close();
   }
+  
+  blsurf_set_param(bls, "topo_points", _topology > 0 ? "1" : "0");
+  blsurf_set_param(bls, "topo_curves", _topology > 0 ? "1" : "0");
+  blsurf_set_param(bls, "topo_project", _topology > 0 ? "1" : "0");
+  blsurf_set_param(bls, "clean_boundary", _topology > 1 ? "1" : "0");
+  blsurf_set_param(bls, "close_boundary", _topology > 1 ? "1" : "0");
+  blsurf_set_param(bls, "hphy_flag", to_string(_physicalMesh).c_str());
+  blsurf_set_param(bls, "hphydef", to_string(_phySize).c_str());
+  blsurf_set_param(bls, "hgeo_flag", to_string(_geometricMesh).c_str());
+  blsurf_set_param(bls, "angle_meshs", to_string(_angleMeshS).c_str());
+  blsurf_set_param(bls, "angle_meshc", to_string(_angleMeshS).c_str());
+  blsurf_set_param(bls, "gradation", to_string(_gradation).c_str());
+  //  blsurf_set_param(bls, "patch_independent", to_string(_decimesh).c_str());
+  blsurf_set_param(bls, "patch_independent", _decimesh ? "1" : "0");
+  blsurf_set_param(bls, "element",  _quadAllowed ? "q1.0" : "p1");
+  blsurf_set_param(bls, "verb", "10");
 }
 
+status_t curv_fun(real t, real *uv, real *dt, real *dtt, void *user_data);
+status_t surf_fun(real *uv, real *xyz, real*du, real *dv,
+                 real *duu, real *duv, real *dvv, void *user_data);
+
 //=============================================================================
 /*!
  *
@@ -173,8 +213,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp) {
 
 bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) {
 
-  SetParameters(_hypothesis);
-
   MESSAGE("BLSURFPlugin_BLSURF::Compute");
 
   if (aShape.ShapeType() == TopAbs_COMPOUND) {
@@ -184,208 +222,213 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
     cout << "  the shape is UNKNOWN" << endl;
   };
 
-  int i=0;
-  if (1) {
-    for (TopExp_Explorer expf(aShape, TopAbs_FACE); expf.More(); expf.Next()) {
-      const TopoDS_Shape& face = expf.Current();
-      i++;
-      int j=0;
-      for (TopExp_Explorer expe(face, TopAbs_EDGE); expe.More(); expe.Next()) {
-        const TopoDS_Shape& edge = expe.Current();
-        j++;
-        int k=0;
-        for (TopExp_Explorer expv(edge, TopAbs_VERTEX); expv.More(); expv.Next()) {
-          k++;
-        }
-        // cout << "  face " << i << " and its edge " << j << " has " << k << " vertices" << endl;
-      }
-      // cout << "  face " << i << " has " << j << " edges" << endl;
+  context_t *ctx =  context_new();
+  cad_t *c = cad_new(ctx);
+
+  TopTools_IndexedMapOfShape fmap;
+  TopTools_IndexedMapOfShape emap;
+  TopTools_IndexedMapOfShape pmap;
+  vector<Handle(Geom2d_Curve)> curves;
+  vector<Handle(Geom_Surface)> surfaces;
+
+  fmap.Clear();
+  emap.Clear();
+  pmap.Clear();
+  surfaces.resize(0);
+  curves.resize(0);
+
+  int iface = 0;
+  for (TopExp_Explorer face_iter(aShape,TopAbs_FACE);face_iter.More();face_iter.Next()) {
+    TopoDS_Face f=TopoDS::Face(face_iter.Current());
+    if (fmap.FindIndex(f) > 0)
+      continue;
+    
+    fmap.Add(f);
+    iface++;
+    surfaces.push_back(BRep_Tool::Surface(f));
+    cad_face_t *fce = cad_face_new(c, iface, surf_fun, surfaces.back());  
+    cad_face_set_tag(fce, iface);
+    if(f.Orientation() != TopAbs_FORWARD){
+      cad_face_set_orientation(fce, CAD_ORIENTATION_REVERSED);
+    } else {
+      cad_face_set_orientation(fce, CAD_ORIENTATION_FORWARD);
     }
-    // cout << "  total number of faces = " << i << endl;
-  }
+    
+    for (TopExp_Explorer edge_iter(f,TopAbs_EDGE);edge_iter.More();edge_iter.Next()) {
+      TopoDS_Edge e = TopoDS::Edge(edge_iter.Current());
+      int ic = emap.FindIndex(e);
+      if (ic <= 0)
+       ic = emap.Add(e);
+      
+      double tmin,tmax;
+      curves.push_back(BRep_Tool::CurveOnSurface(e, f, tmin, tmax));
+      cad_edge_t *edg = cad_edge_new(fce, ic, tmin, tmax, curv_fun, curves.back());
+      cad_edge_set_tag(edg, ic);
+      cad_edge_set_property(edg, EDGE_PROPERTY_SOFT_REQUIRED);
+
+      int npts = 0;
+      int ip1, ip2, *ip;
+      gp_Pnt2d e0 = curves.back()->Value(tmin);
+      gp_Pnt ee0 = surfaces.back()->Value(e0.X(), e0.Y());
+      Standard_Real d1=0,d2=0;
+      for (TopExp_Explorer ex_edge(e ,TopAbs_VERTEX); ex_edge.More(); ex_edge.Next()) {
+       TopoDS_Vertex v = TopoDS::Vertex(ex_edge.Current());
+
+       ++npts;
+       if (npts == 1){
+         ip = &ip1;
+         d1 = ee0.SquareDistance(BRep_Tool::Pnt(v));
+       } else {
+         ip = &ip2;
+          d2 = ee0.SquareDistance(BRep_Tool::Pnt(v));
+       }
+       *ip = pmap.FindIndex(v);
+       if(*ip <= 0)
+         *ip = pmap.Add(v);
+      }
+      if (npts != 2) {
+       // should not happen 
+       cout << "An edge does not have 2 extremities." << endl;
+      } else {
+       if (d1 < d2)
+         cad_edge_set_extremities(edg, ip1, ip2);
+       else
+         cad_edge_set_extremities(edg, ip2, ip1);
+      }
+    } // for edge
+  } //for face
+
 
-  BL_SURF mesh;
-  blw_* blw;
+
+  blsurf_session_t *bls = blsurf_session_new(ctx);
+  blsurf_data_set_cad(bls, c);
+
+  SetParameters(_hypothesis, bls);
 
   cout << endl;
   cout << "Beginning of Surface Mesh generation" << endl;
   cout << endl;
-  if (!mesh.init(aShape))
-    return(false);
+
+  if (blsurf_compute_mesh(bls) != STATUS_OK){
+    blsurf_session_delete(bls);
+    cad_delete(c);
+    context_delete(ctx);
+
+    return false;
+  }
+
   cout << endl;
   cout << "End of Surface Mesh generation" << endl;
   cout << endl;
-  mesh.get_blw(blw);
 
-  SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
+  mesh_t *msh;
+  blsurf_data_get_mesh(bls, &msh);
+  if(!msh){
+    blsurf_session_delete(bls);
+    cad_delete(c);
+    context_delete(ctx);
+    
+    return false;
+  }
+  
+  integer nv, ne, nt, nq, vtx[4], tag;
+  real xyz[3];
 
-  if ( !_decimesh ) {
-    /* cf. export_mesh_all */
-    int j, ip, ic, nptri, is, oriented, iF, nF, idom, ndom, v[5], verb;
-    double centre[3];
-    char element[8];
+  mesh_get_vertex_count(msh, &nv);
+  mesh_get_edge_count(msh, &ne);
+  mesh_get_triangle_count(msh, &nt);
+  mesh_get_quadrangle_count(msh, &nq);
 
-    verb = blw->env.verb;
-    blw->env.verb = 0;
-    assign_bls_mesh_num(blw);
-    blw->env.verb = verb;
   
-    FOR (j, 0, 2) {
-      centre[j] = (blw->bls_glo.xyzmin[j] + blw->bls_glo.xyzmax[j]) * 0.5;
-      cout << "centre[" << j << "] : " << centre[j] << endl;
+  SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
+  SMDS_MeshNode** nodes = new SMDS_MeshNode*[nv+1];
+  bool* tags = new bool[nv+1];
+
+  for(int iv=1;iv<=nv;iv++) {
+    mesh_get_vertex_coordinates(msh, iv, xyz);
+    mesh_get_vertex_tag(msh, iv, &tag);    
+    nodes[iv] = meshDS->AddNode(xyz[0], xyz[1], xyz[2]);
+    // internal point are tagged to zero
+    if(tag){
+      meshDS->SetNodeOnVertex(nodes[iv], TopoDS::Vertex(pmap(tag)));
+      tags[iv] = false;
+    } else {
+      tags[iv] = true;
     }
+  }
 
-    /* points sommets des edges et des triangles */
-    nptri = blw->bls_mesh_num.number_of_nodes;
-    if (blw->env.verb >= 10)
-      fprintf(blw->out, "export_salome: surface mesh contains %d vertices\n", nptri);
-    SMDS_MeshNode** nodes = new SMDS_MeshNode*[nptri+1];
-    j = 0;
-    FOR (ip, 1, nptri) {
-      if (blw->bls_glo.vertices_xyz[3*ip-3] == BLHUGE) {
-        if (++j <= 10) {
-             fprintf(blw->out, "export_salome: unconnected vertex %d\n", ip);
-             if (j == 10) fprintf(blw->out, "export_salome: ...\n");
-        }
-        nodes[ip] = meshDS->AddNode(centre[0], centre[1], centre[2]);
-      }
-      else {
-        double floatVal = blw->bls_glo.vertices_xyz[3*ip-3];
-        // cout << "j : " << j << " node nmuber : " << ip << " --> first coordinate = " << floatVal << " != " << BLHUGE << endl;
-        nodes[ip] = meshDS->AddNode(blw->bls_glo.vertices_xyz[3*ip-3], blw->bls_glo.vertices_xyz[3*ip-2], blw->bls_glo.vertices_xyz[3*ip-1]);
-        // cout << "nodes[" << ip << "] : " << blw->bls_glo.vertices_xyz[3*ip-3] << ", "
-        //                                  << blw->bls_glo.vertices_xyz[3*ip-2] << ", "
-        //                                  << blw->bls_glo.vertices_xyz[3*ip-1] << endl;
-      }
-    }
+  for(int it=1;it<=ne;it++) {
+    mesh_get_edge_vertices(msh, it, vtx);
+    SMDS_MeshEdge* edg = meshDS->AddEdge(nodes[vtx[0]], nodes[vtx[1]]);
+    mesh_get_edge_tag(msh, it, &tag);    
+
+    if (tags[vtx[0]]) {
+      meshDS->SetNodeOnEdge(nodes[vtx[0]], TopoDS::Edge(emap(tag)));
+      tags[vtx[0]] = false;
+    };
+    if (tags[vtx[1]]) {
+      meshDS->SetNodeOnEdge(nodes[vtx[1]], TopoDS::Edge(emap(tag)));
+      tags[vtx[1]] = false;
+    };
+    meshDS->SetMeshElementOnShape(edg, TopoDS::Edge(emap(tag)));
+    
+  }
 
-    /* edges */
-    int nbEdges = C3D.number_of_curves;
-    cout << "Number Of Edges : " << nbEdges << endl;
-    FOR (ic, 1, C3D.number_of_curves) {
-      //TopoDS_Edge topo_edge = mesh.all_edges[ic-1]->topology;
-      int np = C3D.TC[ic].number_of_points;
-      cout << "Number Of Nodes for edge " << ic << " : " << np << endl;
-      FOR (ip, 1, np-1) {
-        meshDS->AddEdge(nodes[C3D.TC[ic].iglopc[ip]], nodes[C3D.TC[ic].iglopc[ip+1]]);
-      }
-    }
+  for(int it=1;it<=nt;it++) {
+    mesh_get_triangle_vertices(msh, it, vtx);
+    SMDS_MeshFace* tri = meshDS->AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]]);
+    mesh_get_triangle_tag(msh, it, &tag);    
+    meshDS->SetMeshElementOnShape(tri, TopoDS::Face(fmap(tag)));
+    if (tags[vtx[0]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[0]], TopoDS::Face(fmap(tag)));
+      tags[vtx[0]] = false;
+    };
+    if (tags[vtx[1]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[1]], TopoDS::Face(fmap(tag)));
+      tags[vtx[1]] = false;
+    };
+    if (tags[vtx[2]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[2]], TopoDS::Face(fmap(tag)));
+      tags[vtx[2]] = false;
+    };
+  }
 
-    /* faces (triangles or quadrilaterals) */ 
-    SMDS_MeshFace* face;
-    if (blw->bls_glo.number_of_patches <= 0) {
-      strcpy(element, "p1");
-    }
-    else {
-      strcpy(element, TC2D[1].ms2d.element);
-    }
-    cout << endl;
-    cout << "Number_of_patches    : " << blw->bls_glo.number_of_patches << endl;
-    cout << "Element              : " << element << endl;
-    cout << "TC2D[1].ms2d.element : " << TC2D[1].ms2d.element << endl;
-    cout << endl;
-    if (STREQUAL(element, "p1")) {
-      if (blw->env.verb >= 10)
-        fprintf(blw->out, "export_salome: surface mesh contains %d triangles\n", blw->bls_mesh_num.ntri);
-      FOR (is, 1, blw->bls_glo.number_of_patches) {
-        TopoDS_Face topo_face = mesh.surfaces[is-1]->topology;
-        oriented = (TC2D[is].surforient >= 0);
-        // cout << endl;
-        // cout << "TC2D[is].surforient : " << TC2D[is].surforient << " --> oriented : " << oriented << endl;
-        nF = TC2D[is].ms2d.jmax_F;
-        ndom = TC2D[is].ms2d.ndom;
-        // cout << "nF   : " << nF   << endl;
-        // cout << "ndom : " << ndom << endl;
-        // cout << endl;
-        FOR (iF, 1, nF) {
-          idom = TC2D[is].ms2d.FRef[iF];
-          if (!(1 <= idom && idom <= ndom))
-            continue;
-          v[0] = TC2D[is].iglops[TC2D[is].ms2d.F[3*iF-3]];
-          v[1] = TC2D[is].iglops[TC2D[is].ms2d.F[3*iF-2]];
-          v[2] = TC2D[is].iglops[TC2D[is].ms2d.F[3*iF-1]];
-          if (v[0]==v[1] || v[1]==v[2] || v[2]==v[0])
-            continue;                                                 /* triangle degenere */
-          // cout << "Triangle " << iF << " of face " << is;
-          if ( oriented) {
-            // cout << " doesn't need to be re-oriented" << endl;
-            face = meshDS->AddFace(nodes[v[2]], nodes[v[1]], nodes[v[0]]);
-          }
-          else {
-            // cout << " needs to be re-oriented" << endl;
-            face = meshDS->AddFace(nodes[v[0]], nodes[v[1]], nodes[v[2]]);
-          }
-             meshDS->SetMeshElementOnShape(face, topo_face);
-        }
-      }
-    }
-    delete nodes;
+  for(int it=1;it<=nq;it++) {
+    mesh_get_quadrangle_vertices(msh, it, vtx);
+    SMDS_MeshFace* quad = meshDS->AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]], nodes[vtx[3]]);
+    mesh_get_quadrangle_tag(msh, it, &tag);    
+    meshDS->SetMeshElementOnShape(quad, TopoDS::Face(fmap(tag)));
+    if (tags[vtx[0]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[0]], TopoDS::Face(fmap(tag)));
+      tags[vtx[0]] = false;
+    };
+    if (tags[vtx[1]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[1]], TopoDS::Face(fmap(tag)));
+      tags[vtx[1]] = false;
+    };
+    if (tags[vtx[2]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[2]], TopoDS::Face(fmap(tag)));
+      tags[vtx[2]] = false;
+    };
+    if (tags[vtx[3]]) {
+      meshDS->SetNodeOnFace(nodes[vtx[3]], TopoDS::Face(fmap(tag)));
+      tags[vtx[3]] = false;
+    };
   }
-  else {
-    cout << "decimesh is started"  << endl;
-    system("decimesh");
-    cout << "decimesh is finished" << endl;
-
-    FILE* fic = fopen("x_h100.mesh", "r");
-    char buf[200];
-    do {
-      fscanf(fic, "%s\n", buf);
-    }
-    while (strcmp(buf, "Vertices")!=0);
-    int n_vtx;
-    fscanf(fic, "%d\n", &n_vtx);
-    cout << "number of vertices: " << n_vtx << endl;
-
-    SMDS_MeshNode** nodes = new SMDS_MeshNode*[n_vtx+1];
-    double coo_x, coo_y, coo_z;
-    for (int i=1; i<=n_vtx; i++) {
-      fscanf(fic, "%lf %lf %lf %*d\n", &coo_x, &coo_y, &coo_z);
-      nodes[i] = meshDS->AddNode(coo_x, coo_y, coo_z);
-    }
-    cout << "nodes are updated" << endl;
-
-    fscanf(fic, "%*s\n");
-    int n_tri, n1, n2, n3, iFace;
-    SMDS_MeshFace* face;
-    fscanf(fic, "%d\n", &n_tri);
-    cout << "number of triangles: " << n_tri << endl;
-    for (int i=0; i<n_tri; i++) {
-      fscanf(fic, "%d %d %d %d\n", &n1, &n2, &n3, &iFace);
-      face = meshDS->AddFace(nodes[n3], nodes[n2], nodes[n1]);
-    }
-    cout << "triangles are updated" << endl;
-
-    char *keyWord;
-    fscanf(fic, "%s\n", keyWord);
-    cout << "keyWord : " << keyWord << endl;
-    int n_edges;
-    SMDS_MeshEdge* edge;
-    fscanf(fic, "%d\n", &n_edges);
-    cout << "number of edges: " << n_edges << endl;
-    for (int i=0; i<n_edges; i++) {
-      fscanf(fic, "%d %d %*d\n", &n1, &n2);
-      edge = meshDS->AddEdge(nodes[n1], nodes[n2]);
-      //meshDS->SetMeshElementOnShape(edge, topo_edge);
-    }
-    cout << "edges are updated, and finished" << endl;
 
-    fscanf(fic, "%s\n", keyWord); cout << "keyWord : " << keyWord << endl;
-    fscanf(fic, "%s\n", keyWord); cout << "keyWord : " << keyWord << endl;
-    fscanf(fic, "%s\n", keyWord); cout << "keyWord : " << keyWord << endl;
-    fscanf(fic, "%s\n", keyWord); cout << "keyWord : " << keyWord << endl;
-    fscanf(fic, "%s\n", keyWord); cout << "keyWord : " << keyWord << endl;
-    fscanf(fic, "%s\n", keyWord); cout << "keyWord : " << keyWord << endl;
+  delete nodes;
 
-    int number = fscanf(fic, "%lf %lf %*lf\n", &coo_x, &coo_y);
-    cout << "coo_x  : " << coo_x << endl;
-    cout << "coo_y  : " << coo_y << endl;
-    cout << "number : " << number << endl;
+  /* release the mesh object */
+  blsurf_data_regain_mesh(bls, msh);
 
-    fclose(fic);
-  }
+  /* clean up everything */
+  blsurf_session_delete(bls);
+  cad_delete(c);
+
+  context_delete(ctx);
 
-  bool b = mesh.end();
-  return(b);
+  return true;
 }
 
 //=============================================================================
@@ -431,3 +474,62 @@ istream & operator >> (istream & load, BLSURFPlugin_BLSURF & hyp)
 {
   return hyp.LoadFrom( load );
 }
+
+status_t curv_fun(real t, real *uv, real *dt, real *dtt, void *user_data)
+{
+  const Geom2d_Curve*pargeo = (const Geom2d_Curve*) user_data;
+
+  if (uv){
+    gp_Pnt2d P;
+    P=pargeo->Value(t);
+    uv[0]=P.X(); uv[1]=P.Y();
+  }
+
+  if(dt) {
+    gp_Vec2d V1;
+    V1=pargeo->DN(t,1);
+    dt[0]=V1.X(); dt[1]=V1.Y();
+  }
+
+  if(dtt){
+    gp_Vec2d V2;
+    V2=pargeo->DN(t,2);
+    dtt[0]=V2.X(); dtt[1]=V2.Y();
+  }
+
+  return 0;
+}
+
+status_t surf_fun(real *uv, real *xyz, real*du, real *dv,
+                 real *duu, real *duv, real *dvv, void *user_data)
+{
+  const Geom_Surface* geometry = (const Geom_Surface*) user_data;
+
+  if(xyz){
+   gp_Pnt P;
+   P=geometry->Value(uv[0],uv[1]);   // S.D0(U,V,P);
+   xyz[0]=P.X(); xyz[1]=P.Y(); xyz[2]=P.Z();
+  }
+
+  if(du && dv){
+    gp_Pnt P;
+    gp_Vec D1U,D1V;
+    
+    geometry->D1(uv[0],uv[1],P,D1U,D1V);
+    du[0]=D1U.X(); du[1]=D1U.Y(); du[2]=D1U.Z();
+    dv[0]=D1V.X(); dv[1]=D1V.Y(); dv[2]=D1V.Z();
+  }
+
+  if(duu && duv && dvv){
+    gp_Pnt P;
+    gp_Vec D1U,D1V;
+    gp_Vec D2U,D2V,D2UV;
+    
+    geometry->D2(uv[0],uv[1],P,D1U,D1V,D2U,D2V,D2UV);
+    duu[0]=D2U.X(); duu[1]=D2U.Y(); duu[2]=D2U.Z();
+    duv[0]=D2UV.X(); duv[1]=D2UV.Y(); duv[2]=D2UV.Z();
+    dvv[0]=D2V.X(); dvv[1]=D2V.Y(); dvv[2]=D2V.Z();    
+  }
+
+  return 0;
+}
index fbd9fd068d0af2f50fd36a245a6c2209ffb8015d..7ec8b22cb7582f3b81b725ca69fc645771e2894a 100644 (file)
@@ -21,6 +21,7 @@
 //
 // File      : BLSURFPlugin_BLSURF.hxx
 // Authors   : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
+//             & Aurelien ALLEAUME (DISTENE)
 // Date      : 20/03/2006
 // Project   : SALOME
 //=============================================================================
@@ -31,6 +32,9 @@
 #include "SMESH_2D_Algo.hxx"
 #include "SMESH_Mesh.hxx"
 #include "Utils_SALOME_Exception.hxx"
+extern "C"{
+#include "distene/api.h"
+}
 
 class BLSURFPlugin_Hypothesis;
 
@@ -44,7 +48,7 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
                                  const TopoDS_Shape&                  aShape,
                                  SMESH_Hypothesis::Hypothesis_Status& aStatus);
 
-    void SetParameters(const BLSURFPlugin_Hypothesis* hyp);
+    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls);
 
     virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
 
@@ -57,6 +61,7 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
     const BLSURFPlugin_Hypothesis* _hypothesis;
 
   private:
+    int    _topology;
     int    _physicalMesh;
     double _phySize;
     int    _geometricMesh;
index df282103c9e2f2749c6fbb7456796a2672a2da3d..02f5d0c3ffc3db5acbb36a24744656516b82d953 100644 (file)
@@ -21,6 +21,7 @@
 //
 // File      : BLSURFPlugin_Hypothesis.cxx
 // Authors   : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
+//             & Aurelien ALLEAUME (DISTENE)
 // Date      : 28/03/2006
 // Project   : SALOME
 //=============================================================================
@@ -37,6 +38,7 @@ using namespace std;
 BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis (int hypId, int studyId,
                                                   SMESH_Gen * gen)
   : SMESH_Hypothesis(hypId, studyId, gen),
+    _topology(GetDefaultTopology()),
     _physicalMesh(GetDefaultPhysicalMesh()),
     _phySize(GetDefaultPhySize()),
     _geometricMesh(GetDefaultGeometricMesh()),
@@ -49,6 +51,19 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis (int hypId, int studyId,
   _param_algo_dim = 2;
 }
 
+//=============================================================================
+/*!
+ *  
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology)
+{
+  if (theTopology != _topology) {
+    _topology = theTopology;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
 //=============================================================================
 /*!
  *  
@@ -263,6 +278,12 @@ bool BLSURFPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
   return false;
 }
 
+//=============================================================================
+BLSURFPlugin_Hypothesis::Topology BLSURFPlugin_Hypothesis::GetDefaultTopology()
+{
+  return FromCAD;
+}
+
 //=============================================================================
 BLSURFPlugin_Hypothesis::PhysicalMesh BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh()
 {
index 89d1030740ed5a4304ef26aa1b86f4646f1992fc..e0e0f3b12732e4955963a638a0e3667def261e78 100644 (file)
@@ -21,6 +21,7 @@
 //
 // File      : BLSURFPlugin_Hypothesis.hxx
 // Authors   : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
+//             & Aurelien ALLEAUME (DISTENE)
 // Date      : 27/03/2006
 // Project   : SALOME
 // $Header$
@@ -39,6 +40,12 @@ class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
 public:
   BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
 
+  enum Topology {
+    FromCAD,
+    Process,
+    Process2
+  };
+
   enum PhysicalMesh {
     DefaultSize,
     PhysicalUserDefined
@@ -49,6 +56,9 @@ public:
     UserDefined
   };
 
+  void SetTopology(Topology theTopology);
+  Topology GetTopology() const { return _topology; }
+
   void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
   PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
 
@@ -70,6 +80,7 @@ public:
   void SetDecimesh(bool theVal);
   bool GetDecimesh() const { return _decimesh; }
 
+  static Topology GetDefaultTopology();
   static PhysicalMesh GetDefaultPhysicalMesh();
   static double GetDefaultPhySize();
   static GeometricMesh GetDefaultGeometricMesh();
@@ -93,6 +104,7 @@ public:
   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
 
 private:
+  Topology      _topology;
   PhysicalMesh  _physicalMesh;
   double        _phySize;
   GeometricMesh _geometricMesh;
index 873492b448ceb259dd6ca8890c49655890e4852d..32984aa1ca6053b39f3d33c5664f9a751dc17083 100644 (file)
@@ -65,6 +65,37 @@ BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
   MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
 }
 
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetTopology
+ *
+ *  Set topology
+ */
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetTopology (CORBA::Long theValue)
+{
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology)theValue);
+  SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetTopology
+ *
+ *  Get Topology
+ */
+//=============================================================================
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology()
+{
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetTopology();
+}
+
+//=============================================================================
+
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
index 0f3c536b9f66e7c7149e4d80ab56f7c3eebb0fe5..0df0f0dfc681263efc89b093b435c7699e25683a 100644 (file)
@@ -50,6 +50,9 @@ class BLSURFPlugin_Hypothesis_i:
   // Destructor
   virtual ~BLSURFPlugin_Hypothesis_i();
 
+  void SetTopology(CORBA::Long theValue);
+  CORBA::Long GetTopology();
+
   void SetPhysicalMesh(CORBA::Long theValue);
   CORBA::Long GetPhysicalMesh();
 
index 8c179f4125d6194260f99053df4c64ce9dc29a5a..d71f2d060dc46f722d4241fa214d59656bb017c1 100644 (file)
@@ -38,8 +38,7 @@ LIB_SRC = \
        BLSURFPlugin_BLSURF_i.cxx \
        BLSURFPlugin_Hypothesis.cxx \
        BLSURFPlugin_Hypothesis_i.cxx \
-       BLSURFPlugin_i.cxx \
-       cad_occ.cxx
+       BLSURFPlugin_i.cxx
 
 LIB_SERVER_IDL = BLSURFPlugin_Algorithm.idl
 
index 5f3e0a9c90fbf0b968be3802e6fa031727a99fb0..3a41e48d76680be42f2cfb14ffb80aba8536ae09 100644 (file)
 #include <qcheckbox.h>
 #include <qpixmap.h>
 
+enum Topology {
+    FromCAD,
+    Process,
+    Process2
+  };
+
+
 enum PhysicalMesh
   {
     DefaultSize,
@@ -96,6 +103,14 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
     myName = new QLineEdit( GroupC1 );
   }
 
+  new QLabel( tr( "BLSURF_TOPOLOGY" ), GroupC1 );
+  myTopology = new QtxComboBox( GroupC1 );
+  QStringList topologyTypes;
+  topologyTypes.append( QObject::tr( "BLSURF_TOPOLOGY_CAD" ) );
+  topologyTypes.append( QObject::tr( "BLSURF_TOPOLOGY_PROCESS" ) );
+  topologyTypes.append( QObject::tr( "BLSURF_TOPOLOGY_PROCESS2" ) );
+  myTopology->insertStringList( topologyTypes );
+
   new QLabel( tr( "BLSURF_PHY_MESH" ), GroupC1 );
   myPhysicalMesh = new QtxComboBox( GroupC1 );
   QStringList physicalTypes;
@@ -131,7 +146,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   new QLabel( tr( "BLSURF_GRADATION" ), GroupC1 );
   myGradation = new QtxDblSpinBox( GroupC1 );
   myGradation->setMinValue( 1.1 );
-  myGradation->setMaxValue( 1.5 );
+  myGradation->setMaxValue( 2.5 );
   myGradation->setLineStep( 0.1 );
 
 //   new QLabel( tr( "BLSURF_SEG_PER_RADIUS" ), GroupC1 );
@@ -159,6 +174,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
 
   if( myName )
     myName->setText( data.myName );
+  myTopology->setCurrentItem( data.myTopology );
   myPhysicalMesh->setCurrentItem( data.myPhysicalMesh );
   myPhySize->setValue( data.myPhySize );
   myGeometricMesh->setCurrentItem( data.myGeometricMesh );
@@ -184,6 +200,7 @@ QString BLSURFPluginGUI_HypothesisCreator::storeParams() const
   storeParamsToHypo( data );
 
   QString guiHyp;
+  guiHyp += tr("BLSURF_TOPOLOGY") + " = " + QString::number( data.myTopology ) + "; ";
   guiHyp += tr("BLSURF_PHY_MESH") + " = " + QString::number( data.myPhysicalMesh ) + "; ";
   guiHyp += tr("BLSURF_HPHYDEF") + " = " + QString::number( data.myPhySize ) + "; ";
   guiHyp += tr("BLSURF_GEOM_MESH") + " = " + QString::number( data.myGeometricMesh ) + "; ";
@@ -205,6 +222,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData
   HypothesisData* data = SMESH::GetHypothesisData( hypType() );
   h_data.myName = isCreation() && data ? data->Label : "";
 
+  h_data.myTopology = (int) h->GetTopology();
   h_data.myPhysicalMesh = (int) h->GetPhysicalMesh();
   h_data.myPhySize = h->GetPhySize();
   h_data.myGeometricMesh = (int) h->GetGeometricMesh();
@@ -227,6 +245,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
     if( isCreation() )
       SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() );
 
+    h->SetTopology( (int) h_data.myTopology );
     h->SetPhysicalMesh( (int) h_data.myPhysicalMesh );
     h->SetPhySize( h_data.myPhySize );
     h->SetGeometricMesh( (int) h_data.myGeometricMesh );
@@ -251,6 +270,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
 bool BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothesisData& h_data ) const
 {
   h_data.myName             = myName ? myName->text() : "";
+  h_data.myTopology         = myTopology->currentItem();
   h_data.myPhysicalMesh     = myPhysicalMesh->currentItem();
   h_data.myPhySize          = myPhySize->value();
   h_data.myGeometricMesh    = myGeometricMesh->currentItem();
index 7a393eec0eddeb211402e6c157c1442695619107..a5b596de085050c255edf89ee856963636b29b3d 100644 (file)
@@ -22,6 +22,7 @@
 //
 //  File   : BLSURFPluginGUI_HypothesisCreator.h
 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
+//           & Aurelien ALLEAUME (DISTENE)
 //  Module : BLSURFPlugin
 //  $Header: 
 
@@ -37,6 +38,7 @@ class QLineEdit;
 
 typedef struct
 {
+  int     myTopology;
   int     myPhysicalMesh, myGeometricMesh;
   double  myPhySize, myAngleMeshS, myGradation;
   bool    myAllowQuadrangles, myDecimesh;
@@ -79,6 +81,7 @@ private:
 
 private:
  QLineEdit*       myName;
+ QtxComboBox*     myTopology;
  QtxComboBox*     myPhysicalMesh;
  QtxDblSpinBox*   myPhySize;
  QtxComboBox*     myGeometricMesh;
index 0fe902b3a589628d4541d04e8c8b21c7b1a9b68e..9fd9f1d7e3ab31e31f80bb532818e975d6f1952a 100755 (executable)
@@ -23,6 +23,7 @@
 //
 // File      : BLSURFPlugin_msg_en.po
 // Authors   : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
+//             & Aurelien ALLEAUME (DISTENE)
 // Date      : 28/03/2006
 // Project   : SALOME
 //=============================================================================
@@ -38,6 +39,18 @@ msgstr ""
 msgid "BLSURF_2D_HYPOTHESIS"
 msgstr "BLSURF 2D"
 
+msgid "BLSURF_TOPOLOGY"
+msgstr "Topology"
+
+msgid "BLSURF_TOPOLOGY_CAD"
+msgstr "From CAD"
+
+msgid "BLSURF_TOPOLOGY_PROCESS"
+msgstr "Pre-process"
+
+msgid "BLSURF_TOPOLOGY_PROCESS2"
+msgstr "Pre-process++"
+
 msgid "BLSURF_PHY_MESH"
 msgstr "Physical Mesh"
 
@@ -66,10 +79,10 @@ msgid "BLSURF_GRADATION"
 msgstr "Gradation"
 
 msgid "BLSURF_DECIMESH"
-msgstr "Decimesh"
+msgstr "Patch independent"
 
 msgid "BLSURF_ALLOW_QUADRANGLES"
-msgstr "Allow Quadrangles"
+msgstr "Allow Quadrangles (Test)"
 
 msgid "BLSURF_2D_TITLE"
 msgstr "Hypothesis Construction"
index 229ea573e54320d8b56377a5e8e1350a4daa608a..885f073a3f9add8118126d5cda9a15be5d66513c 100644 (file)
@@ -66,8 +66,8 @@ CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) \
 CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \
            -I${GEOM_ROOT_DIR}/include/salome  -I${SMESH_ROOT_DIR}/include/salome
 
-LDFLAGS += -lSMESH $(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome \
-          -L${GUI_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome \
-          -L${SMESH_ROOT_DIR}/lib/salome
+LDFLAGS += -lSMESH $(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome \
+          -L${GUI_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome -L${GEOM_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome \
+          -L${SMESH_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
 
 @CONCLUDE@