]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: merge V2_2_4
authorprascle <prascle>
Fri, 8 Jul 2005 07:16:20 +0000 (07:16 +0000)
committerprascle <prascle>
Fri, 8 Jul 2005 07:16:20 +0000 (07:16 +0000)
100 files changed:
INSTALL
Makefile.in
bin/VERSION
bin/killSalome.py
bin/killSalomeWithPort.py
bin/launchConfigureParser.py
bin/runNS.sh
bin/runSalome
bin/runSalome.py
idl/SALOME_Comm.idl
resources/KERNELCatalog.xml
resources/Plugin [deleted file]
resources/Plugin.in [new file with mode: 0755]
salome_adm/Makefile.in
salome_adm/unix/config_files/check_boost.m4
salome_adm/unix/config_files/check_cas.m4
salome_adm/unix/config_files/check_hdf5.m4
salome_adm/unix/config_files/check_lam.m4
salome_adm/unix/config_files/check_lsf.m4
salome_adm/unix/config_files/check_med2.m4
salome_adm/unix/config_files/check_mico.m4
salome_adm/unix/config_files/check_mpi.m4
salome_adm/unix/config_files/check_mpich.m4
salome_adm/unix/config_files/check_omniorb.m4
salome_adm/unix/config_files/check_opengl.m4
salome_adm/unix/config_files/check_openpbs.m4
salome_adm/unix/config_files/check_pyqt.m4
salome_adm/unix/config_files/check_qt.m4
salome_adm/unix/config_files/check_qwt.m4
salome_adm/unix/config_files/check_sip.m4
salome_adm/unix/config_files/check_swig.m4
salome_adm/unix/config_files/check_vtk.m4
salome_adm/unix/depend.in
salome_adm/unix/make_commence.in
salome_adm/unix/make_conclude.in
src/Communication/Makefile.in
src/Communication/Receiver.cxx [deleted file]
src/Communication/Receiver.hxx
src/Communication/ReceiverFactory.cxx
src/Communication/ReceiverFactory.hxx
src/Communication/Receivers.cxx
src/Communication/Receivers.hxx
src/Communication/SALOME_Comm_i.cxx
src/Communication/SALOME_Comm_i.hxx
src/Communication/SenderFactory.cxx
src/Communication/SenderFactory.hxx
src/Communication/libSALOME_Comm.i [new file with mode: 0644]
src/Container/Container_i.cxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx
src/LifeCycleCORBA_SWIG/Makefile.in
src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py
src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i
src/MEDWrapper/Base/MED_Common.hxx
src/Makefile.in
src/ModuleGenerator/IDLparser.py
src/OCCViewer/OCCViewer_ViewFrame.cxx
src/OCCViewer/OCCViewer_ViewPort.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_Viewer3d.cxx
src/PatchQt/Makefile.in
src/PatchQt/qactionP.cxx
src/PatchQt/qactionP.h
src/PatchQt/qfiledialogP.cxx
src/PatchQt/qfiledialogP.h
src/PatchQt/qsplitterP.cxx
src/PatchQt/qsplitterP.h
src/PatchQt/qworkspaceP.cxx
src/PatchQt/qworkspaceP.h
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewFrame.h
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx
src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx
src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx
src/SALOMEDS/SALOMEDS_StudyManager_i.cxx
src/SALOMEGUI/CLIENT_msg_en.po
src/SALOMEGUI/QAD_Desktop.cxx
src/SALOMEGUI/QAD_Desktop.h
src/SALOMEGUI/QAD_RightFrame.cxx
src/SALOMEGUI/QAD_StudyFrame.cxx
src/SALOMEGUI/QAD_ViewFrame.cxx
src/SALOMEGUI/QAD_ViewFrame.h
src/SALOMEGUI/QAD_XmlHandler.cxx
src/SALOMEGUI/QAD_msg_en.po
src/SALOMELocalTrace/utilities.h
src/SALOME_PYQT/Makefile.in
src/SALOME_PYQT/SalomePyQt_v4.sip [new file with mode: 0644]
src/SALOME_SWIG/Makefile.in
src/SALOME_SWIG/libSALOME_Swig.i
src/Session/SALOME_Session_Server.cxx
src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx
src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx
src/Utils/Utils_SINGLETON.hxx
src/VTKFilter/SALOME_ExtractUnstructuredGrid.cxx
src/VTKFilter/SALOME_ExtractUnstructuredGrid.h
src/VTKViewer/VTKViewer_Algorithm.h
src/VTKViewer/VTKViewer_RenderWindow.cxx
src/VTKViewer/VTKViewer_RenderWindow.h
src/VTKViewer/VTKViewer_ViewFrame.cxx

diff --git a/INSTALL b/INSTALL
index b4672cadd98253eccc58b5814a4519b983c35292..a63e887a71d9b82105207894f67aa7f57a51d6c5 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,8 @@
-This is the version 2.2.2 of KERNEL
+This is the version 2.2.4 of KERNEL
 
 Previous versions :
+        - 2.2.3
+       - 2.2.2
        - 2.2.1
        - 2.2.0
        - 2.1.1
index 3eda287c444cd1622071a81d5011662ffae954e0..e26d509bdc7367b262a8e174a256148de0074f55 100644 (file)
@@ -83,7 +83,6 @@ uc_del.png \
 uc_new.png \
 uc_clear.png \
 channel.cfg \
-Plugin \
 SALOMEDS_Resources
 
 BIN_SCRIPT= \
@@ -180,6 +179,10 @@ install-bin: $(BIN_SCRIPT)
        $(INSTALL) -d  $(bindir)
        $(INSTALL_PROGRAM) $^ $(bindir)
 
+# install Plugin file
+install-plugin: $(top_builddir)/share/salome/resources/Plugin
+       ($(INSTALL_DATA) $^ $(datadir)/resources/. || exit 1); \
+
 uninstall: uninstall-idl
 
 uninstall-idl:
@@ -195,5 +198,9 @@ distclean-other:
 
 @MODULE@
 
-install: install-bin install-appliskel install-include install-make install-end
+$(top_builddir)/share/salome/resources/Plugin: resources/Plugin
+       cp -f $< $@ ; \
+
+resources: $(top_builddir)/share/salome/resources/Plugin
 
+install: install-bin install-appliskel install-include install-make install-plugin install-end
index aaa365137d8ed305657b40f5b510bab6b7172d05..9ba43eb6b1075319fb6df47bbbe72aa6bb2dd28c 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - KERNEL VERSION: 2.2.2
+THIS IS SALOME - KERNEL VERSION: 2.2.4
index 96e923980773f150248c9f98a6363f9b44742cc9..7ed1d63725772a1f8904373028f2982ba796e19d 100755 (executable)
@@ -5,7 +5,7 @@ from killSalomeWithPort import killMyPort
 
 def killAllPorts():
     user = os.getenv('USER')
-    for file in os.listdir("/tmp"):
+    for file in os.listdir(os.getenv("HOME")):
         l = string.split(file, "_")
         if len(l) >= 4:
             if file[:len(user)] == user:
index 7c8dcd2ed1800c80f269142caef2488c702616c4..bf02709cf6e1480678abea387ac9bf4902407bea 100755 (executable)
@@ -3,7 +3,7 @@ import os, sys, pickle, signal, commands
 
 ########## kills all salome processes with the given port ##########
 def killMyPort(port):
-    filedict='/tmp/'+os.getenv('USER')+"_"+port+'_SALOME_pidict'
+    filedict=os.getenv("HOME")+'/'+os.getenv('USER')+"_"+port+'_SALOME_pidict'
     found = 0
     try:
         fpid=open(filedict, 'r')
index 403e0299bcb3b59799c2fc0fdcda4d519f716f54..d66bdedf9d44987dc2a9e4a3ae049aadb4784fa4 100755 (executable)
@@ -140,7 +140,7 @@ try:
   s = file.read()
   while len(s):
     l = string.split(s, ":")
-    if string.split(l[0], " ")[0] == "ORBInitRef":
+    if string.split(l[0], " ")[0] == "ORBInitRef" or string.split(l[0], " ")[0] == "InitRef" :
       my_port = int(l[len(l)-1])
       pass
     s = file.read()
