X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Filter_i.cxx;h=28e749b6e758b5a0650660c187f9d41428028b78;hp=016a2f84bb934df9cd6458cf58a74a55ea232c68;hb=04f997252152407f9180e03f0af428ab2ca6f4be;hpb=c98d9fcd7f02c1f1f5c24dd3e709ed75228d66c4 diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 016a2f84b..28e749b6e 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -192,7 +192,7 @@ static TopoDS_Shape getShapeByID (const char* theID) /* Class : Functor_i - Description : An abstact class for all functors + Description : An abstract class for all functors */ Functor_i::Functor_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) @@ -532,6 +532,21 @@ SMESH::Length2D::Values* Length2D_i::GetValues() return aResult._retn(); } +/* + Class : Deflection2D_i + Description : Functor for calculating distance between a face and geometry +*/ +Deflection2D_i::Deflection2D_i() +{ + myNumericalFunctorPtr.reset( new Controls::Deflection2D() ); + myFunctorPtr = myNumericalFunctorPtr; +} + +FunctorType Deflection2D_i::GetFunctorType() +{ + return SMESH::FT_Deflection2D; +} + /* Class : MultiConnection_i Description : Functor for calculating number of faces conneted to the edge @@ -562,6 +577,21 @@ FunctorType BallDiameter_i::GetFunctorType() return SMESH::FT_BallDiameter; } +/* + Class : NodeConnectivityNumber_i + Description : Functor returning diameter of a ball element +*/ +NodeConnectivityNumber_i::NodeConnectivityNumber_i() +{ + myNumericalFunctorPtr.reset( new Controls::NodeConnectivityNumber() ); + myFunctorPtr = myNumericalFunctorPtr; +} + +FunctorType NodeConnectivityNumber_i::GetFunctorType() +{ + return SMESH::FT_NodeConnectivityNumber; +} + /* Class : MultiConnection2D_i Description : Functor for calculating number of faces conneted to the edge @@ -1412,7 +1442,7 @@ FunctorType LinearOrQuadratic_i::GetFunctorType() /* Class : GroupColor_i - Description : Functor for check color of group to whic mesh element belongs to + Description : Functor for check color of group to which mesh element belongs to */ GroupColor_i::GroupColor_i() { @@ -2096,6 +2126,14 @@ Length2D_ptr FilterManager_i::CreateLength2D() return anObj._retn(); } +Deflection2D_ptr FilterManager_i::CreateDeflection2D() +{ + SMESH::Deflection2D_i* aServant = new SMESH::Deflection2D_i(); + SMESH::Deflection2D_var anObj = aServant->_this(); + TPythonDump()<_this(); + TPythonDump()<CreateLength2D(); break; + case SMESH::FT_Deflection2D: + aFunctor = aFilterMgr->CreateDeflection2D(); + break; case SMESH::FT_AspectRatio: aFunctor = aFilterMgr->CreateAspectRatio(); break; @@ -2964,6 +3013,9 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria case SMESH::FT_BallDiameter: aFunctor = aFilterMgr->CreateBallDiameter(); break; + case SMESH::FT_NodeConnectivityNumber: + aFunctor = aFilterMgr->CreateNodeConnectivityNumber(); + break; // Predicates @@ -3423,9 +3475,10 @@ static inline LDOMString toString( CORBA::Long theType ) case FT_EqualFaces : return "Equal faces"; case FT_EqualVolumes : return "Equal volumes"; case FT_MultiConnection : return "Borders at multi-connections"; - case FT_MultiConnection2D :return "Borders at multi-connections 2D"; + case FT_MultiConnection2D : return "Borders at multi-connections 2D"; case FT_Length : return "Length"; case FT_Length2D : return "Length 2D"; + case FT_Deflection2D : return "Deflection 2D"; case FT_LessThan : return "Less than"; case FT_MoreThan : return "More than"; case FT_EqualTo : return "Equal to"; @@ -3434,7 +3487,7 @@ static inline LDOMString toString( CORBA::Long theType ) case FT_LogicalOR : return "Or"; case FT_GroupColor : return "Color of Group"; case FT_LinearOrQuadratic : return "Linear or Quadratic"; - case FT_ElemGeomType : return "Element geomtry type"; + case FT_ElemGeomType : return "Element geometry type"; case FT_EntityType : return "Entity type"; case FT_Undefined : return ""; default : return ""; @@ -3474,6 +3527,7 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr ) // else if ( theStr.equals( "Borders at multi-connections 2D" ) ) return FT_MultiConnection2D; else if ( theStr.equals( "Length" ) ) return FT_Length; // else if ( theStr.equals( "Length2D" ) ) return FT_Length2D; + else if ( theStr.equals( "Deflection" ) ) return FT_Deflection2D; else if ( theStr.equals( "Range of IDs" ) ) return FT_RangeOfIds; else if ( theStr.equals( "Bad Oriented Volume" ) ) return FT_BadOrientedVolume; else if ( theStr.equals( "Volumes with bare border" ) ) return FT_BareBorderVolume; @@ -3488,7 +3542,7 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr ) else if ( theStr.equals( "Or" ) ) return FT_LogicalOR; 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( "Element geometry type" ) ) return FT_ElemGeomType; else if ( theStr.equals( "Entity type" ) ) return FT_EntityType; else if ( theStr.equals( "" ) ) return FT_Undefined; else return FT_Undefined; @@ -3913,14 +3967,15 @@ CORBA::Boolean FilterLibrary_i::Save() if ( myFileName == 0 || strlen( myFileName ) == 0 ) return false; - FILE* aOutFile = fopen( myFileName, "wt" ); - if ( !aOutFile ) - return false; + std::filebuf fb; + fb.open( myFileName, std::ios::out ); + + Standard_OStream os( &fb ); - LDOM_XmlWriter aWriter( aOutFile ); + LDOM_XmlWriter aWriter; aWriter.SetIndentation( 2 ); - aWriter << myDoc; - fclose( aOutFile ); + aWriter.Write( os, myDoc ); + fb.close(); TPythonDump()<