Salome HOME
PR: mergefrom branch BR_OCC_For_3_1_0b1 tag mergeto_BR_PR_V320b1_31mar06
authorprascle <prascle>
Mon, 3 Apr 2006 09:12:26 +0000 (09:12 +0000)
committerprascle <prascle>
Mon, 3 Apr 2006 09:12:26 +0000 (09:12 +0000)
21 files changed:
configure.ac
doc/SALOME_Application.txt
doc/salome/tui/KERNEL/doxyfile
doc/salome/tui/Makefile.am
idl/SALOME_TestModuleCatalog.idl
salome_adm/unix/config_files/check_htmlgen.m4
src/SALOMEDS/Makefile.am
src/SALOMEDS/SALOMEDS.cxx
src/SALOMEDS/SALOMEDS_IParameters.hxx
src/SALOMEDS/SALOMEDS_SComponent.cxx
src/SALOMEDS/SALOMEDS_SObject.cxx
src/SALOMEDS/SALOMEDS_SObject.hxx
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_StudyBuilder.cxx
src/SALOMEDS/SALOMEDS_StudyBuilder.hxx
src/SALOMEDSClient/Makefile.am
src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx
src/SALOMEDSClient/SALOMEDSClient_ClientFactory.hxx
src/SALOMEDSClient/SALOMEDSClient_IParameters.hxx [new file with mode: 0644]
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx
src/Utils/Utils_SALOME_Exception.hxx

index fe3a6b39815bac6b5055ffd5a3da06000a9db061..b897ecaaae483e8d49f76da893de3b71bfad0e6f 100644 (file)
@@ -305,6 +305,17 @@ dnl localbatch_ok is set to yes by CHECK_LOCAL
 
 WITH_BATCH=no
 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
