Salome HOME
52609: Geometric progression works wrong with "Reversed edges" option used + Propagation
authoreap <eap@opencascade.com>
Tue, 3 Feb 2015 10:43:25 +0000 (13:43 +0300)
committereap <eap@opencascade.com>
Tue, 3 Feb 2015 10:43:25 +0000 (13:43 +0300)
+ BUG: Lying on Geom filetr works wrong with Geom Group
+ BUG: Too long opening of Mesh Info dlg of a small sub-mesh in a large mesh

src/Controls/SMESH_Controls.cxx
src/SMESHGUI/SMESHGUI_MeshInfo.cxx
src/StdMeshers/StdMeshers_Regular_1D.cxx

index 9cfbc313ea2de35b00092cfce6a22dfdcc5972cd..42c668044def6d2b04df05bb2536ab948c218c0e 100644 (file)
@@ -4087,39 +4087,39 @@ bool ElementsOnShape::IsSatisfy (long elemId)
   if ( !elem || myClassifiers.empty() )
     return false;
 
   if ( !elem || myClassifiers.empty() )
     return false;
 
-  for ( size_t i = 0; i < myClassifiers.size(); ++i )
+  bool isSatisfy = myAllNodesFlag, isNodeOut;
+
+  gp_XYZ centerXYZ (0, 0, 0);
+
+  SMDS_ElemIteratorPtr aNodeItr = elem->nodesIterator();
+  while (aNodeItr->more() && (isSatisfy == myAllNodesFlag))
   {
   {
-    SMDS_ElemIteratorPtr aNodeItr = elem->nodesIterator();
-    bool isSatisfy = myAllNodesFlag, isNodeOut;
-    
-    gp_XYZ centerXYZ (0, 0, 0);
+    SMESH_TNodeXYZ aPnt( aNodeItr->next() );
+    centerXYZ += aPnt;
 
 
-    while (aNodeItr->more() && (isSatisfy == myAllNodesFlag))
+    isNodeOut = true;
+    if ( !getNodeIsOut( aPnt._node, isNodeOut ))
     {
     {
-      const SMDS_MeshNode* n = (const SMDS_MeshNode*) aNodeItr->next();
-      if ( !getNodeIsOut( n, isNodeOut ))
-      {
-        SMESH_TNodeXYZ aPnt( n );
-        centerXYZ += aPnt;
+      for ( size_t i = 0; i < myClassifiers.size() && isNodeOut; ++i )
         isNodeOut = myClassifiers[i]->IsOut( aPnt );
         isNodeOut = myClassifiers[i]->IsOut( aPnt );
-        setNodeIsOut( n, isNodeOut );
-      }
-      isSatisfy = !isNodeOut;
+
+      setNodeIsOut( aPnt._node, isNodeOut );
     }
     }
+    isSatisfy = !isNodeOut;
+  }
 
 
-    // Check the center point for volumes MantisBug 0020168
-    if (isSatisfy &&
-        myAllNodesFlag &&
-        myClassifiers[i]->ShapeType() == TopAbs_SOLID)
-    {
-      centerXYZ /= elem->NbNodes();
+  // Check the center point for volumes MantisBug 0020168
+  if (isSatisfy &&
+      myAllNodesFlag &&
+      myClassifiers[0]->ShapeType() == TopAbs_SOLID)
+  {
+    centerXYZ /= elem->NbNodes();
+    isSatisfy = false;
+    for ( size_t i = 0; i < myClassifiers.size() && !isSatisfy; ++i )
       isSatisfy = ! myClassifiers[i]->IsOut( centerXYZ );
       isSatisfy = ! myClassifiers[i]->IsOut( centerXYZ );
-    }
-    if ( isSatisfy )
-      return true;
   }
 
   }
 
-  return false;
+  return isSatisfy;
 }
 
 TopAbs_ShapeEnum ElementsOnShape::TClassifier::ShapeType() const
 }
 
 TopAbs_ShapeEnum ElementsOnShape::TClassifier::ShapeType() const
index e91afa388e3d91e894bc3caf141d2a711369106e..70b9aa1a6d62555ac770b25c70c3e79b0d46ed37 100644 (file)
@@ -3340,7 +3340,8 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
       // free nodes
       computeFreeNodesInfo();
       // double nodes
       // free nodes
       computeFreeNodesInfo();
       // double nodes
-      computeDoubleNodesInfo();
+      if ( Max( (int)mesh->NbNodes(), (int)mesh->NbElements() ) <= ctrlLimit )
+        computeDoubleNodesInfo();
     }
     else {
       myButtons[0]->setEnabled( true );
     }
     else {
       myButtons[0]->setEnabled( true );
index a7e67cfeb6fc3c1e2db18cd06ef0acb49c57c714..45af00a8dc9266a6c9c4af00dc8e219361b8f646 100644 (file)
@@ -968,13 +968,13 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
     {
       if ( Abs( param - Un ) < 0.2 * Abs( param - theParams.back() ))
       {
     {
       if ( Abs( param - Un ) < 0.2 * Abs( param - theParams.back() ))
       {
-        compensateError( a1, eltSize, U1, Un, theLength, theC3d, theParams );
+        compensateError( a1, Abs(eltSize), U1, Un, theLength, theC3d, theParams );
       }
       else if ( Abs( Un - theParams.back() ) <
       }
       else if ( Abs( Un - theParams.back() ) <
-                0.2 * Abs( theParams.back() - *(--theParams.rbegin())))
+                0.2 * Abs( theParams.back() - *(++theParams.rbegin())))
       {
         theParams.pop_back();
       {
         theParams.pop_back();
-        compensateError( a1, an, U1, Un, theLength, theC3d, theParams );
+        compensateError( a1, Abs(an), U1, Un, theLength, theC3d, theParams );
       }
     }
     if (theReverse) theParams.reverse(); // NPAL18025
       }
     }
     if (theReverse) theParams.reverse(); // NPAL18025
@@ -1170,10 +1170,13 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
     }
     if ( !_mainEdge.IsNull() ) {
       // take into account reversing the edge the hypothesis is propagated from
     }
     if ( !_mainEdge.IsNull() ) {
       // take into account reversing the edge the hypothesis is propagated from
+      // (_mainEdge.Orientation() marks mutual orientation of EDGEs in propagation chain)
       reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
       reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
-      int mainID = meshDS->ShapeToIndex(_mainEdge);
-      if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end())
-        reversed = !reversed;
+      if ( !_isPropagOfDistribution ) {
+        int mainID = meshDS->ShapeToIndex(_mainEdge);
+        if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end())
+          reversed = !reversed;
+      }
     }
     // take into account this edge reversing
     if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), shapeID) != _revEdgesIDs.end())
     }
     // take into account this edge reversing
     if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), shapeID) != _revEdgesIDs.end())