index 76b7452bfbf981dd0e62350ade3632d3119ea91a..b5c155a6c46fda66161d8dbd41b64cd6c461fe17 100755 (executable)
@@ -17,7 +17,7 @@ touch ${BaseDir}/logs/${Username}/dummy
 \rm -f ${BaseDir}/logs/${Username}/omninames* ${BaseDir}/logs/${Username}/dummy ${BaseDir}/logs/${Username}/*.log
 
 echo "Name Service... "
-aSedCommand="s/ORBInitRef NameService=corbaname::`hostname`:\([[:digit:]]*\)/\1/"
+aSedCommand="s/.*NameService=corbaname::`hostname`:\([[:digit:]]*\)/\1/"
 aPort=`sed -e"$aSedCommand" $OMNIORB_CONFIG`
 omniNames -start $aPort -logdir ${BaseDir}/logs/${Username} &
 
index 1112c8433d7ffb3b2de6ed70aab6da5daf6487e4..9bd7d4ace534c888321935260a8ddff37ca412a9 100755 (executable)
@@ -12,9 +12,13 @@ searchFreePort() {
             echo ${NSPORT} - Ok
            local myhost=`hostname`
             export OMNIORB_CONFIG=${HOME}/.omniORB_${myhost}_${NSPORT}.cfg
+           local initref="NameService=corbaname::"`hostname`":$NSPORT"
            export NSPORT
-            local initref="NameService=corbaname::"`hostname`":$NSPORT"
-            echo "ORBInitRef $initref" > $OMNIORB_CONFIG
+           if [[ `python -c "import CORBA; print CORBA.ORB_ID"` = "omniORB4" ]]; then
+                echo "InitRef = $initref" > $OMNIORB_CONFIG
+           else
+               echo "ORBInitRef $initref" > $OMNIORB_CONFIG
+           fi
             break
         fi
         echo -n "${NSPORT} "
index 1c47d008a761dacc0d97126b2336a4b86eec7b28..4d344156147a5f79eb2c573ff8fafd6dca5af65e 100755 (executable)
@@ -674,7 +674,7 @@ def useSalome(args, modules_list, modules_root_dir):
         
     #print process_id
     
-    filedict = '/tmp/' + os.getenv('USER') + "_" + str(args['port']) \
+    filedict = os.getenv("HOME") + '/' + os.getenv('USER') + "_" + str(args['port']) \
              + '_' + args['appname'].upper() + '_pidict'
    
     process_ids = []
index a01eca1a6ae5a5b622a61a17538e96d4dfac72ca..e1736c61619486d58d3f534a10568c4e8ef91fdc 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _SALOME_COMM_IDL_
+#define _SALOME_COMM_IDL_
+
 #include "SALOME_Exception.idl"
 
 module SALOME {
@@ -20,33 +23,40 @@ module SALOME {
 
   interface Sender {
     TypeOfDataTransmitted getTypeOfDataTransmitted();
-    Sender buildOtherWithProtocol(in TypeOfCommunication type);
     void release();
   };
 
+  interface SenderDouble : Sender {
+    SenderDouble buildOtherWithProtocol(in TypeOfCommunication type);
+  };
+
+  interface SenderInt : Sender {
+    SenderInt buildOtherWithProtocol(in TypeOfCommunication type);
+  };
+
   //No compulsory copy between double and CORBA::Double
-  interface CorbaDoubleNCSender : Sender {
+  interface CorbaDoubleNCSender : SenderDouble {
     unsigned long getSize();
     vectorOfDouble sendPart(in unsigned long n1,in unsigned long n2);
     vectorOfDouble send();
   };
 
   //Compulsory copy between double and CORBA::Double
-  interface CorbaDoubleCSender : Sender {
+  interface CorbaDoubleCSender : SenderDouble {
     unsigned long getSize();
     //unsigned long getSize2();
     vectorOfDouble sendPart(in unsigned long n1,in unsigned long n2);
   };
 
   //No compulsory copy between int and CORBA::Long
-  interface CorbaLongNCSender : Sender {
+  interface CorbaLongNCSender : SenderInt {
     unsigned long getSize();
     vectorOfLong sendPart(in unsigned long n1,in unsigned long n2);
     vectorOfLong send();
   };
 
   //Compulsory copy between int and CORBA::Long
-  interface CorbaLongCSender : Sender {
+  interface CorbaLongCSender : SenderInt {
     unsigned long getSize();
     vectorOfLong sendPart(in unsigned long n1,in unsigned long n2);
   };
@@ -63,6 +73,12 @@ module SALOME {
     void close(in param p);
   };
 
+  interface MPISenderDouble : SenderDouble,MPISender {
+  };
+
+  interface MPISenderInt : SenderInt,MPISender {
+  };
+
   interface SocketSender : Sender {
     typedef struct Parameter {
       unsigned long lstart;
@@ -78,4 +94,11 @@ module SALOME {
     void send();
   };
 
+  interface SocketSenderDouble : SenderDouble,SocketSender {
+  };
+
+  interface SocketSenderInt : SenderInt,SocketSender {
+  };
 };
+
+#endif
index 70151724e6d50ec0cb30e8f0f80abb5b3ca2dc50..0ca69b4786f436bc377990d0b6a5319644100bf0 100644 (file)
@@ -16,7 +16,7 @@
                <component-username>Salome</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>2.2.2</component-version>
+               <component-version>2.2.4</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>2.2.2</component-version>
+               <component-version>2.2.4</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>2.2.2</component-version>
+               <component-version>2.2.4</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
diff --git a/resources/Plugin b/resources/Plugin
deleted file mode 100644 (file)
index 8212624..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-! Description of available plugins
-! ********************************
-!
-a148e300-5740-11d1-a904-080036aaa103.Location: FWOSPlugin
-!
-! standard attribute drivers plugin
-!
-ad696000-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
-ad696001-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
-ad696002-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
diff --git a/resources/Plugin.in b/resources/Plugin.in
new file mode 100755 (executable)
index 0000000..3d4fad5
--- /dev/null
@@ -0,0 +1,10 @@
+! Description of available plugins
+! ********************************
+!
+a148e300-5740-11d1-a904-080036aaa103.Location: FWOSPlugin
+!
+! standard attribute drivers plugin
+!
+ad696000-5b34-11d1-b5ba-00a0c9064368.Location: @CAS_STDPLUGIN@
+ad696001-5b34-11d1-b5ba-00a0c9064368.Location: @CAS_STDPLUGIN@
+ad696002-5b34-11d1-b5ba-00a0c9064368.Location: @CAS_STDPLUGIN@
index 2982ad06c7b72d28330a5d07054d545dae4afc79..4dfafb94b34265c0ff86260539651ac4e9e1dc03 100644 (file)
@@ -41,5 +41,7 @@ uninstall-idl:
 
 distclean:
 
+clean:
+
 distclean-other:
 
index 789167b4c1264a3d29860a04c96f3f492090f5bf..ed3a09302886034679a531ed34b4a27f6b7bc1c3 100644 (file)
@@ -32,6 +32,11 @@ boost_ok=no
 
 if test -z ${BOOSTDIR}; then
   AC_MSG_WARN(You must provide BOOSTDIR variable)
+  dnl E.A. : If BOOSTDIR is not defined, trying in system
+  AC_CHECK_HEADER(boost/shared_ptr.hpp,boost_ok=yes,boost_ok=no)
+  if test boost_ok = no ; then
+    AC_MSG_WARN(You must provide BOOSTDIR variable)
+  fi
 else
   AC_MSG_RESULT(\$BOOSTDIR = ${BOOSTDIR})
   AC_CHECKING(for boost/shared_ptr.hpp header file)
index b27c7deacb222a222820aac2226837713a737b90..99fd4be6b3c71621e06e4a10e11ad48e63af43a1 100644 (file)
@@ -37,6 +37,7 @@ AC_SUBST(CAS_OCAF)
 AC_SUBST(CAS_DATAEXCHANGE)
 AC_SUBST(CAS_LDFLAGS)
 AC_SUBST(CAS_LDPATH)
+AC_SUBST(CAS_STDPLUGIN)
 
 OWN_CONFIG_H=no
 
@@ -72,6 +73,19 @@ case $host_os in
 esac
 
 AC_MSG_CHECKING(for OpenCascade directories)
+
+if test -z $CASROOT; then
+  AC_MSG_RESULT(CASROOT not defined)
+  for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
+    if test -f $d/libTKernel.so ; then
+      AC_MSG_RESULT(libTKernel.so detected in $d)
+      CASROOT=$d
+      CASROOT=`echo ${CASROOT} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+      break
+    fi
+  done
+fi
+
 if test -d ${CASROOT}/${casdir}/lib; then
   CAS_LDPATH="-L$CASROOT/$casdir/lib "
   AC_MSG_RESULT(yes)
@@ -91,12 +105,17 @@ if test -z $CASROOT; then
 else
   occ_ok=yes
   OCC_VERSION_MAJOR=0
+  OCC_VERSION_MINOR=0
   ff=$CASROOT/inc/Standard_Version.hxx
   if test -f $ff ; then
     grep "define OCC_VERSION_MAJOR" $ff > /dev/null
     if test $? = 0 ; then
       OCC_VERSION_MAJOR=`grep "define OCC_VERSION_MAJOR" $ff | awk '{i=3 ; print $i}'`
     fi
+    grep "define OCC_VERSION_MINOR" $ff > /dev/null
+    if test $? = 0 ; then
+      OCC_VERSION_MINOR=`grep "define OCC_VERSION_MINOR" $ff | awk '{i=3 ; print $i}'`
+    fi
   fi
 fi
 
@@ -123,6 +142,15 @@ case $host_os in
 esac
   CPPFLAGS="$CPPFLAGS $CAS_CPPFLAGS"
 
+  if test -n $KERNEL_ROOT_DIR; then
+      if test -d $KERNEL_ROOT_DIR/include/salome; then
+          CAS_CPPFLAGS="$CAS_CPPFLAGS -I$KERNEL_ROOT_DIR/include/salome"
+         CPPFLAGS="$CPPFLAGS -I$KERNEL_ROOT_DIR/include/salome"
+      fi
+  fi
+  CAS_CPPFLAGS="$CAS_CPPFLAGS -I${ROOT_BUILDDIR}/include/salome"
+  CPPFLAGS="$CPPFLAGS -I${ROOT_BUILDDIR}/salome_adm/unix"
+
   echo
   echo
   echo testing config.h
@@ -186,14 +214,23 @@ else
   CAS_KERNEL="$CAS_LDPATH -lTKernel -lTKMath"
 
   # E.A. compatibility version 4 and 5.x  
-  CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKCAF -lFWOSPlugin -lTKPShape -lTKPCAF -lTKStdSchema -lTKShapeSchema -lPAppStdPlugin"
+  CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKPShape -lTKCDF -lTKCAF -lTKShapeSchema -lTKPCAF -lFWOSPlugin -lTKStdSchema"
   if test $OCC_VERSION_MAJOR -lt 5 ; then
     CAS_OCAF="$CAS_OCAF -lTKPAppStd"
   fi
-  CAS_OCAF="$CAS_OCAF -lTKCDF"
+  if test -f $CASROOT/$casdir/lib/libPAppStdPlugin.so ; then
+    # this library is absent in CASCADE 5.2.3
+    CAS_OCAF="$CAS_OCAF -lPAppStdPlugin"
+    CAS_STDPLUGIN="PAppStdPlugin"
+  fi
+  if test -f $CASROOT/$casdir/lib/libStdPlugin.so ; then
+    # this libraries are only for CASCADE 5.2.3
+    CAS_STDPLUGIN="StdPlugin"
+    CAS_OCAF="$CAS_OCAF -lStdPlugin -lStdLPlugin -lTKLCAF -lTKPLCAF -lTKStdLSchema"
+  fi
   
   CAS_VIEWER="$CAS_LDPATH -lTKOpenGl -lTKV3d -lTKService"
-  CAS_MODELER="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKOffset"
+  CAS_MODELER="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBO -lTKBool -lTKHLR -lTKFillet -lTKOffset -lTKFeat"
 
   # E.A. compatibility version 4 and 5.x  
   CAS_DATAEXCHANGE="$CAS_LDPATH -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing"
index b3658afc1e622c4c897f27816dcb8404b6754f27..b20db13ac474e0ce1918f5e64413c51e6117c7d4 100644 (file)
@@ -48,7 +48,12 @@ then
    AC_MSG_WARN(undefined HDF5HOME variable which specify hdf5 installation directory)
 else
    LOCAL_INCLUDES="-I$HDF5HOME/include"
-   LOCAL_LIBS="-L$HDF5HOME/lib"
+   if test "x$HDF5HOME" = "x/usr"
+   then
+      LOCAL_LIBS=""
+   else
+      LOCAL_LIBS="-L$HDF5HOME/lib"
+   fi
 fi
 
 dnl hdf5 headers
index 9a303a054a1b9d4a7d8dbf51c23943bc15aca306..994a2b0a538d5ca0e2f4b9cd643a6fe59acfb321 100644 (file)
@@ -41,7 +41,12 @@ if test "$WITHLAM" = yes; then
 
   if test "$LAM_HOME"; then
     MPI_INCLUDES="-I$LAM_HOME/include"
-    MPI_LIBS="-L$LAM_HOME/lib"
+    if test "x$LAM_HOME" = "x/usr"
+    then
+      MPI_LIBS=""
+    else
+      MPI_LIBS="-L$LAM_HOME/lib"
+    fi
   fi
 
   CPPFLAGS_old="$CPPFLAGS"
index 5fb9e0b100f4bd8125cd22b8706a76ffad3cdbc7..4e448bafad92b71deccfcdf2d686377e260399a2 100755 (executable)
@@ -43,7 +43,12 @@ AC_DEFUN([CHECK_LSF],
  
    dnl LIB directory
 
-   LSF_LDFLAGS="-L${LSF_LIBDIR}"
+   if test "x${LSF_LIBDIR}" = "x/usr/lib"
+   then
+     LSF_LDFLAGS=""
+   else
+     LSF_LDFLAGS="-L${LSF_LIBDIR}"
+   fi
    LSF_LIBS=""
    saved_LDFLAGS=${LDFLAGS}
    saved_LIBS=${LIBS}
index 3b8fd9f8d815934b00d90089d17fccc2f5eb8fef..c1388819536f265d1dae9692b78fe4aca4584035 100644 (file)
@@ -51,9 +51,22 @@ dnl check, if there is MED library
 if test -z $MED2HOME
 then
    AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory)
-else
+   AC_PATH_PROG(MDUMP, mdump)
+   if test "xMDUMP" != "x" ; then
+      MED2HOME=$MDUMP
+      MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+      MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+   fi
+fi
+if test ! -z $MED2HOME
+then
    LOCAL_INCLUDES="$HDF5_INCLUDES -I$MED2HOME/include"
-   LOCAL_LIBS="-L$MED2HOME/lib -lmed $HDF5_LIBS"
+   if test "x$MED2HOME" = "x/usr"
+   then
+     LOCAL_LIBS="-lmed $HDF5_LIBS"
+   else
+     LOCAL_LIBS="-L$MED2HOME/lib -lmed $HDF5_LIBS"
+   fi
 fi
 
 dnl check med2 header
index b839d1e5c868810bc6b545d689f78b6963d21069..5d97e2aa185fd5471a4b8adab40e9d1e22b92a2f 100644 (file)
@@ -84,7 +84,12 @@ fi
 
 if test "x$mico_ok" = "xyes" 
 then
-  MICO_LDFLAGS="-L$MICO_LIB"
+  if test "x$MICO_LIB" = "x/usr/lib"
+  then
+    MICO_LDFLAGS=""
+  else
+    MICO_LDFLAGS="-L$MICO_LIB"
+  fi
 
   LIBS_old=$LIBS
   MICO_LIBS="$MICO_LDFLAGS -lmico$MICO_VERSION -ldl"
index d746ac0554d93a2d3ecc9f6574c7d6264c0f433a..e8255a2e482ea4bd414468c9661f3354006cd8ac 100644 (file)
@@ -41,7 +41,12 @@ if test "$WITHMPI" = yes; then
   if test "x$withval" != "xyes"; then
     MPI_HOME=$withval
     MPI_INCLUDES="-I$MPI_HOME/include"
-    MPI_LIBS="-L$MPI_HOME/lib"
+    if test "x$MPI_HOME" = "x/usr"
+    then
+      MPI_LIBS=""
+    else
+      MPI_LIBS="-L$MPI_HOME/lib"
+    fi
   fi
 
   CPPFLAGS_old="$CPPFLAGS"
index de0e6d50a9d5b6b85c62a924806e7d6d7ab10508..c5971aa35220357ed5215b58a4305fec9f7d40f3 100644 (file)
@@ -41,7 +41,12 @@ if test "$WITHMPICH" = yes; then
 
   if test "$MPICH_HOME"; then
     MPI_INCLUDES="-I$MPICH_HOME/include"
-    MPI_LIBS="-L$MPICH_HOME/lib"
+    if test "x$MPICH_HOME" = "x/usr"
+    then
+      MPI_LIBS=""
+    else
+      MPI_LIBS="-L$MPICH_HOME/lib"
+    fi
   fi
 
   CPPFLAGS_old="$CPPFLAGS"
index f3d5abcdb62d902211015d7a4bdc6ef2c1a10514..1f63365bf30438d3bf8ed8057466d08d16f84114 100644 (file)
@@ -99,7 +99,12 @@ dnl omniORB_ok=yes
 
 if test "x$omniORB_ok" = "xyes" 
 then
-  OMNIORB_LDFLAGS="-L$OMNIORB_LIB"
+  if test "x$OMNIORB_LIB" = "x/usr/lib"
+  then
+    OMNIORB_LDFLAGS=""
+  else
+    OMNIORB_LDFLAGS="-L$OMNIORB_LIB"
+  fi
 
   LIBS_old=$LIBS
   LIBS="$LIBS $OMNIORB_LDFLAGS -lomnithread"
index ad1ccbd1eb044e154d898b9216eda416814d91ea..dd43d25a03a6b873d0ddee362a62704078b2bb61 100644 (file)
@@ -49,7 +49,12 @@ if test "x$local_opengl" = "xyes" ; then
    if test -f "${opengl_dir}/include/GL/gl.h" ; then
       OpenGL_ok=yes
       OGL_INCLUDES="-I${opengl_dir}/include"
-      OGL_LIBS="-L${opengl_dir}/lib"
+      if test "x${opengl_dir}" = "x/usr"
+      then
+        OGL_LIBS=""
+      else
+        OGL_LIBS="-L${opengl_dir}/lib"
+      fi
       AC_MSG_RESULT(select OpenGL distribution in ${opengl_dir})
    else
       AC_MSG_RESULT(no gl.h header file in ${opengl_dir}/include/GL)
@@ -91,13 +96,23 @@ then
   for i in $dirs; do
     if test -r "$i/libGL.so"; then
 dnl      AC_MSG_RESULT(in $i)
-      OGL_LIBS="-L$i"
+      if test "x$i" = "x/usr/lib"
+      then
+        OGL_LIBS=""
+      else
+        OGL_LIBS="-L$i"
+      fi
       break
     fi
 # under IRIX ?
     if test -r "$i/libGL.sl"; then
 dnl      AC_MSG_RESULT(in $i)
-      OGL_LIBS="-L$i"
+      if test "x$i" = "x/usr/lib"
+      then
+        OGL_LIBS=""
+      else
+        OGL_LIBS="-L$i"
+      fi
       break
     fi
   done
index 9598285c9548c3e09f6d30f16637cd53b8b97a60..220528574cab3fc786af9016af0eaebfce967204 100644 (file)
@@ -30,7 +30,12 @@ AC_DEFUN([CHECK_OPENPBS],
    CPPFLAGS=${saved_CPPFLAGS}
    AC_SUBST(OPENPBS_INCLUDES)
  
-   OPENPBS_LIBDIR="-L${OPENPBS}/lib"
+   if test "x${OPENPBS}" = "x/usr"
+   then
+     OPENPBS_LIBDIR=""
+   else
+     OPENPBS_LIBDIR="-L${OPENPBS}/lib"
+   fi
    OPENPBS_LIBS="-lpbs"
    saved_LDFLAGS=${LDFLAGS}
    saved_LIBS=${LIBS}
index 9374319a6562e210b5ae1c19eceb34f8888ab865..573ebc44f41e0090a368eeb6084e39c7a74773a4 100644 (file)
@@ -2,6 +2,8 @@ dnl Copyright (C) 2003  CEA/DEN, EDF R&D
 
 AC_DEFUN([CHECK_PYQT],[
 AC_REQUIRE([CHECK_PYTHON])dnl
+AC_REQUIRE([CHECK_QT])dnl
+AC_REQUIRE([CHECK_SIP])dnl
 
 AC_ARG_WITH(pyqt,
     [  --with-pyqt=DIR      root directory path to PyQt installation ],
@@ -24,68 +26,239 @@ AC_ARG_WITH(pyuic,
 
 AC_CHECKING(for pyqt)
 
-pyqt_ok=no
+pyqt_ok=yes
 
-if test "x$PYQTDIR" = x; then
-  PYQTDIR="/usr"
+dnl look for pyuic
+pyqt_uic_ok=no
+if test "x$PYUIC" != x; then
+  dnl try withval value
+  AC_CHECK_FILE($PYUIC,pyqt_uic_ok=yes,pyqt_uic_ok=no)
 fi
-  
-if test "x$PYQT_SIPS" = x; then
-  PYQT_SIPS="/usr/share/sip/qt"
+if test "x$pyqt_uic_ok" == "xno"; then
+  dnl try ${PYQTDIR}
+  if test "x${PYQTDIR}" != "x"; then
+    if test -d ${PYQTDIR} ; then
+      AC_CHECK_FILE(${PYQTDIR}/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
+      if test "x$pyqt_uic_ok" == "xyes"; then
+        PYUIC="${PYQTDIR}/pyuic"
+      fi
+    fi
+  fi   
 fi
-
-if test -d $PYQTDIR/lib/python${PYTHON_VERSION}/site-packages; then
-  PYQTLIB=$PYQTDIR/lib/python${PYTHON_VERSION}/site-packages
-else
-  if test -d $PYQTDIR/lib; then
-    PYQTLIB=$PYQTDIR/lib
-  else
-    PYQTLIB=$PYQTDIR
+if test "x$pyqt_uic_ok" == "xno"; then
+  dnl try ${SIPDIR}
+  if test "x${SIPDIR}" != "x"; then
+    if test -d ${SIPDIR} ; then
+      AC_CHECK_FILE(${SIPDIR}/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
+      if test "x$pyqt_uic_ok" == "xyes"; then
+        PYUIC="${SIPDIR}/pyuic"
+      fi
+    fi
+  fi   
+fi
+if test "x$pyqt_uic_ok" == "xno"; then
+  dnl try ${PYTHONHOME}/bin
+  if test "x${PYTHONHOME}" != "x"; then
+    if test -d ${PYTHONHOME}/bin ; then
+      AC_CHECK_FILE(${PYTHONHOME}/bin/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
+      if test "x$pyqt_uic_ok" == "xyes"; then
+        PYUIC="${PYTHONHOME}/bin/pyuic"
+      fi
+    fi
+  fi   
+fi
+if test "x$pyqt_uic_ok" == "xno"; then
+  dnl try /usr/bin
+  AC_CHECK_FILE(/usr/bin/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
+  if test "x$pyqt_uic_ok" == "xyes"; then
+    PYUIC="/usr/bin/pyuic"
   fi
 fi
-
-if test -d $PYQTDIR/bin; then
-  PYQTBIN=$PYQTDIR/bin
-else
-  PYQTBIN=$PYQTDIR
+if test "x$pyqt_uic_ok" == "xno"; then
+  pyqt_ok=no
 fi
 
-if test "x$PYUIC" = x; then
-  PYUIC="$PYQTBIN/pyuic"
+dnl look for PyQt libs
+pyqt_lib_ok=no
+if test "x${PYQTDIR}" != "x"; then
+  dnl try {PYQTDIR}
+  AC_CHECK_FILE(${PYQTDIR}/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+  if test "x$pyqt_lib_ok" == "xyes"; then
+    if test "x${PYQTDIR}" = "x/usr/lib"
+    then
+      PYQT_LIBS="-lqtcmodule"
+    else
+      PYQT_LIBS="-L${PYQTDIR} -lqtcmodule"
+    fi
+  else 
+    AC_CHECK_FILE(${PYQTDIR}/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+    if test "x$pyqt_lib_ok" == "xyes"; then
+      if test "x${PYQTDIR}" = "x/usr/lib"
+      then
+        PYQT_LIBS=""
+      else
+        PYQT_LIBS="-L${PYQTDIR}"
+      fi
+    fi
+  fi
+  if test "x$pyqt_lib_ok" == "xno"; then
+    dnl try {PYQTDIR}/lib
+    if test -d {PYQTDIR}/lib; then
+      AC_CHECK_FILE(${PYQTDIR}/lib/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+      if test "x$pyqt_lib_ok" == "xyes"; then
+        PYQT_LIBS="-L${PYQTDIR}/lib -lqtcmodule"
+      else 
+        AC_CHECK_FILE(${PYQTDIR}/lib/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+        if test "x$pyqt_lib_ok" == "xyes"; then
+          PYQT_LIBS="-L${PYQTDIR}/lib"
+        fi
+      fi
+    fi
+  fi
+  if test "x$pyqt_lib_ok" == "xno"; then
+    dnl try {PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages
+    if test -d {PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages; then
+      AC_CHECK_FILE(${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+      if test "x$pyqt_lib_ok" == "xyes"; then
+        PYQT_LIBS="-L${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages -lqtcmodule"
+      else 
+        AC_CHECK_FILE(${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+        if test "x$pyqt_lib_ok" == "xyes"; then
+          PYQT_LIBS="-L${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages"
+        fi
+      fi
+    fi
+  fi
 fi
-  
-AC_CHECK_FILE("$PYUIC",pyqt_ok=yes,pyqt_ok=no)
-
-dnl if test "x$pyqt_ok" = xyes ; then
-dnl   AC_CHECK_FILES("$PYQTLIB/qt.py",pyqt_ok=yes,pyqt_ok=no)
-dnl fi
-
-dnl if test "x$pyqt_ok" = xno ; then
-dnl  AC_CHECK_FILES("$PYQTLIB/qt/qt.py",pyqt_ok=yes,pyqt_ok=no)
-dnl fi
-
-dnl if test "x$pyqt_ok" = xyes ; then
-dnl   AC_CHECK_FILE("$PYQTLIB/libqtcmodule.so",pyqt_ok=yes,pyqt_ok=no)
-dnl fi
-
-if test "x$pyqt_ok" = xyes ; then
-  AC_CHECK_FILES("$PYQT_SIPS/qtmod.sip",pyqt_ok=yes,pyqt_ok=no)
+if test "x$pyqt_lib_ok" == "xno"; then
+  dnl try ${SIPDIR}
+  if test "x${SIPDIR}" != "x"; then
+    if test -d ${SIPDIR} ; then
+      AC_CHECK_FILE(${SIPDIR}/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+      if test "x$pyqt_lib_ok" == "xyes"; then
+        if test "x${SIPDIR}" = "x/usr/lib"
+        then
+          PYQT_LIBS="-lqtcmodule"
+        else
+          PYQT_LIBS="-L${SIPDIR} -lqtcmodule"
+        fi
+      else 
+        AC_CHECK_FILE(${SIPDIR}/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+        if test "x$pyqt_lib_ok" == "xyes"; then
+          if test "x${SIPDIR}" = "x/usr/lib"
+          then
+            PYQT_LIBS=""
+          else
+            PYQT_LIBS="-L${SIPDIR}"
+          fi
+        fi
+      fi
+    fi
+  fi
 fi
-if test "x$pyqt_ok" = xyes ; then
-  AC_CHECK_FILE("$PYQT_SIPS/copying.sip",pyqt_ok=yes,pyqt_ok=no)
+if test "x$pyqt_lib_ok" == "xno"; then
+  dnl try ${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages
+  if test "x${PYTHONHOME}" != "x"; then
+    if test -d ${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages ; then
+      AC_CHECK_FILE(${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+      if test "x$pyqt_lib_ok" == "xyes"; then
+        PYQT_LIBS="-L${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages -lqtcmodule"
+      else 
+        AC_CHECK_FILE(${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+        if test "x$pyqt_lib_ok" == "xyes"; then
+          PYQT_LIBS="-L${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages"
+        fi
+      fi
+    fi
+  fi   
+fi
+if test "x$pyqt_lib_ok" == "xno"; then
+  dnl try /usr/lib/python${PYTHON_VERSION}/site-packages
+  AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+  if test "x$pyqt_lib_ok" == "xyes"; then
+    PYQT_LIBS="-L/usr/lib/python${PYTHON_VERSION}/site-packages -lqtcmodule"
+  else 
+    AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
+    if test "x$pyqt_lib_ok" == "xyes"; then
+      PYQT_LIBS="-L/usr/lib/python${PYTHON_VERSION}/site-packages"
+    fi
+  fi
+fi
+if test "x$pyqt_lib_ok" == "xno"; then
+  pyqt_ok=no
 fi
 
-if test "x$pyqt_ok" = xyes ; then
-  PYQT_ROOT=$PYQTDIR
+dnl look for PyQt sips
+pyqt_sips_ok=no
+dnl try ${PYQT_SIPS} or ${PYQT_SIPS}/qt
+if test "x${PYQT_SIPS}" != "x"; then
+  AC_CHECK_FILE(${PYQT_SIPS}/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+  if test "x$pyqt_sips_ok" == "xno"; then
+    AC_CHECK_FILE(${PYQT_SIPS}/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+    if test "x$pyqt_sips_ok" == "xyes"; then
+      PYQT_SIPS="${PYQT_SIPS}/qt"
+    fi
+  fi
+fi
+if test "x$pyqt_sips_ok" == "xno"; then
+  dnl try ${PYQTDIR}/sip
+  if test "x${PYQTDIR}" != "x"; then
+    if test -d ${PYQTDIR}/sip ; then
+      AC_CHECK_FILE(${PYQTDIR}/sip/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+      if test "x$pyqt_sips_ok" == "xyes"; then
+        PYQT_SIPS="${PYQTDIR}/sip"
+      else
+        AC_CHECK_FILE(${PYQTDIR}/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+        if test "x$pyqt_sips_ok" == "xyes"; then
+          PYQT_SIPS="${PYQTDIR}/sip/qt"
+        fi
+      fi
+    fi
+  fi
+fi
+if test "x$pyqt_sips_ok" == "xno"; then
+  dnl try ${SIPDIR}/sip
+  if test "x${SIPDIR}" != "x"; then
+    if test -d ${SIPDIR}/sip ; then
+      AC_CHECK_FILE(${SIPDIR}/sip/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+      if test "x$pyqt_sips_ok" == "xyes"; then
+        PYQT_SIPS="${SIPDIR}/sip"
+      else
+        AC_CHECK_FILE(${SIPDIR}/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+        if test "x$pyqt_sips_ok" == "xyes"; then
+          PYQT_SIPS="${SIPDIR}/sip/qt"
+        fi
+      fi
+    fi
+  fi
+fi
+if test "x$pyqt_sips_ok" == "xno"; then
+  dnl try /usr/share/sip
+  if test -d /usr/share/sip ; then
+    AC_CHECK_FILE(/usr/share/sip/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+    if test "x$pyqt_sips_ok" == "xyes"; then
+      PYQT_SIPS="/usr/share/sip"
+    else
+      AC_CHECK_FILE(/usr/share/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
+      if test "x$pyqt_sips_ok" == "xyes"; then
+        PYQT_SIPS="/usr/share/sip/qt"
+      fi
+    fi
+  fi
+fi
+if test "x$pyqt_sips_ok" == "xno"; then
+  pyqt_ok=no
+else
   PYQT_INCLUDES="-I$PYQT_SIPS"
-  PYQT_LIBS="-L$PYQTLIB "
-  AC_SUBST(PYQT_ROOT)
-  AC_SUBST(PYQT_INCLUDES)
-  AC_SUBST(PYQT_LIBS)
-  AC_SUBST(PYQT_SIPS)
-  AC_SUBST(PYUIC)
 fi
 
+AC_SUBST(PYQT_INCLUDES)
+AC_SUBST(PYQT_LIBS)
+AC_SUBST(PYQT_SIPS)
+AC_SUBST(PYUIC)
+
+AC_MSG_RESULT(for pyqt: $pyqt_ok)
+
 ])dnl
 dnl
 
index b1557decd72952de075d84afab0a80667366e7eb..3faa1e990dd1076a526628175ecb53028d9c20e0 100644 (file)
@@ -37,6 +37,14 @@ if test "x$QTDIR" = "x"
 then
    AC_MSG_RESULT(please define QTDIR variable)
    qt_ok=no
+else
+   AC_MSG_RESULT(QTDIR is $QTDIR)
+   qt_inc_ok=no
+   QTINC=""
+   AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
+   QT_VERS=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
+   AC_MSG_RESULT(Qt version is $QT_VERS)
+   QT_VERS="Qt_"`echo $QT_VERS | sed -e 's%\"%%g' -e 's%\.%_%g'`
 fi
 
 if  test "x$qt_ok" = "xyes"
@@ -75,32 +83,13 @@ then
   fi
 fi
 
-version=`moc -v > mocversion 2>&1;cut -c40-44 mocversion;rm -rf mocversion`
-case "$version" in
-  3.3.3)
-   QT_VERS=v3_3_3
-   AC_MSG_RESULT(QT3.3.3 install detected)
-   qt_ok=yes;;
-  3.0.5)
-   AC_MSG_RESULT(QT3.0.5 install detected)
-   QT_VERS=v3_0_5
-   qt_ok=yes;;
-  *)
-   AC_MSG_RESULT(qt version $version not supported)
-   qt_ok=no
-   QT_VERS=no ;;
-esac
-
-AC_SUBST(QT_VERS)
-AC_MSG_RESULT(qt version $QT_VERS )
-
 AC_SUBST(QTDIR)
 QT_ROOT=$QTDIR
 
 if  test "x$qt_ok" = "xyes"
 then
   CPPFLAGS_old=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
+  CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
 
   AC_LANG_CPLUSPLUS
   AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
@@ -109,31 +98,14 @@ then
 
   AC_MSG_CHECKING(include of qt headers)
 
-  if  test "x$qt_ok" = "xyes"
+  if  test "x$qt_ok" = "xno"
   then
-    AC_MSG_RESULT(yes)
-    QT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT"
-    QT_MT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT"
+    AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
+    AC_MSG_RESULT(QTDIR environment variable may be wrong)
   else
-    CPPFLAGS_old=$CPPFLAGS
-    CPPFLAGS="$CPPFLAGS -I$QTDIR/include/qt3"
-
-    AC_LANG_CPLUSPLUS
-    AC_CHECK_HEADER(qapp.h,qt_ok=yes ,qt_ok=no)
-
-    CPPFLAGS=$CPPFLAGS_old
-
-    AC_MSG_CHECKING(include of qt headers)
-
-    if  test "x$qt_ok" = "xno"
-    then
-      AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
-      AC_MSG_RESULT(QTDIR environment variable may be wrong)
-    else
-      AC_MSG_RESULT(yes)
-      QT_INCLUDES="-I${QT_ROOT}/include/qt3 -DQT_THREAD_SUPPORT"
-      QT_MT_INCLUDES="-I${QT_ROOT}/include/qt3 -DQT_THREAD_SUPPORT"
-    fi
+    AC_MSG_RESULT(yes)
+    QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT"
+    QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT"
   fi
 fi
 
@@ -141,10 +113,15 @@ if  test "x$qt_ok" = "xyes"
 then
   AC_MSG_CHECKING(linking qt library)
   LIBS_old=$LIBS
-  LIBS="$LIBS -L$QTDIR/lib -lqt-mt $OGL_LIBS"
+  if test "x$QTDIR" = "x/usr"
+  then
+    LIBS="$LIBS -lqt-mt $OGL_LIBS"
+  else
+    LIBS="$LIBS -L$QTDIR/lib -lqt-mt $OGL_LIBS"
+  fi
 
   CXXFLAGS_old=$CXXFLAGS
-  CXXFLAGS="$CXXFLAGS $QT_MT_INCLUDES"
+  CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
 
   AC_CACHE_VAL(salome_cv_lib_qt,[
     AC_TRY_LINK(
@@ -163,8 +140,14 @@ then
     AC_MSG_RESULT(QTDIR environment variable may be wrong)
   else
     AC_MSG_RESULT(yes)
-       QT_LIBS="-L$QTDIR/lib -lqt-mt"
-    QT_MT_LIBS="-L$QTDIR/lib -lqt-mt"
+    if test "x$QTDIR" = "x/usr"
+    then
+         QT_LIBS=" -lqt-mt"
+      QT_MT_LIBS=" -lqt-mt"
+    else
+         QT_LIBS="-L$QTDIR/lib -lqt-mt"
+      QT_MT_LIBS="-L$QTDIR/lib -lqt-mt"
+    fi
   fi
 
   LIBS=$LIBS_old
index 21b15fa3a5dac7c0fe2d3b7f35ea61316db817ac..760cc7dac0f336b70f161c11f93f1c60cff6b0e1 100644 (file)
@@ -24,23 +24,34 @@ AC_ARG_WITH(qwt_inc,
 if test -z $QWTHOME; then
   AC_MSG_RESULT(QWTHOME not defined)
   exits_ok=no  
-  AC_CHECK_FILE("/usr/local/lib/libqwt.so",exits_ok=yes,exits_ok=no)
+  if test "x$exits_ok" = "xno"; then
+     for d in /usr/local /usr ; do
+        AC_CHECK_FILE(${d}/lib/libqwt.so,exits_ok=yes,exits_ok=no)
+        if test "x$exits_ok" = "xyes"; then
+           QWTHOME=$d
+           AC_MSG_RESULT(libqwt.so detected in $d/lib)
+        fi
+     done
+  fi
+  if test "x$exits_ok" = "xno"; then
+     for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
+        if test -f $d/libqwt.so ; then
+           AC_MSG_RESULT(libqwt.so detected in $d)
+           QWTHOME=$d
+           QWTHOME=`echo ${QWTHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+           exits_ok=yes
+           break
+        fi
+     done
+  fi
   if test "x$exits_ok" = "xyes"; then
-     QWTHOME="/usr/local/lib"    
-     AC_MSG_RESULT(libqwt.so detected in /usr/local/lib)
      if test -z $QWT_INCLUDES; then
-        QWT_INCLUDES="/usr/local/include/qwt"
+        QWT_INCLUDES=$QWTHOME"/include/qwt"
+       if test ! -d $QWTHOME"/include/qwt" ; then
+          QWT_INCLUDES=$QWTHOME"/include"
+       fi
      fi
-  else
-     AC_CHECK_FILE("/usr/lib/libqwt.so",exits_ok=yes,exits_ok=no)
-     if test "x$exits_ok" = "xyes"; then
-       QWTHOME="/usr/lib"   
-       AC_MSG_RESULT(libqwt.so detected in /usr/lib)
-         if test -z $QWT_INCLUDES; then
-           QWT_INCLUDES="/usr/include/qwt"
-         fi
-       fi
-  fi   
+  fi
 else
   if test -z $QWT_INCLUDES; then
      QWT_INCLUDES="$QWTHOME/include"
@@ -57,7 +68,6 @@ else
    CPPFLAGS_old=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS -I$QWT_INCLUDES"
    CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
-#   CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
 
    AC_CHECK_HEADER(qwt.h,qwt_ok=yes,qwt_ok=no) 
 
@@ -74,11 +84,21 @@ if  test "x$qwt_ok" = "xyes"
 then
   AC_MSG_CHECKING(linking qwt library)
   LIBS_old=$LIBS
-  LIBS="$LIBS -L$QTDIR/lib -lqt-mt -L$QWTHOME/lib -lqwt"
+  if test "x$QTDIR" = "x/usr"
+  then
+    LIBS="$LIBS -lqt-mt"
+  else
+    LIBS="$LIBS -L$QTDIR/lib -lqt-mt"
+  fi
+  if test "x$QWTHOME" = "x/usr/lib"
+  then
+    LIBS="$LIBS -lqwt"
+  else
+    LIBS="$LIBS -L$QWTHOME/lib -lqwt"
+  fi
 
   CXXFLAGS_old=$CXXFLAGS
   CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$QWT_INCLUDES"
-#  CXXFLAGS="$CXXFLAGS -I$QTDIR/include -I$QWT_INCLUDES"
 
   AC_CACHE_VAL(salome_cv_lib_qwt,[
     AC_TRY_LINK(
@@ -100,7 +120,12 @@ then
     AC_MSG_RESULT(QWTHOME environment variable may be wrong)
   else
     QWT_INCLUDES="-I$QWT_INCLUDES"
-    QWT_LIBS="-L$QWTHOME/lib -lqwt"
+    if test "x$QWTHOME" = "x/usr/lib"
+    then
+      QWT_LIBS=" -lqwt"
+    else
+      QWT_LIBS="-L$QWTHOME/lib -lqwt"
+    fi
 
     AC_SUBST(QWT_INCLUDES)
     AC_SUBST(QWT_LIBS)
index 84d35f62938cc22ea254438f3a3343c260747447..dde9bc31f2d398e4d69f0b802ebd6a74c261614c 100644 (file)
@@ -2,6 +2,7 @@ dnl Copyright (C) 2003  CEA/DEN, EDF R&D
 
 AC_DEFUN([CHECK_SIP],[
 AC_REQUIRE([CHECK_PYTHON])dnl
+AC_REQUIRE([CHECK_QT])dnl
 
 sip_ok=yes
 
@@ -13,88 +14,144 @@ AC_ARG_WITH(sip,
       AC_PATH_PROG(SIP, sip)
     ])
 
-if test "x$SIP" = "x"
-then
+if test "x$SIP" = "x" ; then
     sip_ok=no
     AC_MSG_RESULT(sip not in PATH variable)
 else
-    version=`sip -V`
+    version=`$SIP -V`
+    AC_MSG_RESULT(sip version is $version)
     case "$version" in
          3.2*)
-           SIP_VERS=old ;;
+           SIP_VERS=v3_old ;;
          3.3*)
-           SIP_VERS=old ;;
+           SIP_VERS=v3_old ;;
          3.4*)
-           SIP_VERS=new ;;
+           SIP_VERS=v3_old ;;
          3.5*)
-           SIP_VERS=new ;;
+           SIP_VERS=v3_old ;;
          3.6*)
-           SIP_VERS=new ;;
+           SIP_VERS=v3_old ;;
          3.7*)
-           SIP_VERS=new ;;
+           SIP_VERS=v3_old ;;
          3.8*)
-           SIP_VERS=new ;;
+           SIP_VERS=v3_old ;;
          3.9*)
-           SIP_VERS=new ;;
+           SIP_VERS=v3_old ;;
          3.10*)
-           SIP_VERS=new2 ;;
-        4.1*)
-          SIP_VERS=v4_1 ;;
+           SIP_VERS=v3_new ;;
+         4.*)
+           SIP_VERS=v4 ;;
          *)
            AC_MSG_RESULT(sip version $version not supported)
-           SIP_VERS=no ;;
+           SIP_VERS=unsupported ;;
     esac
-    sip_ok=no
 
-    if test "x$SIP_VERS" = "xold"
-    then
-        dnl old install : includes and libs are in python install or in SIPDIR
-        AC_MSG_RESULT(old install detected)
-        sip_ok=yes
-       SIP_ROOT="$SIPDIR"
-       SIP_INCLUDES="${PYTHON_INCLUDES} -I${SIPDIR}"
-       SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -L${SIPDIR} -lsip"
+    sip_ok=no
+    dnl Search sip.h file
+    if test "x$SIPDIR" != "x" ; then
+        dnl look for sip.h in ${SIPDIR}
+        AC_CHECK_FILE(${SIPDIR}/sip.h,sip_ok=yes,sip_ok=no)
+       if test "x$sip_ok" == "xyes" ; then
+           SIP_INCLUDES="-I${SIPDIR}"
+       fi
+        if test "x$sip_ok" == "xno" ; then
+            dnl look for sip.h in ${SIPDIR}/include/python${PYTHON_VERSION}
+           if test -d ${SIPDIR}/include/python${PYTHON_VERSION} ; then
+               AC_CHECK_FILE(${SIPDIR}/include/python${PYTHON_VERSION}/sip.h,sip_ok=yes,sip_ok=no)
+               if test "x$sip_ok" == "xyes" ; then
+                   SIP_INCLUDES="-I${SIPDIR}/include/python${PYTHON_VERSION}"
+               fi
+           fi
+       fi
     fi
-
-    if test "x$SIP_VERS" = "xnew"
-    then
-       sip_ok=yes
-       if test -d ${SIPDIR}/include/python${PYTHON_VERSION} ; then
-           AC_MSG_RESULT(new install with include dir detected)
-           dnl new install with include dir : includes and libs are in python install or in SIPDIR/include
-          SIP_ROOT="$SIPDIR"
-          SIP_INCLUDES="${PYTHON_INCLUDES} -I${SIPDIR}/include/python${PYTHON_VERSION}"
-          SIP_LIBS="-L${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages -lsip"
-       else
-           dnl new install without include dir : includes and libs are in SIPDIR
-           AC_MSG_RESULT(new install without include dir detected)
-          sip_ok=yes
-          SIP_ROOT="$SIPDIR"
-          SIP_INCLUDES="-I${SIPDIR}"
-          SIP_LIBS="-L${SIPDIR} -lsip"
-        fi
+    if test "x$sip_ok" == "xno" ; then
+        dnl look for sip.h in ${PYTHON_PREFIX}/include/python${PYTHON_VERSION}
+       if test -d ${PYTHON_PREFIX}/include/python${PYTHON_VERSION} ; then
+            AC_CHECK_FILE(${PYTHON_PREFIX}/include/python${PYTHON_VERSION}/sip.h,sip_ok=yes,sip_ok=no)
+           if test "x$sip_ok" == "xyes" ; then
+               SIP_INCLUDES="${PYTHON_INCLUDES}"
+            fi
+       fi
     fi
-
-    if test "x$SIP_VERS" = "xnew2"
-        then
-        dnl new2 install : includes and libs are in python install 
-        AC_MSG_RESULT(new2 install detected)
-       sip_ok=yes
-        AC_CHECK_FILE($PYTHON_PREFIX/include/python$PYTHON_VERSION/sip.h,sip_ok=$sip_ok,sip_ok=no)
-       SIP_INCLUDES="${PYTHON_INCLUDES}"
-        AC_CHECK_FILE($PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/libsip.so,sip_ok=$sip_ok,sip_ok=no)
-       SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -lsip"
+    if test "x$sip_ok" == "xno" ; then
+        dnl look for sip.h in /usr/include/python${PYTHON_VERSION}
+       if test -d /usr/include/python${PYTHON_VERSION} ; then
+            AC_CHECK_FILE(/usr/include/python${PYTHON_VERSION}/sip.h,sip_ok=yes,sip_ok=no)
+           if test "x$sip_ok" == "xyes" ; then
+               SIP_INCLUDES="/usr/include/python${PYTHON_VERSION}"
+            fi
+       fi
     fi
+       
+    dnl Search (lib)sip.so file
+    sip_lib_ok=no
+    if test "x$SIPDIR" != "x" ; then
+        dnl look for (lib)sip.so in ${SIPDIR}
+        AC_CHECK_FILE(${SIPDIR}/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
+       if test "x$sip_lib_ok" == "xyes" ; then
+            if test "x${SIPDIR}" = "x/usr/lib"
+            then
+              SIP_LIBS="-lsip"
+            else
+              SIP_LIBS="-L${SIPDIR} -lsip"
+            fi
+       else
+           AC_CHECK_FILE(${SIPDIR}/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
+           if test "x$sip_lib_ok" == "xyes" ; then
+              if test "x${SIPDIR}" = "x/usr/lib"
+              then
+                SIP_LIBS=""
+              else
+                SIP_LIBS="-L${SIPDIR}"
+              fi
+           fi
+       fi
 
-    if test "x$SIP_VERS" = "xv4_1"
-        then
-        dnl 4.1 install : includes and libs are in python install 
-        AC_MSG_RESULT(4.1 install detected)
-       sip_ok=yes
-        AC_CHECK_FILE($PYTHON_PREFIX/include/python$PYTHON_VERSION/sip.h,sip_ok=$sip_ok,sip_ok=no)
-       SIP_INCLUDES="${PYTHON_INCLUDES}"
-        AC_CHECK_FILE($PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/sip.so,sip_ok=$sip_ok,sip_ok=no)
-       SIP_LIBS="${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/sip.so"
+        if test "x$sip_lib_ok" == "xno" ; then
+            dnl look for (lib)sip.so in ${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages
+           if test -d ${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages ; then
+               AC_CHECK_FILE(${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
+               if test "x$sip_lib_ok" == "xyes" ; then
+                   SIP_LIBS="-L${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages -lsip"
+               else
+                   AC_CHECK_FILE(${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
+                   if test "x$sip_lib_ok" == "xyes" ; then
+                       SIP_LIBS="-L${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages"
+                   fi
+               fi
+           fi
+       fi
+    fi
+    if test "x$sip_lib_ok" == "xno" ; then
+        dnl look for (lib)sip.so in ${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages
+       if test -d ${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages ; then
+            AC_CHECK_FILE(${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
+           if test "x$sip_lib_ok" == "xyes" ; then
+               SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -lsip"
+           else
+               AC_CHECK_FILE(${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
+                if test "x$sip_lib_ok" == "xyes" ; then
+                   SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"
+                fi
+           fi
+       fi
+    fi
+    if test "x$sip_lib_ok" == "xno" ; then
+        dnl look for (lib)sip.so in /usr/lib/python${PYTHON_VERSION}/site-packages
+       if test -d /usr/lib/python${PYTHON_VERSION}/site-packages ; then
+            AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
+           if test "x$sip_lib_ok" == "xyes" ; then
+               SIP_LIBS="-L$/usr/lib/python${PYTHON_VERSION}/site-packages -lsip"
+           else
+               AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
+                if test "x$sip_lib_ok" == "xyes" ; then
+                   SIP_LIBS="-L/usr/lib/python${PYTHON_VERSION}/site-packages"
+               fi
+            fi
+       fi
+    fi
+    if test "x$sip_lib_ok" == "xno" ; then
+        sip_ok=no
     fi
 fi
 
index 10408c009575de98a5fcdbd43595b2173d82b05a..f20599e95f3e6465ae196a1c4efd98ba3c9af772 100644 (file)
@@ -39,6 +39,15 @@ then
     AC_MSG_RESULT(swig not in PATH variable)
 fi
 
+if test "x$swig_ok" = "xyes" ; then
+   AC_MSG_CHECKING(for swig version)
+   $SWIG -version > .swig_version 2>&1
+   SWIG_VERSION=`cat .swig_version  | awk 'NR==2 {print $(3)}'`
+   # SWIG_VERSION=${SWIG_VERSION::6} # convert 1.3.17u-20040526-1709 into 1.3.17 for instance
+   rm .swig_version
+   AC_MSG_RESULT($SWIG_VERSION)
+fi
+
 if  test "x$swig_ok" = "xyes"
 then
    AC_MSG_CHECKING(python wrapper generation with swig)
@@ -57,6 +66,7 @@ EOF
    AC_MSG_RESULT($swig_ok) 
 fi
 
+AC_SUBST(SWIG_VERSION)
 AC_SUBST(SWIG_FLAGS)
 AC_SUBST(SWIG)
 
index 4b4b1454fab0c07c93f3cdcb6d164863b686e03a..b37edf89ef10518ae5df46fd0176a9f48e0543fe 100644 (file)
@@ -55,6 +55,11 @@ else
    LXLIB=""
 fi
 
+if test "x$x_libraries" = "x/usr/lib"
+then
+   LXLIB=""
+fi
+
 LOCAL_INCLUDES="$OGL_INCLUDES"
 LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid $OGL_LIBS $LXLIB -lX11 -lXt"
 TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS $LXLIB -lX11 -lXt"
@@ -62,9 +67,21 @@ TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS $LXLIB -lX11 -lXt"
 if test -z $VTKHOME
 then 
    AC_MSG_WARN(undefined VTKHOME variable which specify where vtk was compiled)
-else
+   if test -f /usr/include/vtk/vtkPlane.h ; then
+      AC_MSG_RESULT(trying /usr)
+      VTKHOME="/usr"
+   fi
+fi
+
+if test ! -z $VTKHOME
+then
    LOCAL_INCLUDES="-I$VTKHOME/include/vtk $LOCAL_INCLUDES"
    LOCAL_LIBS="-L$VTKHOME/lib/vtk $LOCAL_LIBS"
+   dnl E.A. : On mandrake 10.2 with vtk4.4, the libvtk*Python.so
+   dnl E.A. : are separated ...
+   if test -d $VTKHOME/lib/vtk/python ; then
+      LOCAL_LIBS="-L$VTKHOME/lib/vtk/python $LOCAL_LIBS"
+   fi
    TRY_LINK_LIBS="-L$VTKHOME/lib/vtk $TRY_LINK_LIBS"
 fi
 
index 09a46645aa9c0dafd232ff6fbe35c95e1004a1a3..45d6d0ca0b7bc7b3f84f8af1d9fb63a36e10a46c 100644 (file)
@@ -35,7 +35,11 @@ depend:.depend
 # we had Makefile target, because we want Makefile rebuild before include .depend
 .depend: $(LIB_DEP) $(TEST_SRC) $(BIN_DEP)
        @touch .depend
-       @for dep in X $? ; do                                                 \
+       @# mpv: we have to screen substituted sed paths ('.' symbols are intrpreted by sed as 'any' symbol)
+       @sed_srcdir=`echo $(srcdir) | sed "s%\.%\\\\\.%g"`;                   \
+       sed_top_srcdir=`echo $(top_srcdir) | sed "s%\.%\\\\\.%g"`;            \
+       sed_top_builddir=`echo $(top_builddir) | sed "s%\.%\\\\\.%g"`;        \
+       for dep in X $? ; do                                                  \
           if [ $$dep != "X" ]; then                                          \
           if [ $$dep != "Makefile" ]; then                                   \
              case "$$dep" in                                                 \
@@ -44,9 +48,9 @@ depend:.depend
                    obj=`basename $$dep .c`.lo;                               \
                    sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@;   \
                    $(CC) $(C_DEPEND_FLAG) $(CPPFLAGS) $$dep 2>/dev/null |    \
-                        sed 's% $(srcdir)/% $$(srcdir)/%g' |                 \
-                        sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' |         \
-                        sed 's% $(top_builddir)/% $$(top_builddir)/%g' |      \
+                        sed "s% $$sed_srcdir/% \$$\(srcdir)/%g" |            \
+                        sed "s% $$sed_top_srcdir/% \$$\(top_srcdir\)/%g" |    \
+                        sed "s% $$sed_top_builddir/% \$$\(top_builddir\)/%g" | \
                        sed 's/\.o/.lo/' >>$@;                                \
                    ;;                                                        \
                 *.cc)                                                        \
@@ -54,9 +58,9 @@ depend:.depend
                    obj=`basename $$dep .cc`.lo;                              \
                    sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@;   \
                    $(CXX) $(CXX_DEPEND_FLAG) $(CXXFLAGS) $(CPPFLAGS) $$dep 2>/dev/null | \
-                        sed 's% $(srcdir)/% $$(srcdir)/%g' |                 \
-                        sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' |         \
-                        sed 's% $(top_builddir)/% $$(top_builddir)/%g' |      \
+                        sed "s% $$sed_srcdir/% \$$\(srcdir)/%g" |            \
+                        sed "s% $$sed_top_srcdir/% \$$\(top_srcdir\)/%g" |    \
+                        sed "s% $$sed_top_builddir/% \$$\(top_builddir\)/%g" | \
                        sed 's/\.o/.lo/' >>$@;                                \
                    ;;                                                        \
                 *.cxx)                                                       \
@@ -64,9 +68,9 @@ depend:.depend
                    obj=`basename $$dep .cxx`.lo;                             \
                    sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@;   \
                    $(CXX) $(CXX_DEPEND_FLAG) $(CXXFLAGS) $(CPPFLAGS) $$dep 2>/dev/null | \
-                        sed 's% $(srcdir)/% $$(srcdir)/%g' |                 \
-                        sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' |         \
-                        sed 's% $(top_builddir)/% $$(top_builddir)/%g' |      \
+                        sed "s% $$sed_srcdir/% \$$\(srcdir)/%g" |            \
+                        sed "s% $$sed_top_srcdir/% \$$\(top_srcdir\)/%g" |    \
+                        sed "s% $$sed_top_builddir/% \$$\(top_builddir\)/%g" | \
                        sed 's/\.o/.lo/' >>$@;                                \
                    ;;                                                        \
              esac;                                                           \
@@ -79,5 +83,3 @@ depend:.depend
 
 # idl depend
 -include $(top_builddir)/idl/.depidl
-
-
index faf3e9a0ef6a6ac1699b563b6e93d7011970d859..9137541aff2f1e7e16a461c32becf65608642ebc 100644 (file)
@@ -77,11 +77,13 @@ QT_INCLUDES = @QT_INCLUDES@
 QT_MT_INCLUDES = @QT_INCLUDES@ -DQT_THREAD_SUPPORT
 QT_LIBS = @QT_LIBS@
 QT_MT_LIBS = @QT_MT_LIBS@
+QT_VERS = @QT_VERS@
 
 MOC = @MOC@
 UIC = @UIC@
 
-QT_VERS = @QT_VERS@
+# msg2qm
+MSG2QM = @MSG2QM@
 
 #QWT
 
index 2b8f95495ffc84b81fdfa33e08ba7694f88c2a99..839e1b084919b8417b09bbebc8c11d91ddcd9c42 100644 (file)
@@ -38,6 +38,7 @@ LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $
 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib/salome/%.la)
 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib/salome/%.la, $(filter %.la, $(LIB)))
 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib/salome/%.a, $(filter %.a, $(LIB)))
+LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib/salome/%.so, $(filter %.so, $(LIB)))
 
 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
@@ -45,7 +46,7 @@ else
 LIB_SWIG = 
 endif
 
-lib: $(LIB_BUILD) $(LIB_CLIENT_PY)
+lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
 # we don't build static library !
 
 $(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la
@@ -66,8 +67,12 @@ $(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a
        -$(RM) $@
        ln -sf $(CURDIR)/$< $@ || true
 
+$(LIB_BUILD_SO): $(top_builddir)/lib/salome/%.so: %.so
+       -$(RM) $@
+       ln -sf $(CURDIR)/$< $@ || true
+
 $(LIB): $(LIB_OBJ)
-       @$(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
+       @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
 
 # transform idl reference in appropriate obj file
 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
index 736fbe560d54a7cd2d8823f50b0ec2fea3f38190..a5d3d18c4e1218d65b281a0621e61cd58a641d70 100644 (file)
@@ -13,11 +13,13 @@ EXPORT_HEADERS = \
        ReceiverFactory.hxx \
        SenderFactory.hxx \
        SALOMEMultiComm.hxx \
-       MultiCommException.hxx
+       MultiCommException.hxx \
+       SALOME_Comm_i.hxx \
+       libSALOME_Comm.i
 # Libraries targets
 
 LIB = libSalomeCommunication.la 
-LIB_SRC = SALOME_Comm_i.cxx  SenderFactory.cxx Receiver.cxx MultiCommException.cxx SALOMEMultiComm.cxx ReceiverFactory.cxx
+LIB_SRC = SALOME_Comm_i.cxx  SenderFactory.cxx MultiCommException.cxx SALOMEMultiComm.cxx ReceiverFactory.cxx
 LIB_SERVER_IDL = SALOME_Comm.idl SALOME_Exception.idl
 
 # Executables targets
diff --git a/src/Communication/Receiver.cxx b/src/Communication/Receiver.cxx
deleted file mode 100644 (file)
index 559f815..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "Receiver.hxx"
-#include <string.h>
-using namespace std;
-
-/*!
-  return a deep copy of the array contained in the servant.
- */
-void *Receiver::getLocalValue(long &size,SALOME_Sender_i* servant)
-{
-  const void *src=servant->getData(size);
-  long lgr=size*servant->getSizeOf();
-  void *ret=new char[lgr];
-  memcpy(ret,src,lgr);
-  return ret;
-  //return (void *)servant->getData(size);
-}
-
-void *Receiver::getValue(long &size,SALOME::Sender_ptr sender)
-{
-  SALOME_Sender_i* data=SALOME_Sender_i::find(sender);
-  if(data)
-    return getLocalValue(size,data);
-  else
-    return getDistValue(size);
-}
-
index 56c65ad7ed918a70fbeb5f3946145990d629129a..d155e3360e73915c094d43d633449061d0a15056 100644 (file)
@@ -5,16 +5,38 @@
 
 /*! Abstract class factorizing common methods of all the receivers. All of the receivers have to inheritate from it.
  */