+
+AC_ARG_ENABLE(batch,
+  [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
+  [case "${enableval}" in
+     yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
+     no)  WITH_BATCH=no ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
+  esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
+
+echo Batch mode = $WITH_BATCH
+
 AC_SUBST(WITH_BATCH)
 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
 
@@ -365,7 +376,12 @@ function check_fatal_error {
 
 # --------------------------------------
 
-basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
+if test x$corba_gen = xtrue; then
+  basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
+else
+  basic_mandatory_products="cc_ok threads_ok python_ok hdf5_ok occ_ok"
+fi
+
 echo --- General mandatory products - Light configuration:
 summary $basic_mandatory_products
 check_fatal_error $basic_mandatory_products
index 83e016276f426f9044b4659a7c53663cc382e9bd..890291cb0bd831b5b65c8071338991335fca9e8e 100644 (file)
@@ -7,7 +7,7 @@ SALOME Application Concept. Configuration for one or more computers
 
   rst2html doc.txt > doc.html
 
-This document corresponds to SALOME2 3.1. (alpha version)
+This document corresponds to SALOME2 3.2. (alpha version)
 
 +-------------------------------------------+
 | **WORK in PROGRESS, INCOMPLETE DOCUMENT** |
@@ -55,6 +55,12 @@ computer.
 Application Directory
 ---------------------
 
+Two ways for creation of an application directory
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+First way - references to different module directories
+''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
 The script createAppli.sh in ${KERNEL_ROOT_DIR}/bin/salome creates an
 application directory with the given path in parameter. ${APPLI} is a path 
 relative to ${HOME}.
@@ -68,6 +74,23 @@ configure his own application. These files are described after, the list is:
 - CatalogResources.xml
 - SalomeApp.xml
 
+Second way - one single virtual install directory
+'''''''''''''''''''''''''''''''''''''''''''''''''
+
+The user must create an application directory in which he copies
+appli_install.sh, appli_clean.sh and virtual_salome.py,
+from ${KERNEL_ROOT_DIR}/bin/salome.
+
+appli_install.sh needs to be edited, to define a list of modules with their
+install paths.
+Then, the script appli_install.sh creates a virtual installation of SALOME
+in the application directory (bin, lib, doc, share...), with,
+for each file (executable, script, data,library, resources...),
+symbolic links to the actual file.
+
+General rules
+-------------
+
 Directory ${APPLI} must be created on each computer of the application.
 The easiest way is to use the same relative path (to ${HOME}) on each computer.
 (Sometimes it is not possible to use the same path everywhere, for instance
@@ -78,15 +101,22 @@ The ${APPLI} directory contains scripts for environment and runs. Environment
 scripts must be configured (by the user) on each computer. All the environment
 scripts are in the ${APPLI}/env.d directory. 
 
-The script  ${APPLI}/envd sources **all** the files in ${APPLI}/env.d in
+The script  ${APPLI}/envd sources **all** the files (\*.sh) in ${APPLI}/env.d in
 alphanumeric order (after edition, think to remove backup files). the envd
 script is used by run scripts.
 
 
-Proposal for env.d scripts
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+env.d scripts
+~~~~~~~~~~~~~
+
 Each user **must define** his own configuration for these scripts, following
-the above rules. **The following is only an example not working as it is**.
+the above rules. With the virtual installation (second way, above), env.d
+scripts are built by appli_install.sh (given it's parameters). Otherwise, the
+scripts must be manually defined.
+
+
+ **The following is only an example proposed by createAppli.sh,
+ not working as it is**.
 
 atFirst.sh
     Sets the computer configuration not directly related to SALOME,
@@ -118,7 +148,7 @@ runAppli
 
 runSession
    Launches a shell script in the SALOME application environment, with access
-   to the current SALOME session (naming service), if any.
+   to the current (last launched) SALOME session (naming service), if any.
    Without arguments, the script is interactive. With arguments, the script
    executes the command in the SALOME application environment.
 
@@ -152,6 +182,7 @@ SalomeApp.xml
    This file is similar to the default given
    in ${GUI_ROOT_DIR}/share/salome/resources
 
+
 CatalogRessources.xml
    This files describes all the computer the application can use. The given
    example is minimal and suppose ${APPLI} is the same relative path
@@ -161,4 +192,87 @@ CatalogRessources.xml
        appliPath="my/specific/path/on/this/computer"
 
 
+Examples of use
+---------------
+
+Launch a SALOME session with a GUI interface
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launch is done with a command like::
+
+   ./runAppli --logger
+
+The --logger option means here : collect all the traces from the all the
+distributed process, via CORBA, in a single file : logger.log.
+
+There are a lot of options, a complete list is given by::
+
+   ./runAppli --help
+
+Note that, without argument, runAppli is a non interactive Python application,
+and, with arguments, runAppli is an interactive Python interpreter.
+
+Several options are already defined by default in SalomeApp.xml files. Optional
+arguments given in the command override the SalomeApp.xml configuration.
+
+Several sessions can run simultaneously, each session use a different port for
+CORBA naming service, so the sessions are totally separated from each other.
+
+When the GUI is closed, the different SALOME servers are still running.
+
+Close a SALOME session, kill all the servers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Inside the interactive python interpreter you get when you use runAppli
+with arguments, you can kill all the servers of your session with::
+
+   >>> killLocalPort()
+
+or the servers of all the sessions with::
+
+   >>> killAllPorts()
+
+If you have no active Python interpreter connected to your session, you can
+kill all the SALOME servers of **all the sessions** on a given computer::
+
+   ./runSession killSalome.py
+
+Remember! it's the same in *Windows (R) operating system* [#]_ :
+use the start menu to stop...
+
+When you use only one session at a time, you don't need more.
+
+To kill a given session (when several session are running), one needs
+the naming service port number::
+
+   ./runSession killSalomeWithPort 2810
+
+Note that the port number of the last launched session can be found on Linux,
+in the prompt, within a runSession shell (see below).
+
+It is also possible to get the Naming Service host and port number of
+the last launched session with::
+
+   ./runSession NSparam.py
+
+.. [#] Microsoft and Windows are either registered trademarks or trademarks of
+       Microsoft Corporation in the United States and/or other countries.
+
+Different uses of the runSession shell interpreter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+runSession invoked without arguments gives an interactive shell with the full
+environment of SALOME (PATH, LD_LIBRARY_PATH, PYTHONPATH, other variables).
+If there are running sessions of the same SALOME application, runSession
+connects to the last launched session (i.e. gets the naming service references
+of the session: hostname and port)
+
+On Linux, the shell prompt (bash) gives information on naming service
+references, hostname and port::
+
+   [NS=cli76cc:2811]prascle@cli76cc:~/SALOME2/Run/Virtual$
+
+If there is no running session, prompt looks like::
+
+   [NS=:]prascle@cli76cc:~/SALOME2/Run/Virtual$
 
index 1cb1191e839af5bf840578a8ee7d5807c08565e5..c19b684b2f6f2e967aed2364537a9567e0283d7f 100755 (executable)
@@ -56,17 +56,23 @@ WARN_LOGFILE           = log.txt
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = ../../../share/salome/idl/SALOME_ModuleCatalog.idl \
-                         ../../../share/salome/idl/SALOMEDS.idl \
-                         ../../../share/salome/idl/SALOME_Exception.idl \
-                         ../../../share/salome/idl/SALOMEDS_Attributes.idl \
-                         ../../../share/salome/idl/SALOME_Component.idl \
-                         ../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx \
-                         ../../../share/salome/src/NamingService/SALOME_NamingService.hxx \
-                         ../../../share/salome/src/NamingService/SALOME_NamingService.cxx \
-                         ../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
-FILE_PATTERNS          = 
-RECURSIVE              = NO
+INPUT                  = ../../../../share/salome/idl/SALOME_ModuleCatalog.idl \
+                       ../../../../share/salome/idl/SALOMEDS.idl \
+                       ../../../../share/salome/idl/SALOME_Exception.idl \
+                       ../../../../share/salome/idl/SALOMEDS_Attributes.idl \
+                       ../../../../share/salome/idl/SALOME_Component.idl \
+                       ../../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx \
+                       ../../../../share/salome/src/NamingService/SALOME_NamingService.hxx \
+                       ../../../../share/salome/src/NamingService/SALOME_NamingService.cxx \
+                       ../../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx \
+                       ../../../../build/salome/bin/salome \
+                       ../../../../build/salome/src/Batch_SWIG \
+                       ../../../../build/salome/src/Communication_SWIG \
+                       ../../../../build/salome/src/LifeCycleCORBA_SWIG \
+                       ../../../../build/salome/src/LifeCycleCORBA_SWIG \
+                       ../../../../build/salome/src/NOTIFICATION_SWIG
+FILE_PATTERNS          = *.idl *.hxx *.cxx python_extension_must_be_here
+RECURSIVE              = YES
 EXCLUDE                = 
 EXCLUDE_SYMLINKS       = NO
 EXCLUDE_PATTERNS       = 
index 09511f9539bd1b3893e9524477370ae239e79ec2..a1e17c6a6e8a23f5a66309a7cbe4fe1df0accb77 100644 (file)
@@ -16,10 +16,26 @@ userdoc:
        cp -fr $(srcdir)/KERNEL ./INPUT; \
        cd INPUT; \
        sed 's|../../../share/salome|@top_srcdir@|' ./doxyfile > ./doxyfile1; \
+       sed 's|../../../build/salome|@top_builddir@|' ./doxyfile1 > ./doxyfile2; \
+       mv -f doxyfile2 doxyfile1; \
+       echo "DOXYGEN SUPPORT PYTHON - $(DOXYGEN_WITH_PYTHON)"; \
+       if( test "x$(DOXYGEN_WITH_PYTHON)" = "xyes"); then \
+         sed 's|python_extension_must_be_here|*.py|' ./doxyfile1 > ./doxyfile2; \
+         mv -f doxyfile2 doxyfile1; \
+         $(DOXYGEN) -u ./doxyfile1; \
+       else \
+         sed 's|python_extension_must_be_here||' ./doxyfile1 > ./doxyfile2; \
+         mv -f doxyfile2 doxyfile1; \
+       fi; \
+       if( test "x$(DOXYGEN_WITH_STL)" = "xyes"); then \
+         sed -e 's|BUILTIN_STL_SUPPORT    = NO|BUILTIN_STL_SUPPORT    = YES|' ./doxyfile1 > ./doxyfile2; \
+         mv -f doxyfile2 doxyfile1; \
+       fi; \
        mv -f doxyfile1 doxyfile; \
        $(DOXYGEN) ./doxyfile; \
        cd ..;
-       $(INSTALL) -d $(docdir)/tui/KERNEL; 
+       $(INSTALL) -d $(docdir)/tui/KERNEL;
+       cp -fr KERNEL $(docdir)/tui
        cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir)/tui/KERNEL;
        cp -fr $(srcdir)/KERNEL/sources/ $(docdir)/tui/KERNEL;
        cp -fr $(srcdir)/KERNEL/HTML/ $(docdir)/tui/KERNEL;
index 80f5be22947d9e56cc4e6169bc0d6b3d2fd57cf6..b497fdb113bca550c35675584d8aed527523e417 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "SALOME_Component.idl"
 
-module SuperVisionTest {
+module CatalogTest {
 
   interface Adder ;
 
index 6f46e9fbacc29cf06cc01d732a99943ccb8ca32b..8e42b102ebcad6c61e16138fd485df69f6ed9144 100644 (file)
@@ -12,6 +12,49 @@ then
   AC_MSG_WARN(doxygen not found)
   doxygen_ok=no
 fi
+if test "x$doxygen_ok" = "xyes"
+then
+  version=`$DOXYGEN --version`
+  AC_MSG_RESULT(doxygen version $version)
+  case "$version" in
+       1.4.4*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=no
+         ;;
+       1.4.5*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=yes
+         ;;
+       1.4.6*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=yes
+         ;;
+       1.4.7*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=yes
+         ;;
+       1.4.8*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=yes
+         ;;
+       1.4.9*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=yes
+         ;;
+       [1-9].[5-9]*)
+         DOXYGEN_WITH_PYTHON=yes
+         DOXYGEN_WITH_STL=yes
+         ;;
+       *)
+         DOXYGEN_WITH_PYTHON=no
+         DOXYGEN_WITH_STL=no
+         ;;
+  esac
+  AC_MSG_RESULT(doxygen with support STL    - $DOXYGEN_WITH_STL)
+  AC_MSG_RESULT(doxygen with support PYTHON - $DOXYGEN_WITH_PYTHON)
+  AC_SUBST(DOXYGEN_WITH_PYTHON)
+  AC_SUBST(DOXYGEN_WITH_STL)
+fi
 dnl AC_SUBST(DOXYGEN)
 
 graphviz_ok=yes
index 7a8263368faa9fea6bdfc33afd5ea48a3721cc0d..f0b80d248a554d02b8d4940b57c268fa221b6165 100644 (file)
@@ -307,7 +307,7 @@ libSalomeDS_la_SOURCES =    \
        SALOMEDS_TMPFile_i.hxx
 
 libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDS_la_LDFLAGS  = -no-undefined -version-info=0:0:0
+libSalomeDS_la_LDFLAGS  = -Wl,-E -no-undefined -version-info=0:0:0 @LDEXPDYNFLAGS@
 libSalomeDS_la_LIBADD    = $(COMMON_LIBS)
 
 #
index 4a35577e12f33e2a9988df814177a7faed6b20ac..c0a6bf3090ac90f0e27fe86784361d13f30c6be6 100644 (file)
 //  Module : SALOME
 //  $Header$
 
-#ifndef WNT
+#ifdef WNT
 #include <SALOMEDS.hxx>
 #include <SALOMEDS_StudyManager.hxx>
 #include <SALOMEDS_Study.hxx>
 #include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_StudyBuilder.hxx>
 #include <SALOMEDS_SComponent.hxx>
 #include <SALOMEDSClient.hxx>
+#include <SALOMEDSClient_IParameters.hxx>
+#include <SALOMEDS_IParameters.hxx>
 #include <SALOMEDS_StudyManager_i.hxx>
 #else
 #include "SALOMEDS.hxx"
 #include "SALOMEDS_StudyManager.hxx"
 #include "SALOMEDS_Study.hxx"
+#include "SALOMEDS_StudyBuilder.hxx"
 #include "SALOMEDS_SObject.hxx"
 #include "SALOMEDS_SComponent.hxx"
 #include "SALOMEDSClient.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
+#include "SALOMEDS_IParameters.hxx"
 #include "SALOMEDS_StudyManager_i.hxx"
 #endif
 
 // IDL headers
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
+#include <SALOME_NamingService.hxx>
 
 using namespace SALOMEDS;
 
@@ -92,26 +99,70 @@ SALOMEDSClient_StudyManager* StudyManagerFactory()
 
 SALOMEDSClient_Study* StudyFactory(SALOMEDS::Study_ptr theStudy)
 {
+  if(CORBA::is_nil(theStudy)) return NULL;
   return new SALOMEDS_Study(theStudy);
 }
 
 SALOMEDSClient_SObject* SObjectFactory(SALOMEDS::SObject_ptr theSObject)
 {
+  if(CORBA::is_nil(theSObject)) return NULL;
   return new SALOMEDS_SObject(theSObject);
 }
 
 SALOMEDSClient_SComponent* SComponentFactory(SALOMEDS::SComponent_ptr theSComponent)
 {
+  if(CORBA::is_nil(theSComponent)) return NULL;
   return new SALOMEDS_SComponent(theSComponent);
 }
 
+SALOMEDSClient_StudyBuilder* BuilderFactory(SALOMEDS::StudyBuilder_ptr theBuilder)
+{
+  if(CORBA::is_nil(theBuilder)) return NULL;
+  return new SALOMEDS_StudyBuilder(theBuilder);
+}
+
 SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
 {
-  SALOMEDS_StudyManager_i * aStudyManager_i = new  SALOMEDS_StudyManager_i(orb, root_poa);
-  // Activate the objects.  This tells the POA that the objects are ready to accept requests.
-  PortableServer::ObjectId_var aStudyManager_iid =  root_poa->activate_object(aStudyManager_i);
-  aStudyManager_i->register_name("/myStudyManager");
+  cout << "############## CreateStudyManager"   << endl;
+  SALOME_NamingService namingService(orb);
+  CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
+  SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
+  if( CORBA::is_nil(theManager) ) {
+    SALOMEDS_StudyManager_i * aStudyManager_i = new  SALOMEDS_StudyManager_i(orb, root_poa);
+    // Activate the objects.  This tells the POA that the objects are ready to accept requests.
+    PortableServer::ObjectId_var aStudyManager_iid =  root_poa->activate_object(aStudyManager_i);
+    aStudyManager_i->register_name("/myStudyManager");
+  }
   return new SALOMEDS_StudyManager();
 }
 
+SALOMEDSClient_IParameters* GetIParameters(const _PTR(AttributeParameter)& ap)
+{
+  return new SALOMEDS_IParameters(ap);
+}
+
+
+SALOMEDS::SObject_ptr ConvertSObject(const _PTR(SObject)& theSObject)
+{
+  
+  SALOMEDS_SObject* so = _CAST(SObject, theSObject);
+  if(!theSObject || !so) return SALOMEDS::SObject::_nil();
+  return so->GetSObject();
+}
+
+SALOMEDS::Study_ptr ConvertStudy(const _PTR(Study)& theStudy)
+{
+  SALOMEDS_Study* study = _CAST(Study, theStudy);
+  if(!theStudy || !study) return SALOMEDS::Study::_nil();
+  return study->GetStudy();
+}
+
+SALOMEDS::StudyBuilder_ptr ConvertBuilder(const _PTR(StudyBuilder)& theBuilder)
+{
+  SALOMEDS_StudyBuilder* builder = _CAST(StudyBuilder, theBuilder);
+  if(!theBuilder || !builder) return SALOMEDS::StudyBuilder::_nil(); 
+  return builder->GetBuilder();
+}
+
+
 }
index 4111e83f978901b02068e57959c3cfa83d5a09a3..9c0e957607ff5ae11ce65aea6f00fb3254fbfdc2 100644 (file)
 #include <map>
 
 #include "SALOMEDSClient.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
 
 /*! 
   Class which an interface to store the parameters of the objects
 */
-class SALOMEDS_IParameters
+class SALOMEDS_IParameters: public SALOMEDSClient_IParameters
 {
 public:
   SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap); 
@@ -127,17 +128,17 @@ public:
   /*!
     Enables/Disables the dumping visual parameters
    */
-  static void setDumpPython(_PTR(Study) study, const std::string& theID = "");
+  virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "");
 
   /*!
     Returns whether there is the dumping visual parameters
    */
-  static bool isDumpPython(_PTR(Study) study, const std::string& theID = "");  
+  virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "");  
 
   /*!
     Returns a default name of the component where the visula parameters are stored.
   */
-  static std::string getDefaultVisualComponent();
+  virtual std::string getDefaultVisualComponent();
 
 private:
   _PTR(AttributeParameter) _ap;
index f061fcc5f9d08d7e26b9251a846541a8d15cac4a..3f104bcfedac0c09701b904828fd543991b6a7bf 100644 (file)
@@ -76,15 +76,14 @@ bool SALOMEDS_SComponent::ComponentIOR(std::string& theID)
 
 SALOMEDS::SComponent_ptr SALOMEDS_SComponent::GetSComponent()
 {
-  if (_isLocal) {
-    if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
-    SALOMEDS::SComponent_var aSCO =
-      SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+  if(_isLocal) {
+    if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
+    SALOMEDS::SComponent_var aSCO = SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+    _corba_impl = SALOMEDS::SComponent::_duplicate(aSCO);
     return aSCO._retn();
   }
   else {
-    return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
+    return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
   }
-
   return SALOMEDS::SComponent::_nil();
 }
index 233c5fca805dfd5d790d5418ff401ff459a4dec8..d11a3cb1ce7f54aa6f5ad0fa7cc53bc2697f8d30 100644 (file)
@@ -33,6 +33,7 @@
 #include "SALOMEDS_SComponent.hxx"
 #include "SALOMEDS_GenericAttribute.hxx"
 #include "SALOMEDS_Study.hxx"
+#include "SALOMEDS_SObject_i.hxx"
 
 #include "SALOMEDSImpl_SComponent.hxx"
 #include "SALOMEDSImpl_GenericAttribute.hxx"
@@ -310,12 +311,13 @@ CORBA::Object_ptr SALOMEDS_SObject::GetObject()
 SALOMEDS::SObject_ptr SALOMEDS_SObject::GetSObject()
 {
   if(_isLocal) {
-    if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
+    if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SObject::_duplicate(_corba_impl);
     SALOMEDS::SObject_var aSO = SALOMEDS_SObject_i::New(_local_impl, _orb);
+    _corba_impl = SALOMEDS::SObject::_duplicate(aSO);
     return aSO._retn();
   }
   else {
-    return _corba_impl;
+    return SALOMEDS::SObject::_duplicate(_corba_impl);
   }
   return SALOMEDS::SObject::_nil();
 }
index f947d1ad089ee5b354691acec547c55be09ec259..6ac8f1d26015bb3720cc596006290d62d223915b 100644 (file)
@@ -33,7 +33,6 @@
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
 
-#include "SALOMEDS_SObject_i.hxx"
 #include "SALOMEDSImpl_SObject.hxx"
 
 class Standard_EXPORT SALOMEDS_SObject: public virtual SALOMEDSClient_SObject
index 67220592ea50bd39eb33faacca6a697daf9deeca..c3e572f217042bea3be8dd65d1159c313745f511 100644 (file)
@@ -665,7 +665,7 @@ SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy()
   if (_isLocal) {
     SALOMEDS::Locker lock;
 
-    if (!CORBA::is_nil(_corba_impl)) return _corba_impl;
+    if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::Study::_duplicate(_corba_impl);
     std::string anIOR = _local_impl->GetTransientReference().ToCString();
     SALOMEDS::Study_var aStudy;
     if (!_local_impl->IsError() && anIOR != "") {
@@ -676,15 +676,17 @@ SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy()
       aStudy = aStudy_servant->_this();
       _local_impl->SetTransientReference(_orb->object_to_string(aStudy));
     }
+    _corba_impl = SALOMEDS::Study::_duplicate(aStudy);
     return aStudy._retn();
   }
   else {
-    return _corba_impl;
+    return SALOMEDS::Study::_duplicate(_corba_impl);
   }
 
   return SALOMEDS::Study::_nil();
 }
 
+
 _PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint)
 {
   SALOMEDSClient_AttributeParameter* AP = NULL;
index e11a77eb498a0d41f83270d5780b8aa81766eacd..d7c12eb6d73f62d16e40e2c512c6e974cd430d1e 100644 (file)
@@ -32,6 +32,7 @@
 #include "SALOMEDS_SComponent.hxx"
 #include "SALOMEDS_GenericAttribute.hxx"
 #include "SALOMEDS_StudyManager.hxx"
+#include "SALOMEDS_StudyBuilder_i.hxx"
 
 #include "SALOMEDS_Driver_i.hxx"
 
@@ -515,6 +516,21 @@ void SALOMEDS_StudyBuilder::SetIOR(const _PTR(SObject)& theSO, const std::string
   else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str());
 }
 
+SALOMEDS::StudyBuilder_ptr SALOMEDS_StudyBuilder::GetBuilder()
+{
+  if(_isLocal) {
+    if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
+    SALOMEDS_StudyBuilder_i* servant = new SALOMEDS_StudyBuilder_i(_local_impl, _orb);
+    SALOMEDS::StudyBuilder_var aBuilder = servant->StudyBuilder::_this();
+    _corba_impl = SALOMEDS::StudyBuilder::_duplicate(aBuilder);
+    return aBuilder._retn();
+  }
+  else {
+    return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
+  }
+  return SALOMEDS::StudyBuilder::_nil();
+}
+
 void SALOMEDS_StudyBuilder::init_orb()
 {
   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
index a40e19e4ce0fc7217dddf8c237b91ce51c0515bd..0db1647abed5fa78ccb7fb3ad3fb00e1028b5500 100644 (file)
@@ -80,6 +80,8 @@ public:
   virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue);
   virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue);
 
