X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVISU_I%2FVISUConfig.hh;h=6ec9a2d015ba90dce00fdd20403169043f77a357;hb=953451df51750a1d9910c0325f01d5ca7b6e0330;hp=dd9f4c6afe8b6a4c889fad6e96f5e21eb5be5bc6;hpb=841f0997ef150283cedda4a8e3fd5d8e0f783ac0;p=modules%2Fvisu.git diff --git a/src/VISU_I/VISUConfig.hh b/src/VISU_I/VISUConfig.hh index dd9f4c6a..6ec9a2d0 100644 --- a/src/VISU_I/VISUConfig.hh +++ b/src/VISU_I/VISUConfig.hh @@ -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 @@ -27,31 +27,48 @@ #ifndef __VISU_CONFIG_H__ #define __VISU_CONFIG_H__ -// standard C++ headers -#include -#include -#include -#include -#include -#include -#include - // IDL headers #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(VISU_Gen) #include CORBA_SERVER_HEADER(MED) #include CORBA_SERVER_HEADER(SALOMEDS) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) + #include "SALOME_NamingService.hxx" #include "SALOME_LifeCycleCORBA.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +#include "SALOMEDSClient_SObject.hxx" +#include "SALOMEDSClient_Study.hxx" + +// QT headers +#include +#include +#include +#include + +// standard C++ headers +#include + +// STL headers +#include +#include +#include +#include #include -#include -namespace VISU{ +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, @@ -86,10 +103,9 @@ namespace VISU{ //=========================================================================== class Mutex{ QMutex* myMutex; - QApplication* myQApp; - int isQAppLocked, isSessionLocked, myDelay; + int isQAppLocked; public: - Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay = 0); + Mutex(QMutex* theMutex); ~Mutex(); }; @@ -102,15 +118,12 @@ namespace VISU{ std::string ToString(); virtual const char* GetComment() const = 0; typedef std::map 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 TCallbackMap; - static void Registry(const char* theComment, TStorableEngine theEngine) - throw(std::logic_error&); - static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString) - throw(std::runtime_error&); - static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL) - throw(std::logic_error&); + typedef std::map TCallbackMap; + static void Registry(const char* theComment, TStorableEngine theEngine); + 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); @@ -118,24 +131,51 @@ 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)); + + void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject, + bool theIsAttrOnly = true, + bool theDestroySubObjects = false); + void RemoveFromStudy(_PTR(SObject) theSObject, + bool theIsAttrOnly = true, + bool theDestroySubObjects = false); } #endif