+template<class T,class senderPtr, class senderSrv>
 class Receiver
 {
 public:
-  virtual void *getValue(long &size)=0;
+  virtual T *getValue(long &size)=0;
   virtual ~Receiver() {}
 protected:
-  virtual void *getValue(long &size,SALOME::Sender_ptr sender);
-  static inline void *getLocalValue(long &size,SALOME_Sender_i* servant);
-  virtual void *getDistValue(long &size)=0;
+  virtual T *getValue(long &size,senderPtr sender);
+  static inline T *getLocalValue(long &size,senderSrv* servant);
+  virtual T *getDistValue(long &size)=0;
 };
 
+template<class T,class senderPtr, class senderSrv>
+T *Receiver<T,senderPtr,senderSrv>::getLocalValue(long &size,senderSrv* servant)
+{
+  const T *src=(const T *)servant->getData(size);
+  long lgr=size*servant->getSizeOf();
+  void *ret=new char[lgr];
+  memcpy(ret,src,lgr);
+  return (T *)ret;
+  //return (void *)servant->getData(size);
+}
+
+template<class T,class senderPtr, class senderSrv>
+T *Receiver<T,senderPtr,senderSrv>::getValue(long &size,senderPtr sender)
+{
+  senderSrv* data=senderSrv::find(sender);
+  if(data)
+    return getLocalValue(size,data);
+  else
+    return getDistValue(size);
+}
+
 #endif
 
