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
// free nodes
computeFreeNodesInfo();
// double nodes
- computeDoubleNodesInfo();
+ if ( Max( (int)mesh->NbNodes(), (int)mesh->NbElements() ) <= ctrlLimit )
+ computeDoubleNodesInfo();
}
else {
myButtons[0]->setEnabled( true );
{
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
}
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())