]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Merge with head and (in salome_adm) with OCC_development..a2 branch.
authorasv <asv@opencascade.com>
Fri, 17 Feb 2006 07:34:30 +0000 (07:34 +0000)
committerasv <asv@opencascade.com>
Fri, 17 Feb 2006 07:34:30 +0000 (07:34 +0000)
19 files changed:
INSTALL
bin/VERSION
bin/createAppli.sh
doc/salome/tui/KERNEL/doxyfile
doc/salome/tui/KERNEL/sources/static/tree.js
resources/CatalogResources.xml
resources/KERNELCatalog.xml
salome_adm/unix/config_files/check_boost.m4
salome_adm/unix/config_files/check_lam.m4
salome_adm/unix/config_files/check_pthreads.m4
salome_adm/unix/make_commence.in
src/Communication/ReceiverFactory.cxx
src/Communication/Receivers.cxx
src/Communication/Receivers.hxx
src/Communication/SALOME_Comm_i.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx
src/TOOLSDS/SALOMEDS_Tool.cxx
src/TOOLSDS/SALOMEDS_Tool.hxx

diff --git a/INSTALL b/INSTALL
index 5feb42fc3910ebac6259ca97caf67f618b7c6ca5..d4f202f61d112cf5cacaa596f8e9ab61bf9cbd1b 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,6 @@
-This is the version 3.1.0 of KERNEL
+This is the version 3.2.0a1 of KERNEL
 Previous versions :
+        - 3.1.0
         - 3.0.0
         - 2.2.4
         - 2.2.3
index 140772c2747a2599667a2784497cf28e48b2c7ee..45dcc2b0e2b26c972a20a33d9cf963cfea12ccac 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - KERNEL VERSION: 3.1.0
+THIS IS SALOME - KERNEL VERSION: 3.2.0a1
index c6c4de07287f95b0343aeea44186648861db767f..1ff6ed6def573fd3c20538caec9fa47e80559aa4 100755 (executable)
@@ -3,5 +3,15 @@
 comName=`which $0`
 rep=`dirname $comName`
 