index f3f0da6b149a88f890d05037e6b76d33435e882a..1a2bd9125d61c1b49d5dc5ef1b1617ac8bc3bbb0 100644 (file)
@@ -23,116 +23,141 @@ using namespace std;
 #endif
 
 /*!
-  This method performs the transfert with the remote sender given. If it fails with this sender it tries with an another protocol (CORBA by default).
+  This method performs the transfert of double array with the remote SenderDouble given. If it fails with this SenderDouble it tries with an another protocol (CORBA by default).
  */
-void *ReceiverFactory::getValue(SALOME::Sender_ptr sender,long &size)throw(MultiCommException)
+double *ReceiverFactory::getValue(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException)
 {
-  void *ret;
+  double *ret;
   try{
     ret=getValueOneShot(sender,size);
   }
   catch(MultiCommException&)
     {
-      SALOME::Sender_ptr newSender=sender->buildOtherWithProtocol(SALOME::CORBA_);
+      SALOME::SenderDouble_ptr newSender=sender->buildOtherWithProtocol(SALOME::CORBA_);
+      MESSAGE("PROTOCOL CHANGED TO CORBA");
+      sender->release();
+      ret=getValueOneShot(newSender,size);
+      CORBA::release(newSender);
+    }
+  return ret;
+}
+
+/*!
+  This method performs the transfert of int array with the remote SenderInt given. If it fails with this SenderInt it tries with an another protocol (CORBA by default).
+ */
+int *ReceiverFactory::getValue(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException)
+{
+  int *ret;
+  try{
+    ret=getValueOneShot(sender,size);
+  }
+  catch(MultiCommException&)
+    {
+      SALOME::SenderInt_ptr newSender=sender->buildOtherWithProtocol(SALOME::CORBA_);
       MESSAGE("PROTOCOL CHANGED TO CORBA");
       sender->release();
-      CORBA::release(sender);
       ret=getValueOneShot(newSender,size);
+      CORBA::release(newSender);
     }
   return ret;
 }
 
 /*!
-  This method performs the transfert with the remote sender given. If it fails an exception is thrown.
+  This method performs the transfert with the remote SenderDouble given. If it fails an exception is thrown.
  */
-void *ReceiverFactory::getValueOneShot(SALOME::Sender_ptr sender,long &size)throw(MultiCommException)
+double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException)
 {
   SALOME::CorbaDoubleNCSender_ptr cncD_ptr;
   SALOME::CorbaDoubleCSender_ptr cwcD_ptr;
-  SALOME::CorbaLongNCSender_ptr cncL_ptr;
-  SALOME::CorbaLongCSender_ptr cwcL_ptr;
 #ifdef HAVE_MPI2
-  SALOME::MPISender_ptr mpi_ptr=SALOME::MPISender::_narrow(sender);
+  SALOME::MPISenderDouble_ptr mpi_ptr=SALOME::MPISenderDouble::_narrow(sender);
+#endif
+#ifdef HAVE_SOCKET
+  SALOME::SocketSenderDouble_ptr sock_ptr=SALOME::SocketSenderDouble::_narrow(sender);
+#endif
+  cncD_ptr=SALOME::CorbaDoubleNCSender::_narrow(sender);
+  cwcD_ptr=SALOME::CorbaDoubleCSender::_narrow(sender);
+  if(!CORBA::is_nil(cncD_ptr))
+    {
+      CORBA::release(sender);
+      CorbaDNoCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleNCSender_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(cncD_ptr);
+      return rec.getValue(size);
+    }
+  else if(!CORBA::is_nil(cwcD_ptr))
+    {
+      CORBA::release(sender);
+      CorbaDWithCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleCSender_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(cwcD_ptr);
+      return rec.getValue(size);
+    }
+#ifdef HAVE_MPI2
+  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);
+      return rec.getValue(size);
+    }
 #endif
 #ifdef HAVE_SOCKET
-  SALOME::SocketSender_ptr sock_ptr=SALOME::SocketSender::_narrow(sender);
+  else if(!CORBA::is_nil(sock_ptr))
+    {
+      CORBA::release(sender);
+      SocketReceiver<double,xdr_double,SALOME::SocketSenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(sock_ptr);
+      return rec.getValue(size);
+    }
 #endif
- switch(sender->getTypeOfDataTransmitted())
+  else
     {
-    case SALOME::DOUBLE_:
-      cncD_ptr=SALOME::CorbaDoubleNCSender::_narrow(sender);
-      cwcD_ptr=SALOME::CorbaDoubleCSender::_narrow(sender);
-      if(!CORBA::is_nil(cncD_ptr))
-       {
-         CORBA::release(sender);
-         CorbaDNoCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleNCSender_ptr> rec(cncD_ptr);
-         return rec.getValue(size);
-       }
-      else if(!CORBA::is_nil(cwcD_ptr))
-       {
-         CORBA::release(sender);
-         CorbaDWithCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleCSender_ptr> rec(cwcD_ptr);
-         return rec.getValue(size);
-       }
+      throw MultiCommException("Unknown sender protocol");
+      return 0;
+    }
+}
+
+/*!
+  This method performs the transfert with the remote SenderInt given. If it fails an exception is thrown.
+ */
+int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException)
+{
+  SALOME::CorbaLongNCSender_ptr cncL_ptr;
+  SALOME::CorbaLongCSender_ptr cwcL_ptr;
 #ifdef HAVE_MPI2
-      else if(!CORBA::is_nil(mpi_ptr))
-       {
-         CORBA::release(sender);
-         MPIReceiver<double,MPI_DOUBLE> rec(mpi_ptr);
-         return rec.getValue(size);
-       }
+  SALOME::MPISenderInt_ptr mpi_ptr=SALOME::MPISenderInt::_narrow(sender);
 #endif
 #ifdef HAVE_SOCKET
-      else if(!CORBA::is_nil(sock_ptr))
-       {
-         CORBA::release(sender);
-         SocketReceiver<double,xdr_double> rec(sock_ptr);
-         return rec.getValue(size);
-       }
+  SALOME::SocketSenderInt_ptr sock_ptr=SALOME::SocketSenderInt::_narrow(sender);
 #endif
-      else
-       {
-         throw MultiCommException("Unknown sender protocol");
-         return 0;
-       }
-    case SALOME::INT_:
-      cncL_ptr=SALOME::CorbaLongNCSender::_narrow(sender);
-      cwcL_ptr=SALOME::CorbaLongCSender::_narrow(sender);
-      if(!CORBA::is_nil(cncL_ptr))
-       {
-         CORBA::release(sender);
-         CorbaINoCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongNCSender_ptr> rec(cncL_ptr);
-         return rec.getValue(size);
-       }
-      else if(!CORBA::is_nil(cwcL_ptr))
-       {
-         CORBA::release(sender);
-         CorbaIWithCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongCSender_ptr> rec(cwcL_ptr);
-         return rec.getValue(size);
-       }
+  cncL_ptr=SALOME::CorbaLongNCSender::_narrow(sender);
+  cwcL_ptr=SALOME::CorbaLongCSender::_narrow(sender);
+  if(!CORBA::is_nil(cncL_ptr))
+    {
+      CORBA::release(sender);
+      CorbaINoCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongNCSender_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(cncL_ptr);
+      return rec.getValue(size);
+    }
+  else if(!CORBA::is_nil(cwcL_ptr))
+    {
+      CORBA::release(sender);
+      CorbaIWithCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongCSender_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(cwcL_ptr);
+      return rec.getValue(size);
+    }
 #ifdef HAVE_MPI2
-      else if(!CORBA::is_nil(mpi_ptr))
-       {
-         CORBA::release(sender);
-         MPIReceiver<int,MPI_INT> rec(mpi_ptr);
-         return rec.getValue(size);
-       }
+  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);
+      return rec.getValue(size);
+    }
 #endif
 #ifdef HAVE_SOCKET
-      else if(!CORBA::is_nil(sock_ptr))
-       {
-         CORBA::release(sender);
-         SocketReceiver<int,xdr_int> rec(sock_ptr);
-         return rec.getValue(size);
-       }
+  else if(!CORBA::is_nil(sock_ptr))
+    {
+      CORBA::release(sender);
+      SocketReceiver<int,xdr_int,SALOME::SocketSenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(sock_ptr);
+      return rec.getValue(size);
+    }
 #endif
-      else
-       {
-         throw MultiCommException("Unknown sender protocol");
-         return 0;
-       }
-    default:
-      throw MultiCommException("unknown type of data transfered");
+  else
+    {
+      throw MultiCommException("Unknown sender protocol");
       return 0;
     }
 }
index e5072c9998a2160e2b56c3fa4f7541bc24a61041..28eac49f68d4c6f654e0e97ba6941f1adfbcc974 100644 (file)
 class ReceiverFactory
 {
 public:
-  static void *getValue(SALOME::Sender_ptr sender,long &size)throw(MultiCommException);
+  static double *getValue(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException);
+  static int *getValue(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException);
 private:
-  static void *getValueOneShot(SALOME::Sender_ptr sender,long &size)throw(MultiCommException);
+  static double *getValueOneShot(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException);
+  static int *getValueOneShot(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException);
 };
 
 #endif
index a5d65ae15fc517aa11ba2db600981da5102fce93..19ea8c164d7c3c6ca689ad30417ea5426f05b229 100644 (file)
@@ -5,42 +5,40 @@ using namespace std;
 #define TAILLE_SPLIT 100000
 #define TIMEOUT 20
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaNCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaNCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaNCNoCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaNCNoCopyReceiver(){
   _mySender->release();
-  CORBA::release(_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size)
 {
   TSeqCorba seq=_mySender->send();
   size=seq->length();
-  return seq->get_buffer(1);
+  return (T *)seq->get_buffer(1);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
-  return Receiver::getValue(size,_mySender);
+  return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaNCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaNCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaNCWithCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaNCWithCopyReceiver(){
   _mySender->release();
-  CORBA::release(_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   size=_mySender->getSize();
   long n;
   T *ret=new T[size];
@@ -59,24 +57,23 @@ void *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long
   return ret;
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
-  return Receiver::getValue(size,_mySender);
+  return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaWCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaWCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaWCNoCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaWCNoCopyReceiver(){
   _mySender->release();
-  CORBA::release(_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   size=_mySender->getSize();
   long n;
   T *ret=new T[size];
@@ -95,24 +92,23 @@ void *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &
   return ret;
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
-  return Receiver::getValue(size,_mySender);
+  return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaWCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaWCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaWCWithCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaWCWithCopyReceiver(){
   _mySender->release();
-  CORBA::release(_mySender);
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   size=_mySender->getSize();
   long n;
   T *ret=new T[size];
@@ -131,26 +127,25 @@ void *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long
   return ret;
 }
 
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
-  return Receiver::getValue(size,_mySender);
+  return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
 
 #ifdef HAVE_MPI2
 
-template<class T,MPI_Datatype T2>
-MPIReceiver<T,T2>::MPIReceiver(SALOME::MPISender_ptr mySender):_mySender(mySender){
+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,MPI_Datatype T2>
-MPIReceiver<T,T2>::~MPIReceiver(){
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
   _mySender->release();
-  CORBA::release(_mySender);
 }
 
-template<class T,MPI_Datatype T2>
-void *MPIReceiver<T,T2>::getDistValue(long &size){
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
   int i=0;
   int myproc;
   int sproc;
@@ -204,10 +199,10 @@ void *MPIReceiver<T,T2>::getDistValue(long &size){
   return _v;
 }
 
-template<class T,MPI_Datatype T2>
-void *MPIReceiver<T,T2>::getValue(long &size)
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
-  return Receiver::getValue(size,_mySender);
+  return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
 
 #endif
@@ -221,31 +216,30 @@ void *MPIReceiver<T,T2>::getValue(long &size)
 #include <unistd.h>
 #include <rpc/xdr.h>
 
-template<class T,int (*myFunc)(XDR*,T*)>
-SocketReceiver<T,myFunc>::SocketReceiver(SALOME::SocketSender_ptr mySender) : _mySender(mySender)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::SocketReceiver(CorbaSender mySender) : _mySender(mySender)
 {
   _clientSockfd = -1;
   _senderDestruc=true;
 }
 
-template<class T,int (*myFunc)(XDR*,T*)>
-SocketReceiver<T,myFunc>::~SocketReceiver()
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::~SocketReceiver()
 {
   if(_senderDestruc)
     {
       _mySender->release();
-      CORBA::release(_mySender);
     }
 }
 
-template<class T,int (*myFunc)(XDR*,T*)>
-void *SocketReceiver<T,myFunc>::getValue(long &size)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+T *SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::getValue(long &size)
 {
-  return Receiver::getValue(size,_mySender);
+  return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
 }
 
-template<class T,int (*myFunc)(XDR*,T*)>
-void* SocketReceiver<T,myFunc>::getDistValue(long &size)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+T* SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::getDistValue(long &size)
 {
   int n=0, m;
   T *v;
@@ -296,8 +290,8 @@ void* SocketReceiver<T,myFunc>::getDistValue(long &size)
   return v;
 }
 
-template<class T,int (*myFunc)(XDR*,T*)>
-void SocketReceiver<T,myFunc>::initCom()
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+void SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::initCom()
 {
   try{
     _mySender->initCom();
@@ -325,8 +319,8 @@ void SocketReceiver<T,myFunc>::initCom()
 
 }
 
-template<class T,int (*myFunc)(XDR*,T*)>
-void SocketReceiver<T,myFunc>::connectCom(const char *dest_address, int port)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+void SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::connectCom(const char *dest_address, int port)
 {
   struct sockaddr_in serv_addr;
   struct hostent * server;
@@ -377,8 +371,8 @@ void SocketReceiver<T,myFunc>::connectCom(const char *dest_address, int port)
 }
 
 
-template<class T,int (*myFunc)(XDR*,T*)>
-void SocketReceiver<T,myFunc>::closeCom()
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+void SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::closeCom()
 {
   _mySender->closeCom();
   if( _clientSockfd >= 0 ){
index 4fd2581ee0a9e313f3556882976d78137c130327..c4309b754a3fa082c66d5df09c19a40426a726e0 100644 (file)
 /*!
   Receiver used for transfert with CORBA when no copy is required remotely and locally.
  */
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaNCNoCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaNCNoCopyReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
   CorbaSender _mySender;
 public:
   CorbaNCNoCopyReceiver(CorbaSender mySender);
   ~CorbaNCNoCopyReceiver();
-  void *getValue(long &size);
+  T *getValue(long &size);
 private:
-  void *getDistValue(long &size);
+  T *getDistValue(long &size);
 };
 
 /*!
   Receiver used for transfert with CORBA when copy is not required remotely but required locally.
  */
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaNCWithCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaNCWithCopyReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
   CorbaSender _mySender;
 public:
   CorbaNCWithCopyReceiver(CorbaSender mySender);
   ~CorbaNCWithCopyReceiver();
-  void *getValue(long &size);
+  T *getValue(long &size);
 private:
-  void *getDistValue(long &size);
+  T *getDistValue(long &size);
 };
 
 /*!
   Receiver used for transfert with CORBA when copy is required remotely but not required locally.
  */
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaWCNoCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaWCNoCopyReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
   CorbaSender  _mySender;
 public:
   CorbaWCNoCopyReceiver(CorbaSender mySender);
   ~CorbaWCNoCopyReceiver();
-  void *getValue(long &size);
+  T *getValue(long &size);
 private:
-  void *getDistValue(long &size);
+  T *getDistValue(long &size);
 };
 
 /*!
   Receiver used for transfert with CORBA when copy is required both remotely and locally.
  */
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaWCWithCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaWCWithCopyReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
   CorbaSender _mySender;
 public:
   CorbaWCWithCopyReceiver(CorbaSender mySender);
   ~CorbaWCWithCopyReceiver();
-  void *getValue(long &size);
+  T *getValue(long &size);
 private:
-  void *getDistValue(long &size);
+  T *getDistValue(long &size);
 };
 
 #ifdef HAVE_MPI2
 /*!
   Receiver for MPI transfert.
  */
-template<class T,MPI_Datatype T2>
-class MPIReceiver : public Receiver
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+class MPIReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
-  SALOME::MPISender_ptr _mySender;
+  CorbaSender _mySender;
 public:
-  MPIReceiver(SALOME::MPISender_ptr mySender);
+  MPIReceiver(CorbaSender mySender);
   ~MPIReceiver();
-  void *getValue(long &size);
+  T *getValue(long &size);
 private:
-  void *getDistValue(long &size);
+  T *getDistValue(long &size);
 };
 #endif
 
@@ -96,19 +96,19 @@ class XDR;
 /*!
   Receiver for transfert with sockets.
  */
-template<class T,int (*myFunc)(XDR*,T*)>
-class SocketReceiver : public Receiver
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+class SocketReceiver : public Receiver<T,servForT,ptrForT>
 {
 private:
-  SALOME::SocketSender_ptr _mySender;
+  CorbaSender _mySender;
   int _clientSockfd;
   bool _senderDestruc;
 public:
-  SocketReceiver(SALOME::SocketSender_ptr mySender);
+  SocketReceiver(CorbaSender mySender);
   ~SocketReceiver();
-  void *getValue(long &size);
+  T *getValue(long &size);
 private:
-  void *getDistValue(long &size);
+  T *getDistValue(long &size);
   void initCom();
   void connectCom(const char *, int);
   void closeCom();
index c9b677a84e3799283bda51ebd517c15c32d85b7d..aed4140b596add811586c90b28728fd7e5a92e83 100644 (file)
@@ -30,13 +30,47 @@ int SALOME_Sender_i::getSizeOf() const {
 }
 
 /*! Unique constructor */
-SALOME_Sender_i::SALOME_Sender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf):_tabToSend(tabToSend),_lgrTabToSend(lgrTabToSend),_type(type),_sizeOf(sizeOf){
+SALOME_Sender_i::SALOME_Sender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):_tabToSend(tabToSend),_lgrTabToSend(lgrTabToSend),_sizeOf(sizeOf),_ownTabToSend(ownTabToSend){
+}
+
+/*! To force ownerShip status */
+void SALOME_Sender_i::setOwnerShip(bool own)
+{
+  _ownTabToSend=own;
+}
+
+/*! Method for the remote destroy of the current servant. This method is used by the receiver to destroy the sender when the transfert is complete.
+ */
+void SALOME_Sender_i::release()
+{
+  PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
+  _default_POA()->deactivate_object(oid);
+  _remove_ref();
+}
+
+SALOME_SenderDouble_i::SALOME_SenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
+{
+}
+
+/*! Destructor.
+ */
+SALOME_SenderDouble_i::~SALOME_SenderDouble_i()
+{
+  if(_ownTabToSend)
+    delete [] (double *)_tabToSend;
+}
+
+/*! Return a new sender of the same array but with an another protocol and delegates to the returned sender the ownership of array.
+ */
+SALOME::SenderDouble_ptr SALOME_SenderDouble_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
+{
+  return SenderFactory::buildSender(type,this);
 }
 
 /*! Method to establish if the CORBA object refered by pCorba is collocalised.\n
   If it is, the pointer to the servant that incarnates the CORBA object is returned.
 */
-SALOME_Sender_i *SALOME_Sender_i::find(SALOME::Sender_ptr pCorba){
+SALOME_SenderDouble_i *SALOME_SenderDouble_i::find(SALOME::SenderDouble_ptr pCorba){
   PortableServer::ServantBase *ret;
   try {
     ret=PortableServer::POA::_the_root_poa()->reference_to_servant(pCorba);
@@ -45,33 +79,44 @@ SALOME_Sender_i *SALOME_Sender_i::find(SALOME::Sender_ptr pCorba){
     return 0;
   }
   ret->_remove_ref();
-  return dynamic_cast<SALOME_Sender_i *>(ret);
+  return dynamic_cast<SALOME_SenderDouble_i *>(ret);
 }
 
-/*! Method for the remote destroy of the current servant. This method is used by the receiver to destroy the sender when the transfert is complete.
- */
-void SALOME_Sender_i::release()
+SALOME_SenderInt_i::SALOME_SenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
 {
-  PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
-  _default_POA()->deactivate_object(oid);
-  _remove_ref();
 }
 
-/*! Return the type of the element that compose the array. Used by receiverfactory to build the correct receiver.
+/*! Destructor.
  */
-SALOME::TypeOfDataTransmitted SALOME_Sender_i::getTypeOfDataTransmitted()
+SALOME_SenderInt_i::~SALOME_SenderInt_i()
 {
-  return _type;
+  if(_ownTabToSend)
+    delete [] (int *)_tabToSend;
 }
 
 /*! Return a new sender of the same array but with an another protocol.
  */
-SALOME::Sender_ptr SALOME_Sender_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
+SALOME::SenderInt_ptr SALOME_SenderInt_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
 {
   return SenderFactory::buildSender(type,this);
 }
 
-SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend):SALOME_Sender_i(SALOME::DOUBLE_,tabToSend,lgrTabToSend,sizeof(double)){
+/*! Method to establish if the CORBA object refered by pCorba is collocalised.\n
+  If it is, the pointer to the servant that incarnates the CORBA object is returned.
+*/
+SALOME_SenderInt_i *SALOME_SenderInt_i::find(SALOME::SenderInt_ptr pCorba){
+  PortableServer::ServantBase *ret;
+  try {
+    ret=PortableServer::POA::_the_root_poa()->reference_to_servant(pCorba);
+  }
+  catch(...){
+    return 0;
+  }
+  ret->_remove_ref();
+  return dynamic_cast<SALOME_SenderInt_i *>(ret);
+}
+
+SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){
 }
 
 SALOME_CorbaDoubleNCSender_i::~SALOME_CorbaDoubleNCSender_i(){
@@ -92,7 +137,7 @@ SALOME::vectorOfDouble* SALOME_CorbaDoubleNCSender_i::send(){
   return c1._retn();
 }
 
-SALOME_CorbaDoubleCSender_i::SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend):SALOME_Sender_i(SALOME::DOUBLE_,tabToSend,lgrTabToSend,sizeof(double)){
+SALOME_CorbaDoubleCSender_i::SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){
 }
 
 SALOME_CorbaDoubleCSender_i::~SALOME_CorbaDoubleCSender_i(){
@@ -113,7 +158,7 @@ SALOME::vectorOfDouble* SALOME_CorbaDoubleCSender_i::sendPart(CORBA::ULong offse
 
 ////////////////////////
 
-SALOME_CorbaLongNCSender_i::SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend):SALOME_Sender_i(SALOME::INT_,tabToSend,lgrTabToSend,sizeof(int)){
+SALOME_CorbaLongNCSender_i::SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend){
 }
 
 SALOME_CorbaLongNCSender_i::~SALOME_CorbaLongNCSender_i(){
@@ -134,7 +179,7 @@ SALOME::vectorOfLong* SALOME_CorbaLongNCSender_i::send(){
   return c1._retn();
 }
 
-SALOME_CorbaLongCSender_i::SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend):SALOME_Sender_i(SALOME::INT_,tabToSend,lgrTabToSend,sizeof(int)){
+SALOME_CorbaLongCSender_i::SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend){
 }
 
 SALOME_CorbaLongCSender_i::~SALOME_CorbaLongCSender_i(){
@@ -159,7 +204,7 @@ unsigned long SALOME_MPISender_i::_tag1=0;
 
 unsigned long SALOME_MPISender_i::_tag2=1;
 
-SALOME_MPISender_i::SALOME_MPISender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf):SALOME_Sender_i(type,tabToSend,lgrTabToSend,sizeOf){
+SALOME_MPISender_i::SALOME_MPISender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeOf,ownTabToSend){
   _portName=new char[MPI_MAX_PORT_NAME];
 }
 
@@ -203,6 +248,7 @@ SALOME::MPISender::param* SALOME_MPISender_i::getParam()
 
 void SALOME_MPISender_i::send()
 {
+  _type=getTypeOfDataTransmitted();
   _argsForThr=new (void *)[8];
   _argsForThr[0]=_portName;
   _argsForThr[1]=&_lgrTabToSend;
@@ -238,6 +284,7 @@ void* SALOME_MPISender_i::myThread(void *args)
       MPI_Send(argsTab[2],*lgrTabToSend,MPI_INT,*cproc,*tag2,*com);
     }
   omni_thread::exit();
+  return args;
 }
 
 void SALOME_MPISender_i::close(const SALOME::MPISender::param& p)
@@ -252,6 +299,18 @@ void SALOME_MPISender_i::close(const SALOME::MPISender::param& p)
   delete [] _argsForThr;
 }
 
+SALOME_MPISenderDouble_i::SALOME_MPISenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend)
+  :SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
+  ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
+{
+}
+
+SALOME_MPISenderInt_i::SALOME_MPISenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend)
+  :SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
+  ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
+{
+}
+
 #endif
 
 #ifdef HAVE_SOCKET
@@ -267,7 +326,7 @@ void SALOME_MPISender_i::close(const SALOME::MPISender::param& p)
 #include <netdb.h>
 #include <unistd.h>
 
-SALOME_SocketSender_i::SALOME_SocketSender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf):SALOME_Sender_i(type,tabToSend,lgrTabToSend,sizeOf){
+SALOME_SocketSender_i::SALOME_SocketSender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeOf,ownTabToSend){
   _IPAddress = inetAddress();
   _serverSockfd = -1;
   _clientSockfd = -1;
@@ -314,6 +373,7 @@ SALOME::SocketSender::param * SALOME_SocketSender_i::getParam()
 
 void SALOME_SocketSender_i::send()
 {
+  _type=getTypeOfDataTransmitted();
   _argsForThr=new void *[6];
   _argsForThr[0]=&_serverSockfd;
   _argsForThr[1]=&_clientSockfd;
@@ -393,6 +453,7 @@ void* SALOME_SocketSender_i::myThread(void *args)
       xdr_vector( &xp, (char*)tabToSend, *lgrTabToSend, sizeof(int), (xdrproc_t)xdr_int );
       xdr_destroy( &xp );
     }
+  return args;
 }
 
 void SALOME_SocketSender_i::initCom() throw(SALOME::SALOME_Exception)
@@ -443,7 +504,6 @@ void SALOME_SocketSender_i::initCom() throw(SALOME::SALOME_Exception)
 void SALOME_SocketSender_i::acceptCom() throw(SALOME::SALOME_Exception)
 {
   socklen_t sin_size;
-  int new_fd;
   struct sockaddr_in client_addr;
   SALOME::ExceptionStruct es;
 
@@ -485,6 +545,18 @@ void SALOME_SocketSender_i::endOfCom()
   delete [] _argsForThr;
 }
 
+SALOME_SocketSenderDouble_i::SALOME_SocketSenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend)
+  :SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_SocketSender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
+  ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend)
+{
+}
+
+SALOME_SocketSenderInt_i::SALOME_SocketSenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend)
+  :SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_SocketSender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
+  ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
+{
+}
+
 //CCRT porting
 #undef _LIBC_POLLUTION_H_
 #undef _POSIX_PII_SOCKET
