#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;
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 )
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);
+
+ static void AddToCurrentPyScript (const TCollection_AsciiString& theString);
+
+ 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);
+
+ // Dump python comfort methods
+
+ static TCollection_AsciiString& AddObject(TCollection_AsciiString& theStr,
+ CORBA::Object_ptr theObject);
+ // add object to script string
+
+ template <class _array>
+ static TCollection_AsciiString& AddArray(TCollection_AsciiString& theStr,
+ const _array & array)
+ // put array contents into theStr like this: "[ 1, 2, 5 ]"
+ {
+ ostringstream sout; // can convert long int, and TCollection_AsciiString cant
+ sout << "[ ";
+ for (int i = 1; i <= array.length(); i++) {
+ sout << array[i-1];
+ if ( i < array.length() )
+ sout << ", ";
+ }
+ sout << " ]";
+ theStr += (char*) sout.str().c_str();
+ return theStr;
+ }
+
// *****************************************
// Internal methods
// *****************************************
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