#include <SalomeApp_SelectionMgr.h>
#include <SalomeApp_Tools.h>
+#include <SalomeApp_UpdateFlags.h>
#include <TColStd_MapOfInteger.hxx>
+#include <GEOMBase.h>
+
//=================================================================================
// function : Constructor
// purpose :
myHypothesisFilter( 0 ),
myAlgorithmFilter( 0 )
{
+ setAutoResumed( true );
}
//=================================================================================
myHypothesisFilter = new SMESH_TypeFilter (HYPOTHESIS);
init();
- myDlg->clearSelection();
myDlg->show();
}
}
}
}
- // commit transaction
- //update( UF_Model | UF_ObjBrowser );
- module()->updateObjBrowser( true, 0 );
+ update( UF_Model | UF_ObjBrowser );
+
init();
return true;
}
void SMESHGUI_InitMeshOp::init()
{
if( myDlg )
+ {
myDlg->setMeshName( defaultMeshName() );
+ myDlg->clearSelection();
+ myDlg->updateControlState();
+ }
}
//=================================================================================
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 );
+ }
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool SMESHGUI_InitMeshOp::isValid( SUIT_Operation* theOtherOp ) const
+{
+ if ( theOtherOp && theOtherOp->inherits( "SMESHGUI_AddSubMeshOp" ) )
+ return true;
+ else
+ return false;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+