]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Merge from V6_main (04/10/2012) V7_0_0 V7_0_0rc1
authorvsr <vsr@opencascade.com>
Mon, 8 Oct 2012 13:09:32 +0000 (13:09 +0000)
committervsr <vsr@opencascade.com>
Mon, 8 Oct 2012 13:09:32 +0000 (13:09 +0000)
doc/salome/gui/BLSURFPLUGIN/Makefile.am
doc/salome/gui/BLSURFPLUGIN/doxyfile_py.in
doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc
doc/salome/gui/BLSURFPLUGIN/input/blsurfplugin_python_interface.doc
resources/BLSURFPlugin.xml
src/BLSURFPlugin/BLSURFPluginDC.py
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx

index 1746a98110537666ce95c85009c7361ff784cc20..2517c0b879f722dbcd508e2b3c5c900f6dab60f0 100644 (file)
@@ -28,16 +28,15 @@ EXTRA_DIST += images input static/footer.html static/doxygen.css
 guidocdir = $(docdir)/gui/BLSURFPLUGIN
 guidoc_DATA = images/head.png
 
+DOC_PYTHONPATH=$(prefix)/bin/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(MED_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GEOM_ROOT_DIR)/bin/salome:$(GEOM_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
+DOC_SMESH_MeshersList=BLSURFPlugin
 
-usr_docs: doxyfile
-       echo "===========================================" ;                    \
-       echo "Generating Python interface documentation";                       \
-       echo "===========================================" ;                    \
-       $(DOXYGEN) doxyfile_py                                                  \
-       echo "===========================================" ;                    \
-       echo "Generating GUI documentation" ;                                   \
-       echo "===========================================" ;                    \
-       $(DOXYGEN) doxyfile ;
+smesh.py: $(top_srcdir)/src/BLSURFPlugin/BLSURFPluginDC.py
+       @PYTHONPATH=$(DOC_PYTHONPATH):${PYTHONPATH} SMESH_MeshersList=$(DOC_SMESH_MeshersList) $(PYTHON) $(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py -d -o $@ BLSURFPlugin
+
+usr_docs: doxyfile_py doxyfile smesh.py
+       @$(DOXYGEN) doxyfile_py ; \
+       $(DOXYGEN) doxyfile
 
 docs: usr_docs
 
index 68057ba36d9a20845247d3ad1d49f693f2865073..2c1ad9db3e7cc8cc1cd09039a25379742e1c2fab 100755 (executable)
@@ -96,7 +96,9 @@ EXAMPLE_RECURSIVE      = NO
 #---------------------------------------------------------------------------
 #Input related options
 #---------------------------------------------------------------------------
-INPUT             = @top_srcdir@/src/BLSURFPlugin/BLSURFPluginDC.py
+INPUT             = @top_srcdir@/src/BLSURFPlugin/BLSURFPluginDC.py \
+                    smesh.py \
+                   @SMESH_ROOT_DIR@/bin/salome/smesh_algorithm.py
 FILE_PATTERNS     = 
 IMAGE_PATH        = @srcdir@/images
 RECURSIVE         = NO
@@ -129,24 +131,24 @@ GENERATE_RTF      = NO
 #---------------------------------------------------------------------------
 CLASS_DIAGRAMS         = NO
 HIDE_UNDOC_RELATIONS   = NO
-HAVE_DOT               = NO
-CLASS_GRAPH            = NO
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
 COLLABORATION_GRAPH    = NO
 GROUP_GRAPHS           = NO
 UML_LOOK               = NO
-TEMPLATE_RELATIONS     = NO
-INCLUDE_GRAPH          = NO
-INCLUDED_BY_GRAPH      = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
 CALL_GRAPH             = NO
-GRAPHICAL_HIERARCHY    = NO
-DIRECTORY_GRAPH        = NO
-DOT_IMAGE_FORMAT       = jpg
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
 DOT_FONTNAME           = Arial
 DOT_PATH               = 
 DOTFILE_DIRS           = 
 MAX_DOT_GRAPH_WIDTH    = 1024
-MAX_DOT_GRAPH_HEIGHT   = 1200
-MAX_DOT_GRAPH_DEPTH    = 0
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 1000
 DOT_TRANSPARENT        = NO
 DOT_MULTI_TARGETS      = NO
 GENERATE_LEGEND        = NO
@@ -156,4 +158,4 @@ DOT_CLEANUP            = YES
 #External reference options
 #---------------------------------------------------------------------------
 GENERATE_TAGFILE  = blsurfpluginpy_doc.tag
-SEARCHENGINE           = YES
\ No newline at end of file
+SEARCHENGINE           = YES
index 1964dbe72adcb016393aaf6c67b61bc6355b1bbb..9bc028a9e148502123e7cfe691228d53f9dde338 100644 (file)
@@ -5,7 +5,7 @@
 \anchor blsurf_top
 BLSURF Parameters hypothesis works only with \b DISTENE \b BLSurf 2d
 algorithm. This algorithm is a commercial software. To obtain a
-licence, visit http://www.distene.com/corp/eval-distene.html 
+licence, visit http://www.distene.com/en/corp/eval-distene.html 
 
 \tableofcontents                                            
 
@@ -430,7 +430,7 @@ The enforced vertex is the projection of a point defined by its
 
 - If the projected point is on the boundary or outside of the face, it will be ignored.
 
-- If a group name is specified, the enforced nodes will be added in the group. If the group does not exist it will be created.
+- If a group name is specified : If the group exists, the enforced nodes will be added in the existing group, if the group does not exist it will be created.
 
 \sa Sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including enforced vertices.
 
index 0d3efc1da50977a7ee4d70fbf48226bf3b02582a..2e883ab8858e469082d7a1a28dd3147132806bbb 100644 (file)
@@ -2,11 +2,11 @@
 
 \page blsurfplugin_python_interface_page Python Interface
 
-Python package \ref BLSURFPluginDC "BLSURFPlugin" defines several classes, destined for creation of the 2D meshes.
+Python package BLSURFPluginDC defines several classes, destined for creation of the 2D meshes.
 
-Documentation for BLSURFPlugin package is available in linear form grouped by classes, declared in the BLSURFPluginDC.py file.
+BLSURF meshing plugin dynamically adds several methods to the smesh.Mesh class to create meshing algorithms.
 
-Below you can see an example of usage of the BLSURFPlugin package for mesh generation:
+Below you can see an example of usage of the BLSURFPlugin Python API for mesh generation:
 
 \anchor tui_blsurf
 
index ff40d4cb78d75a7392ca3067b51559344b61fc32..7eb2e41995ebc9e79c5bacccf67bd4a61a2d6d87 100644 (file)
     <hypothesis type="BLSURF_Parameters"
                label-id="BLSURF Parameters"
                icon-id="mesh_hypo_BLSURF.png"
-               dim="2"/>
+               dim="2">
+      <python-wrap>
+        <accumulative-methods>
+          SetOptionValue,
+          SetPreCADOptionValue,
+          UnsetOption,
+          UnsetPreCADOption,
+          SetSizeMap,
+          SetConstantSizeMap,
+          UnsetSizeMap,
+          SetAttractor,
+          UnsetAttractor,
+          SetAttractorGeom,
+          UnsetAttractorGeom,
+          SetEnforcedVertex,
+          SetEnforcedVertexNamed,
+          SetEnforcedVertexGeom,
+          SetEnforcedVertexWithGroup,
+          SetEnforcedVertexNamedWithGroup,
+          SetEnforcedVertexGeomWithGroup,
+          UnsetEnforcedVertex,
+          UnsetEnforcedVertexGeom,
+          UnsetEnforcedVertices
+        </accumulative-methods>
+      </python-wrap>
+    </hypothesis>
+
   </hypotheses>
   <algorithms>
 
index 8dffd50e86f2c3071923cd431fb260284971da5e..791744e0b413142d1ba56ace780181ab6574e34d 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from smesh import Mesh_Algorithm, AssureGeomPublished
+##
+# @package BLSURFPluginDC
+# Python API for the BLSURF meshing plug-in module.
+
+from smesh_algorithm import Mesh_Algorithm
+from smesh import AssureGeomPublished
 
 # Topology treatment way of BLSURF
 FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3
@@ -34,22 +39,40 @@ except ImportError:
     noBLSURFPlugin = 1
     pass
 
+#----------------------------
+# Mesh algo type identifiers
+#----------------------------
 
-
-# a constant to call Mesh.Triangle(BLSURF,geom=0)
+## Algorithm type: BLSurf triangle 2D algorithm, see BLSURF_Algorithm
 BLSURF = "BLSURF"
 
-## BLSURF 2D algorithm. It is created by calling Mesh.Triangle(BLSURF,geom=0)
+#----------------------
+# Algorithms
+#----------------------
+
+## BLSurf 2D algorithm.
+#
+#  It can be created by calling smesh.Mesh.Triangle(smesh.BLSURF,geom=0)
 #
 class BLSURF_Algorithm(Mesh_Algorithm):
 
+    ## name of the dynamic method in smesh.Mesh class
+    #  @internal
     meshMethod = "Triangle"
+    ## type of algorithm used with helper function in smesh.Mesh class
+    #  @internal
     algoType   = BLSURF
+    ## doc string of the method
+    #  @internal
+    docHelper  = "Creates triangle 2D algorithm for faces"
 
     _angleMeshS = 8
     _gradation  = 1.1
 
     ## Private constructor.
+    #  @param mesh parent mesh object algorithm is assigned to
+    #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
+    #              if it is @c 0 (default), the algorithm is assigned to the main shape
     def __init__(self, mesh, geom=0):
         Mesh_Algorithm.__init__(self)
         if noBLSURFPlugin:
@@ -57,102 +80,141 @@ class BLSURF_Algorithm(Mesh_Algorithm):
         self.Create(mesh, geom, BLSURF, "libBLSURFEngine.so")
         self.params=None
         #self.SetPhysicalMesh() - PAL19680
+        pass
 
     ## Sets a way to define size of mesh elements to generate.
     #  @param thePhysicalMesh is: DefaultSize, BLSURF_Custom or SizeMap.
     def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize):
         self.Parameters().SetPhysicalMesh(thePhysicalMesh)
+        pass
 
     ## Sets size of mesh elements to generate.
+    #  @param theVal value of mesh element size
     def SetPhySize(self, theVal):
         self.Parameters().SetPhySize(theVal)
+        pass
 
     ## Sets lower boundary of mesh element size (PhySize).
+    #  @param theVal value of mesh element minimal size
     def SetPhyMin(self, theVal=-1):
         self.Parameters().SetPhyMin(theVal)
+        pass
 
     ## Sets upper boundary of mesh element size (PhySize).
+    #  @param theVal value of mesh element maximal size
     def SetPhyMax(self, theVal=-1):
         self.Parameters().SetPhyMax(theVal)
+        pass
 
     ## Sets a way to define maximum angular deflection of mesh from CAD model.
     #  @param theGeometricMesh is: 0 (None) or 1 (Custom)
     def SetGeometricMesh(self, theGeometricMesh=0):
         if self.Parameters().GetPhysicalMesh() == 0: theGeometricMesh = 1
         self.Parameters().SetGeometricMesh(theGeometricMesh)
+        pass
 
     ## Sets angular deflection (in degrees) of a mesh face from CAD surface.
+    #  @param theVal value of angular deflection for mesh face
     def SetAngleMeshS(self, theVal=_angleMeshS):
         if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
         self.Parameters().SetAngleMeshS(theVal)
+        pass
 
     ## Sets angular deflection (in degrees) of a mesh edge from CAD curve.
+    #  @param theVal value of angular deflection for mesh edge
     def SetAngleMeshC(self, theVal=_angleMeshS):
         if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
         self.Parameters().SetAngleMeshC(theVal)
+        pass
 
     ## Sets lower boundary of mesh element size computed to respect angular deflection.
+    #  @param theVal value of mesh element minimal size
     def SetGeoMin(self, theVal=-1):
         self.Parameters().SetGeoMin(theVal)
+        pass
 
     ## Sets upper boundary of mesh element size computed to respect angular deflection.
+    #  @param theVal value of mesh element maximal size
     def SetGeoMax(self, theVal=-1):
         self.Parameters().SetGeoMax(theVal)
+        pass
 
     ## Sets maximal allowed ratio between the lengths of two adjacent edges.
+    #  @param theVal value of maximal length ratio
     def SetGradation(self, theVal=_gradation):
         if self.Parameters().GetGeometricMesh() == 0: theVal = self._gradation
         self.Parameters().SetGradation(theVal)
+        pass
 
     ## Sets topology usage way.
-    # @param way defines how mesh conformity is assured <ul>
-    # <li>FromCAD - mesh conformity is assured by conformity of a shape</li>
-    # <li>PreProcess or PreProcessPlus - by pre-processing a CAD model</li>
-    # <li>PreCAD - by pre-processing with PreCAD a CAD model</li></ul>
+    # @param way defines how mesh conformity is assured
+    # - FromCAD - mesh conformity is assured by conformity of a shape
+    # - PreProcess or PreProcessPlus - by pre-processing a CAD model
+    # - PreCAD - by pre-processing with PreCAD a CAD model
     def SetTopology(self, way):
         self.Parameters().SetTopology(way)
+        pass
 
     ## To respect geometrical edges or not.
+    #  @param toIgnoreEdges "ignore edges" flag value
     def SetDecimesh(self, toIgnoreEdges=False):
         self.Parameters().SetDecimesh(toIgnoreEdges)
+        pass
 
     ## Sets verbosity level in the range 0 to 100.
+    #  @param level verbosity level
     def SetVerbosity(self, level):
         self.Parameters().SetVerbosity(level)
+        pass
 
     ## To optimize merges edges.
+    #  @param toMergeEdges "merge edges" flag value
     def SetPreCADMergeEdges(self, toMergeEdges=False):
         self.Parameters().SetPreCADMergeEdges(toMergeEdges)
+        pass
 
     ## To remove nano edges.
+    #  @param toRemoveNanoEdges "remove nano edges" flag value
     def SetPreCADRemoveNanoEdges(self, toRemoveNanoEdges=False):
         self.Parameters().SetPreCADRemoveNanoEdges(toRemoveNanoEdges)
+        pass
 
     ## To compute topology from scratch
+    #  @param toDiscardInput "discard input" flag value
     def SetPreCADDiscardInput(self, toDiscardInput=False):
         self.Parameters().SetPreCADDiscardInput(toDiscardInput)
+        pass
 
     ## Sets the length below which an edge is considered as nano 
     #  for the topology processing.
+    #  @param epsNano nano edge length threshold value
     def SetPreCADEpsNano(self, epsNano):
         self.Parameters().SetPreCADEpsNano(epsNano)
+        pass
 
     ## Sets advanced option value.
+    #  @param optionName advanced option name
+    #  @param level advanced option value
     def SetOptionValue(self, optionName, level):
         self.Parameters().SetOptionValue(optionName,level)
+        pass
 
     ## Sets advanced PreCAD option value.
-    #  Keyword arguments:
-    #  optionName: name of the option
-    #  optionValue: value of the option
+    #  @param optionName name of the option
+    #  @param optionValue value of the option
     def SetPreCADOptionValue(self, optionName, optionValue):
         self.Parameters().SetPreCADOptionValue(optionName,optionValue)
+        pass
 
     ## Sets GMF file for export at computation
+    #  @param fileName GMF file name
     def SetGMFFile(self, fileName):
         self.Parameters().SetGMFFile(fileName)
+        pass
 
-    ## Enforced vertices (BLSURF)
+    #-----------------------------------------
+    # Enforced vertices (BLSURF)
+    #-----------------------------------------
 
     ## To get all the enforced vertices
     def GetAllEnforcedVertices(self):
@@ -194,11 +256,14 @@ class BLSURF_Algorithm(Mesh_Algorithm):
                 return self.Parameters().SetEnforcedVertex(theFace, x, y, z)
             else:
                 return self.Parameters().SetEnforcedVertexWithGroup(theFace, x, y, z, groupName)
+            pass
         else:
             if groupName == "":
                 return self.Parameters().SetEnforcedVertexNamed(theFace, x, y, z, vertexName)
             else:
                 return self.Parameters().SetEnforcedVertexNamedWithGroup(theFace, x, y, z, vertexName, groupName)
+            pass
+        pass
 
     ## To set an enforced vertex on a face (or group, compound) given a GEOM vertex, group or compound.
     #  @param theFace      : GEOM face (or group, compound) on which to define an enforced vertex
@@ -211,6 +276,7 @@ class BLSURF_Algorithm(Mesh_Algorithm):
             return self.Parameters().SetEnforcedVertexGeom(theFace, theVertex)
         else:
             return self.Parameters().SetEnforcedVertexGeomWithGroup(theFace, theVertex,groupName)
+        pass
 
     ## To remove an enforced vertex on a given GEOM face (or group, compound) given the coordinates.
     #  @param theFace      : GEOM face (or group, compound) on which to remove the enforced vertex
@@ -253,7 +319,9 @@ class BLSURF_Algorithm(Mesh_Algorithm):
     def GetInternalEnforcedVertexAllFacesGroup(self):
         return self.Parameters().GetInternalEnforcedVertexAllFacesGroup()
 
-    ## Attractors
+    #-----------------------------------------
+    #  Attractors
+    #-----------------------------------------
 
     ## Sets an attractor on the chosen face. The mesh size will decrease exponentially with the distance from theAttractor, following the rule h(d) = theEndSize - (theEndSize - theStartSize) * exp [ - ( d / theInfluenceDistance ) ^ 2 ] 
     #  @param theFace      : face on which the attractor will be defined
@@ -266,14 +334,18 @@ class BLSURF_Algorithm(Mesh_Algorithm):
         AssureGeomPublished( self.mesh, theFace )
         AssureGeomPublished( self.mesh, theAttractor )
         self.Parameters().SetAttractorGeom(theFace, theAttractor, theStartSize, theEndSize, theInfluenceDistance, theConstantSizeDistance)
+        pass
 
     ## Unsets an attractor on the chosen face. 
     #  @param theFace      : face on which the attractor has to be removed                               
     def UnsetAttractorGeom(self, theFace):
         AssureGeomPublished( self.mesh, theFace )
         self.Parameters().SetAttractorGeom(theFace)
+        pass
 
-    ## Size maps (BLSURF)
+    #-----------------------------------------
+    # Size maps (BLSURF)
+    #-----------------------------------------
 
     ## To set a size map on a face, edge or vertex (or group, compound) given Python function.
     #  If theObject is a face, the function can be: def f(u,v): return u+v
@@ -284,25 +356,33 @@ class BLSURF_Algorithm(Mesh_Algorithm):
     def SetSizeMap(self, theObject, theSizeMap):
         AssureGeomPublished( self.mesh, theObject )
         self.Parameters().SetSizeMap(theObject, theSizeMap)
+        pass
 
     ## To remove a size map defined on a face, edge or vertex (or group, compound)
     #  @param theObject   : GEOM face, edge or vertex (or group, compound) on which to define a size map
     def UnsetSizeMap(self, theObject):
         AssureGeomPublished( self.mesh, theObject )
         self.Parameters().UnsetSizeMap(theObject)
+        pass
 
     ## To remove all the size maps
     def ClearSizeMaps(self):
         self.Parameters().ClearSizeMaps()
+        pass
 
     ## Sets QuadAllowed flag.
+    #  @param toAllow "allow quadrangles" flag value
     def SetQuadAllowed(self, toAllow=True):
         self.Parameters().SetQuadAllowed(toAllow)
+        pass
 
     ## Defines hypothesis having several parameters
-    #
+    #  @return hypothesis object
     def Parameters(self):
         if not self.params:
             self.params = self.Hypothesis("BLSURF_Parameters", [],
                                           "libBLSURFEngine.so", UseExisting=0)
+            pass
         return self.params
+
+    pass # end of BLSURF_Algorithm class
index 4743bbaef821c90bed7a808c48ed4aaa9bc345e8..e834c58b05a2c7f50b283b9bfd8a95064b60391a 100644 (file)
@@ -689,6 +689,10 @@ void BLSURFPlugin_BLSURF::SetParameters(
                                         bool *                  use_precad
                                        )
 {
+  // rnc : Bug 1457
+  // Clear map so that it is not stored in the algorithm with old enforced vertices in it
+  EnfVertexCoords2EnfVertexList.clear();
+  
   int    _topology      = BLSURFPlugin_Hypothesis::GetDefaultTopology();
   int    _physicalMesh  = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh();
   double _phySize       = BLSURFPlugin_Hypothesis::GetDefaultPhySize();
@@ -1025,7 +1029,7 @@ void BLSURFPlugin_BLSURF::SetParameters(
       TopExp_Explorer exp (GeomShape, TopAbs_FACE);
       for (; exp.More(); exp.Next()){
         MESSAGE("Iterating shapes. Shape type is " << exp.Current().ShapeType());
-        TopExp_Explorer exp_face (exp.Current(), TopAbs_VERTEX);
+        TopExp_Explorer exp_face (exp.Current(), TopAbs_VERTEX, TopAbs_EDGE);
         for (; exp_face.More(); exp_face.Next())
         {
           // Get coords of vertex
@@ -1041,6 +1045,7 @@ void BLSURFPlugin_BLSURF::SetParameters(
           enfVertex->faceEntries.clear();
           enfVertex->geomEntry = "";
           enfVertex->grpName = grpName;
+          enfVertex->vertex = TopoDS::Vertex( exp_face.Current() );
           _createEnforcedVertexOnFace( TopoDS::Face(exp.Current()),  aPnt, enfVertex);
           HasSizeMapOnFace = true;
         }
@@ -1192,6 +1197,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
   helper.SetIsQuadratic( haveQudraticSubMesh );
   bool needMerge = false;
   set< SMESH_subMesh* > edgeSubmeshes;
+  set< SMESH_subMesh* >& mergeSubmeshes = edgeSubmeshes;
 
   /* Now fill the CAD object with data from your CAD
    * environement. This is the most complex part of a successfull
@@ -1323,8 +1329,9 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
           gp_Pnt P(xyzCoords[0],xyzCoords[1],xyzCoords[2]);
           BRepClass_FaceClassifier scl(f,P,1e-7);
           // scl.Perform() is bugged. The function was rewritten
-//          scl.Perform();
-          BRepClass_FaceClassifierPerform(&scl,f,P,1e-7);
+          // BRepClass_FaceClassifierPerform(&scl,f,P,1e-7);
+          // OCC 6.5.2: scl.Perform() is not bugged anymore
+          scl.Perform(f, P, 1e-7);
           TopAbs_State result = scl.State();
           MESSAGE("Position of point on face: "<<result);
           if ( result == TopAbs_OUT )
@@ -1411,7 +1418,22 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
             ienf++;
             MESSAGE("Add cad point on (u,v)=(" << uvCoords[0] << "," << uvCoords[1] << ") with id = " << ienf);
             cad_point_t* point_p = cad_point_new(fce, ienf, uvCoords);
-            cad_point_set_tag(point_p, ienf);
+            int tag = 0;
+            std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList >::const_iterator enfCoordsIt = EnfVertexCoords2EnfVertexList.find(xyzCoords);
+            if (enfCoordsIt != EnfVertexCoords2EnfVertexList.end() &&
+                !enfCoordsIt->second.empty() )
+            {
+              TopoDS_Vertex     v = (*enfCoordsIt->second.begin())->vertex;
+              if ( v.IsNull() ) v = (*enfCoordsIt->second.rbegin())->vertex;
+              if ( !v.IsNull() ) {
+                tag = pmap.Add( v );
+                mergeSubmeshes.insert( aMesh.GetSubMesh( v ));
+                //if ( tag != pmap.Extent() )
+                  needMerge = true;
+              }
+            }
+            if ( tag == 0 ) tag = ienf;
+            cad_point_set_tag(point_p, tag);
           }
         }
         FaceId2EnforcedVertexCoords.erase(faceKey);
@@ -1882,12 +1904,11 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
     };
   }
 
-  // SetIsAlwaysComputed( true ) to sub-meshes of degenerated EDGEs
+  // SetIsAlwaysComputed( true ) to sub-meshes of EDGEs w/o mesh
   TopLoc_Location loc; double f,l;
   for (int i = 1; i <= emap.Extent(); i++)
-    if ( BRep_Tool::Curve(TopoDS::Edge( emap( i )), loc, f,l).IsNull() )
-      if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( emap( i )))
-        sm->SetIsAlwaysComputed( true );
+    if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( emap( i )))
+      sm->SetIsAlwaysComputed( true );
   for (int i = 1; i <= pmap.Extent(); i++)
       if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( pmap( i )))
         if ( !sm->IsMeshComputed() )
@@ -1895,8 +1916,8 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
 
   if ( needMerge )
   {
-    set< SMESH_subMesh* >::iterator smIt = edgeSubmeshes.begin();
-    for ( ; smIt != edgeSubmeshes.end(); ++smIt )
+    set< SMESH_subMesh* >::iterator smIt = mergeSubmeshes.begin();
+    for ( ; smIt != mergeSubmeshes.end(); ++smIt )
     {
       SMESH_subMesh* sm = *smIt;
       SMESH_subMeshIteratorPtr subsmIt = sm->getDependsOnIterator( /*includeSelf=*/true,
@@ -2337,6 +2358,11 @@ bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh&         aMesh,
     //_angleMeshS    = hyp->GetAngleMeshS();
     _angleMeshC    = _hypothesis->GetAngleMeshC();
     _quadAllowed   = _hypothesis->GetQuadAllowed();
+  } else {
+    //0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry
+    // GetDefaultPhySize() sometimes leads to computation failure
+    _phySize = aMesh.GetShapeDiagonalSize() / _gen->GetBoundaryBoxSegmentation();
+    MESSAGE("BLSURFPlugin_BLSURF::SetParameters using defaults");
   }
 
   bool IsQuadratic = false;
index 3067dc447634ef19b2ec24729b0bc0b6c841b88b..60690721763b35ae99e17c18c898fed6e91bb7a9 100644 (file)
@@ -47,7 +47,7 @@
 #endif
 
 #include <Python.h>
-#include "SMESH_2D_Algo.hxx"
+#include "SMESH_Algo.hxx"
 #include "SMESH_Mesh.hxx"
 #include <SMESHDS_Mesh.hxx>
 #include <SMDS_MeshElement.hxx>
index 1856a70a94942991fd1c6b49d0a411bd2692a668..f934918b367fee0d8ba93f2eddc03262b88af3ca 100644 (file)
@@ -1134,6 +1134,7 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
       << _angleMeshS << " " << _gradation << " " << (int) _quadAllowed << " " << (int) _decimesh;
   save << " " << _phyMin << " " << _phyMax << " " << _angleMeshC << " " << _hgeoMin << " " << _hgeoMax << " " << _verb;
   save << " " << (int) _preCADMergeEdges << " " << (int) _preCADRemoveNanoEdges << " " << (int) _preCADDiscardInput << " " << _preCADEpsNano ;
+  save << " " << (int) _enforcedInternalVerticesAllFaces;
 
   TOptionValues::iterator op_val = _option2value.begin();
   if (op_val != _option2value.end()) {
@@ -1355,6 +1356,12 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
   else
     load.clear(std::ios::badbit | load.rdstate());
 
+  isOK = (load >> i);
+  if (isOK)
+    _enforcedInternalVerticesAllFaces = (bool) i;
+  else
+    load.clear(std::ios::badbit | load.rdstate());
+
   std::string option_or_sm;
   bool hasOptions = false;
   bool hasPreCADOptions = false;
index f6167a52fcad19b57d73ec13baa082d432d81746..2b014b00a9aa73691207d5dbd42b6e24226957cc 100644 (file)
@@ -184,6 +184,7 @@ public:
     TEnfVertexCoords coords;
     TEnfGroupName grpName;
     TEntryList faceEntries;
+    TopoDS_Vertex vertex;
   };
     
   struct CompareEnfVertices
index 3c6fd0384fffecc81d1b2c6793d2e4a36ac45212..4884edfc7f309793616b9d6359c573c86acf076e 100644 (file)
@@ -1386,7 +1386,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
     if (boost::trim_copy(groupName).empty())
       groupName = "";
 
-    if (selEnfVertex == 1)
+    if (selEnfVertex <= 1)
     {
       double x,y,z;
       x = myXCoord->GetValue();