]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021338: EDF 1926 SMESH: New controls and filters
authoreap <eap@opencascade.com>
Thu, 26 Jan 2012 16:04:00 +0000 (16:04 +0000)
committereap <eap@opencascade.com>
Thu, 26 Jan 2012 16:04:00 +0000 (16:04 +0000)
+    FT_EqualNodes,
+    FT_EqualEdges,
+    FT_EqualFaces,
+    FT_EqualVolumes,

idl/SMESH_Filter.idl
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_DeviceActor.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESH_SWIG/smeshDC.py

index e4e7bc04fdd82e92773ae7a6fdf1a03814076fad..6983982d731a6c37a4e0ef41520871ea2c855ce8 100644 (file)
@@ -53,6 +53,10 @@ module SMESH
     FT_FreeEdges,
     FT_FreeNodes,
     FT_FreeFaces,
+    FT_EqualNodes,
+    FT_EqualEdges,
+    FT_EqualFaces,
+    FT_EqualVolumes,
     FT_MultiConnection,
     FT_MultiConnection2D,
     FT_Length,
@@ -193,6 +197,31 @@ module SMESH
    */
   interface OverConstrainedFace: Predicate {};
 
+  /*!
+   * Logical functor (predicate) "Equal Nodes".
+   * Verify whether there is another mesh node with same coordinates
+   */
+  interface EqualNodes: Predicate 
+  {
+    void    SetTolerance( in double theToler );
+    double  GetTolerance();
+  };
+  /*!
+   * Logical functor (predicate) "Equal Edges".
+   * Verify whether there is another mesh edge basing on the same nodes
+   */
+  interface EqualEdges: Predicate {};
+  /*!
+   * Logical functor (predicate) "Equal Faces".
+   * Verify whether there is another mesh face basing on the same nodes
+   */
+  interface EqualFaces: Predicate {};
+  /*!
+   * Logical functor (predicate) "Equal Volumes".
+   * Verify whether there is another mesh volumes basing on the same nodes
+   */
+  interface EqualVolumes: Predicate {};
+
   /*!
    * Logical functor (predicate) "Belong To Geometry".
    * Verify whether mesh element or node belong to pointed Geom Object
@@ -527,6 +556,11 @@ module SMESH
     FreeNodes         CreateFreeNodes();
     FreeFaces         CreateFreeFaces();
 
+    EqualNodes        CreateEqualNodes();
+    EqualEdges        CreateEqualEdges();
+    EqualFaces        CreateEqualFaces();
+    EqualVolumes      CreateEqualVolumes();
+
     RangeOfIds        CreateRangeOfIds();
 
     BadOrientedVolume CreateBadOrientedVolume();
index 23a702774ab678e8878f81f9aff1a640561cdcfb..25766c7b0dbe51f3a673f35a90ded61efdb2e2c7 100644 (file)
@@ -872,21 +872,21 @@ SetControlMode(eControl theMode,
           if (!myIsEntityModeCache){
             myEntityModeCache = GetEntityMode();
             myIsEntityModeCache=true;
-         } 
+          
           SetEntityMode(eFaces);
           break;
         default:
           if (!myIsEntityModeCache){
             myEntityModeCache = GetEntityMode();
             myIsEntityModeCache=true;
-         }
+          }
           SetEntityMode(eFaces);
         }
       }else if(myControlActor == my3DActor) {
         if (!myIsEntityModeCache){
             myEntityModeCache = GetEntityMode();
             myIsEntityModeCache=true;
-       } 
+        
         SetEntityMode(eVolumes);
     }
     }
@@ -1219,24 +1219,27 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
     if(myControlMode != eNone){
       switch(myControlMode){
       case eFreeNodes:
+      case eCoincidentNodes:
         myNodeExtActor->VisibilityOn();
         break;
       case eFreeEdges:
       case eFreeBorders:
+      case eCoincidentElems1D:
+      case eLength2D:
+      case eMultiConnection2D:
         my1DExtActor->VisibilityOn();
         break;
       case eFreeFaces:
       case eBareBorderFace:
       case eOverConstrainedFace:
+      case eCoincidentElems2D:
         my2DExtActor->VisibilityOn();
         break;
       case eBareBorderVolume:
       case eOverConstrainedVolume:
+      case eCoincidentElems3D:
         my3DExtActor->VisibilityOn();
         break;
-      case eLength2D:
-      case eMultiConnection2D:
-        my1DExtActor->VisibilityOn();
       default:
         if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
           myScalarBarActor->VisibilityOn();
index 41de5c531b566ced63b3daf5f6187c8243986457..7e2202460bbfc067f1d99d14cee68d987d2f288a 100644 (file)
@@ -489,19 +489,18 @@ SMESH_DeviceActor
        dynamic_cast<BareBorderVolume     *>(theFunctor.get()) ||
        dynamic_cast<BareBorderFace       *>(theFunctor.get()) ||
        dynamic_cast<OverConstrainedVolume*>(theFunctor.get()) ||
-       dynamic_cast<CoincidentNodes      *>(theFunctor.get()) ||
        dynamic_cast<CoincidentElements1D *>(theFunctor.get()) ||
        dynamic_cast<CoincidentElements2D *>(theFunctor.get()) ||
        dynamic_cast<CoincidentElements3D *>(theFunctor.get()) ||
        dynamic_cast<OverConstrainedFace  *>(theFunctor.get()))
   {
-    Predicate* aFreePredicate = dynamic_cast<Predicate*>(theFunctor.get());
+    Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get());
     myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
     vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid();
     vtkIdType aNbCells = aGrid->GetNumberOfCells();
     for( vtkIdType i = 0; i < aNbCells; i++ ){
       vtkIdType anObjId = myVisualObj->GetElemObjId(i);
-      if(aFreePredicate->IsSatisfy(anObjId))
+      if(aPredicate->IsSatisfy(anObjId))
         myExtractUnstructuredGrid->RegisterCell(i);
     }
     if(!myExtractUnstructuredGrid->IsCellsRegistered())
@@ -557,13 +556,15 @@ SMESH_DeviceActor
     SetUnstructuredGrid(aDataSet);
     aDataSet->Delete();
   }
-  else if(FreeNodes* aFreeNodes = dynamic_cast<FreeNodes*>(theFunctor.get()))
+  else if(dynamic_cast<FreeNodes      *>(theFunctor.get()) ||
+          dynamic_cast<CoincidentNodes*>(theFunctor.get()))
   {
+    Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get());
     myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
     vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
     for( vtkIdType i = 0; i < aNbNodes; i++ ){
       vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
-      if(aFreeNodes->IsSatisfy(anObjId))
+      if(aPredicate->IsSatisfy(anObjId))
         myExtractUnstructuredGrid->RegisterCell(i);
     }
     if(!myExtractUnstructuredGrid->IsCellsRegistered())
index 7e0f02a4146d673e208dfd4b3a1d7219d5dfb51e..685120057d9796a3246253476d326ba3e397986c 100755 (executable)
@@ -1351,7 +1351,8 @@ void SMESHGUI_FilterTable::SetCriterion (const int                       theRow,
       theCriterion.Type    == SMESH::FT_BelongToGenSurface ||
       theCriterion.Type    == SMESH::FT_BelongToGeom ||
       theCriterion.Type    == SMESH::FT_LyingOnGeom ||
-      theCriterion.Type    == SMESH::FT_CoplanarFaces)
+      theCriterion.Type    == SMESH::FT_CoplanarFaces ||
+      theCriterion.Type    == SMESH::FT_EqualNodes)
   {
     QTableWidgetItem* anItem = aTable->item(theRow, 0);
     if (!myAddWidgets.contains(anItem))
@@ -1534,6 +1535,7 @@ const char* SMESHGUI_FilterTable::getPrecision( const int aType )
   case SMESH::FT_BelongToCylinder:
   case SMESH::FT_BelongToGenSurface:
   case SMESH::FT_LyingOnGeom:
+  case SMESH::FT_EqualNodes:
     retval = "len_tol_precision"; break;
   case SMESH::FT_Length:
   case SMESH::FT_Length2D:
@@ -1729,15 +1731,19 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
     aTable->blockSignals( isSignalsBlocked );
   }
 
-  if ((aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ) ||
-      (aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ) ||
-      (aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace ||
-                                aCriterionType == SMESH::FT_OverConstrainedFace ||
-                                aCriterionType == SMESH::FT_FreeEdges ||
-                                aCriterionType == SMESH::FT_FreeFaces)) ||
-      (aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume ||
+  if ((aType == SMESH::NODE && (aCriterionType == SMESH::FT_FreeNodes               ||
+                                aCriterionType == SMESH::FT_EqualNodes ))           ||
+      (aType == SMESH::EDGE && (aCriterionType == SMESH::FT_FreeBorders             ||
+                                aCriterionType == SMESH::FT_EqualEdges ))           ||
+      (aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace          ||
+                                aCriterionType == SMESH::FT_OverConstrainedFace     ||
+                                aCriterionType == SMESH::FT_FreeEdges               ||
+                                aCriterionType == SMESH::FT_FreeFaces               ||
+                                aCriterionType == SMESH::FT_EqualFaces))            ||
+      (aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume     ||
                                   aCriterionType == SMESH::FT_OverConstrainedVolume ||
-                                  aCriterionType == SMESH::FT_BareBorderVolume)) ||
+                                  aCriterionType == SMESH::FT_BareBorderVolume      ||
+                                  aCriterionType == SMESH::FT_EqualVolumes ))       ||
       aCriterionType == SMESH::FT_LinearOrQuadratic ||
       aCriterionType == SMESH::FT_GroupColor ||
       aCriterionType == SMESH::FT_ElemGeomType ||
@@ -1980,6 +1986,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
       aCriteria[ SMESH::FT_LyingOnGeom        ] = tr("LYING_ON_GEOM");
       aCriteria[ SMESH::FT_FreeNodes          ] = tr("FREE_NODES");
       aCriteria[ SMESH::FT_GroupColor         ] = tr("GROUP_COLOR");
+      aCriteria[ SMESH::FT_EqualNodes         ] = tr("EQUAL_NODE");
     }
     return aCriteria;
   }
@@ -2000,6 +2007,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
       aCriteria[ SMESH::FT_LinearOrQuadratic  ] = tr("LINEAR");
       aCriteria[ SMESH::FT_GroupColor         ] = tr("GROUP_COLOR");
       aCriteria[ SMESH::FT_ElemGeomType       ] = tr("GEOM_TYPE");
+      aCriteria[ SMESH::FT_EqualEdges         ] = tr("EQUAL_EDGE");
     }
     return aCriteria;
   }
@@ -2031,6 +2039,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
       aCriteria[ SMESH::FT_GroupColor         ] = tr("GROUP_COLOR");
       aCriteria[ SMESH::FT_ElemGeomType       ] = tr("GEOM_TYPE");
       aCriteria[ SMESH::FT_CoplanarFaces      ] = tr("COPLANAR_FACES");
+      aCriteria[ SMESH::FT_EqualFaces         ] = tr("EQUAL_FACE");
     }
     return aCriteria;
   }
@@ -2051,6 +2060,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
       aCriteria[ SMESH::FT_LinearOrQuadratic    ] = tr("LINEAR");
       aCriteria[ SMESH::FT_GroupColor           ] = tr("GROUP_COLOR");
       aCriteria[ SMESH::FT_ElemGeomType         ] = tr("GEOM_TYPE");
+      aCriteria[ SMESH::FT_EqualVolumes         ] = tr("EQUAL_VOLUME");
     }
     return aCriteria;
   }
index 1922e98af8a2b864f0953608aeb2fcc3625d6427..9dcc32a52f2f23392cf1a6cfc29ff035fa9deff2 100644 (file)
         <source>STB_FIND_ELEM</source>
         <translation>Find Element by Point</translation>
     </message>
+    <message>
+        <source>EQUAL_NODE</source>
+        <translation>Double nodes</translation>
+    </message>
     <message>
         <source>MEN_EQUAL_NODE</source>
         <translation>Double nodes</translation>
         <source>TOP_EQUAL_NODE</source>
         <translation>Double nodes</translation>
     </message>
+    <message>
+        <source>EQUAL_EDGE</source>
+        <translation>Double edges</translation>
+    </message>
     <message>
         <source>MEN_EQUAL_EDGE</source>
         <translation>Double edges</translation>
         <source>TOP_EQUAL_EDGE</source>
         <translation>Double edges</translation>
     </message>
+    <message>
+        <source>EQUAL_FACE</source>
+        <translation>Double faces</translation>
+    </message>
     <message>
         <source>MEN_EQUAL_FACE</source>
         <translation>Double faces</translation>
         <source>TOP_EQUAL_FACE</source>
         <translation>Double faces</translation>
     </message>
+    <message>
+        <source>EQUAL_VOLUME</source>
+        <translation>Double volumes</translation>
+    </message>
     <message>
         <source>MEN_EQUAL_VOLUME</source>
         <translation>Double volumes</translation>
index b9e283308fb610df3a7797cf8a9226fc945c4042..50bd078cba814ea65c712ef1d8a089a877e6bb56 100644 (file)
@@ -901,10 +901,11 @@ class smeshDC(SMESH._objref_SMESH_Gen):
                 print "Error: The threshold value should be of SALOMEDS.Color type"
                 return None
             pass
-        elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume, FT_FreeNodes,
-                          FT_FreeFaces, FT_LinearOrQuadratic,
+        elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_FreeNodes, FT_FreeFaces,
+                          FT_LinearOrQuadratic, FT_BadOrientedVolume,
                           FT_BareBorderFace, FT_BareBorderVolume,
-                          FT_OverConstrainedFace, FT_OverConstrainedVolume]:
+                          FT_OverConstrainedFace, FT_OverConstrainedVolume,
+                          FT_EqualNodes,FT_EqualEdges,FT_EqualFaces,FT_EqualVolumes ]:
             # At this point the treshold is unnecessary
             if aTreshold ==  FT_LogicalNOT:
                 aCriterion.UnaryOp = self.EnumToLong(FT_LogicalNOT)
@@ -940,7 +941,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
     #  @param Treshold the threshold value (range of id ids as string, shape, numeric)
     #  @param UnaryOp  FT_LogicalNOT or FT_Undefined
     #  @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface,
-    #         FT_LyingOnGeom, FT_CoplanarFaces criteria
+    #         FT_LyingOnGeom, FT_CoplanarFaces and FT_EqualNodes criteria
     #  @return SMESH_Filter
     #
     #  <a href="../tui_filters_page.html#tui_filters">Example of Filters usage</a>