fix script SALOME_TESTS/Grids/smesh/bugs_00/A3

prevent publishing, that was forbidden
This commit is contained in:
eap 2018-07-16 19:01:43 +03:00
parent ec2b6eb2fb
commit 78a29bb103
3 changed files with 20 additions and 8 deletions

View 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();

View 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:

View 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