+  SALOMEDS::StudyBuilder_ptr GetBuilder();
+
 private:
   void CheckLocked();
   void init_orb();
index f74e2115189358f0e512314fa0d4a81c1e2958fc..cf4b48561bd4e77b0dce53978056b79375f985e9 100644 (file)
@@ -48,6 +48,7 @@ salomeinclude_HEADERS=\
                 SALOMEDSClient_UseCaseBuilder.hxx \
                 SALOMEDSClient_UseCaseIterator.hxx \
                SALOMEDSClient_ClientFactory.hxx \
+               SALOMEDSClient_IParameters.hxx \
                SALOMEDSClient.hxx
 
 #
@@ -79,5 +80,5 @@ libSalomeDSClient_la_SOURCES =        \
 
 
 libSalomeDSClient_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDSClient_la_LDFLAGS  = -no-undefined -version-info=0:0:0
+libSalomeDSClient_la_LDFLAGS  = -Wl,-E -no-undefined -version-info=0:0:0
 libSalomeDSClient_la_LIBADD   = $(COMMON_LIBS)
index 4b5e23b5921a62becc5f50ad46c9a18bd4fe857e..4e29d1b5d622739962e1dbc1359d41f6000ee0b3 100644 (file)
@@ -13,20 +13,36 @@ static void* _libHandle = NULL;
 #define SOBJECT_FACTORY      "SObjectFactory"
 #define SCOMPONENT_FACTORY   "SComponentFactory"
 #define STUDY_FACTORY        "StudyFactory"
