Salome HOME
Debug visu.py; add visu_split_views.py as example of view parameters management
[modules/visu.git] / src / VISU_I / VISUConfig.hh
index ba38a0ee54365508edd7c3e155acda547c736128..b5ef6b0612278b4bc6ea5029fd99030be28fc227 100644 (file)
@@ -1,23 +1,23 @@
 //  VISU OBJECT : interactive object for VISU entities implementation
 //
 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
 //
 //
 //  File   : VISUConfig.hh
 // standard C++ headers
 #include <stdio.h>
 #include <iostream>
+
+#include <map>
 #include <string>
-#include <qstring.h> 
-#include <qthread.h> 
+
+#include <qstring.h>
+#include <qthread.h>
 #include <qfileinfo.h>
 #include <qapplication.h>
 
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
 
+#include <SALOMEDSClient_SObject.hxx>
+#include <SALOMEDSClient_Study.hxx>
+
 #include <stdexcept>
-#include <sstream>     
+#include <sstream>
+
+class SUIT_Session;
+class SUIT_ResourceMgr;
+
 
 namespace VISU{
+
+  SUIT_Session *GetSession();
+  SUIT_ResourceMgr *GetResourceMgr();
+
   //===========================================================================
+
   class VISU_Gen_i;
 
   class Base_i : public virtual POA_VISU::Base,
@@ -101,12 +116,12 @@ namespace VISU{
     std::string ToString();
     virtual const char* GetComment() const = 0;
     typedef std::map<std::string,QString> TRestoringMap;
-    typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject, 
+    typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
                                         const std::string& thePrefix, const TRestoringMap& theMap);
-    typedef std::map<string,TStorableEngine> TCallbackMap;
+    typedef std::map<std::string,TStorableEngine> TCallbackMap;
     static void Registry(const char* theComment, TStorableEngine theEngine);
-    static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString); 
-    static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
+    static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
+    static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
     static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
     static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
     static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
@@ -114,24 +129,43 @@ namespace VISU{
     static void DataToStream(std::ostringstream& theStr, const QString& theName, const double theVal);
   };
 
+  //===========================================================================
+  class RemovableObject_i : public virtual POA_VISU::RemovableObject,
+                            public virtual Storable
+  {
+  public:
+    virtual void RemoveFromStudy() = 0;
+  };
 
   //===========================================================================
   const CORBA::Boolean IsMultifile();
-  QString GenerateName(const string& theFmt, int theId);
+  QString GenerateName(const std::string& theFmt, int theId);
 
   PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject);
-  CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr theSObject);
+  CORBA::Object_var ClientSObjectToObject(_PTR(SObject) theSObject);
+  CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr);
 
+  _PTR(SComponent) ClientFindOrCreateVisuComponent(_PTR(Study) theStudyDocument);
   SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument);
 
-  std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument, 
+  std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
                               const char* theFatherEntry, const char* theRefFatherEntry,
-                              const char* theIOR, const char* theName, 
+                              const char* theIOR, const char* theName,
+                              const char* thePersistentRef, const char* theComment,
+                              CORBA::Boolean theCreateNew = true);
+
+  std::string CreateAttributes(_PTR(Study) theStudyDocument,
+                              const char* theFatherEntry, const char* theRefFatherEntry,
+                              const char* theIOR, const char* theName,
                               const char* thePersistentRef, const char* theComment,
                               CORBA::Boolean theCreateNew = true);
 
   std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
                                   const char* theComment, int IsAllLevels = true);
+
+  SALOMEDS::SObject_var GetSObject( _PTR(SObject) );
+  _PTR(SObject) GetClientSObject( SALOMEDS::SObject_var, _PTR(Study) );
+  SALOMEDS::Study_var GetDSStudy( _PTR(Study) );
 }
 
 #endif