// GEOM Includes
#include <GEOMBase.h>
-#include <GEOM_EdgeFilter.h>
+#include <GEOM_TypeFilter.h>
#include <GEOM_CompoundFilter.h>
// Qt includes
//================================================================================
StdMeshersGUI_SubShapeSelectorWdg
-::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent ):
+::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent, TopAbs_ShapeEnum aSubShType ):
QWidget( parent ),
myPreviewActor( 0 ),
myMaxSize( -1 )
setLayout( edgesLayout );
setMinimumWidth( 300 );
- mySubShType = TopAbs_EDGE;
+ mySubShType = aSubShType;
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 );
+ myFilter=0;
+ //setFilter();
connect( myAddButton, SIGNAL(clicked()), SLOT(onAdd()));
connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
updateState();
}
+//================================================================================
+/*!
+ * \brief Install filters to select sub-shapes of mySubShType or their groups
+ */
+//================================================================================
+
+void StdMeshersGUI_SubShapeSelectorWdg::setFilter()
+{
+ SalomeApp_Study* study = mySMESHGUI->activeStudy();
+ GEOM_TypeFilter* typeFilter = new GEOM_TypeFilter(study, mySubShType, /*isShapeType=*/true );
+ GEOM_CompoundFilter* gpoupFilter = new GEOM_CompoundFilter(study);
+ gpoupFilter->addSubType( mySubShType );
+ myGeomFilters.append( typeFilter );
+ myGeomFilters.append( gpoupFilter );
+ myFilter = new SMESH_LogicalFilter( myGeomFilters, SMESH_LogicalFilter::LO_OR );
+ mySelectionMgr->installFilter( myFilter );
+}
+
//================================================================================
/*!
* Create a layout, initialize fields
//=================================================================================
// function : setGeomShape
-// purpose : Called to set geometry
+// purpose : Called to set geometry whose sub-shapes are selected
//================================================================================
void StdMeshersGUI_SubShapeSelectorWdg::SetGeomShapeEntry( const QString& theEntry )
{
//=================================================================================
// function : SetMainShapeEntry
-// purpose : Called to set the Main Object Entry
+// purpose : Called to set the Entry of main shape of the mesh
//=================================================================================
void StdMeshersGUI_SubShapeSelectorWdg::SetMainShapeEntry( const QString& theEntry )
{
Q_OBJECT
public:
- StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0 );
+ StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
+ TopAbs_ShapeEnum aSubShType = TopAbs_EDGE );
~StdMeshersGUI_SubShapeSelectorWdg();
SMESH::long_array_var GetListOfIDs();
int GetListSize() { return myListOfIDs.size(); }
void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; }
- void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
+ //void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }
private:
void updateState();
+ void setFilter();
private slots:
void onAdd();
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
SVTK_Selector* mySelector;
SMESH::SMESH_Mesh_var myMesh;
- TopoDS_Shape myGeomShape;
- TopoDS_Shape myMainShape;
+ TopoDS_Shape myGeomShape; // shape whose sub-shapes are selected
+ TopoDS_Shape myMainShape; // main shape of the mesh
QString myEntry;
QString myMainEntry;
vtkRenderer* myRenderer;