+#define BUILDER_FACTORY      "BuilderFactory"
 #define STUDYMANAGER_FACTORY "StudyManagerFactory"
 #define STUDYMANAGER_CREATE  "CreateStudyManager"
+#define GET_PARAMETERS       "GetIParameters"
+#define CONVERT_SOBJECT      "ConvertSObject"
+#define CONVERT_STUDY        "ConvertStudy"
+#define CONVERT_BUILDER      "ConvertBuilder"
 
 typedef SALOMEDSClient_SObject* (*SOBJECT_FACTORY_FUNCTION) (SALOMEDS::SObject_ptr);
 typedef SALOMEDSClient_SComponent* (*SCOMPONENT_FACTORY_FUNCTION) (SALOMEDS::SComponent_ptr);
 typedef SALOMEDSClient_Study* (*STUDY_FACTORY_FUNCTION) (SALOMEDS::Study_ptr);
 typedef SALOMEDSClient_StudyManager* (*STUDYMANAGER_FACTORY_FUNCTION) ();
+typedef SALOMEDSClient_StudyBuilder* (*BUILDER_FACTORY_FUNCTION) (SALOMEDS::StudyBuilder_ptr);
 typedef SALOMEDSClient_StudyManager* (*STUDYMANAGER_CREATE_FUNCTION) (CORBA::ORB_ptr, PortableServer::POA_ptr);
