mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-12 23:44:32 +05:00
full checking of geom selection
This commit is contained in:
parent
71c8ad7da0
commit
aba480e0e8
@ -57,7 +57,7 @@ SMESHGUI_InitMeshDlg::SMESHGUI_InitMeshDlg( SMESHGUI* theModule )
|
||||
GroupC1->layout()->setSpacing(6);
|
||||
GroupC1->layout()->setMargin(11);
|
||||
|
||||
myMeshNameLabel = new QLabel(tr("SMESH_NAME"), GroupC1, "TextLabel_NameMesh");
|
||||
new QLabel(tr("SMESH_NAME"), GroupC1, "TextLabel_NameMesh");
|
||||
GroupC1->addSpace(1);
|
||||
myMeshName = new QLineEdit(GroupC1, "LineEdit_NameMesh");
|
||||
|
||||
@ -72,8 +72,6 @@ SMESHGUI_InitMeshDlg::SMESHGUI_InitMeshDlg( SMESHGUI* theModule )
|
||||
setObjectType( Algo, _smesh + ALGORITHM, -1 );
|
||||
|
||||
main->addWidget( GroupC1 );
|
||||
|
||||
updateControlState();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
|
@ -52,7 +52,6 @@ public:
|
||||
QString meshName() const;
|
||||
|
||||
private:
|
||||
QLabel* myMeshNameLabel;
|
||||
QLineEdit* myMeshName;
|
||||
|
||||
};
|
||||
|
@ -43,9 +43,12 @@
|
||||
|
||||
#include <SalomeApp_SelectionMgr.h>
|
||||
#include <SalomeApp_Tools.h>
|
||||
#include <SalomeApp_UpdateFlags.h>
|
||||
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
|
||||
#include <GEOMBase.h>
|
||||
|
||||
//=================================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
@ -107,7 +110,6 @@ void SMESHGUI_InitMeshOp::startOperation()
|
||||
myHypothesisFilter = new SMESH_TypeFilter (HYPOTHESIS);
|
||||
|
||||
init();
|
||||
myDlg->clearSelection();
|
||||
myDlg->show();
|
||||
}
|
||||
|
||||
@ -230,10 +232,9 @@ bool SMESHGUI_InitMeshOp::onApply()
|
||||
}
|
||||
}
|
||||
}
|
||||
// commit transaction
|
||||
|
||||
//update( UF_Model | UF_ObjBrowser );
|
||||
module()->updateObjBrowser( true, 0 );
|
||||
update( UF_Model | UF_ObjBrowser );
|
||||
|
||||
init();
|
||||
return true;
|
||||
}
|
||||
@ -264,7 +265,11 @@ QString SMESHGUI_InitMeshOp::defaultMeshName() const
|
||||
void SMESHGUI_InitMeshOp::init()
|
||||
{
|
||||
if( myDlg )
|
||||
{
|
||||
myDlg->setMeshName( defaultMeshName() );
|
||||
myDlg->clearSelection();
|
||||
myDlg->updateControlState();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -295,3 +300,24 @@ SMESH::SMESH_Mesh_var SMESHGUI_InitMeshOp::initMesh ( GEOM::GEOM_Object_ptr theS
|
||||
|
||||
return aMesh._retn();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : defaultMeshName()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void SMESHGUI_InitMeshOp::onSelectionChanged( int id )
|
||||
{
|
||||
if( !myDlg->hasSelection( id ) )
|
||||
return;
|
||||
|
||||
if( id==SMESHGUI_InitMeshDlg::GeomObj )
|
||||
{
|
||||
QStringList selGeom;
|
||||
myDlg->selectedObject( SMESHGUI_InitMeshDlg::GeomObj, selGeom );
|
||||
|
||||
_PTR(SObject) aGeomSO = studyDS()->FindObjectID( selGeom.first() );
|
||||
GEOM::GEOM_Object_var myGeomShape = GEOM::GEOM_Object::_narrow( _CAST(SObject,aGeomSO)->GetObject() );
|
||||
if( myGeomShape->_is_nil() || !GEOMBase::IsShape( myGeomShape ) )
|
||||
myDlg->clearSelection( id );
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ protected slots:
|
||||
|
||||
private slots:
|
||||
void onActivateObject( int );
|
||||
void onSelectionChanged( int );
|
||||
|
||||
private:
|
||||
SMESHGUI_InitMeshDlg *myDlg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user