Salome HOME
Fix for problem: SIGSEGV appears if to select group after opening "Edit Group" dialog...
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_StartEndLength_i.cxx
index 08ffa4c815d0b246c8795e7ffb17084d3b564166..56ce6f51d3725d0fbaea397c9c4b66b4c7d3e182 100644 (file)
 
 using namespace std;
 #include "StdMeshers_StartEndLength_i.hxx"
+#include "SMESH_Gen_i.hxx"
 #include "SMESH_Gen.hxx"
 
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
 
+#include <TCollection_AsciiString.hxx>
+
 //=============================================================================
 /*!
  *  StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i
@@ -88,6 +91,13 @@ void StdMeshers_StartEndLength_i::SetLength(CORBA::Double theLength,
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
                                  SALOME::BAD_PARAM );
   }
+
+  // Update Python script
+  TCollection_AsciiString aStr, aStrLen ((double)theLength), aStrFlag ((int)theIsStart);
+  SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength(";
+  aStr += aStrLen + ", " + aStrFlag + ")";
+
+  SMESH_Gen_i::AddToCurrentPyScript(aStr);
 }
 
 //=============================================================================
@@ -118,3 +128,18 @@ CORBA::Double StdMeshers_StartEndLength_i::GetLength( CORBA::Boolean theIsStart)
   MESSAGE( "StdMeshers_StartEndLength_i::GetImpl" );
   return ( ::StdMeshers_StartEndLength* )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_StartEndLength_i::IsDimSupported( SMESH::Dimension type )
+{
+  return type == SMESH::DIM_1D;
+}
+