Salome HOME
PAL10953. protection against creating sub-mesh in an imported mesh
authoreap <eap@opencascade.com>
Fri, 13 Jan 2006 11:14:24 +0000 (11:14 +0000)
committereap <eap@opencascade.com>
Fri, 13 Jan 2006 11:14:24 +0000 (11:14 +0000)
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/SMESHGUI/SMESH_msg_en.po

index 7e590a8b676482fee8488a844fc234a64892ff81..57103003df755799fd70c7b681ec80928c27e696 100644 (file)
@@ -500,6 +500,20 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
     return false;
   }
 
+  // Imported mesh, if create sub-mesh or edit mesh
+  if ( !myToCreate || ( myToCreate && !myIsMesh ))
+  {
+    QString aMeshEntry = myDlg->selectedObject
+      ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
+    if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() )) {
+      SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
+      if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) {
+        theMess = tr( "IMPORTED_MESH" );
+        return false;
+      }
+    }
+  }
+
   // Geom
   if ( myToCreate )
   {
@@ -538,6 +552,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
       }
     }
   }
+    
   return true;
 }
 
index ba1f4f80a3792aa020a8f13c42523c368344f388..54287cd1c6adeb3ae51453c6d8345404c06f8da0 100644 (file)
@@ -1,3 +1,18 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2006-01-13 13:50+0300\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
@@ -2957,6 +2972,9 @@ msgstr "A submesh on the selected geometry already exists.\n Do you want to edit
 msgid "SMESHGUI_MeshOp::MESH_IS_NULL"
 msgstr "Mesh is null"
 
+msgid "SMESHGUI_MeshOp::IMPORTED_MESH"
+msgstr "Mesh is not built on geometry"
+
 msgid "SMESHGUI_MeshOp::INVALID_SUBSHAPE"
 msgstr "Geometry object is not a subshape of the shape to mesh"