+typedef SALOMEDSClient_IParameters* (*GET_PARAMETERS_FACTORY) (const _PTR(AttributeParameter)&);
+typedef SALOMEDS::SObject_ptr (*CONVERT_SOBJECT_FUNCTION) (const _PTR(SObject)&);
+typedef SALOMEDS::Study_ptr (*CONVERT_STUDY_FUNCTION) (const _PTR(Study)&);
+typedef SALOMEDS::StudyBuilder_ptr (*CONVERT_BUILDER_FUNCTION) (const _PTR(StudyBuilder)&);
+
 
 static SOBJECT_FACTORY_FUNCTION aSObjectFactory = NULL;
 static SCOMPONENT_FACTORY_FUNCTION aSComponentFactory = NULL;
 static STUDY_FACTORY_FUNCTION aStudyFactory = NULL;
+static BUILDER_FACTORY_FUNCTION aBuilderFactory = NULL;
 static STUDYMANAGER_FACTORY_FUNCTION aManagerFactory = NULL;
 static STUDYMANAGER_CREATE_FUNCTION aCreateFactory = NULL;
+static GET_PARAMETERS_FACTORY aGetIParameters = NULL;
+static CONVERT_SOBJECT_FUNCTION aConvertSObject = NULL;
+static CONVERT_STUDY_FUNCTION aConvertStudy = NULL;
+static CONVERT_BUILDER_FUNCTION aConvertBuilder = NULL;
 
 using namespace std;
 
