Salome HOME
Fix for problem: SIGSEGV appears if to select group after opening "Edit Group" dialog...
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_Deflection1D_i.cxx
index 84ef5e96d3de9de4f91ee41c11583ca41ec200ea..0f3f4a942e7a122538cd0b9fd41a2eda66f03f02 100644 (file)
 
 using namespace std;
 #include "StdMeshers_Deflection1D_i.hxx"
+#include "SMESH_Gen_i.hxx"
 #include "SMESH_Gen.hxx"
 
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
 
+#include <TCollection_AsciiString.hxx>
+
 //=============================================================================
 /*!
  *  StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i
@@ -87,6 +90,13 @@ void StdMeshers_Deflection1D_i::SetDeflection( CORBA::Double theValue )
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
                                  SALOME::BAD_PARAM );
   }
+
+  // Update Python script
+  TCollection_AsciiString aStr, aStrVal ((double)theValue);
+  SMESH_Gen_i::AddObject(aStr, _this()) += ".SetDeflection(";
+  aStr += aStrVal + ")";
+
+  SMESH_Gen_i::AddToCurrentPyScript(aStr);
 }
 
 //=============================================================================
@@ -117,3 +127,18 @@ CORBA::Double StdMeshers_Deflection1D_i::GetDeflection()
   MESSAGE( "StdMeshers_Deflection1D_i::GetImpl" );
   return ( ::StdMeshers_Deflection1D* )myBaseImpl;
 }
+
+//================================================================================
+/*!
+ * \brief Verify whether hypothesis supports given entity type 
+  * \param type - dimension (see SMESH::Dimension enumeration)
+  * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
+ * 
+ * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
+ */
+//================================================================================  
+CORBA::Boolean StdMeshers_Deflection1D_i::IsDimSupported( SMESH::Dimension type )
+{
+  return type == SMESH::DIM_1D;
+}
+