From: enk Date: Fri, 24 Dec 2004 10:59:44 +0000 (+0000) Subject: Bug PAL7334 DEVELOPMENT : Control Improvement X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2adad59bbbf96843bebf1fa577f778199b157174;p=modules%2Fsmesh.git Bug PAL7334 DEVELOPMENT : Control Improvement --- diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 0c7c9a639..6b12b6ad1 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -427,6 +427,47 @@ FunctorType Length_i::GetFunctorType() return SMESH::FT_Length; } +/* + Class : Length2D_i + Description : Functor for calculating length of edge +*/ +Length2D_i::Length2D_i() +{ + myNumericalFunctorPtr.reset( new Controls::Length2D() ); + myFunctorPtr = myNumericalFunctorPtr; +} + +FunctorType Length2D_i::GetFunctorType() +{ + return SMESH::FT_Length2D; +} + +SMESH::Length2D::Values* Length2D_i::GetValues() +{ + INFOS("Length2D_i::GetValues"); + SMESH::Controls::Length2D::TValues aValues; + myLength2DPtr->GetValues( aValues ); + + long i = 0, iEnd = aValues.size(); + + SMESH::Length2D::Values_var aResult = new SMESH::Length2D::Values(iEnd); + + SMESH::Controls::Length2D::TValues::const_iterator anIter; + for ( anIter = aValues.begin() ; anIter != aValues.end(); anIter++, i++ ) + { + const SMESH::Controls::Length2D::Value& aVal = *anIter; + SMESH::Length2D::Value &aValue = aResult[ i ]; + + aValue.myLength = aVal.myLength; + aValue.myPnt1 = aVal.myPntId[ 0 ]; + aValue.myPnt2 = aVal.myPntId[ 1 ]; + + } + + INFOS("Length2D_i::GetValuess~"); + return aResult._retn(); +} + /* Class : MultiConnection_i Description : Functor for calculating number of faces conneted to the edge @@ -1037,6 +1078,12 @@ Length_ptr FilterManager_i::CreateLength() return anObj._retn(); } +Length2D_ptr FilterManager_i::CreateLength2D() +{ + SMESH::Length2D_i* aServant = new SMESH::Length2D_i(); + SMESH::Length2D_var anObj = aServant->_this(); + return anObj._retn(); +} MultiConnection_ptr FilterManager_i::CreateMultiConnection() { @@ -1426,6 +1473,9 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria case SMESH::FT_Length: aFunctor = aFilterMgr->CreateLength(); break; + case SMESH::FT_Length2D: + aFunctor = aFilterMgr->CreateLength2D(); + break; case SMESH::FT_AspectRatio: aFunctor = aFilterMgr->CreateAspectRatio(); break; @@ -1692,6 +1742,7 @@ static inline LDOMString toString( const long theType ) case FT_FreeEdges : return "Free edges"; case FT_MultiConnection : return "Borders at multi-connections"; case FT_Length : return "Length"; + case FT_Length2D : return "Length2D"; case FT_LessThan : return "Less than"; case FT_MoreThan : return "More than"; case FT_EqualTo : return "Equal to"; diff --git a/src/SMESH_I/SMESH_Filter_i.hxx b/src/SMESH_I/SMESH_Filter_i.hxx index d931d0560..95e7b58e9 100644 --- a/src/SMESH_I/SMESH_Filter_i.hxx +++ b/src/SMESH_I/SMESH_Filter_i.hxx @@ -218,6 +218,22 @@ public: FunctorType GetFunctorType(); }; +/* + Class : Length2D_i + Description : Functor for calculating length of edge +*/ +class Length2D_i: public virtual POA_SMESH::Length2D, + public virtual NumericalFunctor_i +{ +public: + Length2D_i(); + SMESH::Length2D::Values* GetValues(); + FunctorType GetFunctorType(); + +protected: + Controls::Length2DPtr myLength2DPtr; +}; + /* Class : MultiConnection_i @@ -602,6 +618,7 @@ public: Skew_ptr CreateSkew(); Area_ptr CreateArea(); Length_ptr CreateLength(); + Length2D_ptr CreateLength2D(); MultiConnection_ptr CreateMultiConnection(); BelongToGeom_ptr CreateBelongToGeom();