}
}
+ //================================================================================
+ /*!
+ * \brief Return true if a mesh icon == ICON_SMESH_TREE_GEOM_MODIF
+ * which means that the mesh can't be modified. It should be either re-computed
+ * or breakShaperLink()'ed. Warn the user about it.
+ */
+ //================================================================================
+
+ bool warnOnGeomModif()
+ {
+ SALOME_ListIO selected;
+ if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
+ aSel->selectedObjects(selected,"",/*convertReferences=*/false);
+
+ SALOME_ListIteratorOfListIO It( selected );
+ for ( ; It.More(); It.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = It.Value();
+ if ( !io->hasEntry() ) continue;
+ _PTR(SObject) so = SMESH::getStudy()->FindObjectID( io->getEntry() );
+ SMESH::SMESH_Mesh_var mesh;
+ while ( mesh->_is_nil() && so )
+ {
+ CORBA::Object_var obj = SMESH::SObjectToObject( so );
+ SMESH::SMESH_IDSource_var isrc = SMESH::SMESH_IDSource::_narrow( obj );
+ if ( isrc->_is_nil() )
+ so = so->GetFather();
+ else
+ mesh = isrc->GetMesh();
+ }
+ if ( mesh->_is_nil() ) continue;
+ so = SMESH::FindSObject( mesh );
+ if ( !so ) continue;
+ _PTR(GenericAttribute) attr;
+ so->FindAttribute( attr, "AttributePixMap" );
+ _PTR(AttributePixMap) pixmap = attr;
+ if ( !pixmap ) continue;
+
+ if ( pixmap->GetPixMap() == "ICON_SMESH_TREE_GEOM_MODIF" )
+ {
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("MSG_WARN_ON_GEOM_MODIF"));
+ return true;
+ }
+ }
+ return false;
+ }
+
void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap)
{
SALOME_ListIO selected;
break;
}
- case SMESHOp::OpCreateMesh:
- case SMESHOp::OpCreateSubMesh:
case SMESHOp::OpEditMeshOrSubMesh:
case SMESHOp::OpEditMesh:
case SMESHOp::OpEditSubMesh:
+ case SMESHOp::OpMeshOrder:
+ case SMESHOp::OpCreateSubMesh:
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
+
+ case SMESHOp::OpCreateMesh:
case SMESHOp::OpCompute:
case SMESHOp::OpComputeSubMesh:
case SMESHOp::OpPreCompute:
case SMESHOp::OpEvaluate:
- case SMESHOp::OpMeshOrder:
startOperation( theCommandID );
break;
case SMESHOp::OpCopyMesh:
if ( isStudyLocked() )
break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
/*Standard_Boolean aRes;
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IObject);
if ( isStudyLocked() )
break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
SMESHGUI_MultiEditDlg* aDlg = NULL;
case SMESHOp::OpSmoothing:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_SmoothingDlg( this ) )->show();
case SMESHOp::OpExtrusion:
{
if (isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if (vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_ExtrusionDlg ( this ) )->show();
case SMESHOp::OpExtrusionAlongAPath:
{
if (isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if (vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
case SMESHOp::OpRevolution:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RevolutionDlg( this ) )->show();
{
if ( isStudyLocked() )
break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd )
{
EmitSignalDeactivateDialog();
case SMESHOp::OpReorientFaces:
case SMESHOp::OpCreateGeometryGroup:
{
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
startOperation( theCommandID );
break;
}
}
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
}
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
}
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
if ( isStudyLocked() )
break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
{
if ( isStudyLocked() )
break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
SMESHGUI_GroupOpDlg* aDlg = new SMESHGUI_DimGroupDlg( this );
{
if ( isStudyLocked() )
break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
EmitSignalDeactivateDialog();
SMESHGUI_FaceGroupsSeparatedByEdgesDlg* aDlg = new SMESHGUI_FaceGroupsSeparatedByEdgesDlg( this );
case SMESHOp::OpEditHypothesis:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected;
case SMESHOp::OpUnassign: // REMOVE HYPOTHESIS / ALGORITHMS
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
SUIT_OverrideCursor wc;
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
case SMESHOp::OpHexagonalPrism:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
SMDSAbs_EntityType type = SMDSEntity_Edge;
case SMESHOp::OpPolyhedron:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
case SMESHOp::OpTriQuadraticHexahedron:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
SMDSAbs_EntityType type = SMDSEntity_Last;
case SMESHOp::OpRemoveNodes:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RemoveNodesDlg( this ) )->show();
case SMESHOp::OpRemoveElements: // REMOVES ELEMENTS
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RemoveElementsDlg( this ) )->show();
case SMESHOp::OpClearMesh: {
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
SALOME_ListIO selected;
if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
case SMESHOp::OpRemoveOrphanNodes:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
SALOME_ListIO selected;
if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
aSel->selectedObjects( selected );
case SMESHOp::OpRenumberingNodes:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
case SMESHOp::OpRenumberingElements:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
case SMESHOp::OpTranslation:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_TranslationDlg( this ) )->show();
case SMESHOp::OpRotation:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RotationDlg( this ) )->show();
case SMESHOp::OpSymmetry:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if(vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_SymmetryDlg( this ) )->show();
case SMESHOp::OpScale:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_ScaleDlg( this ) )->show();
case SMESHOp::OpOffset:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_OffsetDlg( this ) )->show();
case SMESHOp::OpSewing:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if(vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_SewingDlg( this ) )->show();
case SMESHOp::OpMergeNodes:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if(vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_MergeDlg( this, 0 ) )->show();
case SMESHOp::OpMergeElements:
{
if (isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if (vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_MergeDlg( this, 1 ) )->show();
}
case SMESHOp::OpMoveNode: // MAKE MESH PASS THROUGH POINT
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
startOperation( SMESHOp::OpMoveNode );
break;
case SMESHOp::OpDuplicateNodes:
{
if(isStudyLocked()) break;
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_DuplicateNodesDlg( this ) )->show();
}
case SMESHOp::OpElem0DOnElemNodes: // 0D_ON_ALL_NODES
+ if ( warnOnGeomModif() )
+ break; // action forbiden as geometry modified
startOperation( SMESHOp::OpElem0DOnElemNodes );
break;