Patch from Erwan ADAM : fix bugs in DumpPython for NETGEN plugin when local size feature is used

This commit is contained in:
vsr 2010-06-04 06:46:25 +00:00
parent b5ae22d7e5
commit df20adf4f9
3 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#include "SALOME_Exception.idl"
#include "SMESH_Hypothesis.idl"
#include "GEOM_Gen.idl"
/*!
* NETGENPlugin: interfaces to NETGEN related hypotheses and algorithms
@ -92,6 +93,7 @@ module NETGENPlugin
void SetNbSegPerRadius(in double value);
double GetNbSegPerRadius();
void SetLocalSizeOnShape(in GEOM::GEOM_Object GeomObj, in double localSize);
void SetLocalSizeOnEntry(in string entry, in double localSize);
double GetLocalSizeOnEntry(in string entry);
string_array GetLocalSizeEntries();

View File

@ -31,6 +31,7 @@
#include "NETGENPlugin_Hypothesis_i.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_PythonDump.hxx"
#include "GEOM_Object.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
@ -274,6 +275,15 @@ CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius()
//=============================================================================
void NETGENPlugin_Hypothesis_i::SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize)
{
string entry;
entry = GeomObj->GetStudyEntry();
SetLocalSizeOnEntry(entry.c_str(), localSize);
}
//=============================================================================
void NETGENPlugin_Hypothesis_i::SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize)
{
bool valueChanged = false;
@ -281,7 +291,7 @@ void NETGENPlugin_Hypothesis_i::SetLocalSizeOnEntry(const char* entry, CORBA::Do
if ( valueChanged )
this->GetImpl()->SetLocalSizeOnEntry(entry, localSize);
if ( valueChanged )
SMESH::TPythonDump() << _this() << ".SetLocalSizeOnEntry(" << entry << ", " << localSize << ")";
SMESH::TPythonDump() << _this() << ".SetLocalSizeOnShape(" << entry << ", " << localSize << ")";
}
//=============================================================================

View File

@ -40,6 +40,7 @@
#include "NETGENPlugin_Hypothesis.hxx"
class SMESH_Gen;
//class GEOM_Object;
// NETGENPlugin parameters hypothesis
@ -76,6 +77,7 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i:
void SetNbSegPerRadius(CORBA::Double theVal);
CORBA::Double GetNbSegPerRadius();
void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize);
void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
CORBA::Double GetLocalSizeOnEntry(const char* entry);
NETGENPlugin::string_array* GetLocalSizeEntries();