-cp -r $rep/appliskel $1
-chmod +x $1/*.sh $1/run* $1/envd
+if [ $# -ne 1 ]
+  echo "--- usage:"
+  echo $0 AppliName
+  echo "--- In which AppliName is a directory to create with SALOME application scripts"
+elif [ -d $1]
+  echo $1 "directory already exists, nothing done"
+else
+  mkdir -p $1
+  cp -r $rep/appliskel/* $1
+  cp $rep/appliskel/.bashrc $1
+  chmod +x $1/*.sh $1/run* $1/envd
+fi
\ No newline at end of file
index 1758a66e5a5fa148cc17f80fdce8865c256d9327..95584c08b24f808d6931827ec9016229514f7829 100755 (executable)
@@ -3,7 +3,7 @@
 #---------------------------------------------------------------------------
 # General configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME           = "SALOME v.3.1.0"
+PROJECT_NAME           = "SALOME v.3.2.0a1"
 PROJECT_NUMBER         = id#1.1
 OUTPUT_DIRECTORY       = ../
 OUTPUT_LANGUAGE        = English
index 0ddcfec0f6614e5ef787276d9f26027c35e1d27a..e5e050f9bcc27b930372f9726e7421ba345513ba 100755 (executable)
@@ -1,4 +1,4 @@
-foldersTree = gFld("<b>SALOME v.3.1.0 </b>", "", "")
+foldersTree = gFld("<b>SALOME v.3.2.0a1 </b>", "", "")
      insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
 
 aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
index 2a074cda7eaae4ff5c973bdb8061a62c232f15bf..96b0c448b6bec8d24fb99e9012e1ac7d5a22bfc4 100644 (file)
@@ -3,44 +3,44 @@
 
 <machine hostname="is111790" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
 
 <machine hostname="is111915" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
 
 <machine hostname="is111918" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
 
 <machine hostname="is111996" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
index 836c6cadbcd869e713f2b413e22ab0453bb07e44..380055e647c4dbe3473d882bb28645a411b0d62f 100644 (file)
@@ -16,7 +16,7 @@
                <component-username>Salome</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>3.1.0</component-version>
+               <component-version>3.2.0a1</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
 
@@ -27,7 +27,7 @@
                <component-username>SalomeTestComponent</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>3.1.0</component-version>
+               <component-version>3.2.0a1</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
@@ -37,7 +37,7 @@
                <component-username>SALOME_TestComponentPy</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>3.1.0</component-version>
+               <component-version>3.2.0a1</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
index c77edba5d14faec79d9d4288ece7b480efd56b67..c31e57b2b9f05dae5a2a0b7bc1e596b3932ae45b 100644 (file)
@@ -32,6 +32,9 @@ BOOST_CPPFLAGS=""
 AC_SUBST(BOOST_LIBS)
 BOOST_LIBS=""
 
+AC_SUBST(BOOST_LIBTHREAD)
+BOOST_LIBTHREAD=""
+
 boost_ok=no
 
 if test -z ${BOOSTDIR}; then
@@ -58,7 +61,24 @@ else
     AC_CHECKING(for libboost_thread-mt.so library file)
     AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread-mt.so,boost_ok=yes,boost_ok=no)
     if test "x${boost_ok}" = "xyes" ; then
-      BOOST_LIBS="-L${BOOSTDIR}/lib"
+      BOOST_LIBTHREAD="libboost_thread-mt.so"
+      AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD})
+      BOOST_LIBTHREAD="-mt"
+    else
+      AC_CHECKING(for libboost_thread.so library file)
+      AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread.so,boost_ok=yes,boost_ok=no)
+      if test "x${boost_ok}" = "xyes" ; then
+        BOOST_LIBTHREAD="libboost_thread.so"
+        AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD})
+       BOOST_LIBTHREAD=""
+      fi
+    fi
+    if test "x${boost_ok}" = "xyes" ; then
+      if test "x${BOOSTDIR}" = "x/usr" ; then
+        BOOST_LIBS=""
+      else
+        BOOST_LIBS="-L${BOOSTDIR}/lib"
+      fi
       AC_MSG_RESULT(\$BOOST_LIBS = ${BOOST_LIBS})
     fi
   fi
index d15fdde312cbb7238625970aabf5c089372420c9..4a9941e2c98fe05d3d15087442300a9d80224609 100644 (file)
@@ -88,8 +88,25 @@ if test "$WITHLAM" = yes; then
       AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no")
       if test "$WITHLAM" = "yes";then
         MPI_LIBS="-lmpi $MPI_LIBS"
+        LIBS="-lmpi $LIBS"
       fi
 
+      AC_LANG_SAVE
+      AC_LANG_CPLUSPLUS
+      LIBS="-llammpi++ $LIBS"
+      AC_MSG_CHECKING(for MPI_Init in -llammpi++)
+      AC_TRY_LINK([
+         #include <mpi.h>
+         ], [MPI::Init();],
+         WITHLAM="yes",WITHLAM="no")
+      if test "$WITHLAM" = "yes";then
+        AC_MSG_RESULT(yes)
+        MPI_LIBS="-llammpi++ $MPI_LIBS"
+      else
+        AC_MSG_RESULT(no)
+      fi
+      AC_LANG_RESTORE
+
       AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
 
     fi
index 80aef2aad184d0e6509be9383e3422b254bf336c..d5033889e9cf46426843454e85dbd833853be25f 100644 (file)
@@ -38,6 +38,8 @@ if test $flag = no; then
   AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
   AC_CHECK_LIB(pthread,pthread_mutex_lock, 
                LIBS_PTHREADS="-lpthread $LIBS_PTHREADS",LIBS_PTHREADS="")
+else
+  LDFLAGS="-pthread $LDFLAGS"
 fi
 
 if test $flag = no && x$LIBS_PTHREADS = x; then
index 31535c4a62d8cf454c63bca49a035d11ee49cbcf..d1b961624a61ca6cc9638f760a19cb423987796e 100644 (file)
@@ -43,6 +43,7 @@ CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@
 
 BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
 BOOST_LIBS = @BOOST_LIBS@
+BOOST_LIBTHREAD = @BOOST_LIBTHREAD@
 
 # OpenPBS
 
index f404a7ec3dcc4b65b827216ca84b4d23b2f84e98..94743bfae0525b6b1d320eb23657e03c23d7703e 100644 (file)
@@ -115,7 +115,7 @@ double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &s
   else if(!CORBA::is_nil(mpi_ptr))
     {
       CORBA::release(sender);
-      MPIReceiver<double,MPI_DOUBLE,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
+      MPIReceiver<double,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
       return rec.getValue(size);
     }
 #endif
@@ -165,7 +165,7 @@ int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size)th
   else if(!CORBA::is_nil(mpi_ptr))
     {
       CORBA::release(sender);
-      MPIReceiver<int,MPI_INT,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
+      MPIReceiver<int,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
       return rec.getValue(size);
     }
 #endif
index f97b4a1a4bf52918dbadcc45ad3bd9b71130e91c..f2ce1fa890eaef15cb38aec178efe11a6114d5eb 100644 (file)
@@ -154,17 +154,17 @@ T *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::get
 
 #ifdef HAVE_MPI2
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
 }
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
   _mySender->release();
 }
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   int i=0;
   int myproc;
   int sproc;
@@ -211,15 +211,15 @@ T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   }
   MPI_Recv( &_n, 1, MPI_LONG, sproc,p->tag1,com,&status);
   _v = new T[_n];
-  MPI_Recv( _v, _n, T2, sproc,p->tag2,com,&status);
+  MPI_Recv( _v, _n, MPITRAITS<T>::MpiType, sproc,p->tag2,com,&status);
   _mySender->close(p);
   MPI_Comm_disconnect( &com );  
   size=_n;
   return _v;
 }
 
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getValue(long &size)
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
   return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
index 203bf64dc12a225a518bfe14596f732c8d099db8..2dd44a854c9db69f4c01fafb2c6edaa6ffa8ee71 100644 (file)
@@ -94,7 +94,19 @@ private:
 /*!
   Receiver for MPI transfert.
  */
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+template<class T>
+struct MPITRAITS
+{
+  static MPI_Datatype MpiType;
+};
+
+template<>
+MPI_Datatype MPITRAITS<double>::MpiType=MPI_DOUBLE;
+
+template<>
+MPI_Datatype MPITRAITS<int>::MpiType=MPI_INT;
+
+template<class T,class CorbaSender,class servForT,class ptrForT>
 class MPIReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
