From: eap Date: Tue, 3 Feb 2015 10:43:25 +0000 (+0300) Subject: 52609: Geometric progression works wrong with "Reversed edges" option used + Propagation X-Git-Tag: V7_6_0a1~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=51b0f287860107c56c08e61d40a3aea9ba425483;p=modules%2Fsmesh.git 52609: Geometric progression works wrong with "Reversed edges" option used + Propagation + 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 --- diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 9cfbc313e..42c668044 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -4087,39 +4087,39 @@ bool ElementsOnShape::IsSatisfy (long elemId) 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 ); - 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 ); - } - if ( isSatisfy ) - return true; } - return false; + return isSatisfy; } TopAbs_ShapeEnum ElementsOnShape::TClassifier::ShapeType() const diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index e91afa388..70b9aa1a6 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -3340,7 +3340,8 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj ) // free nodes computeFreeNodesInfo(); // double nodes - computeDoubleNodesInfo(); + if ( Max( (int)mesh->NbNodes(), (int)mesh->NbElements() ) <= ctrlLimit ) + computeDoubleNodesInfo(); } else { myButtons[0]->setEnabled( true ); diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index a7e67cfeb..45af00a8d 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -968,13 +968,13 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, { 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() ) < - 0.2 * Abs( theParams.back() - *(--theParams.rbegin()))) + 0.2 * Abs( theParams.back() - *(++theParams.rbegin()))) { 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 @@ -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 + // (_mainEdge.Orientation() marks mutual orientation of EDGEs in propagation chain) 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())