@@ -78,6 +94,22 @@ _PTR(Study) ClientFactory::Study(SALOMEDS::Study_ptr theStudy)
   return _PTR(Study)(study);
 }
 
+_PTR(StudyBuilder) ClientFactory::StudyBuilder(SALOMEDS::StudyBuilder_ptr theStudyBuilder)
+{
+  SALOMEDSClient_StudyBuilder* studyBuilder = NULL;
+
+#ifdef WIN32
+  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+  if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, BUILDER_FACTORY);
+#else
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+  if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION) dlsym(_libHandle, BUILDER_FACTORY);
+#endif
+
+  if(aBuilderFactory) studyBuilder = aBuilderFactory(theStudyBuilder); 
+  return _PTR(StudyBuilder)(studyBuilder);
+}
+
 _PTR(StudyManager) ClientFactory::StudyManager()
 {
   SALOMEDSClient_StudyManager* manager = NULL;
@@ -110,3 +142,73 @@ _PTR(StudyManager) ClientFactory::createStudyManager(CORBA::ORB_ptr orb, Portabl
   return _PTR(StudyManager)(manager);
 }
 
+_PTR(IParameters) ClientFactory::getIParameters(const _PTR(AttributeParameter)& ap)
+{
+  SALOMEDSClient_IParameters* interface = NULL;
+
+#ifdef WIN32
+  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+  if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY)::GetProcAddress(_libHandle, GET_PARAMETERS);
+#else
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+  if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY) dlsym(_libHandle, GET_PARAMETERS);
+#endif
+
+  if(aGetIParameters) interface = aGetIParameters(ap); 
+  return _PTR(IParameters)(interface);
+}
+
+SALOMEDS::SObject_ptr ClientFactory::crbSObject(const _PTR(SObject)& theSObject)
+{
+  SALOMEDS::SObject_var so;
+
+#ifdef WIN32
+  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+  if(!aConvertSObject) aConvertSObject = (CONVERT_SOBJECT_FUNCTION)::GetProcAddress(_libHandle, CONVERT_SOBJECT);
+#else
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+  if(!aConvertSObject) aConvertSObject = (CONVERT_SOBJECT_FUNCTION) dlsym(_libHandle, CONVERT_SOBJECT);
+#endif
+
+  if(aConvertSObject) so = aConvertSObject(theSObject); 
+
+  if(CORBA::is_nil(so)) return SALOMEDS::SObject::_nil();
+  return so._retn();
+}
+
+
+SALOMEDS::Study_ptr ClientFactory::crbStudy(const _PTR(Study)& theStudy)
+{
+  SALOMEDS::Study_var study;
+
+#ifdef WIN32
+  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+  if(!aConvertStudy) aConvertStudy = (CONVERT_STUDY_FUNCTION)::GetProcAddress(_libHandle, CONVERT_STUDY);
+#else
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+  if(!aConvertStudy) aConvertStudy = (CONVERT_STUDY_FUNCTION) dlsym(_libHandle, CONVERT_STUDY);
+#endif
+
+  if(aConvertStudy) study = aConvertStudy(theStudy); 
+  
+  if(CORBA::is_nil(study)) return SALOMEDS::Study::_nil();
+  return study._retn();
+}
+
+SALOMEDS::StudyBuilder_ptr ClientFactory::crbStudyBuilder(const _PTR(StudyBuilder)& theStudyBuilder)
+{
+  SALOMEDS::StudyBuilder_var studyBuilder;
+
+#ifdef WIN32
+  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+  if(!aConvertBuilder)aConvertBuilder  = (CONVERT_BUILDER_FUNCTION)::GetProcAddress(_libHandle, CONVERT_BUILDER);
+#else
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+  if(!aConvertBuilder) aConvertBuilder = (CONVERT_BUILDER_FUNCTION) dlsym(_libHandle, CONVERT_BUILDER);
+#endif
+
+  if(aConvertBuilder) studyBuilder = aConvertBuilder(theStudyBuilder); 
+  
+  if(CORBA::is_nil(studyBuilder)) return SALOMEDS::StudyBuilder::_nil();
+  return studyBuilder._retn();
+}
index 85929293d90df7b699eed79fe5de934b492aeac2..ae9ff5d5b9819b38e2a2d28f0ac43cbbc2da20ea 100644 (file)
@@ -30,6 +30,7 @@
 #include "SALOMEDSClient_SComponent.hxx"
 #include "SALOMEDSClient_Study.hxx"
 #include "SALOMEDSClient_StudyManager.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
 
 #include <string>
 