index f886b53878d6fe1934938241fe16402a1e35ead5..632ce7a7375cd2d1474af94cbbf9b6c0b965e9d3 100644 (file)
@@ -272,7 +272,7 @@ SALOME::MPISender::param* SALOME_MPISender_i::getParam()
 void SALOME_MPISender_i::send()
 {
   _type=getTypeOfDataTransmitted();
-  _argsForThr=new (void *)[8];
+  _argsForThr=new void *[8];
   _argsForThr[0]=_portName;
   _argsForThr[1]=&_lgrTabToSend;
   _argsForThr[2]=(void *)_tabToSend;
index b38df3443edd6a85758eb4ba3c869804d4c05f18..452a50a79f1e2c7d2fae289487adb39b89a35e9c 100644 (file)
@@ -1266,14 +1266,18 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath,
     Handle(SALOMEDSImpl_SComponent) sco = itcomponent.Value();
     aCompType = sco->ComponentDataType();
     //GEOM and MED are independent components
-    if(aCompType == "GEOM" || aCompType == "MED") aSeq.Prepend(TCollection_ExtendedString(aCompType));
-    else aSeq.Append(TCollection_ExtendedString(aCompType));
+    if (aCompType == "GEOM" || aCompType == "MED")
+      aSeq.Prepend(TCollection_ExtendedString(aCompType));
+    else
+      aSeq.Append(TCollection_ExtendedString(aCompType));
   }
 
 #ifdef WIN32
