Fix regression of non-regression tests

- 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)
This commit is contained in:
eap 2015-12-01 14:32:09 +03:00
parent aac6ba83a9
commit 7d08ac8481
5 changed files with 18 additions and 13 deletions

View 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 ));

View 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;
}
//================================================================================

View 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;

View 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)

View 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())