index 7b6e8df4376315ae862cfe1980f361ea10df7150..485b4ea8d743cf2cfc841bb5859dc3f1a27368e4 100644 (file)
@@ -26,26 +26,48 @@ protected:
     Practically in terms of bytes the size to be transmitted is _lgrTabToSend*_sizeOf
   */
   int _sizeOf;
-  /*! Type the component of the array*/
-  SALOME::TypeOfDataTransmitted _type;
+  /*! Indicates if _tabToSend has to be deallocated */ 
+  bool _ownTabToSend;
 
-  SALOME_Sender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
+  SALOME_Sender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend=false);
 public:
   const void *getData(long &size) const;
   int getSizeOf() const;
+  void setOwnerShip(bool own);
+  bool getOwnerShip() const { return _ownTabToSend; }
   void release();
-  SALOME::TypeOfDataTransmitted getTypeOfDataTransmitted();
-  SALOME::Sender_ptr buildOtherWithProtocol(SALOME::TypeOfCommunication type);
-  static SALOME_Sender_i *find(SALOME::Sender_ptr pCorba);
+  virtual ~SALOME_Sender_i() {}
+};
+
+class SALOME_SenderDouble_i : public virtual POA_SALOME::SenderDouble,
+                             public virtual SALOME_Sender_i
+{
+public:
+  SALOME_SenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
+  SALOME::TypeOfDataTransmitted getTypeOfDataTransmitted() { return SALOME::DOUBLE_; }
+  SALOME::SenderDouble_ptr buildOtherWithProtocol(SALOME::TypeOfCommunication type);
+  virtual ~SALOME_SenderDouble_i();
+  static SALOME_SenderDouble_i *find(SALOME::SenderDouble_ptr pCorba);
+};
+
+class SALOME_SenderInt_i : public virtual POA_SALOME::SenderInt,
+                          public virtual SALOME_Sender_i
+{
+public:
+  SALOME_SenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
+  SALOME::TypeOfDataTransmitted getTypeOfDataTransmitted() { return SALOME::INT_; }
+  SALOME::SenderInt_ptr buildOtherWithProtocol(SALOME::TypeOfCommunication type);
+  virtual ~SALOME_SenderInt_i();
+  static SALOME_SenderInt_i *find(SALOME::SenderInt_ptr pCorba);
 };
 
 /*! Servant class for CORBA sender for double* when no copy of array _tabToSend is required, that is to say double and CORBA::Double are binary equal.
  */
 class SALOME_CorbaDoubleNCSender_i : public POA_SALOME::CorbaDoubleNCSender,
-                                    public SALOME_Sender_i
+                                    public SALOME_SenderDouble_i
 {
 public:
-  SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend);
+  SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
   ~SALOME_CorbaDoubleNCSender_i();
   CORBA::ULong getSize();
   SALOME::vectorOfDouble* sendPart(CORBA::ULong offset, CORBA::ULong length);
@@ -55,10 +77,10 @@ public:
 /*! Servant class for CORBA sender for double* when copy of array _tabToSend is required, that is to say double and CORBA::Double are NOT binary equal.
  */
 class SALOME_CorbaDoubleCSender_i : public POA_SALOME::CorbaDoubleCSender,
-                                   public SALOME_Sender_i
+                                   public SALOME_SenderDouble_i
 {
 public:
-  SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend);
+  SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
   ~SALOME_CorbaDoubleCSender_i();
   CORBA::ULong getSize();
   SALOME::vectorOfDouble* sendPart(CORBA::ULong offset, CORBA::ULong length);
@@ -67,10 +89,10 @@ public:
 /*! Servant class for CORBA sender for int* when no copy of array _tabToSend is required, that is to say int and CORBA::Long are binary equal.
  */
 class SALOME_CorbaLongNCSender_i : public POA_SALOME::CorbaLongNCSender,
-                                  public SALOME_Sender_i
+                                  public SALOME_SenderInt_i
 {
 public:
-  SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend);
+  SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
   ~SALOME_CorbaLongNCSender_i();
   CORBA::ULong getSize();
   SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
@@ -80,10 +102,10 @@ public:
 /*! Servant class for CORBA sender for int* when copy of array _tabToSend is required, that is to say int and CORBA::Long are NOT binary equal.
  */
 class SALOME_CorbaLongCSender_i : public POA_SALOME::CorbaLongCSender,
-                                 public SALOME_Sender_i
+                                 public SALOME_SenderInt_i
 {
 public:
-  SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend);
+  SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
   ~SALOME_CorbaLongCSender_i();
   CORBA::ULong getSize();
   SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
@@ -94,8 +116,8 @@ public:
 
 /*! Servant class of sender using MPI2.
  */
-class SALOME_MPISender_i : public POA_SALOME::MPISender,
-                          public SALOME_Sender_i
+class SALOME_MPISender_i : public virtual POA_SALOME::MPISender,
+                          public virtual SALOME_Sender_i
 {
 private:
   static unsigned long _tag1;
@@ -113,8 +135,10 @@ private:
   void **_argsForThr;
   /*! Pointer to thread created on asynchronous invocation*/
   omni_thread *_newThr;
+  /*! Type the component of the array*/
+  SALOME::TypeOfDataTransmitted _type;
 public:
-  SALOME_MPISender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
+  SALOME_MPISender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend=false);
   ~SALOME_MPISender_i();
   SALOME::MPISender::param* getParam();
   void send();
@@ -123,14 +147,30 @@ private:
   static void* myThread(void *args);
 };
 
+class SALOME_MPISenderDouble_i : public POA_SALOME::MPISenderDouble,
+                                public SALOME_SenderDouble_i,
+                                public SALOME_MPISender_i
+{
+public:
+  SALOME_MPISenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
+};
+
+class SALOME_MPISenderInt_i : public POA_SALOME::MPISenderInt,
+                             public SALOME_SenderInt_i,
+                             public SALOME_MPISender_i
+{
+public:
+  SALOME_MPISenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
+};
+
 #endif
 
 #ifdef HAVE_SOCKET
 
 /*! Servant class of sender using Sockets.
  */
-class SALOME_SocketSender_i : public POA_SALOME::SocketSender,
-                             public SALOME_Sender_i
+class SALOME_SocketSender_i : public virtual POA_SALOME::SocketSender,
+                             public virtual SALOME_Sender_i
 {
 private:
   int _serverSockfd;
@@ -140,8 +180,10 @@ private:
   void **_argsForThr;
   omni_thread *_newThr;
   bool _errorFlag;
+  /*! Type the component of the array*/
+  SALOME::TypeOfDataTransmitted _type;
 public:
-  SALOME_SocketSender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
+  SALOME_SocketSender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend=false);
   ~SALOME_SocketSender_i();
   SALOME::SocketSender::param* getParam();
   void send();
@@ -154,6 +196,22 @@ private:
   std::string inetAddress();
 };
 
+class SALOME_SocketSenderDouble_i : public POA_SALOME::SocketSenderDouble,
+                                   public SALOME_SenderDouble_i,
+                                   public SALOME_SocketSender_i
+{
+public:
+  SALOME_SocketSenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
+};
+
+class SALOME_SocketSenderInt_i : public POA_SALOME::SocketSenderInt,
+                                public SALOME_SenderInt_i,
+                                public SALOME_SocketSender_i
+{
+public:
+  SALOME_SocketSenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
+};
+
 #endif
 
 #endif
index 3b1f81165943ed24c6e14a339aad050f7795df46..04f8056d0ec928486ff5907008a5911a3a6f4c33 100644 (file)
@@ -16,25 +16,25 @@ using namespace std;
 #define SALOME_CorbaLongSender SALOME_CorbaLongCSender_i
 #endif
 
-SALOME::Sender_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr)throw(MultiCommException){
+SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab)throw(MultiCommException){
   switch(multiCommunicator.getProtocol())
     {
     case SALOME::CORBA_:
       {
-       SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr);
+       SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
        return retc->_this();
       }
 #ifdef HAVE_MPI2
     case SALOME::MPI_:
       {
-       SALOME_MPISender_i* retm=new SALOME_MPISender_i(SALOME::DOUBLE_,tab,lgr,sizeof(double));
+       SALOME_MPISenderDouble_i* retm=new SALOME_MPISenderDouble_i(tab,lgr,ownTab);
        return retm->_this();
       }
 #endif
 #ifdef HAVE_SOCKET
     case SALOME::SOCKET_:
       {
-       SALOME_SocketSender_i* rets=new SALOME_SocketSender_i(SALOME::DOUBLE_,tab,lgr,sizeof(double));
+       SALOME_SocketSenderDouble_i* rets=new SALOME_SocketSenderDouble_i(tab,lgr,ownTab);
        return rets->_this();
       }
 #endif
@@ -42,58 +42,61 @@ SALOME::Sender_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator
       {
        multiCommunicator.setProtocol(SALOME::CORBA_);
        MESSAGE("PROTOCOL CHANGED TO CORBA");
-       SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr);
+       SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
        return retc->_this();
       }
 //       throw MultiCommException("Communication protocol not implemented");
     }
 }
 
-SALOME::Sender_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr)throw(MultiCommException){
+SALOME::SenderInt_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab)throw(MultiCommException){
   switch(multiCommunicator.getProtocol())
     {
     case SALOME::CORBA_:
       {
-       SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr);
+       SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
        return retc->_this();
       }
 #ifdef HAVE_MPI2
     case SALOME::MPI_:
       {
-       SALOME_MPISender_i* retm=new SALOME_MPISender_i(SALOME::INT_,tab,lgr,sizeof(int));
+       SALOME_MPISenderInt_i* retm=new SALOME_MPISenderInt_i(tab,lgr,ownTab);
        return retm->_this();
       }
 #endif
 #ifdef HAVE_SOCKET
     case SALOME::SOCKET_:
       {
-       SALOME_SocketSender_i* rets=new SALOME_SocketSender_i(SALOME::INT_,tab,lgr,sizeof(int));
+       SALOME_SocketSenderInt_i* rets=new SALOME_SocketSenderInt_i(tab,lgr,ownTab);
        return rets->_this();
       }
 #endif
     default:
       {
        multiCommunicator.setProtocol(SALOME::CORBA_);
-       SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr);
+       SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
        return retc->_this();
       }
 //       throw MultiCommException("Communication protocol not implemented"); 
     }
   }
 
-SALOME::Sender_ptr SenderFactory::buildSender(SALOME::TypeOfCommunication NewType,SALOME_Sender_i *src)
+SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderDouble_i *src)
 {
   SALOMEMultiComm mc(NewType);
   long n;
-  const void *data=src->getData(n);
-  switch(src->getTypeOfDataTransmitted())
-    {
-    case SALOME::DOUBLE_:
-      return buildSender(mc,(const double *)data,n);
-    case SALOME::INT_:
-      return buildSender(mc,(const int *)data,n);
-    }
-  
+  const double *data=(const double *)src->getData(n);
+  bool own=src->getOwnerShip();
+  src->setOwnerShip(false);
+  return buildSender(mc,data,n,own);
 }
 
-
+SALOME::SenderInt_ptr SenderFactory::buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderInt_i *src)
+{
+  SALOMEMultiComm mc(NewType);
+  long n;
+  const int *data=(const int *)src->getData(n);
+  bool own=src->getOwnerShip();
+  src->setOwnerShip(false);
+  return buildSender(mc,data,n,own);
+}
index d85a842baf1175a36e498fd6dd5d337214f21e64..ce3a0ad9130ab7a0133cc445b22f3047d5f05e90 100644 (file)
@@ -7,7 +7,8 @@
 
 class SALOMEMultiComm;
 
