]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
020716: EDF 1229 SMESH : Improvement of reversed edges dialog box
authoreap <eap@opencascade.com>
Fri, 19 Nov 2010 09:26:23 +0000 (09:26 +0000)
committereap <eap@opencascade.com>
Fri, 19 Nov 2010 09:26:23 +0000 (09:26 +0000)
   add geom filters

src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h

index 8b5481121b1002f478ef19720a114f8b2f1003f7..9a8e3827cdba266006dc49908b8f40e824c8512e 100644 (file)
 #include "StdMeshersGUI_SubShapeSelectorWdg.h"
 
 // SMESH Includes
-#include <SMESH_Type.h>
+#include "SMESH_Type.h"
 #include "SMESHGUI_MeshUtils.h"
-#include <SMESH_Actor.h>
-#include <SMESH_PreviewActorsCollection.h>
-#include <SMESH_ActorUtils.h>
+#include "SMESH_Actor.h"
+#include "SMESH_PreviewActorsCollection.h"
+#include "SMESH_ActorUtils.h"
 #include "SMESHGUI_GroupUtils.h"
 #include "SMESH_Gen_i.hxx"
 #include "SMESHGUI_GEOMGenUtils.h"
+#include "SMESH_LogicalFilter.hxx"
 
 // SVTK Includes
 #include <SVTK_ViewWindow.h>
@@ -49,6 +50,8 @@
 
 // GEOM Includes
 #include <GEOMBase.h>
+#include <GEOM_EdgeFilter.h>
+#include <GEOM_CompoundFilter.h>
 
 // Qt includes
 #include <QPushButton>
 #include <TopoDS_Shape.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
+#include <StdSelect_TypeOfEdge.hxx>
 
 // SALOME KERNEL includes
 #include <SALOMEDS_SObject.hxx>
 
+
 #define SPACING 6
 #define MARGIN 0
 
@@ -128,6 +133,14 @@ StdMeshersGUI_SubShapeSelectorWdg::~StdMeshersGUI_SubShapeSelectorWdg()
   myEntry = "";
   myParamValue = "";
   myMainShape.Nullify();
+
+  if ( mySelectionMgr && myFilter )
+    mySelectionMgr->removeFilter( myFilter );
+  delete myFilter; myFilter=0;
+
+  SUIT_SelectionFilter* filter;
+  foreach( filter, myGeomFilters )
+    delete filter;
 }
 
 //================================================================================
@@ -153,6 +166,16 @@ void StdMeshersGUI_SubShapeSelectorWdg::init()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode( ActorSelection );
 
+
+  SalomeApp_Study* study = mySMESHGUI->activeStudy();
+  GEOM_EdgeFilter* edgeFilter = new GEOM_EdgeFilter(study,StdSelect_AnyEdge);
+  GEOM_CompoundFilter* gpoupFilter = new GEOM_CompoundFilter(study);
+  gpoupFilter->addSubType( TopAbs_EDGE );
+  myGeomFilters.append( edgeFilter );
+  myGeomFilters.append( gpoupFilter );
+  myFilter = new SMESH_LogicalFilter( myGeomFilters, SMESH_LogicalFilter::LO_OR );
+  mySelectionMgr->installFilter( myFilter );
+
   connect( myAddButton,    SIGNAL(clicked()), SLOT(onAdd()));
   connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
   
@@ -222,7 +245,8 @@ void StdMeshersGUI_SubShapeSelectorWdg::SelectionIntoArgument()
           aFatherEntry = aGeomFatherObj->GetStudyEntry();
         }
         
-        if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
+        if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) )
+        {
           if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
             GEOMBase::GetShape(aGeomObj, shape); 
             if ( !shape.IsNull() ) {
index b29840bdff7f71a2e416812f3e2bb6851ab1403d..591d28b6f8af53465eacaa3f7253cc691d1264ea 100644 (file)
@@ -45,6 +45,7 @@ class QListWidget;
 class SMESH_Actor;
 class SMESH_PreviewActorsCollection;
 class vtkRenderer;
+class SUIT_SelectionFilter;
 
 class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
 {
@@ -119,6 +120,8 @@ private:
   TopAbs_ShapeEnum               mySubShType;
   
   SMESH_PreviewActorsCollection* myPreviewActor;
+  QList<SUIT_SelectionFilter*>   myGeomFilters;
+  SUIT_SelectionFilter*          myFilter;
 };
 
 #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H