From: eap Date: Fri, 19 Nov 2010 16:30:10 +0000 (+0000) Subject: 0020948: EDF 1468 SMESH: Histogram of the quality controls X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a692fd690daec0d1c49e6439c575d938fb92153;p=modules%2Fsmesh.git 0020948: EDF 1468 SMESH: Histogram of the quality controls limit computed histogram to a submesh 0020944: EDF 1464 SMESH: detection of over-constrained elements + class OverConstrainedVolume: public Predicate + class OverConstrainedFace: public Predicate --- diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 5c1ff34ea..e3ca420e3 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -601,7 +601,8 @@ SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals) { std::vector nbEvents; std::vector funValues; - myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues); + std::vector elements; + myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements); nbIntervals = CORBA::Short( std::min( nbEvents.size(), funValues.size() - 1)); SMESH::Histogram_var histogram = new SMESH::Histogram; @@ -940,8 +941,7 @@ FunctorType BadOrientedVolume_i::GetFunctorType() /* Class : BareBorderVolume_i - Description : Verify whether a mesh volume is incorrectly oriented from - the point of view of MED convention + Description : Verify whether a mesh volume has a free facet without a face on it */ BareBorderVolume_i::BareBorderVolume_i() { @@ -956,8 +956,7 @@ FunctorType BareBorderVolume_i::GetFunctorType() /* Class : BareBorderFace_i - Description : Verify whether a mesh volume is incorrectly oriented from - the point of view of MED convention + Description : Verify whether a mesh face has a free border without an edge on it */ BareBorderFace_i::BareBorderFace_i() { @@ -970,6 +969,36 @@ FunctorType BareBorderFace_i::GetFunctorType() return SMESH::FT_BareBorderFace; } +/* + Class : OverConstrainedVolume_i + Description : Verify whether a mesh volume has only one facet shared with other volumes +*/ +OverConstrainedVolume_i::OverConstrainedVolume_i() +{ + Controls::PredicatePtr control( new Controls::OverConstrainedVolume() ); + myFunctorPtr = myPredicatePtr = control; +}; + +FunctorType OverConstrainedVolume_i::GetFunctorType() +{ + return SMESH::FT_OverConstrainedVolume; +} + +/* + Class : OverConstrainedFace_i + Description : Verify whether a mesh face has only one border shared with other faces +*/ +OverConstrainedFace_i::OverConstrainedFace_i() +{ + Controls::PredicatePtr control( new Controls::OverConstrainedFace() ); + myFunctorPtr = myPredicatePtr = control; +}; + +FunctorType OverConstrainedFace_i::GetFunctorType() +{ + return SMESH::FT_OverConstrainedFace; +} + /* Class : BelongToGeom_i Description : Predicate for selection on geometrical support @@ -2034,6 +2063,22 @@ BareBorderFace_ptr FilterManager_i::CreateBareBorderFace() return anObj._retn(); } +OverConstrainedVolume_ptr FilterManager_i::CreateOverConstrainedVolume() +{ + SMESH::OverConstrainedVolume_i* aServant = new SMESH::OverConstrainedVolume_i(); + SMESH::OverConstrainedVolume_var anObj = aServant->_this(); + TPythonDump()<_this(); + TPythonDump()<GetElementType(); + return true; + } + case FT_OverConstrainedVolume: + { + OverConstrainedVolume_i* aPred = dynamic_cast( thePred ); + + CORBA::ULong i = theCriteria->length(); + theCriteria->length( i + 1 ); + + theCriteria[ i ] = createCriterion(); + + theCriteria[ i ].Type = FT_OverConstrainedVolume; + theCriteria[ i ].TypeOfElement = aPred->GetElementType(); + + return true; + } + case FT_OverConstrainedFace: + { + OverConstrainedFace_i* aPred = dynamic_cast( thePred ); + + CORBA::ULong i = theCriteria->length(); + theCriteria->length( i + 1 ); + + theCriteria[ i ] = createCriterion(); + + theCriteria[ i ].Type = FT_OverConstrainedFace; + theCriteria[ i ].TypeOfElement = aPred->GetElementType(); + return true; } case FT_LessThan: @@ -2743,6 +2816,16 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria aPredicate = aFilterMgr->CreateBareBorderFace(); } break; + case SMESH::FT_OverConstrainedVolume: + { + aPredicate = aFilterMgr->CreateOverConstrainedVolume(); + } + break; + case SMESH::FT_OverConstrainedFace: + { + aPredicate = aFilterMgr->CreateOverConstrainedFace(); + } + break; case SMESH::FT_LinearOrQuadratic: { SMESH::LinearOrQuadratic_ptr tmpPred = aFilterMgr->CreateLinearOrQuadratic(); @@ -2978,6 +3061,8 @@ static inline LDOMString toString( CORBA::Long theType ) case FT_BadOrientedVolume:return "Bad Oriented Volume"; case FT_BareBorderVolume: return "Volumes with bare border"; case FT_BareBorderFace : return "Faces with bare border"; + case FT_OverConstrainedVolume: return "Over-constrained Volumes"; + case FT_OverConstrainedFace : return "Over-constrained Faces"; case FT_RangeOfIds : return "Range of IDs"; case FT_FreeBorders : return "Free borders"; case FT_FreeEdges : return "Free edges"; @@ -3033,6 +3118,8 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr ) else if ( theStr.equals( "Bad Oriented Volume" ) ) return FT_BadOrientedVolume; else if ( theStr.equals( "Volumes with bare border" ) ) return FT_BareBorderVolume; else if ( theStr.equals( "Faces with bare border" ) ) return FT_BareBorderFace; + else if ( theStr.equals( "Over-constrained Volumes" ) ) return FT_OverConstrainedVolume; + else if ( theStr.equals( "Over-constrained Faces" ) ) return FT_OverConstrainedFace; 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;