@@ -55,6 +56,11 @@ public:
    */
   static _PTR(Study) Study(SALOMEDS::Study_ptr theStudy);
 
+  /*!
+   *  Returns a client StudyBuilder wrapper that corresponds %theStudy
+   */
+  static _PTR(StudyBuilder) StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder);
+
   /*!
    *  Returns a client StudyManager wrapper
    */
@@ -65,7 +71,27 @@ public:
    */
   static _PTR(StudyManager) createStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
 
-  
+  /*!
+   * Returns an IParameters interface
+   */
+  static _PTR(IParameters) getIParameters(const _PTR(AttributeParameter)& ap);
+    
+
+  /*!
+   *  Returns a CORBA SObject that corresponds %theStudy
+   */
+  static SALOMEDS::SObject_ptr crbSObject(const _PTR(SObject)& theSObject);
+
+  /*!
+   *  Returns a CORBA Study that corresponds %theStudy
+   */
+  static SALOMEDS::Study_ptr crbStudy(const _PTR(Study)& theStudy);  
+
+  /*!
+   *  Returns a CORBA StudyBuilder that corresponds %theStudyBuilder
+   */
+  static SALOMEDS::StudyBuilder_ptr crbStudyBuilder(const _PTR(StudyBuilder)& theStudyBuilder);  
+
 };
 
 #endif