-class SALOME_Sender_i;
+class SALOME_SenderDouble_i;
+class SALOME_SenderInt_i;
 
 /*!
   This class implements the factory pattern of GoF by making a sender by giving an array and a communicator.It completely hides the type of sender from the user.
@@ -15,9 +16,27 @@ class SALOME_Sender_i;
 class SenderFactory
 {
 public:
-  static SALOME::Sender_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr) throw(MultiCommException);
-  static SALOME::Sender_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr) throw(MultiCommException);
-  static SALOME::Sender_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_Sender_i *src);
+  static SALOME::SenderDouble_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab=false) throw(MultiCommException);
+  static SALOME::SenderInt_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab=false) throw(MultiCommException);
+  static SALOME::SenderDouble_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderDouble_i *src);
+  static SALOME::SenderInt_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderInt_i *src);
+};
+
+template<class T>
+struct mapCppSender {
+  typedef T SenderVarType;
+};
+
+template<>
+struct mapCppSender<int>
+{
+  typedef SALOME::SenderInt_var SenderVarType;
+};
+
+template<>
+struct mapCppSender<double>
+{
+  typedef SALOME::SenderDouble_var SenderVarType;
 };
 
 #endif
diff --git a/src/Communication/libSALOME_Comm.i b/src/Communication/libSALOME_Comm.i
new file mode 100644 (file)
index 0000000..35c8e60
--- /dev/null
@@ -0,0 +1,60 @@
+%{
+  #include "ReceiverFactory.hxx"
+  #include "SALOME_Comm_i.hxx"
+%}
+
+%typemap(python,in) SALOME::SenderDouble_ptr
+{
+  PyObject* pdict = PyDict_New();
+  PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins());
+  PyRun_String("import CORBA", Py_single_input, pdict, pdict);
+  PyRun_String("o = CORBA.ORB_init([''], CORBA.ORB_ID);", Py_single_input,
+                   pdict, pdict);
+  PyObject* orb = PyDict_GetItemString(pdict, "o");
+
+  // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string
+
+  PyObject* iorSupport = PyObject_CallMethod(orb, "object_to_string", "O", $input);
+  if (iorSupport == Py_None)
+    return NULL;
+  char * s = PyString_AsString(PyObject_Str(iorSupport));
+  // Ask omniORB to convert IOR string to SALOME::SenderDouble_ptr
+
+  int argc = 0;
+  char *xargv = "";
+  char **argv = &xargv;
+  CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv);
+  CORBA::Object_var O =  ORB->string_to_object(s);
+  SALOME::SenderDouble_ptr t = SALOME::SenderDouble::_narrow(O);
+  $1 = t;
+}
+
+PyObject * getValueForSender(SALOME::SenderDouble_ptr senderDouble);
+
+%{
+PyObject * getValueForSender(SALOME::SenderDouble_ptr senderDouble)
+{
+  PyObject *py_list;
+  long size;
+  double *ret=ReceiverFactory::getValue(senderDouble,size);
+  py_list = PyList_New(size);
+  for (int i=0; i < size; i++)
+    {
+           int err = PyList_SetItem(py_list, i, Py_BuildValue("d", (double) ret[i]));
+           if(err)
+             {
+               char * message = "Error in SUPPORT::getTypes";
+               PyErr_SetString(PyExc_RuntimeError, message);
+               return NULL;
+             }
+    }
+  PyObject * result = Py_BuildValue("O", py_list);
+  delete [] ret;
+  Py_DECREF(py_list);
+  return result;
+}
+%}
index b474c2e7dd968cc947aa6600e0570db3fa8cd8dc..0c06e153bdb6d0ec92039bffae802ad6c3c5b620 100644 (file)
@@ -794,21 +794,32 @@ void ActSigIntHandler()
     perror("SALOME_Container main ") ;
     exit(0) ;
   }
-  INFOS(pthread_self() << "SigIntHandler activated") ;
+  //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers)
+  //             use of streams (and so on) should never be used because :
+  //             streams of C++ are naturally thread-safe and use pthread_mutex_lock ===>
+  //             A stream operation may be interrupted by a signal and if the Handler use stream we
+  //             may have a "Dead-Lock" ===HangUp
+  //==INFOS is commented
+  //  INFOS(pthread_self() << "SigIntHandler activated") ;
 }
 
 void SetCpuUsed() ;
 
 void SigIntHandler(int what , siginfo_t * siginfo ,
-                                        void * toto )
-{
-  MESSAGE(pthread_self() << "SigIntHandler what     " << what << endl
-          << "              si_signo " << siginfo->si_signo << endl
-          << "              si_code  " << siginfo->si_code << endl
-          << "              si_pid   " << siginfo->si_pid) ;
+                                        void * toto ) {
+  //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers)
+  //             use of streams (and so on) should never be used because :
+  //             streams of C++ are naturally thread-safe and use pthread_mutex_lock ===>
+  //             A stream operation may be interrupted by a signal and if the Handler use stream we
+  //             may have a "Dead-Lock" ===HangUp
+  //==MESSAGE is commented
+  //  MESSAGE(pthread_self() << "SigIntHandler what     " << what << endl
+  //          << "              si_signo " << siginfo->si_signo << endl
+  //          << "              si_code  " << siginfo->si_code << endl
+  //          << "              si_pid   " << siginfo->si_pid) ;
   if ( _Sleeping ) {
     _Sleeping = false ;
-    MESSAGE("SigIntHandler END sleeping.") ;
+    //     MESSAGE("SigIntHandler END sleeping.") ;
     return ;
   }
   else {
@@ -818,13 +829,13 @@ void SigIntHandler(int what , siginfo_t * siginfo ,
     }
     else {
       _Sleeping = true ;
-      MESSAGE("SigIntHandler BEGIN sleeping.") ;
+      //      MESSAGE("SigIntHandler BEGIN sleeping.") ;
       int count = 0 ;
       while( _Sleeping ) {
         sleep( 1 ) ;
         count += 1 ;
       }
-      MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
+      //      MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
     }
     return ;
   }
index d419c3596cee490fed6b910a88af2cc410d49119..2b8a301f58dc3654c745409cd6f321815ba8c309 100644 (file)
@@ -62,7 +62,7 @@ public:
   Engines::Component_ptr 
   FindElseLoadComponent(const Engines::MachineParameters& params,
                        const char *componentName,
-                       int studyId=0);
+                       int studyId =0);
 
   Engines::Component_ptr
   FindOrLoad_Component(const char *containerName,
index c4c55c81d7d24e5a985c76bc0f5d951f9be680a4..48fa79e784ca7c84cae506b1505d5415161cc1ba 100644 (file)
@@ -47,6 +47,6 @@ CPPFLAGS+= $(PYTHON_INCLUDES)
 
 LIBS+= $(PYTHON_LIBS) -lSalomeLifeCycleCORBA
 
-LDFLAGS+=
+LDFLAGS+= -lSalomeLifeCycleCORBA
 
 @CONCLUDE@
index 2cfb6d17402c99abf51b8559c8b878bd5eb6fb19..2fef32d5f3466ebe204dd7556814a17175ceb389 100644 (file)
@@ -4,12 +4,15 @@ import LifeCycleCORBA
 
 lcc = LifeCycleCORBA.LifeCycleCORBA()
 
-obj=lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent")
-comp=obj._narrow(Engines.TestComponent)
-comp.Coucou(1)
+#obj=lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent")
+#comp=obj._narrow(Engines.TestComponent)
+#comp.Coucou(1)
 
 param={}
-param['hostname']='cli76ce'
+param['hostname']='cli70ac'
 param['container_name']='myContainer'
 smesh=lcc.FindElseLoadComponent(param,'SMESH')
 
+container=lcc.FindContainer('myContainer')
+engine=lcc.FindComponent(param,'SMESH')
+geom=lcc.LoadComponent(param,'GEOM')
index 07034b25f474b8466a5c9038ee32a1aadb435214..b0cedeb17c5a1ed585464bc8621b5610ef41fbcc 100644 (file)
   SCRUTE($result);
 }
 
+
+%typemap(typecheck) const Engines::MachineParameters &
+{
+  $1 = ($input != 0);
+}
+
 %typemap(python,in) const Engines::MachineParameters &
 {
-  MESSAGE("typemap in on Engines::MachineParameters");
-  ASSERT (PyDict_Check($input))
+  printf("typemap in on Engines::MachineParameters\n");
+  //MESSAGE("typemap in on Engines::MachineParameters");
+  //ASSERT (PyDict_Check($input))
+  if (PyDict_Check($input) == 1)
     {
       Engines::MachineParameters *param = new Engines::MachineParameters ;
       PyObject *key, *value;
@@ -48,7 +56,7 @@
       while (PyDict_Next($input, &pos, &key, &value))
        {
          char* keystr = PyString_AsString(key);
-         MESSAGE("key: " << keystr);
+         printf("key: %s\n", keystr);
          if (strcmp(keystr,"container_name")==0)
            {
              param->container_name = CORBA::string_dup(PyString_AsString(value));
        }
       $1 = param;
     }
+  else 
+    {
+       printf("pas un dico\n");
+       return NULL;
+    }
 }
 
 %typemap(python,freearg) const Engines::MachineParameters &
index a4d5af9f3466d56b7a1c06f0f8c89f4e462fcdfe..279489642a04a98f2d03c9bc6ca32036e1ef0e75 100644 (file)
@@ -78,12 +78,12 @@ namespace MED{
 
     operator const T& () const 
     { 
-      return *get();
+      return *(this->get());
     }
 
     operator T& () 
     { 
-      return *get();
+      return *(this->get());
     }
   };
 
@@ -143,7 +143,7 @@ namespace MED{
     
     typename TSupperClass::TValue& operator[](size_t theId)
     {
-      return myContainer[GetID(theId)];
+      return myContainer[this->GetID(theId)];
     }
   };
   
index 9912d266b97a04b66742f8df0d6f8e2718a54f35..b65fc9126fd731489a1929613c5c0b3f6ee6b6d5 100644 (file)
@@ -42,8 +42,8 @@ SUBDIRS = MSG2QM SALOMELocalTrace SALOMETraceCollector Logger Utils CASCatch Pat
           TOOLSDS SALOMEDS Event \
           SALOMEGUI TOOLSGUI Plot2d VTKViewer OCCViewer \
          SUPERVGraph \
-         Session SALOME_SWIG SALOME_SWIG_WITHOUTIHM SALOME_PY \
-          RegistryDisplay ModuleGenerator SALOME_PYQT Loader Communication
+         Session Communication SALOME_SWIG SALOME_SWIG_WITHOUTIHM SALOME_PY \
+          RegistryDisplay ModuleGenerator SALOME_PYQT Loader
 endif
 
 ifeq (@WITHIHM@,no)
@@ -52,8 +52,8 @@ SUBDIRS = MSG2QM SALOMELocalTrace SALOMETraceCollector Logger Utils CASCatch \
          ModuleCatalog DataTypeCatalog RessourcesCatalog \
          ResourcesManager Notification  NOTIFICATION_SWIG \
          Container TestContainer LifeCycleCORBA HDFPersist Prs \
-          TOOLSDS SALOMEDS Event \
-          SALOME_SWIG_WITHOUTIHM ModuleGenerator Loader Communication
+          TOOLSDS SALOMEDS Event Communication \
+          SALOME_SWIG_WITHOUTIHM ModuleGenerator Loader
 endif
 
 ifeq (@mpi_ok@,yes)
index a653da09e40be678cf23e3dbe857ffc79541374a..77b4b037e58d3687fc5ee0a3f9672a4fca3d185e 100644 (file)
@@ -49,7 +49,7 @@ nb_components = 0
 # catalog=/tmp/myxml.xml
 #--------------------------------------------------
 def getParamValue( param_name, default_value, args ):
-    pattern=param_name+"="
+    pattern="^"+param_name+"="
 
     res = default_value        #initial value
     for opt in args:
@@ -410,12 +410,20 @@ class Component(Tree):
         Tree.__init__(self, 'component', key=name)
         if name is None:  return
                  
-        self.addNamedChild('component-name',       name)
+# ASV : fix for bug PAL8922 (Component name indicated by user in GUI is not taken into account
+       if common_data["COMP_NAME"] != '':
+           self.addNamedChild('component-name', common_data["COMP_NAME"])
+       else:
+           self.addNamedChild('component-name', name)
 
+# ASV : if user name is NOT set, then use component-name instead.  Else - default.
         if common_data["COMP_UNAME"] != '':
             self.addNamedChild('component-username',   common_data["COMP_UNAME"])
         else:
-            self.addNamedChild('component-username',   name)
+            if common_data["COMP_NAME"] != '':
+                self.addNamedChild('component-username', common_data["COMP_NAME"] )
+            else:
+                self.addNamedChild('component-username',   name)
             
         self.addNamedChild('component-type',       common_data["COMP_TYPE"])
         self.addNamedChild('component-author',     common_data["AUTHOR"])
@@ -673,7 +681,7 @@ def run(tree, args):
     common_data["ICON"]       = getParamValue("icon",       "",                args)
     common_data["AUTHOR"]     = getParamValue("author",     os.getenv("USER"), args)
     common_data["VERSION"]    = getParamValue("version",    "1",               args)
-    common_data["COMP_NAME"]  = getParamValue("name",       "",                args)
+    common_data["COMP_NAME"]  = getParamValue("name",       "",                args) 
     common_data["COMP_UNAME"] = getParamValue("username",   "",                args)
     common_data["COMP_TYPE"]  = getParamValue("type",       "OTHER",           args)
     common_data["COMP_MULT"]  = getParamValue("multistudy", "1",               args)
index 90645fdb2256e293b762c5a2810737ff2e8ed581..8396a6a6c1db0997313abc986ed82a7c86db2ac3 100644 (file)
@@ -189,6 +189,8 @@ void OCCViewer_ViewFrame::initViewPort()
                        this, SIGNAL( vfKeyPress( QKeyEvent* ) ) ) );
   QAD_ASSERT( connect( myViewPort, SIGNAL( vpKeyRelease( QKeyEvent* ) ),
                        this, SIGNAL( vfKeyRelease( QKeyEvent* ) ) ) );
+  QAD_ASSERT( connect( myViewPort, SIGNAL( vpDumpView() ),
+                       this, SLOT( onProcessViewDump() ) ) );
 }
 
 //=======================================================================
index 6f80c7816025573f780a351ea09be051a94b9589..1ddf54a187c4cf6b2c7a94d980c1d9c83a0bfe72 100644 (file)
@@ -171,6 +171,8 @@ signals:
   void           vpPaint (QPaintEvent*);
   void           vpDrawExternal (QPainter* painter);
 
+  void            vpDumpView();
+
 protected slots:
  virtual void  onChangeBackgroundColor() = 0;
 
index 0ace89025e595e3354be5a7024d17fe80f65a3fc..6b39a2add4b5760917fce45767b9858be2e7e661 100644 (file)
@@ -99,6 +99,8 @@ void OCCViewer_ViewPort3d::onCreatePopup()
     int id;
     myIDs.append ( id = myPopup->insertItem (tr ("MEN_VP3D_CHANGEBGR")) );     
     QAD_ASSERT ( myPopup->connectItem ( id, this, SLOT(onChangeBackgroundColor())) );
+    myIDs.append ( id = myPopup->insertItem (tr ("MEN_VP3D_DUMPVIEW")) );      
+    QAD_ASSERT ( myPopup->connectItem ( id, this, SIGNAL(vpDumpView())) );
 //    }
   }
 }
index c79b20136121459860f9ccac0ecea9962fb75667..245332b39e2dbf335230517f50aa91cb3d71c829 100644 (file)
@@ -796,8 +796,13 @@ void OCCViewer_Viewer3d::localSelectionDone( const bool /*bAdded*/ )
     }
     else
     {
-      aMapsOfShapes.Bind( anObj, TopTools_IndexedMapOfShape() );
-      aMapsOfIndexes.Bind( anObj, TColStd_MapOfInteger() );
+      // mpv: proting to gcc 3.4.1 and OCC 5.2.3
+      //aMapsOfShapes.Bind( anObj, TopTools_IndexedMapOfShape() );
+      //aMapsOfIndexes.Bind( anObj, TColStd_MapOfInteger() );
+      TopTools_IndexedMapOfShape empty1;
+      aMapsOfShapes.Bind( anObj, empty1 );
+      TColStd_MapOfInteger empty2;
+      aMapsOfIndexes.Bind( anObj, empty2 );
     }
   }
 
index 7909f104a0d1d7631eb14f02d92cd46179ec8bf5..48769299ca524bd24867553b1feffc9175e1e2b4 100644 (file)
@@ -38,18 +38,13 @@ EXPORT_HEADERS = \
        qfiledialogP.h
 
 # Libraries targets
-ifeq ($(QT_VERS),v3_3_3)
-       LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx
-else
-       LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx qworkspaceP.cxx qworkspaceP_moc.cxx qactionP.cxx qactionP_moc.cxx qfiledialogP.cxx qfiledialogP_moc.cxx
-endif
 
 LIB = libqsplitterP.la 
-
+LIB_SRC = qsplitterP.cxx qworkspaceP.cxx qactionP.cxx qfiledialogP.cxx 
 qsplitterP_moc.cxx: $(inc_builddir)/qsplitterP.h
        $(MOC) $(inc_builddir)/qsplitterP.h -o qsplitterP_moc.cxx
 
-qworkspaceP_moc.cxx: $(inc_builddir)/qworkspaceP.h 
+qworkspaceP_moc.cxx: $(inc_builddir)/qworkspaceP.h
        $(MOC) $(inc_builddir)/qworkspaceP.h -o qworkspaceP_moc.cxx
 
 qactionP_moc.cxx: $(inc_builddir)/qactionP.h
@@ -58,7 +53,7 @@ qactionP_moc.cxx: $(inc_builddir)/qactionP.h
 qfiledialogP_moc.cxx: $(inc_builddir)/qfiledialogP.h
        $(MOC) $(inc_builddir)/qfiledialogP.h -o qfiledialogP_moc.cxx
 
-CPPFLAGS+=$(QT_INCLUDES) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++ -I/usr/share/qt3/mkspecs/linux-g++
+CPPFLAGS+=$(QT_INCLUDES) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++
 CXXFLAGS+=
 LDFLAGS+=$(QT_MT_LIBS) 
 
index 0d1269dac9abb0f3daf1d526c88c1e68e45899d8..75aaa4c15e5ba70e5d51238454a4feeb257ba0e4 100644 (file)
 
 #include "qactionP.h"
 
+#if (QT_VERSION < 0x030303)
+
+#include "qactionP_moc.cxx"
+
 #ifndef QT_NO_ACTION
 
 #include <qtoolbar.h>
@@ -1778,3 +1782,5 @@ void QActionPGroup::addedTo( int index, QPopupMenu *menu )
 }
 
 #endif
+
+#endif
index 160324087b70d35a40db2ceb45c4cf2ca2a97d2b..1af693795cb5fb93b7739f903aa9f0543acb6816 100644 (file)
 #ifndef QACTIONP_H
 #define QACTIONP_H
 
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+// mpv: do not use patches for qt version >= 3.3.3
+#include <qaction.h>
+#define QActionPPrivate QActionPrivate
+#define QActionPGroupPrivate QActionGroupPrivate
+#define QActionPGroup QActionGroup
+#define QActionP QAction
+
+#else
+
 #ifndef QT_H
 #include <qobject.h>
 #include <qiconset.h>
 #endif // QT_H
 
 #ifndef QT_NO_ACTION
-
-#if QT_VERSION > 0x030005
-#include <qaction.h>
-#define QActionP QAction
-#define QActionPGroup QActionGroup
-#else
+#include <qaction.h> // mpv: for QAD_Desktop compilability
 
 class QActionPPrivate;
 class QActionPGroupPrivate;
@@ -190,6 +197,6 @@ public:
 
 #endif
 
-#endif // QT_VERSION
+#endif
 
 #endif
index 0b3ca637bd17be986a71f88088e75f6ae77657cb..5a71ec597355c853c48a0c89961951f98b167578 100644 (file)
@@ -41,8 +41,6 @@
 **
 **********************************************************************/
 
-#include "qplatformdefs.h"
-
 // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED.
 #if defined(connect)
 #undef connect
 
 #include "qfiledialogP.h"
 
+#if (QT_VERSION < 0x030303)
+
+#include <qplatformdefs.h>
+#include "qfiledialogP_moc.cxx"
+
 #ifndef QT_NO_FILEDIALOG
 
 #include "qlineedit.h"
@@ -5976,3 +5979,5 @@ QFilePreviewP::QFilePreviewP()
 */
 
 #endif
+
+#endif
index ab615b7533b0c6be1adb00a149244351c70bd562..9cf6ee7fb34de8475b88c9c8ba4b1b77ba8dfbc5 100644 (file)
 #ifndef QFILEDIALOGP_H
 #define QFILEDIALOGP_H
 
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+#include <qfiledialog.h>
+// mpv: do not use patches for qt version >= 3.3.3
+#define QFileIconProviderP QFileIconProvider
+#define QFilePreviewP QFilePreview
+#define QFileDialogP QFileDialog
+
+#else
+
 class QPushButton;
 class QButton;
 class QLabel;
@@ -68,11 +79,6 @@ class QFileDialogQFileListView;
 #include "qlineedit.h"
 #endif // QT_H
 
-#if QT_VERSION > 0x030005
-#include <qfiledialog.h>
-#define QFileDialogP QFileDialog
-#else
-
 #ifndef QT_NO_FILEDIALOG
 
 class Q_EXPORT QFileIconProviderP : public QObject
@@ -530,6 +536,6 @@ private:
 
 #endif
 
-#endif // QT_VERSION
+#endif
 
 #endif // QFILEDIALOG_H
index 15d5ed2aa2b0ef41a846b4e1591419cb34d09417..85a1b5017c89537335ea21dee7743d1c2b71b054 100644 (file)
 **********************************************************************/
 
 #include "qsplitterP.h"
+
+#if (QT_VERSION < 0x030303)
+
+#include "qsplitterP_moc.cxx"
+
 #ifndef QT_NO_COMPLEXWIDGETS
 
 #include <qglobal.h>
 #include <qpainter.h>
 #include <qdrawutil.h>
 #include <qbitmap.h>
-#include <qlayout.h>
 #include <private/qlayoutengine_p.h>
 #if QT_VERSION < 300
   #include <qlist.h>
@@ -1402,3 +1406,5 @@ void QSplitterP::updateSplitterHandles() const {
        s = data->list.next();
     }
 }
+
+#endif
index 263a90429e4bedb039bc3fd482425881a20cdb00..da94e7e40faf731cc9762ba22474b2df19b8570a 100644 (file)
 #ifndef QSPLITTERP_H
 #define QSPLITTERP_H
 
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+#include <qsplitter.h>
+// mpv: do not use patches for qt version >= 3.3.3
+#define QSplitterPHandle QSplitterHandle
+#define QSplitterPData QSplitterData
+#define QSplitterPLayoutStruct QSplitterLayoutStruct
+#define QSplitterP QSplitter
+
+#else
+
 #ifndef QT_H
 #include <qframe.h>
 #include <qvaluelist.h>
@@ -211,5 +223,6 @@ private:
     QPushButton* unright;
 };
 
+#endif
 
 #endif // QSPLITTERP_H
index 1a959ae47f4008f17ae4ab28c4e40c86b613c851..558c545facbc4ec95e9607c946b400d45a91f7ce 100644 (file)
 
 #include "qworkspaceP.h"
 
+#if (QT_VERSION < 0x030303)
+
+#include "qworkspaceP_moc.cxx"
+
 #include <qapplication.h>
 #include <qobjectlist.h>
 #include <qlayout.h>
@@ -3402,3 +3406,4 @@ QSize QTitleBarP::sizeHint() const
     return QSize( menur.width(), style().pixelMetric( QStyle::PM_TitleBarHeight, this ) );
 }
 
+#endif
index 2197da251308a1b610ab34a35c6aee6f79eef7d4..0ce92b6f06be7ff61304a478a0a902dd647c43ab 100644 (file)
 #ifndef QWORKSPACEP_H
 #define QWORKSPACEP_H
 
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+#include <qworkspace.h>
+// mpv: do not use patches for qt version >= 3.3.3
+#define QWorkspacePChild QWorkspaceChild
+#define QWorkspacePPrivate QWorkspacePrivate
+#define QWidgetResizeHandlerP QWidgetResizeHandler
+#define QTitleBarP QTitleBar
+#define QWorkspaceP QWorkspace
+#define QTitleBarPPrivate QTitleBarPrivate
+
+#else
+
 #ifndef QT_H
 #include <qobject.h>
 #include <qwidget.h>
 #include <qlabel.h>
 #endif // QT_H
 
