Salome HOME
fix script SALOME_TESTS/Grids/smesh/bugs_00/A3
authoreap <eap@opencascade.com>
Mon, 16 Jul 2018 16:01:43 +0000 (19:01 +0300)
committereap <eap@opencascade.com>
Mon, 16 Jul 2018 16:01:43 +0000 (19:01 +0300)
   prevent publishing, that was forbidden

src/SMESH_I/SMESH_Gen_i_1.cxx
src/SMESH_SWIG/StdMeshersBuilder.py
src/SMESH_SWIG/smeshBuilder.py

index dc21b915cd32f6004ffd9ad9220fec1df464efd9..a73f93c3c0417fcd49ad3dd738dc02fb01b7f0aa 100644 (file)
@@ -165,7 +165,7 @@ bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
 {
   if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(getStudyServant()));
   
-  if( !myIsEnablePublish )
+  if ( !myIsEnablePublish )
     return false;
 
   SMESH::SMESH_Mesh_var aMesh       = SMESH::SMESH_Mesh::_narrow(theIOR);
@@ -479,6 +479,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObje
 {
   Unexpect aCatch(SALOME_SalomeException);
   SALOMEDS::SObject_wrap aSO;
+  if ( !myIsEnablePublish )
+    return aSO._retn();
   if ( CORBA::is_nil( theIOR ))
     return aSO._retn();
   if(MYDEBUG) MESSAGE("PublishInStudy");
@@ -521,6 +523,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObje
 SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
 {
   if(MYDEBUG) MESSAGE("PublishComponent");
+  if ( !myIsEnablePublish )
+    return SALOMEDS::SComponent::_nil();
 
   SALOMEDS::StudyBuilder_var    aStudyBuilder  = getStudyServant()->NewBuilder();
   SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
@@ -572,8 +576,10 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
 SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
                                                 const char*           theName)
 {
+  if ( !myIsEnablePublish )
+    return SALOMEDS::SObject::_nil();
   if ( CORBA::is_nil( theMesh ))
-    return SALOMEDS::SComponent::_nil();
+    return SALOMEDS::SObject::_nil();
   if(MYDEBUG) MESSAGE("PublishMesh--IN");
 
   // find or publish a mesh
@@ -659,6 +665,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr    theM
                                                    GEOM::GEOM_Object_ptr    theShapeObject,
                                                    const char*              theName)
 {
+  if ( !myIsEnablePublish )
+    return SALOMEDS::SObject::_nil();
   if ( theMesh->_is_nil() || theSubMesh->_is_nil() || theShapeObject->_is_nil() )
     return SALOMEDS::SObject::_nil();
 
@@ -749,6 +757,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SMESH::SMESH_Mesh_ptr  theMesh,
                                                  GEOM::GEOM_Object_ptr  theShapeObject,
                                                  const char*            theName)
 {
+  if ( !myIsEnablePublish )
+    return SALOMEDS::SObject::_nil();
   if (theMesh->_is_nil() || theGroup->_is_nil() )
     return SALOMEDS::SObject::_nil();
 
@@ -823,6 +833,8 @@ SALOMEDS::SObject_ptr
                                   const char*                 theName)
 {
   if(MYDEBUG) MESSAGE("PublishHypothesis")
+  if ( !myIsEnablePublish )
+    return SALOMEDS::SObject::_nil();
   if (theHyp->_is_nil())
     return SALOMEDS::SObject::_nil();
 
index efa9d0c15bbf29919a080a681f2ee0f2e863da63..9c039d146616595b057dbde3d9873fd82d40b7e8 100644 (file)
@@ -169,7 +169,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
     
 
         hyp = self.Hypothesis("MaxLength", [length], UseExisting=UseExisting)
-        if length > 0.0:
+        if isinstance(length,str) or length > 0:
             # set given length
             hyp.SetLength(length)
         if not UseExisting:
index 8706efa1b39ab8500192c7de92ba09a80b3ff338..f64b1e5334c451e187531975a2d8460111d1de57 100644 (file)
@@ -4167,7 +4167,7 @@ class Mesh(metaclass = MeshMeta):
     def GetPointState(self, x, y, z):
         """
         Return point state in a closed 2D mesh in terms of TopAbs_State enumeration:
-        0-IN, 1-OUT, 2-ON, 3-UNKNOWN.
+        smesh.TopAbs_IN, smesh.TopAbs_OUT, smesh.TopAbs_ON and smesh.TopAbs_UNKNOWN.
         UNKNOWN state means that either mesh is wrong or the analysis fails.
         """
 
@@ -5608,7 +5608,7 @@ class Mesh(metaclass = MeshMeta):
         Parameters:
             IDsOfElements: list of elements ids
             Mirror: is :class:`SMESH.AxisStruct` or geom object (point, line, plane)
-            theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
+            theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
                 If the *Mirror* is a geom object this parameter is unnecessary
             Copy: allows to copy element (Copy is 1) or to replace with its mirroring (Copy is 0)
             MakeGroups: forces the generation of new groups from existing ones (if Copy)
@@ -5636,7 +5636,7 @@ class Mesh(metaclass = MeshMeta):
         Parameters:
             IDsOfElements: the list of elements ids
             Mirror: is :class:`SMESH.AxisStruct` or geom object (point, line, plane)
-            theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
+            theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
                 If the *Mirror* is a geom object this parameter is unnecessary
             MakeGroups: to generate new groups from existing ones
             NewMeshName: a name of the new mesh to create
@@ -5663,7 +5663,7 @@ class Mesh(metaclass = MeshMeta):
         Parameters:
             theObject: :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`
             Mirror: :class:`SMESH.AxisStruct` or geom object (point, line, plane)
-            theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
+            theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
                 If the *Mirror* is a geom object this parameter is unnecessary
             Copy: allows copying the element (Copy==True) or replacing it with its mirror (Copy==False)
             MakeGroups: forces the generation of new groups from existing ones (if Copy)
@@ -5691,7 +5691,7 @@ class Mesh(metaclass = MeshMeta):
         Parameters:
             theObject: :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`
             Mirror: :class:`SMESH.AxisStruct` or geom object (point, line, plane)
-            theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
+            theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
                 If the *Mirror* is a geom object this parameter is unnecessary
             MakeGroups: forces the generation of new groups from existing ones
             NewMeshName: the name of the new mesh to create