From b3fe66157cc51539413e4a7a524627c74c61321d Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 19 Nov 2010 09:26:23 +0000 Subject: [PATCH] 020716: EDF 1229 SMESH : Improvement of reversed edges dialog box add geom filters --- .../StdMeshersGUI_SubShapeSelectorWdg.cxx | 34 ++++++++++++++++--- .../StdMeshersGUI_SubShapeSelectorWdg.h | 3 ++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx index 8b5481121..9a8e3827c 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx @@ -24,14 +24,15 @@ #include "StdMeshersGUI_SubShapeSelectorWdg.h" // SMESH Includes -#include +#include "SMESH_Type.h" #include "SMESHGUI_MeshUtils.h" -#include -#include -#include +#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 @@ -49,6 +50,8 @@ // GEOM Includes #include +#include +#include // Qt includes #include @@ -63,10 +66,12 @@ #include #include #include +#include // SALOME KERNEL includes #include + #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() ) { diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h index b29840bdf..591d28b6f 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h @@ -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 myGeomFilters; + SUIT_SelectionFilter* myFilter; }; #endif // STDMESHERSGUI_SUBSHAPESELECTORWDG_H -- 2.30.2