Salome HOME
clear data when new study from button new
[modules/hydro.git] / src / HYDROData / HYDROData_Document.cxx
index ddbc99338e9dc15e6a06fbe4a2698b2aaee90750..d522a34c88e25834db4d8135fa481d818bd86def 100644 (file)
@@ -37,6 +37,9 @@
 #include <QTextStream>
 #include <QColor>
 
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared)
 
 #define PYTHON_DOC_NAME "hydro_doc"
@@ -63,6 +66,7 @@ Handle(HYDROData_Document) HYDROData_Document::Document()
   Handle(HYDROData_Document) aResult = 
     HYDROData_Application::GetApplication()->GetDocument();
   if (aResult.IsNull()) {
+    DEBTRACE("new HYDROData_Document");
     aResult = new HYDROData_Document();
     HYDROData_Application::GetApplication()->AddDocument(aResult);
   }
@@ -103,6 +107,7 @@ bool HYDROData_Document::HasDocument()
 
 Data_DocError HYDROData_Document::Load(const char* theFileName)
 {
+  DEBTRACE("Load");
   Handle(TDocStd_Document) aResult;
   TCollection_ExtendedString aPath ((const Standard_CString)theFileName);
   PCDM_ReaderStatus aStatus = (PCDM_ReaderStatus) -1;
@@ -155,6 +160,7 @@ Data_DocError HYDROData_Document::Load(const char* theFileName)
 
 Data_DocError HYDROData_Document::Save(const char* theFileName)
 {
+  DEBTRACE("Save");
   TCollection_ExtendedString aPath ((const Standard_CString)theFileName);
   PCDM_StoreStatus aStatus;
   try {
@@ -187,6 +193,7 @@ Data_DocError HYDROData_Document::Save(const char* theFileName)
 
 void HYDROData_Document::Close()
 {
+  DEBTRACE("Close");
   myDoc->Close();
   HYDROData_Application::GetApplication()->RemoveDocument(this);
 }
@@ -282,6 +289,7 @@ void HYDROData_Document::SetCountDelaunay( int nbDelaunay) const
 bool HYDROData_Document::DumpToPython( const QString& thePyScriptPath,
                                        const bool     theIsMultiFile ) const
 {
+  DEBTRACE("DumpToPython");
   // Try to open the file
   QFile aFile( thePyScriptPath );
   if ( !aFile.open( QIODevice::WriteOnly | QFile::Text ) )
@@ -344,6 +352,7 @@ QStringList HYDROData_Document::DumpToPython( const QString& thePyScriptPath,
                                               MapOfTreatedObjects& theTreatedObjects,
                                               const bool           theIsMultiFile ) const
 {
+  DEBTRACE("DumpToPython");
   QString aDocName = GetDocPyName();
 
   // Append document in to the map of treated objects to prevent names overlaping
@@ -377,6 +386,7 @@ bool HYDROData_Document::dumpPartitionToPython( QFile&               theFile,
                                                 MapOfTreatedObjects& theTreatedObjects,
                                                 const ObjectKind&    theObjectKind ) const
 {
+  DEBTRACE("dumpPartitionToPython");
   if ( !theFile.isOpen() )
     return false;
 
@@ -746,6 +756,7 @@ HYDROData_SequenceOfObjects HYDROData_Document::CollectAllObjects( const ObjectK
 
 HYDROData_Document::HYDROData_Document()
 {
+  DEBTRACE("HYDROData_Document");
   HYDROData_Application::GetApplication()->NewDocument("BinOcaf", myDoc);
   myDoc->SetUndoLimit(UNDO_LIMIT);
   NewID(); // needed to have at least one attribute in initial document to avoid errors
@@ -758,6 +769,7 @@ HYDROData_Document::HYDROData_Document()
 
 HYDROData_Document::HYDROData_Document(const Handle(TDocStd_Document)& theDoc)
 {
+  DEBTRACE("HYDROData_Document");
   myDoc = theDoc;
   myTransactionsAfterSave = 0;
   myLX = -1;
@@ -768,6 +780,7 @@ HYDROData_Document::HYDROData_Document(const Handle(TDocStd_Document)& theDoc)
 
 HYDROData_Document::~HYDROData_Document()
 {
+  DEBTRACE("~HYDROData_Document");
 }
 
 int HYDROData_Document::NewID()