Salome HOME
Fix regression of non-regression tests
authoreap <eap@opencascade.com>
Tue, 1 Dec 2015 11:32:09 +0000 (14:32 +0300)
committereap <eap@opencascade.com>
Tue, 1 Dec 2015 11:32:09 +0000 (14:32 +0300)
- Coplanar faces filter (SMESH_Controls.cxx)
- Convert to quadratic (SMESH_MesherHelper.cxx)
- Missing Compute item in mesh pop-up in presence of a sub-mesh on compound only (no other algos) (SSMESHGUI_ComputeDlg.cxx)
- set checkAll=False in call of SMESH_Gen::IsApplicable() (smeshBuilder.py)

src/Controls/SMESH_Controls.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESH_SWIG/StdMeshersBuilder.py
src/SMESH_SWIG/smeshBuilder.py

index 9978a6d6815728898853e7f2acb46a2800e43dab..3f612a24fc823cc2b4750d44f01095709f07ba70 100644 (file)
@@ -3013,12 +3013,13 @@ bool ConnectedElements::IsSatisfy( long theElementId )
 
 namespace
 {
-  inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos2 )
+  inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos )
   {
     double dot = v1 * v2; // cos * |v1| * |v2|
     double l1  = v1.SquareMagnitude();
     double l2  = v2.SquareMagnitude();
-    return ( dot * dot ) / l1 / l2 >= cos2;
+    return (( dot * cos >= 0 ) && 
+            ( dot * dot ) / l1 / l2 >= ( cos * cos ));
   }
 }
 CoplanarFaces::CoplanarFaces()
@@ -3046,7 +3047,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
     if (!normOK)
       return;
 
-    const double cosTol2 = Cos( myToler ) * Cos( myToler );
+    const double cosTol = Cos( myToler * M_PI / 180. );
     NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks;
 
     std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
@@ -3070,7 +3071,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
           if ( f->GetNodeIndex( n2 ) > -1 )
           {
             gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
-            if (!normOK || isLessAngle( myNorm, norm, cosTol2))
+            if (!normOK || isLessAngle( myNorm, norm, cosTol))
             {
               myCoplanarIDs.Add( f->GetID() );
               faceQueue.push_back( make_pair( f, norm ));
index 3e52ed9b482b5d89415fbc118f53104bac8b7eb2..3703a7215de3c4d0e89733d5da826d9c539f0615 100644 (file)
@@ -4059,12 +4059,13 @@ namespace { // Structures used by FixQuadraticElements()
 
   const QFace* QLink::GetContinuesFace( const QFace* face ) const
   {
-    for ( size_t i = 0; i < _faces.size(); ++i ) {
-      if ( _faces[i] == face ) {
-        int iF = i < 2 ? 1-i : 5-i;
-        return iF < (int)_faces.size() ? _faces[iF] : 0;
+    if ( _faces.size() <= 4 )
+      for ( size_t i = 0; i < _faces.size(); ++i ) {
+        if ( _faces[i] == face ) {
+          int iF = i < 2 ? 1-i : 5-i;
+          return iF < (int)_faces.size() ? _faces[iF] : 0;
+        }
       }
-    }
     return 0;
   }
   //================================================================================
index 429531fd28919106e398c59cf2775f7339b2e467..a71b425d407fdd28f5e16f52de0ac45022aada07 100644 (file)
@@ -1773,7 +1773,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
   }
 
   // check sub-meshes
-  for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart < SMESH::Tag_LastSubMesh; ++aPart )
+  for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart <= SMESH::Tag_LastSubMesh; ++aPart )
   {
     if ( !theMesh->FindSubObject( aPart, aHypFolder ))
       continue;
index 98acce5f6d38b3d3943984d5619d1d0ecf475b8b..d9ad9bf5ee3643766cfa4942770d0c2e6b2301cf 100644 (file)
@@ -1421,6 +1421,8 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
                                       hyp.GetCopySourceMesh() == args[1], args[2] )
         hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups],
                               UseExisting=UseExisting, CompareMethod=compFun, toAdd=False)
+        if groups and isinstance( groups, SMESH._objref_SMESH_GroupBase ):
+            groups = [groups]
         hyp.SetSourceFaces(groups)
         hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
         self.mesh.AddHypothesis(hyp, self.geom)
index 22ea69d836f27507b247dc6893f7b63a9adf056b..0dc3b25f05890e36ef4893fdce7f48ef9e29ceac 100644 (file)
@@ -1680,9 +1680,10 @@ class Mesh:
         if self.mesh.HasShapeToMesh():
             hyp_type     = hyp.GetName()
             lib_name     = hyp.GetLibName()
-            checkAll    = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
-            if checkAll and geom:
-                checkAll = geom.GetType() == 37
+            # checkAll    = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
+            # if checkAll and geom:
+            #     checkAll = geom.GetType() == 37
+            checkAll     = False
             isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll)
         if isApplicable:
             AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())