Salome HOME
Merge from OCC_development_generic_2006
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i.hxx
index a9330165364c232e7c74da62819508ca51d88957..f1cce14532e39807622b9cc37fa4ab113f6b83e6 100644 (file)
 #include "SMESH_Gen.hxx"
 #include "GEOM_Client.hxx"
 
+#include <TCollection_AsciiString.hxx>
+#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
+#include <TColStd_HSequenceOfAsciiString.hxx>
+
 #include <map>
+#include <sstream>
 
 class SMESH_Mesh_i;
 class SALOME_LifeCycleCORBA;
@@ -171,6 +176,13 @@ public:
                                                 const char* theLibName)
     throw ( SALOME::SALOME_Exception );
   
+  // Return hypothesis of given type holding parameter values of the existing mesh
+  SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char*           theHypType,
+                                                            const char*           theLibName,
+                                                            SMESH::SMESH_Mesh_ptr theMesh,
+                                                            GEOM::GEOM_Object_ptr theGeom)
+    throw ( SALOME::SALOME_Exception );
+  
   // Create empty mesh on a shape
   SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
     throw ( SALOME::SALOME_Exception );
@@ -198,11 +210,21 @@ public:
                                    GEOM::GEOM_Object_ptr theShapeObject )
     throw ( SALOME::SALOME_Exception );
 
+  // Returns errors of hypotheses definintion
+  SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh, 
+                                         GEOM::GEOM_Object_ptr theSubObject )
+      throw ( SALOME::SALOME_Exception );
+
   // Get sub-shapes unique ID's list
   SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr      theMainShapeObject,
                                      const SMESH::object_array& theListOfSubShape )
     throw ( SALOME::SALOME_Exception );
 
+  // Return geometrical object the given element is built on
+  GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
+                                                  CORBA::Long            theElementID,
+                                                  const char*            theGeomName)
+    throw ( SALOME::SALOME_Exception );
 
   // ****************************************************
   // Interface inherited methods (from SALOMEDS::Driver)
@@ -273,6 +295,32 @@ public:
     return aResultSO._retn();
   }
 
+  // ============
+  // Dump python
+  // ============
+
+  virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, 
+                                      CORBA::Boolean isPublished, 
+                                      CORBA::Boolean& isValidScript);
+
+  void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
+
+  void RemoveLastFromPythonScript (int theStudyID);
+
+  void SavePython (SALOMEDS::Study_ptr theStudy);
+
+  TCollection_AsciiString DumpPython_impl (int theStudyID, 
+                                           Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                                           Resource_DataMapOfAsciiStringAsciiString& theNames,
+                                           bool isPublished, 
+                                           bool& aValidScript,
+                                           const TCollection_AsciiString& theSavedTrace);
+
+  TCollection_AsciiString GetNewPythonLines (int theStudyID);
+
+  void CleanPythonTrace (int theStudyID);
+
+
   // *****************************************
   // Internal methods
   // *****************************************
@@ -369,6 +417,21 @@ private:
 
   GEOM_Client*              myShapeReader;      // Shape reader
   SALOMEDS::Study_var       myCurrentStudy;     // Current study
+
+  // Dump Python: trace of API methods calls
+  std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
 };
 
+
+namespace SMESH
+{
+  template<class T>
+  T
+  DownCast(CORBA::Object_ptr theArg)
+  {
+    return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
+  }
+}
+
+
 #endif