-  TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("\\")+theBaseName+TCollection_AsciiString(".py");
+  TCollection_AsciiString aFileName =
+    thePath + TCollection_AsciiString("\\") + theBaseName + TCollection_AsciiString(".py");
 #else
-  TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("/")+theBaseName+TCollection_AsciiString(".py");
+  TCollection_AsciiString aFileName =
+    thePath + TCollection_AsciiString("/")  + theBaseName + TCollection_AsciiString(".py");
 #endif
 
   //Create a file that will contain a main Study script
@@ -1293,7 +1297,8 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath,
 
   TCollection_AsciiString aBatchModeScript = "salome";
 
-  //Output to the main Study script required Python modules import, set sys.path and add a creation of the study.
+  //Output to the main Study script required Python modules import,
+  //set sys.path and add a creation of the study.
   fp << GetDumpStudyComment().ToCString() << endl << endl;
   fp << "import sys" << endl;
   fp << "import " << aBatchModeScript << "\n" << endl;
@@ -1374,9 +1379,9 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath,
     fp2.open(aFileName.ToCString(), ios::out);
 
 #ifdef WIN32
-    isOpened = fp.is_open();
+    isOpened = fp2.is_open();
 #else
-    isOpened = fp.rdbuf()->is_open();
+    isOpened = fp2.rdbuf()->is_open();
 #endif
 
     if(!isOpened) {
index b6e861c10f4fcb9e847a30841a30816c409cd901..ebf67aeca7c1caa8739666e4af8b3221db0b6e26 100644 (file)
@@ -1214,7 +1214,8 @@ static void ReadAttributes(const Handle(SALOMEDSImpl_Study)& theStudy,
 
   if (!strcmp(hdf_dataset->GetName(),"COMPONENTDATATYPE")) {
     anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, "AttributeComment");
-  } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference")) {
+  } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") ||
+             !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance
     theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string));
     delete(current_string);
     hdf_dataset->CloseOnDisk();
index fa13a1eb42756a3ed27dbcdae66f5ab00c00a053..90263d1de00ff4116a630f832d185439c0931316 100644 (file)
@@ -150,112 +150,133 @@ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory,
 // function : PutFilesToStream
 // purpose  : converts the files from a list 'theFiles' to the stream
 //============================================================================
