if (IsContains(theMeshDS, theShape, theElem, theFindShapeEnum, theAvoidShapeEnum))
return true;
- if ( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( theShape ) )
- {
- SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes();
- while ( aNodeIt->more() )
- {
- const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
- SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
- while ( anElemIt->more() )
- {
- const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
- if (anElement == theElem)
- return true;
- }
- }
- }
+ TopTools_IndexedMapOfShape aSubShapes;
+ TopExp::MapShapes( theShape, aSubShapes );
- TopExp_Explorer anExp( theShape,TopAbs_VERTEX,theAvoidShapeEnum );
-
- while( anExp.More() )
- {
- const TopoDS_Shape& aShape = anExp.Current();
- if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){
- SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes();
- while ( aNodeIt->more() )
- {
- const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
- SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
- while ( anElemIt->more() )
- {
- const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
- if (anElement == theElem)
- return true;
- }
- }
+ for (int i = 1; i <= aSubShapes.Extent(); i++)
+ {
+ const TopoDS_Shape& aShape = aSubShapes.FindKey(i);
+
+ if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){
+ if( aSubMesh->Contains( theElem ) )
+ return true;
+
+ SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes();
+ while ( aNodeIt->more() )
+ {
+ const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
+ SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
+ while ( anElemIt->more() )
+ {
+ const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
+ if (anElement == theElem)
+ return true;
+ }
+ }
+ }
}
- anExp.Next();
- }
return false;
}
return myPredicatePtr;
}
+/*
+ Class : BadOrientedVolume_i
+ Description : Verify whether a mesh volume is incorrectly oriented from
+ the point of view of MED convention
+*/
+BadOrientedVolume_i::BadOrientedVolume_i()
+{
+ Controls::PredicatePtr control( new Controls::BadOrientedVolume() );
+ myFunctorPtr = myPredicatePtr = control;
+};
+
+FunctorType BadOrientedVolume_i::GetFunctorType()
+{
+ return SMESH::FT_BadOrientedVolume;
+}
/*
Class : BelongToGeom_i
return anObj._retn();
}
+BadOrientedVolume_ptr FilterManager_i::CreateBadOrientedVolume()
+{
+ SMESH::BadOrientedVolume_i* aServant = new SMESH::BadOrientedVolume_i();
+ SMESH::BadOrientedVolume_var anObj = aServant->_this();
+ return anObj._retn();
+}
+
LessThan_ptr FilterManager_i::CreateLessThan()
{
SMESH::LessThan_i* aServant = new SMESH::LessThan_i();
theCriteria[ i ].ThresholdStr = aPred->GetRangeStr();
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
+ return true;
+ }
+ case FT_BadOrientedVolume:
+ {
+ BadOrientedVolume_i* aPred = dynamic_cast<BadOrientedVolume_i*>( thePred );
+
+ CORBA::ULong i = theCriteria->length();
+ theCriteria->length( i + 1 );
+
+ theCriteria[ i ] = createCriterion();
+
+ theCriteria[ i ].Type = FT_BadOrientedVolume;
+ theCriteria[ i ].TypeOfElement = aPred->GetElementType();
+
return true;
}
case FT_LessThan:
aPredicate = tmpPred;
}
break;
+ case SMESH::FT_BadOrientedVolume:
+ {
+ aPredicate = aFilterMgr->CreateBadOrientedVolume();
+ }
+ break;
default:
continue;
case FT_BelongToPlane : return "Belong to Plane";
case FT_BelongToCylinder: return "Belong to Cylinder";
case FT_LyingOnGeom : return "Lying on Geom";
+ case FT_BadOrientedVolume: return "Bad Oriented Volume";
case FT_RangeOfIds : return "Range of IDs";
case FT_FreeBorders : return "Free borders";
case FT_FreeEdges : return "Free edges";
else if ( theStr.equals( "Length" ) ) return FT_Length;
// else if ( theStr.equals( "Length2D" ) ) return FT_Length2D;
else if ( theStr.equals( "Range of IDs" ) ) return FT_RangeOfIds;
+ else if ( theStr.equals( "Bad Oriented Volume" ) ) return FT_BadOrientedVolume;
else if ( theStr.equals( "Less than" ) ) return FT_LessThan;
else if ( theStr.equals( "More than" ) ) return FT_MoreThan;
else if ( theStr.equals( "Equal to" ) ) return FT_EqualTo;