-#if QT_VERSION > 0x030005
-#include <qworkspace.h>
-#define QWorkspaceP QWorkspace
-#else
-
 class QWorkspacePChild;
 class QShowEvent;
 class QWorkspacePPrivate;
@@ -355,5 +364,6 @@ private:
 
     QTitleBarPPrivate *d;
 };
-#endif // QT_VERSION
+#endif
+
 #endif // QWORKSPACEP_H
index cde7a39613c5c7df7f04684a70a18f7b4cf821ad..3af1cbd5c220b11dd9525cf95ee0725d28e6a1c9 100644 (file)
@@ -171,8 +171,11 @@ void Plot2d_ViewFrame::createActions()
   logXAction->setStatusTip ( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" ) );
   logXAction->setToggleAction( true );
   myActions.insert( ModeXLogarithmicId, logXAction );
-  connect( modeHorGrp, SIGNAL( selected( QActionP* ) ), this, SLOT( onHorMode() ) );
-
+#if (QT_VERSION >= 0x030303) // mpv: do not use patches for qt version >= 3.3.3
+  connect( modeHorGrp, SIGNAL( selected( QAction * ) ), this, SLOT( onHorMode() ) );
+#else
+  connect( modeHorGrp, SIGNAL( selected( QActionP * ) ), this, SLOT( onHorMode() ) );
+#endif
   // Vertical axis
   QActionPGroup* modeVerGrp = new QActionPGroup( this );
   modeVerGrp->setExclusive( TRUE );
@@ -188,8 +191,11 @@ void Plot2d_ViewFrame::createActions()
   logYAction->setStatusTip ( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_VER" ) );
   logYAction->setToggleAction( true );
   myActions.insert( ModeYLogarithmicId, logYAction );
+#if (QT_VERSION >= 0x030303) // mpv: do not use patches for qt version >= 3.3.3
+  connect( modeVerGrp, SIGNAL( selected( QAction* ) ), this, SLOT( onVerMode() ) );
+#else
   connect( modeVerGrp, SIGNAL( selected( QActionP* ) ), this, SLOT( onVerMode() ) );
-
+#endif
   /* Legend */
   QActionP* legendAction = new QActionP ( tr( "TOT_PLOT2D_SHOW_LEGEND"),
                                        rmgr->loadPixmap( "SALOMEGUI", tr("ICON_PLOT2D_SHOW_LEGEND") ) ,
@@ -220,8 +226,11 @@ void Plot2d_ViewFrame::createActions()
   splinesAction->setStatusTip ( tr( "PRP_PLOT2D_CURVES_SPLINES" ) );
   splinesAction->setToggleAction( true );
   myActions.insert( CurveSplinesId, splinesAction );
+#if (QT_VERSION >= 0x030303) // mpv: do not use patches for qt version >= 3.3.3
+  connect( curveGrp, SIGNAL( selected( QAction* ) ), this, SLOT( onCurves() ) );
+#else
   connect( curveGrp, SIGNAL( selected( QActionP* ) ), this, SLOT( onCurves() ) );
-
+#endif
   // Settings
   QActionP* settingsAction = new QActionP ( tr( "TOT_PLOT2D_SETTINGS"),
                                          rmgr->loadPixmap( "SALOMEGUI", tr("ICON_PLOT2D_SETTINGS") ) ,
@@ -244,6 +253,13 @@ void Plot2d_ViewFrame::createActions()
   fitDataAction->setStatusTip ( tr( "PRP_PLOT2D_CHANGE_BACKGROUND" ) );
   myActions.insert( ChangeBackgroundId, changeBGAction );
   connect( changeBGAction, SIGNAL( activated() ), this, SLOT( onChangeBackground() ) );
+
+  // Dump View
+  QActionP* dumpViewAction = new QActionP ( tr( "MEN_VP3D_DUMPVIEW"),
+                                           tr( "MEN_VP3D_DUMPVIEW" ), 0, this );
+  dumpViewAction->setStatusTip ( tr( "MEN_VP3D_DUMPVIEW" ) );
+  myActions.insert( DumpViewId, dumpViewAction );
+  connect( dumpViewAction, SIGNAL( activated() ), this, SLOT( onProcessViewDump() ) );
 }
 /*!
   Gets window's central widget
@@ -288,6 +304,7 @@ void Plot2d_ViewFrame::onCreatePopup()
     // Change background
     myPopup->insertSeparator();
     myActions[ ChangeBackgroundId ]->addTo( myPopup );
+    myActions[ DumpViewId ]->addTo( myPopup );
   }
 }
 /*!
@@ -1244,9 +1261,11 @@ void Plot2d_ViewFrame::setMarkerSize( const int size, bool update )
        QwtSymbol aSymbol = crv->symbol();
        aSymbol.setSize( myMarkerSize, myMarkerSize );
        crv->setSymbol( aSymbol );
+#if QWT_VERSION < 0x040200 // mpv: porting to the QWT 4.2.0
        int legendIndex = myPlot->getLegend()->findFirstKey( keys[i] );
        if ( legendIndex != myPlot->getLegend()->itemCnt() )
          myPlot->getLegend()->setSymbol( legendIndex, aSymbol );
+#endif
       }
     }
     if ( update )
index 275c432fb843a4d25e7c4c9613ca3fee3ae5b926..93cb990e3a39a435694aa56c7063f0b3ad952e3f 100644 (file)
@@ -35,7 +35,7 @@ class QAD_EXPORT Plot2d_ViewFrame : public QAD_ViewFrame, public QAD_PopupClient
 
   enum { NoOpId, FitAllId, FitAreaId, ZoomId, PanId, DumpId, 
         ModeXLinearId, ModeXLogarithmicId, ModeYLinearId, ModeYLogarithmicId,
-        LegendId, CurvePointsId, CurveLinesId, CurveSplinesId, SettingsId, FitDataId, ChangeBackgroundId };
+        LegendId, CurvePointsId, CurveLinesId, CurveSplinesId, SettingsId, FitDataId, ChangeBackgroundId, DumpViewId };
 public:
   /* Construction/destruction */
   Plot2d_ViewFrame( QWidget* parent, const QString& title = "" );
@@ -203,7 +203,15 @@ public:
 
   void       replot();
   void       getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine );
-  QwtLegend* getLegend() { return d_legend; }
+
+
+  QwtLegend* getLegend() { 
+#if QWT_VERSION < 0x040200
+    return d_legend;
+#else
+   return legend(); /* mpv: porting to QWT 4.2.0 */
+#endif
+  }
 
 protected:
   bool       existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine );
index b9954ade1fc07586ffcb93a7e20baa95535e403a..fe5b1b4f7898007be139c4fc19d772e5aa3699bb 100644 (file)
@@ -238,7 +238,16 @@ string SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer(const strin
 //       system(commandRcp.c_str());
     }
   else if(resInfo.Protocol==ssh)
-    command = "ssh ";
+    {
+      command = "ssh ";
+      string commandScp="scp ";
+      commandScp+=_TmpFileName;
+      commandScp+=" ";
+      commandScp+=machine;
+      commandScp+=":";
+      commandScp+=_TmpFileName;
+      system(commandScp.c_str());
+    }
   else
     throw SALOME_Exception("Unknown protocol");
 //   command+=machine;
@@ -345,14 +354,14 @@ void SALOME_ResourcesManager::SelectOnlyResourcesWithOS(vector<string>& hosts,co
 //Warning need an updated parsed list : _resourcesList
 void SALOME_ResourcesManager::KeepOnlyResourcesWithModule(vector<string>& hosts,const char *moduleName) const throw(SALOME_Exception)
 {
-   for(vector<string>::iterator iter=hosts.begin();iter!=hosts.end();iter++)
+   for(vector<string>::iterator iter=hosts.begin();iter!=hosts.end();)
      {
        MapOfParserResourcesType::const_iterator it=_resourcesList.find(*iter);
        const map<string,string>& mapOfModulesOfCurrentHost=(((*it).second).ModulesPath);
        if(mapOfModulesOfCurrentHost.find(moduleName)==mapOfModulesOfCurrentHost.end())
-        {
-          hosts.erase(iter);
-        }
+        hosts.erase(iter);
+       else
+        iter++;
      }
 }
 
index 1dd93ea10e37296125fed4391e25903f9884b144..ecf0cad066f431b93c8bb17afa38cc3d9a2ad028 100644 (file)
@@ -52,3 +52,15 @@ void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value)
   //  Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
   Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
 }
+
+char* SALOMEDS_AttributeExternalFileDef_i::Store() {
+  SALOMEDS::Locker lock;
+  return Value();
+}
+    
+void SALOMEDS_AttributeExternalFileDef_i::Restore(const char* value) {
+  SALOMEDS::Locker lock;      
+  SetValue(value);
+}
+
+    
index 12b2033565a3a4abbbbb7d810b2ad93989c99b3c..592a614bf2ffb98e8d6a477e9249325b14aa28f9 100644 (file)
@@ -46,6 +46,9 @@ class SALOMEDS_AttributeExternalFileDef_i:
 public:
   char* Value();
   void SetValue(const char* value);
+
+  char* Store();
+  void Restore(const char*);
   
 };
 
index c41320e90628517f3070f97a352d9e6687034392..7c69bc9ba65c3f7e1f472487ce64c2708e542499 100644 (file)
@@ -52,3 +52,17 @@ void SALOMEDS_AttributeFileType_i::SetValue(const char* value)
   //  Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
   Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
 }
+
+char* SALOMEDS_AttributeFileType_i::Store() {
+  SALOMEDS::Locker lock;
+  
+  return Value();
+}
+    
+void SALOMEDS_AttributeFileType_i::Restore(const char* value) {
+   SALOMEDS::Locker lock;
+      
+   SetValue(value);
+}  
+
+
index e31e23b2ee27a7a0eb05e47be1836ddc843b8d0f..61a57db71a39d8c0b2f2c5748484aa607e214241 100644 (file)
@@ -46,6 +46,9 @@ class SALOMEDS_AttributeFileType_i:
 public:
   char* Value();
   void SetValue(const char* value);
+
+  char* Store();
+  void Restore(const char*);
   
 };
 
index d0464d63f55576ce0c856d08105aad1bf0359cce..3207f78a05e087f8339a03ad0bf38d0c690e9eb7 100644 (file)
@@ -597,8 +597,6 @@ static void SaveAttributes(SALOMEDS::SObject_ptr SO, HDFgroup *hdf_group_sobject
   SALOMEDS::ListOfAttributes_var anAttrList = SO->GetAllAttributes();
   for(a = anAttrList->length() - 1; a >= 0; a--) {
     if (strcmp(anAttrList[a]->Type(), "AttributeIOR") == 0) continue; // never write AttributeIOR to file
-    if (strcmp(anAttrList[a]->Type(), "AttributeExternalFileDef") == 0) continue; // never write ExternalFileDef to file
-    if (strcmp(anAttrList[a]->Type(), "AttributeFileType") == 0) continue; // never write FileType to file
     CORBA::String_var aSaveStr(anAttrList[a]->Store());
     size[0] = (hdf_int32) strlen(aSaveStr.in()) + 1;
     HDFdataset *hdf_dataset = new HDFdataset(anAttrList[a]->Type(),hdf_group_sobject,HDF_STRING,size,1);
@@ -831,10 +829,12 @@ void SALOMEDS_StudyManager_i::_SaveAs(const char* aUrl,
            
            SALOMEDS::TMPFile_var aStream;
            
+           SALOMEDS::unlock(); // asv : fix for PAL8727 
            if(theASCII) 
              aStream = Engine->SaveASCII(sco,SALOMEDS_Tool::GetDirFromPath(aUrl).c_str(),theMultiFile);
            else
              aStream = Engine->Save(sco,SALOMEDS_Tool::GetDirFromPath(aUrl).c_str(),theMultiFile);
+           SALOMEDS::lock();  // asv : fix for PAL8727
 
            HDFdataset *hdf_dataset;
            hdf_size aHDFSize[1];
@@ -863,7 +863,9 @@ void SALOMEDS_StudyManager_i::_SaveAs(const char* aUrl,
            hdf_dataset->CloseOnDisk();
            hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor              
            
+           SALOMEDS::unlock(); //srn: fix for bug PAL8727
            Translate_IOR_to_persistentID(aStudy,SB,sco,Engine,theMultiFile, theASCII);
+           SALOMEDS::lock();   //srn: fix for bug PAL8727
            MESSAGE("After Translate_IOR_to_persistentID");
                  
            // Creation of the persistance reference  attribute
index 6ce59fb2320da3627036e30830a016594a1b9526..2afd3473f88a979d69f90fa51e094fb7df394ada 100644 (file)
@@ -20,7 +20,7 @@ msgstr ""
 #---------------
 
 msgid "INF_VERSION"
-msgstr "Version 2.2.2"
+msgstr "Version 2.2.4"
 
 msgid "INF_COPYRIGHT"
 msgstr "Copyright (C) 2003-2004 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS"
@@ -38,8 +38,8 @@ msgstr "salome"
 
 #: QAD_Application.cxx:133
 msgid "QAD_Application::APP_DEFAULTTITLE"
-msgstr "SALOME 2.2.2"
+msgstr "SALOME 2.2.4"
 
 #: QAD_Desktop.cxx:424
 msgid "QAD_Desktop::DESK_DEFAULTTITLE"
-msgstr "SALOME 2.2.2"
+msgstr "SALOME 2.2.4"
index cbc5a92e784a96c088fbd9e59fc6efcb05c4cce9..0397011fa0ff41d5bfe861f936ac5780f5747937 100644 (file)
@@ -794,7 +794,11 @@ void QAD_Desktop::createActions()
     myStdActions.insert( DefaultPlot2dId, viewerPlot2dAction1 );
 
     myQAG->addTo( &myDefaultViewer );
-    QAD_ASSERT(connect( myQAG, SIGNAL(selected(QActionP * )), this, SLOT(onDefaultViewer(QActionP *) )));
+#if (QT_VERSION >= 0x030303) // mpv: do not use patches for QT version >= 3.3.3
+    QAD_ASSERT(connect( myQAG, SIGNAL(selected(QAction* )), this, SLOT(onDefaultViewer(QAction*) )));
+#else
+    QAD_ASSERT(connect( myQAG, SIGNAL(selected(QActionP* )), this, SLOT(onDefaultViewer(QActionP *) )));
+#endif
     //VRV: T2.5 - add default viewer
 
     myPrefPopup.insertSeparator();
@@ -3349,7 +3353,7 @@ SALOMEGUI* QAD_Desktop::getComponentGUI( const QString& component )
 #ifdef WNT
        dir = dir + "libSalomePyQtcmodule.dll" ;
 #else
-#ifdef SIP_VERS_v4_1
+#ifdef SIP_VERS_v4
        dir = dir + "SalomePyQt.so" ;
 #else
        dir = dir + "libSalomePyQtcmodule.so" ;
index 35c71416e8726c46d93ec3ed892c600cc6bb0473..caa0e8603f3ef5d19b13f8c1f81ebfb1ce22e478 100644 (file)
@@ -236,7 +236,12 @@ protected slots:
     void              onPlot2d();
     void              onConsoleFontAction();
   //VRV: T2.5 - add default viewer
+#if (QT_VERSION >= 0x030303) // mpv: do not use Qt patch for Qt vewrsion >= 3.3.3
+    void             onDefaultViewer( QAction * theAction);
+#else
+    void             onDefaultViewer( QAction * theAction) {};
     void             onDefaultViewer( QActionP * theAction);
+#endif
   //VRV: T2.5 - add default viewer
 
     void             onViewerTrihedron();
index 96e3d69b6ec08a5bb5513591941dda317d6922bf..583540cb7c42a5fffc450d8d1b9526ed76d8c2a3 100644 (file)
 //  Module : SALOME
 //  $Header$
 
-#include "QAD_PyEditor.h"  // this include must be first (see PyInterp_base.h)!
+// mpv 28.02.2005: if Python 2.4 python includes must be first: it uses "slots" field, redefined in qt
+#include "QAD_PyInterp.h"
+
 #include "QAD_RightFrame.h"
 #include "QAD_Application.h"
 #include "QAD_Desktop.h"
 #include "QAD_StudyFrame.h"
 #include "QAD_Tools.h"
-#include "QAD_PyInterp.h"
+#include "QAD_PyEditor.h"
 
 #include <qvaluelist.h>
 
@@ -62,7 +64,10 @@ QAD_RightFrame::QAD_RightFrame(QWidget *theParent,
   myViewType(theTypeView),
   myInterp(theInterp)
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
   this->setCompressEnabled( true );
+#endif
 
   QAD_Desktop* Desktop = QAD_Application::getDesktop();
   int DesktopHeight = Desktop->getMainFrame()->width();
@@ -193,7 +198,10 @@ QAD_RightFrame::QAD_RightFrame(QWidget *theParent,
   myViewFrame->setMinimumSize( 1, 1 );
   mySplitter = new QAD_Splitter( Qt::Horizontal, this );
   mySplitter->setMinimumSize( 1, 1 );
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
   mySplitter->setCompressEnabled( true );
+#endif
 
   myPyEditor = new QAD_PyEditor(myInterp, theMutex, mySplitter ,"Python Interpreter");
   myPyEditor->setMinimumSize( 1, 1 );
@@ -252,9 +260,14 @@ QAD_PyEditor* QAD_RightFrame::getPyEditor() const
 */
 void QAD_RightFrame::compressUp()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = getHandleAfter(myViewFrame);
   if (h)
     h->compressBefore();
+
+#endif
 }
 
 /*!
@@ -262,9 +275,14 @@ void QAD_RightFrame::compressUp()
 */
 void QAD_RightFrame::unCompressUp()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = getHandleAfter(myViewFrame);
   if (h)
     h->unCompressBefore();
+
+#endif
 }
 
 /*!
@@ -272,9 +290,14 @@ void QAD_RightFrame::unCompressUp()
 */
 void QAD_RightFrame::compressBottom()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = getHandleAfter(myViewFrame);
   if (h)
     h->compressAfter();
+
+#endif
 }
 
 /*!
@@ -282,51 +305,95 @@ void QAD_RightFrame::compressBottom()
 */
 void QAD_RightFrame::unCompressBottom()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = getHandleAfter(myViewFrame);
   if (h)
     h->unCompressAfter();
+
+#endif
 }
 
 void QAD_RightFrame::compressLeft()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() );
   if( h )
     h->compressBefore();
+
+#endif
 }
 
 void QAD_RightFrame::compressRight()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() );
   if( h )
     h->compressAfter();
+
+#endif
 }
 
 void QAD_RightFrame::unCompressLeft()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() );
   if( h )
     h->unCompressBefore();
+
+#endif
 }
 
 void QAD_RightFrame::unCompressRight()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() );
   if( h )
     h->unCompressAfter();
+
+#endif
 }
 
 bool QAD_RightFrame::isCompressedViewFrame() const
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
     return isCompressed( myViewFrame );
+#else
+    return false;
+#endif
 }
 
 bool QAD_RightFrame::isCompressedPython() const
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
     return mySplitter->isCompressed( getPyEditor() );
+
+#else
+    return false;
+#endif
 }
 
 bool QAD_RightFrame::isCompressedMessage() const
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
     return mySplitter->isCompressed( getMessage() );
-}
 
+#else
+    return false;
+#endif
+}
index fa1642d6da4a79f48297cf7ee0b0d11480a9b777..0cfc30df70c1150b235357221605fc4e371d75c6 100644 (file)
@@ -31,7 +31,9 @@
   \brief Frame window which contains QAD_LeftFrame and QAD_RightFrame.
 */
 
-#include "QAD_PyInterp.h"  // this include must be first (see PyInterp_base.h)!
+// mpv 28.02.2005: if Python 2.4 python includes must be first: it uses "slots" field, redefined in qt
+#include "QAD_PyInterp.h"
+
 #include "QAD_StudyFrame.h"
 #include "QAD_StudyFrame.h"
 #include "QAD_RightFrame.h"
@@ -64,7 +66,10 @@ QAD_StudyFrame::QAD_StudyFrame(QAD_Study* theStudy, QWidget* theParent,
   setPalette(QAD_Application::getPalette());
 
   mySplitter = new QAD_Splitter( Qt::Horizontal, this);
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
   mySplitter->setCompressEnabled( true );
+#endif
 
   setCentralWidget(mySplitter);
   myLeftFrm = new QAD_LeftFrame(myStudy->getStudyDocument(), mySplitter, theTitle );
@@ -134,40 +139,74 @@ void QAD_StudyFrame::closeEvent(QCloseEvent* e)
  */
 void QAD_StudyFrame::compressLeft()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm);
   if( h ) 
     h->compressBefore();
+
+#endif
 }
 
 void QAD_StudyFrame::compressRight()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm);
   if( h )
     h->compressAfter();
+
+#endif
 }
 
 void QAD_StudyFrame::unCompressLeft()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm);
   if( h )
     h->unCompressBefore();
+
+#endif
 }
 
 void QAD_StudyFrame::unCompressRight()
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm);
   if( h )
     h->unCompressAfter();
+
+#endif
 }
 
 bool QAD_StudyFrame::isCompressedLeft() const
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   return mySplitter->isCompressed(myLeftFrm);
+
+#else
+  return false;
+#endif
 }
 
 bool QAD_StudyFrame::isCompressedRight() const
 {
+#if (QT_VERSION < 0x030303)
+// mpv: do not use patchqt for qt version >= 3.3.3
+
   return mySplitter->isCompressed(myRightFrm);
+
+#else
+  return false;
+#endif
 }
 
 /*!
index c22c7a4a8224e785529c5df99c060cc166fffdde..ff25d5aa302e1f422a9bcacabf074406eebf4df7 100644 (file)
@@ -78,7 +78,6 @@ void QAD_ViewFrame::onViewDump()
 {
   if (!getViewWidget())
     return;
-
   QApplication::setOverrideCursor( Qt::waitCursor );
   QPixmap px = QPixmap::grabWindow(getViewWidget()->winId());
   QApplication::restoreOverrideCursor();
@@ -105,3 +104,29 @@ void QAD_ViewFrame::onViewDump()
     }
   }
 }
+
+#define DUMP_EVENT QEvent::User + 123
+/*!
+   This method is used to dump the viewer contents to the image file
+   from the context popup menu (uses event mechanizm to assure redrawing
+   the viewer contents before dumping by sending custom event)
+*/
+void QAD_ViewFrame::onProcessViewDump() 
+{
+  qApp->postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ), TRUE ) );
+  qApp->postEvent( this, new QCustomEvent( DUMP_EVENT ) );
+}
+
+/*!
+  Processes the custom event sent by onProcessViewDump() method to
+  call onViewDump() slot: dumping the view contents to the image file
+  (see desription for onProcessViewDump() method above)
+*/
+bool QAD_ViewFrame::event ( QEvent* e )
+{
+  if ( e->type() == DUMP_EVENT ) {
+    onViewDump();
+    return TRUE;
+  }
+  return QMainWindow::event( e );
+}
index 7ea86fb5fa03f17337564136d8f9782aea7c0ebe..572eccddf030ba9bba73eb5b944900b8fec07270 100644 (file)
@@ -51,6 +51,8 @@ public:
   QAD_ViewFrame(QWidget* parent = 0);
   virtual ~QAD_ViewFrame();
 