-SALOMEDS::TMPFile* 
-SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
-                               const SALOMEDS::ListOfFileNames& theFiles,
-                               const int theNamesOnly)
+namespace
 {
-  int i, aLength = theFiles.length();
-  if(aLength == 0)
-//    return NULL;
-    return (new SALOMEDS::TMPFile);
-
-  //Get a temporary directory for saved a file
-  TCollection_AsciiString aTmpDir(const_cast<char*>(theFromDirectory.c_str()));
-
-  long aBufferSize = 0;
-  long aCurrentPos;
-
-  int aNbFiles = 0;
-  int* aFileNameSize= new int[aLength];
-  long* aFileSize= new long[aLength];
-
-  //Determine the required size of the buffer
-
-  for(i=0; i<aLength; i++) {
-
-    //Check if the file exists
+  SALOMEDS::TMPFile* 
+  PutFilesToStream(const std::string& theFromDirectory,
+                  const SALOMEDS::ListOfFileNames& theFiles,
+                  const SALOMEDS::ListOfFileNames& theFileNames,
+                  const int theNamesOnly)
+  {
+    int i, aLength = theFiles.length();
+    if(aLength == 0)
+      return (new SALOMEDS::TMPFile);
+    
+    //Get a temporary directory for saved a file
+    TCollection_AsciiString aTmpDir(const_cast<char*>(theFromDirectory.c_str()));
+    
+    long aBufferSize = 0;
+    long aCurrentPos;
+    
+    int aNbFiles = 0;
+    int* aFileNameSize= new int[aLength];
+    long* aFileSize= new long[aLength];
     
-    if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
-      TCollection_AsciiString aFullPath = aTmpDir + CORBA::string_dup(theFiles[i]);   
-      OSD_Path anOSDPath(aFullPath);
-      OSD_File anOSDFile(anOSDPath);
-      if(!anOSDFile.Exists()) continue;
+    //Determine the required size of the buffer
+    
+    for(i=0; i<aLength; i++) {
+      
+      //Check if the file exists
+      
+      if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
+       TCollection_AsciiString aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());   
+       OSD_Path anOSDPath(aFullPath);
+       OSD_File anOSDFile(anOSDPath);
+       if(!anOSDFile.Exists()) continue;
 #ifdef WNT
-      ifstream aFile(aFullPath.ToCString(), ios::binary);
+       ifstream aFile(aFullPath.ToCString(), ios::binary);
 #else
-      ifstream aFile(aFullPath.ToCString());
+       ifstream aFile(aFullPath.ToCString());
 #endif
-      aFile.seekg(0, ios::end);
-      aFileSize[i] = aFile.tellg();
-      aBufferSize += aFileSize[i];              //Add a space to store the file
-    }
-    aFileNameSize[i] = strlen(theFiles[i])+1;
-    aBufferSize += aFileNameSize[i];          //Add a space to store the file name
-    aBufferSize += (theNamesOnly)?4:12;       //Add 4 bytes: a length of the file name,
-                                              //    8 bytes: length of the file itself
-    aNbFiles++;
-  } 
-
-  aBufferSize += 4;      //4 bytes for a number of the files that will be written to the stream;
-  unsigned char* aBuffer = new unsigned char[aBufferSize];  
-  if(aBuffer == NULL)
-//    return NULL; 
-    return (new SALOMEDS::TMPFile);
-
-  //Initialize 4 bytes of the buffer by 0
-  memset(aBuffer, 0, 4); 
-  //Copy the number of files that will be written to the stream
-  memcpy(aBuffer, &aNbFiles, ((sizeof(int) > 4) ? 4 : sizeof(int))); 
-
-
-  aCurrentPos = 4;
-
-  for(i=0; i<aLength; i++) {
-    ifstream *aFile;
-    if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
-      TCollection_AsciiString aFullPath = aTmpDir + CORBA::string_dup(theFiles[i]);
-      OSD_Path anOSDPath(aFullPath);
-      OSD_File anOSDFile(anOSDPath);
-      if(!anOSDFile.Exists()) continue;
+       aFile.seekg(0, ios::end);
+       aFileSize[i] = aFile.tellg();
+       aBufferSize += aFileSize[i];              //Add a space to store the file
+      }
+      aFileNameSize[i] = strlen(theFileNames[i])+1;
+      aBufferSize += aFileNameSize[i];          //Add a space to store the file name
+      aBufferSize += (theNamesOnly)?4:12;       //Add 4 bytes: a length of the file name,
+      //    8 bytes: length of the file itself
+      aNbFiles++;
+    } 
+    
+    aBufferSize += 4;      //4 bytes for a number of the files that will be written to the stream;
+    unsigned char* aBuffer = new unsigned char[aBufferSize];  
+    if(aBuffer == NULL)
+      return (new SALOMEDS::TMPFile);
+    
+    //Initialize 4 bytes of the buffer by 0
+    memset(aBuffer, 0, 4); 
+    //Copy the number of files that will be written to the stream
+    memcpy(aBuffer, &aNbFiles, ((sizeof(int) > 4) ? 4 : sizeof(int))); 
+    
+    
+    aCurrentPos = 4;
+    
+    for(i=0; i<aLength; i++) {
+      ifstream *aFile;
+      if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
+       TCollection_AsciiString aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+       OSD_Path anOSDPath(aFullPath);
+       OSD_File anOSDFile(anOSDPath);
+       if(!anOSDFile.Exists()) continue;
 #ifdef WNT
-      aFile = new ifstream(aFullPath.ToCString(), ios::binary);
+       aFile = new ifstream(aFullPath.ToCString(), ios::binary);
 #else
-      aFile = new ifstream(aFullPath.ToCString());
+       aFile = new ifstream(aFullPath.ToCString());
 #endif  
-    }
-    //Initialize 4 bytes of the buffer by 0
-    memset((aBuffer + aCurrentPos), 0, 4); 
-    //Copy the length of the file name to the buffer
-    memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int))); 
-    aCurrentPos += 4;
-
-    //Copy the file name to the buffer
-    memcpy((aBuffer + aCurrentPos), theFiles[i], aFileNameSize[i]);
-    aCurrentPos += aFileNameSize[i];
-    
-    if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
-      //Initialize 8 bytes of the buffer by 0
-      memset((aBuffer + aCurrentPos), 0, 8); 
-      //Copy the length of the file to the buffer
-      memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
-      aCurrentPos += 8;
+      }
+      //Initialize 4 bytes of the buffer by 0
+      memset((aBuffer + aCurrentPos), 0, 4); 
+      //Copy the length of the file name to the buffer
+      memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int))); 
+      aCurrentPos += 4;
       
