Salome HOME
Merge from V5_1_main 10/06/2010
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_i.cxx
index b9ac7823c8ca6f742ad01a5cd008abeeafa5b36c..04bd830c3973719e292d9bd515ef32dfe661d4ca 100644 (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"
@@ -272,6 +273,58 @@ CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius()
   return this->GetImpl()->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;
+  valueChanged = ( this->GetImpl()->GetLocalSizeOnEntry(entry) != localSize );
+  if ( valueChanged )
+    this->GetImpl()->SetLocalSizeOnEntry(entry, localSize);
+  if ( valueChanged )
+    SMESH::TPythonDump() << _this() << ".SetLocalSizeOnShape(" << entry << ", " << localSize << ")";
+}
+
+//=============================================================================
+
+CORBA::Double NETGENPlugin_Hypothesis_i::GetLocalSizeOnEntry(const char* entry)
+{
+  return this->GetImpl()->GetLocalSizeOnEntry(entry);
+}
+
+//=============================================================================
+
+NETGENPlugin::string_array* NETGENPlugin_Hypothesis_i::GetLocalSizeEntries()
+{
+  NETGENPlugin::string_array_var result = new NETGENPlugin::string_array();
+  const ::NETGENPlugin_Hypothesis::TLocalSize localSizes = this->GetImpl()->GetLocalSizesAndEntries();
+  result->length(localSizes.size());
+  ::NETGENPlugin_Hypothesis::TLocalSize::const_iterator it = localSizes.begin();
+  for (int i=0 ; it != localSizes.end() ; i++, it++)
+    {
+      string entry = (*it).first;
+      result[i] = CORBA::string_dup(entry.c_str());
+    }
+  return result._retn();
+}
+
+//=============================================================================
+
+void NETGENPlugin_Hypothesis_i::UnsetLocalSizeOnEntry(const char* entry)
+{
+  this->GetImpl()->UnsetLocalSizeOnEntry(entry);
+  SMESH::TPythonDump() << _this() << ".UnsetLocalSizeOnEntry(" << entry << ")";
+}
+
 //=============================================================================
 /*!
  *  NETGENPlugin_Hypothesis_i::GetImpl