0020279: [CEA 334] control the "random" use when using mesh algorithms

fix GetHypothesisList() for mesh w/o shape
This commit is contained in:
eap 2009-05-19 15:31:06 +00:00
parent ea772b0267
commit f33734eda1

View File

@ -568,7 +568,7 @@ throw(SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
if (MYDEBUG) MESSAGE("GetHypothesisList"); if (MYDEBUG) MESSAGE("GetHypothesisList");
if (CORBA::is_nil(aSubShapeObject)) if (_impl->HasShapeToMesh() && CORBA::is_nil(aSubShapeObject))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM); SALOME::BAD_PARAM);
@ -576,6 +576,8 @@ throw(SALOME::SALOME_Exception)
try { try {
TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(aSubShapeObject); TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(aSubShapeObject);
if ( myLocSubShape.IsNull() && !_impl->HasShapeToMesh() )
myLocSubShape = _impl->GetShapeToMesh();
const list<const SMESHDS_Hypothesis*>& aLocalList = _impl->GetHypothesisList( myLocSubShape ); const list<const SMESHDS_Hypothesis*>& aLocalList = _impl->GetHypothesisList( myLocSubShape );
int i = 0, n = aLocalList.size(); int i = 0, n = aLocalList.size();
aList->length( n ); aList->length( n );