From: eap Date: Mon, 16 Jul 2018 16:01:43 +0000 (+0300) Subject: fix script SALOME_TESTS/Grids/smesh/bugs_00/A3 X-Git-Tag: SHAPER_V9_1_0RC1~17^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=78a29bb10360e6b832b47399d665ec86fb3db7e3;hp=ec2b6eb2fb72bce2449d1c0eeb24ad157e571eab fix script SALOME_TESTS/Grids/smesh/bugs_00/A3 prevent publishing, that was forbidden --- diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index dc21b915c..a73f93c3c 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -165,7 +165,7 @@ bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) { if(MYDEBUG) MESSAGE("CanPublishInStudy - "<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(); diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index efa9d0c15..9c039d146 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -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: diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 8706efa1b..f64b1e533 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -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 ` 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 ` 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