Salome HOME
Issue 0020368: SMESHGUI_MeshDlg::isTabEnabled must return something
[modules/smesh.git] / src / SMESH_I / SMESH_Filter_i.cxx
index 189e6cbcc193c6e6c80b811b3957c6cea0870f68..bd92ee2d49b6efc2d38c9c15dabd8d970759f655 100644 (file)
@@ -1995,7 +1995,7 @@ FilterLibrary_ptr FilterManager_i::LoadLibrary( const char* aFileName )
 {
   SMESH::FilterLibrary_i* aServant = new SMESH::FilterLibrary_i( aFileName );
   SMESH::FilterLibrary_var anObj = aServant->_this();
-  TPythonDump()<<aServant<<" = "<<this<<".LoadLibrary("<<aFileName<<")";
+  TPythonDump()<<aServant<<" = "<<this<<".LoadLibrary('"<<aFileName<<"')";
   return anObj._retn();
 }
 
@@ -2189,6 +2189,7 @@ static inline bool getCriteria( Predicate_i*                thePred,
       theCriteria[ i ].ThresholdStr  = aPred->GetShapeName();
       theCriteria[ i ].ThresholdID   = aPred->GetShapeID();
       theCriteria[ i ].TypeOfElement = aPred->GetElementType();
+      theCriteria[ i ].Tolerance     = aPred->GetTolerance();
 
       return true;
     }
@@ -2224,6 +2225,7 @@ static inline bool getCriteria( Predicate_i*                thePred,
       theCriteria[ i ].ThresholdStr  = aPred->GetShapeName();
       theCriteria[ i ].ThresholdID   = aPred->GetShapeID();
       theCriteria[ i ].TypeOfElement = aPred->GetElementType();
+      theCriteria[ i ].Tolerance     = aPred->GetTolerance();
 
       return true;
     }
@@ -2378,9 +2380,10 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
       TPythonDump pd;
       pd << "aCriterion = SMESH.Filter.Criterion(" << aCriterion << "," << aCompare
          << "," << aThreshold << ",'" << aThresholdStr;
-      if (aThresholdID)
-       pd << "',salome.ObjectToID(" << aThresholdID
-          << ")," << aUnary << "," << aBinary << "," << aTolerance
+      if (aThresholdID && strlen(aThresholdID))
+       //pd << "',salome.ObjectToID(" << aThresholdID
+        pd << "','" << aThresholdID
+          << "'," << aUnary << "," << aBinary << "," << aTolerance
           << "," << aTypeOfElem << "," << aPrecision << ")";
       else
        pd << "',''," << aUnary << "," << aBinary << "," << aTolerance
@@ -2450,6 +2453,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
           SMESH::BelongToGeom_ptr tmpPred = aFilterMgr->CreateBelongToGeom();
           tmpPred->SetElementType( aTypeOfElem );
           tmpPred->SetShape( aThresholdID, aThresholdStr );
+          tmpPred->SetTolerance( aTolerance );
           aPredicate = tmpPred;
         }
         break;
@@ -2476,6 +2480,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
           SMESH::LyingOnGeom_ptr tmpPred = aFilterMgr->CreateLyingOnGeom();
           tmpPred->SetElementType( aTypeOfElem );
          tmpPred->SetShape( aThresholdID, aThresholdStr );
+          tmpPred->SetTolerance( aTolerance );
           aPredicate = tmpPred;
         }
         break;
@@ -2511,7 +2516,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
         {
           SMESH::ElemGeomType_ptr tmpPred = aFilterMgr->CreateElemGeomType();
           tmpPred->SetElementType( aTypeOfElem );
-          tmpPred->SetGeometryType( (GeometryType)(aThreshold + 0.5) );
+          tmpPred->SetGeometryType( (GeometryType)(int)(aThreshold + 0.5) );
           aPredicate = tmpPred;
           break;
         }