diff --git a/src/SALOMEDSClient/SALOMEDSClient_IParameters.hxx b/src/SALOMEDSClient/SALOMEDSClient_IParameters.hxx
new file mode 100644 (file)
index 0000000..66419ca
--- /dev/null
@@ -0,0 +1,146 @@
+// Copyright (C) 2006  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// 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.salome-platform.org/
+//
+#ifndef SALOMEDSClient_IParameters_H
+#define SALOMEDSClient_IParameters_H
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "SALOMEDSClient_definitions.hxx"
+#include "SALOMEDSClient_AttributeParameter.hxx"
+
+/*! 
+  Class which an interface to store the parameters of the objects
+*/
+class SALOMEDSClient_IParameters
+{
+public:
+  
+   virtual ~SALOMEDSClient_IParameters() {}
+
+  /*!
+    Appends a string value to a named list. 
+    Returns a number of the added value.
+    Note: the name of the list MUST be unique
+   */
+  virtual int append(const std::string& listName, const std::string& value) = 0; 
+
+  /*!
+    Returns a number elements in the list
+   */
+  virtual int nbValues(const std::string& listName) = 0;
+
+  /*!
+    Returns a list of values in the list
+   */
+  virtual std::vector<std::string> getValues(const std::string& listName) = 0;
+
+  /*!
+    Returns a value with given %index, where %index is in range [0:nbValues-1]
+   */
+  virtual std::string getValue(const std::string& listName, int index) = 0;
+
+  /*!
+    Returns a list all entries lists
+   */
+  virtual std::vector<std::string> getLists() = 0;
+
+  /*!
+    Sets a new named parameter value for the given entry
+   */
+  virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value) = 0;
+
+  /*!
+    Gets a named parameter value for the given entry
+   */
+  virtual std::string getParameter(const std::string& entry, const std::string& parameterName) = 0;
+
+  /*!
+    Returns all parameter names of the given entry
+   */
+  virtual std::vector<std::string> getAllParameterNames(const std::string& entry) = 0;
+
+  /*!
+    Returns all parameter  values of the given entry
+   */
+  virtual std::vector<std::string> getAllParameterValues(const std::string& entry) = 0;
+
+  /*!
+    Returns a number of parameters of the given entry
+   */
+  virtual int getNbParameters(const std::string& entry) = 0;
+
+  /*!
+    Returns a list all entries 
+   */
+  virtual std::vector<std::string> getEntries() = 0;
+
+  /*!
+    Sets a global named property value
+   */
+  virtual void setProperty(const std::string& name, const std::string& value) = 0;
+
+  /*!
+    Gets a value of global named property
+   */
+  virtual std::string getProperty(const std::string& name) = 0;
+
+  /*!
+    Returns a list all properties 
+   */
+  virtual std::vector<std::string> getProperties() = 0;
+
+  /*!
+    Breaks a value string in two parts which is divided by %separator.
+    If fromEnd is True the search of separator starts from the end of the string
+   */
+  virtual std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true) = 0;
+
+
+  /*!
+    Returns encoded entry that is a relative entry for the component
+   */
+  virtual std::string encodeEntry(const std::string& entry, const std::string& compName) = 0;
+
+  /*!
+    Returns decoded entry that is an absolute entry
+   */
+  virtual std::string decodeEntry(const std::string& entry) = 0;
+
+  /*!
+    Enables/Disables the dumping visual parameters, static implementation is supposed
+   */
+  virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;
+
+  /*!
+    Returns whether there is the dumping visual parameters, static implementation is supposed
+   */
+  virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;  
+
+  /*!
+    Returns a default name of the component where the visula parameters are stored.
+    Static implementation is supposed
+  */
+  virtual std::string getDefaultVisualComponent() = 0;
+
+};
+
+
+#endif
index f3f68e2da6fb1d29a10f59d826c0c2303145fee5..464ae7bc2cfeeae2bf252343b0057ea679063564 100644 (file)
@@ -209,7 +209,7 @@ Handle(SALOMEDSImpl_Study) SALOMEDSImpl_StudyManager::Open(const TCollection_Asc
 
   if (isASCII) {
     Handle(TColStd_HSequenceOfAsciiString) aFilesToRemove = new TColStd_HSequenceOfAsciiString;
-    aFilesToRemove->Append(aHDFUrl);
+    aFilesToRemove->Append("hdf_from_ascii.hdf");
     SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
   }
 
index c870618aae1719ef383891205248107c8e7104b1..45cdaaf00291adff139a71020075325ea6d01117 100644 (file)
 # include <exception>
 # include <iostream>
 
+#ifdef _DEBUG_
 # define LOCALIZED(message) #message , __FILE__ , __LINE__
+#else
+# define LOCALIZED(message) #message
+#endif
 
 #if defined UTILS_EXPORTS
 #if defined WIN32