mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 10:08:34 +05:00
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
- StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0 ); + StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0, + TopAbs_ShapeEnum aSubShType = TopAbs_EDGE ); + void setFilter();
This commit is contained in:
parent
b01dba1ff2
commit
b0cd839dd0
@ -50,7 +50,7 @@
|
||||
|
||||
// GEOM Includes
|
||||
#include <GEOMBase.h>
|
||||
#include <GEOM_EdgeFilter.h>
|
||||
#include <GEOM_TypeFilter.h>
|
||||
#include <GEOM_CompoundFilter.h>
|
||||
|
||||
// Qt includes
|
||||
@ -82,7 +82,7 @@
|
||||
//================================================================================
|
||||
|
||||
StdMeshersGUI_SubShapeSelectorWdg
|
||||
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent ):
|
||||
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent, TopAbs_ShapeEnum aSubShType ):
|
||||
QWidget( parent ),
|
||||
myPreviewActor( 0 ),
|
||||
myMaxSize( -1 )
|
||||
@ -108,7 +108,7 @@ StdMeshersGUI_SubShapeSelectorWdg
|
||||
setLayout( edgesLayout );
|
||||
setMinimumWidth( 300 );
|
||||
|
||||
mySubShType = TopAbs_EDGE;
|
||||
mySubShType = aSubShType;
|
||||
|
||||
init();
|
||||
}
|
||||
@ -166,15 +166,8 @@ 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 );
|
||||
myFilter=0;
|
||||
//setFilter();
|
||||
|
||||
connect( myAddButton, SIGNAL(clicked()), SLOT(onAdd()));
|
||||
connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
|
||||
@ -185,6 +178,24 @@ void StdMeshersGUI_SubShapeSelectorWdg::init()
|
||||
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
|
||||
@ -371,7 +382,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onListSelectionChanged()
|
||||
|
||||
//=================================================================================
|
||||
// function : setGeomShape
|
||||
// purpose : Called to set geometry
|
||||
// purpose : Called to set geometry whose sub-shapes are selected
|
||||
//================================================================================
|
||||
void StdMeshersGUI_SubShapeSelectorWdg::SetGeomShapeEntry( const QString& theEntry )
|
||||
{
|
||||
@ -484,7 +495,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::SetListOfIDs( SMESH::long_array_var theI
|
||||
|
||||
//=================================================================================
|
||||
// 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 )
|
||||
{
|
||||
|
@ -52,7 +52,8 @@ class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
|
||||
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();
|
||||
@ -79,10 +80,11 @@ public:
|
||||
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();
|
||||
@ -98,8 +100,8 @@ private:
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user