From: eap Date: Wed, 6 Mar 2013 08:28:25 +0000 (+0000) Subject: 0021859: SMESH : Add conversion from QUAD8 to QUAD9 and from HEXA20 to HEXA27 X-Git-Tag: pluginMGCleaner~76 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=caef3568426dc8b50e6fea72e8041b776cbe4742;p=modules%2Fsmesh.git 0021859: SMESH : Add conversion from QUAD8 to QUAD9 and from HEXA20 to HEXA27 + class SMESH_I_EXPORT ElemEntityType_i: public virtual POA_SMESH::ElemEntityType, + public virtual Predicate_i --- diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index f7040c5ab..ac5273396 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -702,7 +702,6 @@ FunctorType Taper_i::GetFunctorType() return SMESH::FT_Taper; } - /* Class : Skew_i Description : Functor for calculating skew in degrees @@ -1637,6 +1636,37 @@ FunctorType ElemGeomType_i::GetFunctorType() return SMESH::FT_ElemGeomType; } +/* + Class : ElemEntityType_i + Description : Predicate check is element has indicated entity type +*/ +ElemEntityType_i::ElemEntityType_i() +{ + myElemEntityTypePtr.reset(new Controls::ElemEntityType()); + myFunctorPtr = myPredicatePtr = myElemEntityTypePtr; +} + +void ElemEntityType_i::SetElementType(ElementType theType) +{ + myElemEntityTypePtr->SetType(SMDSAbs_ElementType(theType)); + TPythonDump()<SetElemEntityType(SMDSAbs_EntityType (theEntityType)); + TPythonDump()<GetElemEntityType(); +} + +FunctorType ElemEntityType_i::GetFunctorType() +{ + return SMESH::FT_EntityType; +} + /* Class : CoplanarFaces_i Description : Returns true if a mesh face is a coplanar neighbour to a given one @@ -2312,6 +2342,14 @@ ElemGeomType_ptr FilterManager_i::CreateElemGeomType() return anObj._retn(); } +ElemEntityType_ptr FilterManager_i::CreateElemEntityType() +{ + SMESH::ElemEntityType_i* aServant = new SMESH::ElemEntityType_i(); + SMESH::ElemEntityType_var anObj = aServant->_this(); + TPythonDump()<GetGeometryType(); return true; } + case FT_EntityType: + { + CORBA::ULong i = theCriteria->length(); + theCriteria->length( i + 1 ); + + theCriteria[ i ] = createCriterion(); + + ElemEntityType_i* aPred = dynamic_cast( thePred ); + theCriteria[ i ].Type = aFType; + theCriteria[ i ].Threshold = (double)aPred->GetEntityType(); + return true; + } case FT_Undefined: return false; @@ -3043,6 +3093,14 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria aPredicate = tmpPred; break; } + case SMESH::FT_EntityType: + { + SMESH::ElemEntityType_ptr tmpPred = aFilterMgr->CreateElemEntityType(); + tmpPred->SetElementType( aTypeOfElem ); + tmpPred->SetEntityType( EntityType( (int (aThreshold + 0.5)))); + aPredicate = tmpPred; + break; + } case SMESH::FT_CoplanarFaces: { SMESH::CoplanarFaces_ptr tmpPred = aFilterMgr->CreateCoplanarFaces(); @@ -3289,6 +3347,7 @@ static inline LDOMString toString( CORBA::Long theType ) case FT_GroupColor : return "Color of Group"; case FT_LinearOrQuadratic : return "Linear or Quadratic"; case FT_ElemGeomType : return "Element geomtry type"; + case FT_EntityType : return "Entity type"; case FT_Undefined : return ""; default : return ""; } @@ -3341,6 +3400,7 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr ) else if ( theStr.equals( "Color of Group" ) ) return FT_GroupColor; else if ( theStr.equals( "Linear or Quadratic" ) ) return FT_LinearOrQuadratic; else if ( theStr.equals( "Element geomtry type" ) ) return FT_ElemGeomType; + else if ( theStr.equals( "Entity type" ) ) return FT_EntityType; else if ( theStr.equals( "" ) ) return FT_Undefined; else return FT_Undefined; } @@ -3903,6 +3963,7 @@ static const char** getFunctNames() "FT_LinearOrQuadratic", "FT_GroupColor", "FT_ElemGeomType", + "FT_EntityType", "FT_CoplanarFaces", "FT_BallDiameter", "FT_LessThan", @@ -3911,7 +3972,7 @@ static const char** getFunctNames() "FT_LogicalNOT", "FT_LogicalAND", "FT_LogicalOR", - "FT_Undefined" }; + "FT_Undefined"}; return functName; } diff --git a/src/SMESH_I/SMESH_Filter_i.hxx b/src/SMESH_I/SMESH_Filter_i.hxx index d874819a8..2186b42ea 100644 --- a/src/SMESH_I/SMESH_Filter_i.hxx +++ b/src/SMESH_I/SMESH_Filter_i.hxx @@ -329,7 +329,6 @@ namespace SMESH Controls::Length2DPtr myLength2DPtr; }; - /* Class : MultiConnection_i Description : Functor for calculating number of faces conneted to the edge @@ -450,7 +449,7 @@ namespace SMESH OverConstrainedFace_i(); FunctorType GetFunctorType(); }; - + /* Class : BelongToGeom_i Description : Predicate for selection on geometrical support @@ -763,6 +762,25 @@ namespace SMESH private: Controls::ElemGeomTypePtr myElemGeomTypePtr; }; + + /* + Class : ElemEntityType_i + Description : Functor for check element entity type + */ + class SMESH_I_EXPORT ElemEntityType_i: public virtual POA_SMESH::ElemEntityType, + public virtual Predicate_i + { + public: + ElemEntityType_i(); + FunctorType GetFunctorType(); + + void SetElementType ( ElementType theType ); + void SetEntityType( EntityType theEntityType ); + EntityType GetEntityType() const; + + private: + Controls::ElemEntityTypePtr myElemEntityTypePtr; + }; /* Class : CoplanarFaces_i @@ -1095,6 +1113,7 @@ namespace SMESH LinearOrQuadratic_ptr CreateLinearOrQuadratic(); GroupColor_ptr CreateGroupColor(); ElemGeomType_ptr CreateElemGeomType(); + ElemEntityType_ptr CreateElemEntityType(); CoplanarFaces_ptr CreateCoplanarFaces(); LessThan_ptr CreateLessThan();