-      aFile->seekg(0, ios::beg);
-      aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
-      aFile->close();
-      delete(aFile);
-      aCurrentPos += aFileSize[i];
+      //Copy the file name to the buffer
+      memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]);
+      aCurrentPos += aFileNameSize[i];
+      
+      if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
+       //Initialize 8 bytes of the buffer by 0
+       memset((aBuffer + aCurrentPos), 0, 8); 
+       //Copy the length of the file to the buffer
+       memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
+       aCurrentPos += 8;
+       
+       aFile->seekg(0, ios::beg);
+       aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
+       aFile->close();
+       delete(aFile);
+       aCurrentPos += aFileSize[i];
+      }
     }
+    
+    delete[] aFileNameSize;
+    delete[] aFileSize;
+    
+    
+    CORBA::Octet* anOctetBuf =  (CORBA::Octet*)aBuffer;
+    
+    return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1));
   }
-
-  delete[] aFileNameSize;
-  delete[] aFileSize;
   
-  
-  CORBA::Octet* anOctetBuf =  (CORBA::Octet*)aBuffer;
-  
-  return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1));
+}
+
+
+SALOMEDS::TMPFile* 
+SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
+                               const SALOMEDS::ListOfFileNames& theFiles,
+                               const int theNamesOnly)
+{
+  SALOMEDS::ListOfFileNames aFileNames(theFiles);
+  return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly);
+}
+
+
+SALOMEDS::TMPFile* 
+SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
+                               const SALOMEDS::ListOfFileNames& theFileNames)
+{
+  return ::PutFilesToStream("",theFiles,theFileNames,0);
 }
 
 //============================================================================
index c36de54e7d4fcfd362ac94cb4f0d1e5078bcf772..7c7f33a0f49db2c86b26f69343d8e8d1abe9f525 100644 (file)
@@ -64,6 +64,10 @@ public:
                                             const SALOMEDS::ListOfFileNames& theFiles,
                                             const int theNamesOnly = 0);
 
+  // Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
+  static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
+                                            const SALOMEDS::ListOfFileNames& theFileNames);
+
   // Converts a byte sequence <theStream> to files and places them in <theToDirectory>
   static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
                                                        const std::string& theToDirectory,