23051: [CEA 1470] SMESH NetGen - Local refinement not computed and dumped properly

Add protection against not published shapes passed to SetLocalSizeOnShape()
This commit is contained in:
eap 2015-04-23 18:03:26 +03:00
parent 03ed7cce3e
commit 9b3c975bfe
4 changed files with 10 additions and 2 deletions

View File

@ -104,7 +104,8 @@ module NETGENPlugin
void SetFuseEdges(in boolean value); void SetFuseEdges(in boolean value);
boolean GetFuseEdges(); boolean GetFuseEdges();
void SetLocalSizeOnShape(in GEOM::GEOM_Object GeomObj, in double localSize); void SetLocalSizeOnShape(in GEOM::GEOM_Object GeomObj, in double localSize)
raises (SALOME::SALOME_Exception);
void SetLocalSizeOnEntry(in string entry, in double localSize); void SetLocalSizeOnEntry(in string entry, in double localSize);
double GetLocalSizeOnEntry(in string entry); double GetLocalSizeOnEntry(in string entry);
string_array GetLocalSizeEntries(); string_array GetLocalSizeEntries();

View File

@ -311,9 +311,13 @@ CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius()
void NETGENPlugin_Hypothesis_i::SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, void NETGENPlugin_Hypothesis_i::SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj,
CORBA::Double localSize) CORBA::Double localSize)
throw (SALOME::SALOME_Exception)
{ {
string entry; string entry;
entry = GeomObj->GetStudyEntry(); entry = GeomObj->GetStudyEntry();
if ( entry.empty() )
THROW_SALOME_CORBA_EXCEPTION( "SetLocalSizeOnShape(), shape is not published in study!",
SALOME::BAD_PARAM );
SetLocalSizeOnEntry(entry.c_str(), localSize); SetLocalSizeOnEntry(entry.c_str(), localSize);
} }

View File

@ -79,7 +79,8 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i:
void SetNbSegPerRadius(CORBA::Double theVal); void SetNbSegPerRadius(CORBA::Double theVal);
CORBA::Double GetNbSegPerRadius(); CORBA::Double GetNbSegPerRadius();
void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize); void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize)
throw (SALOME::SALOME_Exception);
void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize); void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
CORBA::Double GetLocalSizeOnEntry(const char* entry); CORBA::Double GetLocalSizeOnEntry(const char* entry);
NETGENPlugin::string_array* GetLocalSizeEntries(); NETGENPlugin::string_array* GetLocalSizeEntries();

View File

@ -212,8 +212,10 @@ void NETGENPlugin_Mesher::SetDefaultParameters()
* *
*/ */
//============================================================================= //=============================================================================
void SetLocalSize(TopoDS_Shape GeomShape, double LocalSize) void SetLocalSize(TopoDS_Shape GeomShape, double LocalSize)
{ {
if ( GeomShape.IsNull() ) return;
TopAbs_ShapeEnum GeomType = GeomShape.ShapeType(); TopAbs_ShapeEnum GeomType = GeomShape.ShapeType();
if (GeomType == TopAbs_COMPOUND) { if (GeomType == TopAbs_COMPOUND) {
for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()) { for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()) {