+  bool                   event ( QEvent* e );
+
   void                   cleanup();
 
   virtual ViewType       getTypeView() const = 0; 
@@ -128,6 +130,11 @@ public slots:
   virtual void           onRotateRight() {}
   virtual void           onRotateUp()    {}
   virtual void           onRotateDown()  {}
+
+  /* the next slot is used for dumping viewer contents to the image file;
+     called from the context popup menu
+  */
+  void                   onProcessViewDump();
 };
 
 #endif
index 85df1090063368893e4063d1deec88718b98117d..5044fa001735a506203cac990232683b0316dddb 100644 (file)
@@ -78,7 +78,10 @@ QAD_XmlHandler::~QAD_XmlHandler()
 void QAD_XmlHandler::setMainWindow(QAD_Desktop* desktop)
 {
   myDesktop       = desktop;
-  myIdList        = TColStd_SequenceOfInteger();
+  // mpv: proting to the gcc 3.4.1 and OCC 5.3.2
+  //myIdList        = TColStd_SequenceOfInteger();
+  TColStd_SequenceOfInteger empty;
+  myIdList        = empty;
   myBackMenu      = true;
   myBackPopupMenus.setAutoDelete(false);
 }
index feca9f9e5cc569ceaf3deb8a3772691fc2a877b0..631141152be6006350e17381c5e7812a658cf5db 100644 (file)
@@ -333,6 +333,9 @@ msgstr "Viewer"
 msgid "MEN_VP3D_CHANGEBGR"
 msgstr "Change background..."
 
+msgid "MEN_VP3D_DUMPVIEW"
+msgstr "Camera Dump..."
+
 msgid "MEN_APP_DISPLAY"
 msgstr "Display"
 
index 40238630f67bf6d49af0bf362f883b2f12253f9a..fe0a122382f4e8e04b5a52d6de3db0bbd387ffd1 100644 (file)
@@ -52,8 +52,8 @@
 
 #define MESS_INIT(deb) std::ostringstream os; os<<deb
 #define MESS_BEGIN(deb) MESS_INIT(deb)<<__FILE__ <<" ["<<__LINE__<<"] : "
-#define MESS_END endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
-#define MESS_ABORT endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
+#define MESS_END std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
+#define MESS_ABORT std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
 
 // --- Some macros are always defined (without _DEBUG_): for use with release version
 
index a581f99b16690a9646aeb8d20892362361d0a44f..bb6fe1b4a2b4995e7ba6a868f4efbd91eb3df6eb 100644 (file)
@@ -8,94 +8,89 @@
 #  $Header$
 
 top_srcdir=@top_srcdir@
-top_builddir=../..
+top_builddir=@top_builddir@
 srcdir=@srcdir@
 VPATH=.:@srcdir@:@top_srcdir@/idl
 
 
 @COMMENCE@
 
-# PyQt
-# PYQT_SIPS defined in make_commence.in
-
-# SIP C++ Python
-# SIP defined in make_commence.in
-#SIP_FLAGS    = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
-
+# small trick for Mandrake-10.1: PyQt 3.13 does not support Qt 3.3.3
+ifeq ($(QT_VERS),Qt_3_3_3)
+QT_VERS = Qt_3_3_0
+endif
+ifeq ($(QT_VERS),Qt_3_3_4)
+QT_VERS = Qt_3_3_0
+endif
 
-# SIP input file(s)
+# Sip flags
+SIP_FLAGS = -t WS_X11 -t $(QT_VERS) -s ".cc" -c . -I $(PYQT_SIPS)
+# Sip common sources
+SIP_SRC = sipSalomePyQtSalomePyQt.cc \
+         sipSalomePyQtSALOME_Selection.cc
 
-#SIP_FILES = SalomePyQt.sip
+# Sip version-specific sources
+ifeq ($(SIP_VERS),v4)
+SIP_SRC  += sipSalomePyQtcmodule.cc
+else
+SIP_SRC  += SalomePyQtcmodule.cc
+endif
 
-# SIP-generated C++ source files (corresponding line should be added for each wrapped class 
-# contained by SalomePyQt module)
-#SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \
-#      $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
-#      $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
+# Sip/moc sources
+ifeq ($(SIP_VERS),v4)
+MOC_SRC   = sipSalomePyQtcmodule_moc.cxx
+MOC_H     = sipSalomePyQtcmodule.h
+else 
+ifeq ($(SIP_VERS),v3_new)
+MOC_SRC   = SalomePyQtcmodule_moc.cxx
+MOC_H     = SalomePyQtcmodule.h
+else
+MOC_SRC   = sipSalomePyQtProxySalomePyQt_moc.cxx
+MOC_H     = sipSalomePyQtProxySalomePyQt.h
+endif
+endif
 
-ifeq ($(SIP_VERS),v4_1)
-SIP_FLAGS    = -t WS_X11 -t Qt_3_3_0 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
-SIP_SRC=$(CURDIR)/sipSalomePyQtcmodule.cc \
-       $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
-       $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
-MOC_SRC = sipSalomePyQtcmodule_moc.cxx
-MOC_H = sipSalomePyQtcmodule.h
+# Sip definition files
+ifeq ($(SIP_VERS),v4)
 SIP_FILES = SalomePyQt_v4.sip
-#LDFLAGS+= -lSalomeGUI 
-#LDFLAGS+= -lSalomeGUI -module
-LDFLAGS+= -shared -lSalomeGUI
-
-# Libraries targets
-LIB = SalomePyQt.so
 else
-ifeq ($(SIP_VERS),new2)
-SIP_FLAGS    = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
-SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \
-       $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
-       $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
-MOC_SRC = SalomePyQtcmodule_moc.cxx
-MOC_H = SalomePyQtcmodule.h
 SIP_FILES = SalomePyQt.sip
-LDFLAGS+= -lSalomeGUI -lqtcmodule
+endif 
 
 # Libraries targets
-LIB = libSalomePyQtcmodule.la
-
-EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py
+ifeq ($(SIP_VERS),v4)
+LIB = SalomePyQt.so
+LDFLAGS+=-shared -lSalomeGUI
 else
-SIP_FLAGS    = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
-SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \
-       $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
-       $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
-MOC_SRC = sipSalomePyQtProxySalomePyQt_moc.cxx
-MOC_H = sipSalomePyQtProxySalomePyQt.h
-SIP_FILES = SalomePyQt.sip
-LDFLAGS+= -lSalomeGUI -lqtcmodule
-
-# Libraries targets
 LIB = libSalomePyQtcmodule.la
+LDFLAGS+=-lSalomeGUI -lqtcmodule
+endif 
 
+# Exported python scripts
+ifneq ($(SIP_VERS),v4)
 EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py
 endif
-endif
-
-LIB_SRC += SalomePyQt.cxx SALOME_PYQT_GUI.cxx $(SIP_SRC) $(MOC_SRC) 
-LIB_MOC = SALOME_PYQT_GUI.h
 
-#LIB_MOC += sipSalomePyQtProxySalomePyQt.h
+# Library sources
+LIB_SRC = SalomePyQt.cxx \
+         SALOME_PYQT_GUI.cxx \
+          $(SIP_SRC)     \
+          $(MOC_SRC) 
 
-#EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py
-
-LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_ContainerManager.idl
+# Library moc sources
+LIB_MOC = SALOME_PYQT_GUI.h
 
-CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES)
-LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS)
-#LDFLAGS+= -lSalomeGUI -lqtcmodule
-#LDFLAGS+= -lSalomeGUI 
+# Client IDL
+LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_GenericObj.idl
 
+# Compilation/linkage flags
+CPPFLAGS += $(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) -DHAVE_CONFIG_H -I${KERNEL_ROOT_DIR}/include/salome
+LIBS     += $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS)
+#LDFLAGS  += -lsuit -lCAM -lstd -lqtx -lSalomeApp -lEvent -lLogWindow -lVTKViewer -lToolsGUI -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeDS
+#_CS_gboLDFLAGS += -lVTKViewer -lToolsGUI -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeDS
+LDFLAGS += -lVTKViewer -lToolsGUI -lSalomeDS
 
 # Custom build step: generate C++ wrapping according to $(SIP_FILES)
-
 $(SIP_SRC): $(SIP_FILES)
        $(SIP) $(SIP_FLAGS) $<
 
diff --git a/src/SALOME_PYQT/SalomePyQt_v4.sip b/src/SALOME_PYQT/SalomePyQt_v4.sip
new file mode 100644 (file)
index 0000000..69bbcfd
--- /dev/null
@@ -0,0 +1,62 @@
+%Module SalomePyQt
+
+%Import qtmod.sip
+
+class SALOME_Selection : QObject
+{
+%TypeHeaderCode
+#include <SALOME_Selection.h>
+%End
+
+public:
+  SALOME_Selection(const QString &);
+  void Clear();
+  void ClearIObjects();
+
+signals:
+  void currentSelectionChanged();
+};
+
+enum MenuName {
+  File        = 1,
+  View        = 2,
+  Edit        = 3,
+  Preferences = 4,
+  Tools       = 5,
+  Window      = 6,
+  Help        = 7  
+};
+
+class SalomePyQt
+{
+%TypeHeaderCode
+#include <SalomePyQt.hxx>
+%End
+
+public:
+  static QWidget*    getDesktop();
+  static QWorkspace* getMainFrame();
+  static QMenuBar*   getMainMenuBar();
+  static QPopupMenu* getPopupMenu( const MenuName );
+  static SALOME_Selection* getSelection();
+  static int getStudyId();
+  static void putInfo( const QString& );
+  static void putInfo( const QString&, int );
+
+  static const QString& getActiveComponent();
+
+  static void updateObjBrowser( int, bool );
+
+
+  static bool removeSettings(QString);
+  static QString getSetting(QString);
+  static void addStringSetting(QString, QString, bool);
+  static void addIntSetting(QString, int, bool);
+  static void addDoubleSetting(QString, double, bool);
+
+  static QString getFileName(QWidget*, const QString&, const QStringList&, const QString&, bool);
+  static QStringList getOpenFileNames(QWidget*, const QString&, const QStringList&, const QString&);
+  static QString getExistingDirectory(QWidget*, const QString&, const QString&);
+  static void helpContext(const QString&, const QString&);
+  static bool dumpView(const QString&);
+};
index a5dd3b7c9b9f68a2b1d50d1b74a3e5ddaea1b59f..a704ad5b0d8c6b8677da55e5d18ebb90c3a4d633 100644 (file)
@@ -49,6 +49,6 @@ LIB_CLIENT_IDL = SALOMEDS.idl \
 
 CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -DHAVE_CONFIG_H
 LIBS+= $(PYTHON_LIBS)
-LDFLAGS+= -lSalomeGUI
+LDFLAGS+= -lSalomeGUI -lSalomeCommunication
 
 @CONCLUDE@
index 988ad4cbc96c7a86311902b7d506ab7081ef7bc3..69fb59866960a6a2b68a588ad4bdb248c95200dc 100644 (file)
@@ -28,4 +28,5 @@
 
 //%include "SALOME_NamingService.i"
 %include "SALOMEGUI_Swig.i"
+%include "libSALOME_Comm.i"
 
index 6748448d55f635c9e9a2fd12e9a05551dd26c0a2..5fbb99c69bc8a810e74ded53d95294c949bd11ac 100644 (file)
@@ -32,6 +32,7 @@
 #include <iostream>
 #include <unistd.h>
 
+#include "Container_init_python.hxx"
 #include <qthread.h> 
 #include <qapplication.h>
 #include <qlabel.h>
@@ -49,7 +50,6 @@
 #include "Utils_CorbaException.hxx"
 #include "SALOMEGUI_QtCatchCorbaException.hxx"
 #include "SALOME_Event.hxx"
-#include "Container_init_python.hxx"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Session)
index 62ce955efcf89946da8ca849203b912f95551eb8..aa8406cc43dafd8770026f29f55677f793dab79a 100644 (file)
@@ -46,7 +46,7 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
-static list<DESTRUCTEUR_GENERIQUE_*> *Destructeurs=0 ;
+std::list<DESTRUCTEUR_GENERIQUE_*> *DESTRUCTEUR_GENERIQUE_::Destructeurs=0 ;
 
 /*! \class ATEXIT_
  *
@@ -78,9 +78,10 @@ public :
          //CCRT
          if ( Make_ATEXIT && !ATEXIT_Done ) {
            //CCRT
-               ASSERT (Destructeurs==0);
+               ASSERT (DESTRUCTEUR_GENERIQUE_::Destructeurs==0);
                if(MYDEBUG) MESSAGE("Construction ATEXIT"); // message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561)
-               Destructeurs = new list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeurs alloué dynamiquement (cf. ci-dessous) ,
+               DESTRUCTEUR_GENERIQUE_::Destructeurs = 
+                      new std::list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeurs alloué dynamiquement (cf. ci-dessous) ,
                                                                   // il est utilisé puis détruit par la fonction Nettoyage
                int cr = atexit( Nettoyage );                      // exécute Nettoyage lors de exit, après la destruction des données statiques !
                ASSERT(cr==0) ;
@@ -111,30 +112,30 @@ static ATEXIT_ nettoyage = ATEXIT_( false );      /* singleton statique */
 void Nettoyage( void )
 {
        if(MYDEBUG) BEGIN_OF("Nettoyage( void )") ;
-       ASSERT(Destructeurs) ;
-       if(MYDEBUG) SCRUTE( Destructeurs->size() ) ;
-       if( Destructeurs->size() )
+       ASSERT(DESTRUCTEUR_GENERIQUE_::Destructeurs) ;
+       if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
+       if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() )
        {
-               list<DESTRUCTEUR_GENERIQUE_*>::iterator it = Destructeurs->end() ;
+               std::list<DESTRUCTEUR_GENERIQUE_*>::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ;
 
                do
                {
                        if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON");
                        it-- ;
                        DESTRUCTEUR_GENERIQUE_* ptr = *it ;
-                       //Destructeurs->remove( *it ) ;
+                       //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ;
                        (*ptr)() ;
                        delete ptr ;
-               }while( it!=  Destructeurs->begin() ) ;
+               }while( it!=  DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ;
 
-               Destructeurs->clear() ;
-               if(MYDEBUG) SCRUTE( Destructeurs->size() ) ;
-               ASSERT( Destructeurs->size()==0 ) ;
-               ASSERT( Destructeurs->empty() ) ;
+               DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ;
+               if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
+               ASSERT( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ;
+               ASSERT( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ;
        }
 
-       delete Destructeurs;
-       Destructeurs=0;
+       delete DESTRUCTEUR_GENERIQUE_::Destructeurs;
+       DESTRUCTEUR_GENERIQUE_::Destructeurs=0;
        if(MYDEBUG) END_OF("Nettoyage( void )") ;
        return ;
 }
index 6cf3432c1a46a8a7e2fc43a7826dd11dbc2dc0f7..1d95176ec09b744aaa8d38be317ba6eb2e0cf0c0 100644 (file)
@@ -29,6 +29,7 @@
 # if !defined( __DESTRUCTEUR_GENERIQUE__H__ )
 # define __DESTRUCTEUR_GENERIQUE__H__
 
+# include <list>
 # include <CORBA.h>
 # include "utilities.h"
 
@@ -56,6 +57,8 @@
 class DESTRUCTEUR_GENERIQUE_
 {
 public :
+  static std::list<DESTRUCTEUR_GENERIQUE_*> *Destructeurs;
+
   virtual ~DESTRUCTEUR_GENERIQUE_() {}//!< virtual destructor
   static const int Ajout( DESTRUCTEUR_GENERIQUE_ &objet );//!< adds a destruction object to the list of destructions
   virtual void operator()( void )=0 ;//!< performs the destruction
index 79d4843891e54b56d29957014cce2639135c8f64..4447b3de7aed14954917fc5252de4da0688c09e1 100644 (file)
@@ -147,11 +147,11 @@ template <class TYPE> int SINGLETON_<TYPE>::Destruction( void )
 
 
                std::list<DESTRUCTEUR_GENERIQUE_ *>::iterator k ;
-               for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs.begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs.end();k++)
+               for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++)
                {
                        if ( *k == PtrSingleton->_Instance )
                        {
-                               DESTRUCTEUR_GENERIQUE_::Destructeurs.erase( k ) ;
+                               DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ;
                                break ;
                        }
                }
index 2cc4930bc25c4bfc7314d0da9b9a0e4770422e81..6de6d5ac96a5c7648878acac146eee8e793a97b0 100644 (file)
@@ -61,6 +61,39 @@ SALOME_ExtractUnstructuredGrid::SALOME_ExtractUnstructuredGrid():
 SALOME_ExtractUnstructuredGrid::~SALOME_ExtractUnstructuredGrid(){}
 
 
+void 
+SALOME_ExtractUnstructuredGrid::
+SetModeOfChanging(SALOME_ExtractUnstructuredGrid::EChanging theChangeMode)
+{
+  if(theChangeMode != myChangeMode){
+    myChangeMode = theChangeMode; 
+    Modified();
+  }
+}
+
+
+void
+SALOME_ExtractUnstructuredGrid::
+SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::EExtraction theExtractionMode)
+{
+  if(theExtractionMode != myExtractionMode){
+    myExtractionMode = theExtractionMode; 
+    Modified();
+  }
+}
+
+
+void
+SALOME_ExtractUnstructuredGrid::
+ClearRegisteredCellsWithType()
+{ 
+  if(IsCellsWithTypeRegistered()){
+    myCellTypes.clear();
+    Modified();
+  }
+}
+
+
 void SALOME_ExtractUnstructuredGrid::RegisterCell(vtkIdType theCellId){
   if(0 && MYDEBUG) MESSAGE("RegisterCell - theCellId = "<<theCellId);
   myCellIds.insert(theCellId);
index dc3bcc41aa6c424a352c557562d4cc27e8fa52a0..c507a312a859d7158b65276571fbb518e3d4135d 100644 (file)
@@ -42,16 +42,11 @@ public:
   static SALOME_ExtractUnstructuredGrid *New();
 
   enum EExtraction{ eCells, ePoints};
-  void SetModeOfExtraction(EExtraction theExtractionMode){
-    myExtractionMode = theExtractionMode; Modified();
-  }
+  void SetModeOfExtraction(EExtraction theExtractionMode);
   EExtraction GetModeOfExtraction(){ return myExtractionMode;}
 
   enum EChanging{ ePassAll, eAdding, eRemoving};
-  void SetModeOfChanging(EChanging theChangeMode){
-    myChangeMode = theChangeMode; 
-    Modified();
-  }
+  void SetModeOfChanging(EChanging theChangeMode);
   EChanging GetModeOfChanging(){ return myChangeMode;}
 
   // Remove the cell from the output
@@ -65,10 +60,7 @@ public:
   // Remove every cells with the type from the output
   void RegisterCellsWithType(vtkIdType theCellType);
   int IsCellsWithTypeRegistered() { return !myCellTypes.empty();}
-  void ClearRegisteredCellsWithType() { 
-    myCellTypes.clear();
-    Modified();
-  }
+  void ClearRegisteredCellsWithType();
 
   // Do the filter do some real work
   int IsChanging() { return IsCellsRegistered() || IsCellsWithTypeRegistered();}
index cd38a862dec4a04ed914346081a867a26c2e5c5a..aa9f83c9023a2168e612b609588f89eb3673def8 100644 (file)
@@ -30,7 +30,7 @@
 #define VTKViewer_Algorithm_H
 
 class vtkActor;
-class vtkActorCollection;
+#include <vtkActorCollection.h>
 
 namespace SALOME{
   namespace VTK{
index 08dbc0edaaec4ce8c7245239b1cdfdbbd93428fc..bd97dd2020f204df191deeb7ea05a3e965410167 100644 (file)
@@ -176,6 +176,8 @@ void VTKViewer_RenderWindow::onCreatePopup()
     int id;
     myIDs.append ( id = myPopup->insertItem (tr ("MEN_VP3D_CHANGEBGR")) );     
     QAD_ASSERT ( myPopup->connectItem ( id, this, SLOT(onChangeBackgroundColor())) );
+    myIDs.append ( id = myPopup->insertItem (tr ("MEN_VP3D_DUMPVIEW")) );      
+    QAD_ASSERT ( myPopup->connectItem ( id, this, SIGNAL(DumpView())) );
 //    }
   }
 }
index 34fd61ff0aa51c79713a66da154eb13f897de19f..e19e67966dc72dea8099e72e25d6c5be93633325 100644 (file)
@@ -77,6 +77,7 @@ public QWidget, /*virtual public vtkRenderWindow, */
   void ButtonPressed(const QMouseEvent *event) ;
   void ButtonReleased(const QMouseEvent *event) ;
   void KeyPressed(QKeyEvent *event) ;
+  void DumpView();
 
  protected:
   vtkRenderWindow* myRW;
index 067cc6aee5640bf9f8d1166ac8ef0e4af10de2f0..783b60bae2b44c8973c3683935457ff8dfce6365 100644 (file)
@@ -90,6 +90,7 @@ VTKViewer_ViewFrame::VTKViewer_ViewFrame(QWidget* parent, const char* name)
 void VTKViewer_ViewFrame::InitialSetup() {
   m_RW = new VTKViewer_RenderWindow(this, "RenderWindow");
   m_RW->getRenderWindow()->AddRenderer(m_Renderer);
+  connect(m_RW, SIGNAL(DumpView()), this, SLOT(onProcessViewDump()));
 
   m_Renderer->GetActiveCamera()->ParallelProjectionOn();
   m_Renderer->LightFollowCameraOn();