From a9626b1f014286db259a4aa02ca50353d87ec4ec Mon Sep 17 00:00:00 2001 From: prascle Date: Fri, 8 Jul 2005 07:16:20 +0000 Subject: [PATCH] PR: merge V2_2_4 --- INSTALL | 4 +- Makefile.in | 11 +- bin/VERSION | 2 +- bin/killSalome.py | 2 +- bin/killSalomeWithPort.py | 2 +- bin/launchConfigureParser.py | 2 +- bin/runNS.sh | 2 +- bin/runSalome | 8 +- bin/runSalome.py | 2 +- idl/SALOME_Comm.idl | 33 ++- resources/KERNELCatalog.xml | 6 +- resources/Plugin | 10 - resources/Plugin.in | 10 + salome_adm/Makefile.in | 2 + salome_adm/unix/config_files/check_boost.m4 | 5 + salome_adm/unix/config_files/check_cas.m4 | 43 ++- salome_adm/unix/config_files/check_hdf5.m4 | 7 +- salome_adm/unix/config_files/check_lam.m4 | 7 +- salome_adm/unix/config_files/check_lsf.m4 | 7 +- salome_adm/unix/config_files/check_med2.m4 | 17 +- salome_adm/unix/config_files/check_mico.m4 | 7 +- salome_adm/unix/config_files/check_mpi.m4 | 7 +- salome_adm/unix/config_files/check_mpich.m4 | 7 +- salome_adm/unix/config_files/check_omniorb.m4 | 7 +- salome_adm/unix/config_files/check_opengl.m4 | 21 +- salome_adm/unix/config_files/check_openpbs.m4 | 7 +- salome_adm/unix/config_files/check_pyqt.m4 | 269 ++++++++++++++---- salome_adm/unix/config_files/check_qt.m4 | 77 ++--- salome_adm/unix/config_files/check_qwt.m4 | 61 ++-- salome_adm/unix/config_files/check_sip.m4 | 179 ++++++++---- salome_adm/unix/config_files/check_swig.m4 | 10 + salome_adm/unix/config_files/check_vtk.m4 | 19 +- salome_adm/unix/depend.in | 26 +- salome_adm/unix/make_commence.in | 4 +- salome_adm/unix/make_conclude.in | 9 +- src/Communication/Makefile.in | 6 +- src/Communication/Receiver.cxx | 26 -- src/Communication/Receiver.hxx | 30 +- src/Communication/ReceiverFactory.cxx | 181 +++++++----- src/Communication/ReceiverFactory.hxx | 6 +- src/Communication/Receivers.cxx | 128 ++++----- src/Communication/Receivers.hxx | 56 ++-- src/Communication/SALOME_Comm_i.cxx | 112 ++++++-- src/Communication/SALOME_Comm_i.hxx | 98 +++++-- src/Communication/SenderFactory.cxx | 45 +-- src/Communication/SenderFactory.hxx | 27 +- src/Communication/libSALOME_Comm.i | 60 ++++ src/Container/Container_i.cxx | 31 +- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx | 2 +- src/LifeCycleCORBA_SWIG/Makefile.in | 2 +- src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py | 11 +- .../libSALOME_LifeCycleCORBA.i | 19 +- src/MEDWrapper/Base/MED_Common.hxx | 6 +- src/Makefile.in | 8 +- src/ModuleGenerator/IDLparser.py | 16 +- src/OCCViewer/OCCViewer_ViewFrame.cxx | 2 + src/OCCViewer/OCCViewer_ViewPort.h | 2 + src/OCCViewer/OCCViewer_ViewPort3d.cxx | 2 + src/OCCViewer/OCCViewer_Viewer3d.cxx | 9 +- src/PatchQt/Makefile.in | 11 +- src/PatchQt/qactionP.cxx | 6 + src/PatchQt/qactionP.h | 21 +- src/PatchQt/qfiledialogP.cxx | 9 +- src/PatchQt/qfiledialogP.h | 18 +- src/PatchQt/qsplitterP.cxx | 8 +- src/PatchQt/qsplitterP.h | 13 + src/PatchQt/qworkspaceP.cxx | 5 + src/PatchQt/qworkspaceP.h | 22 +- src/Plot2d/Plot2d_ViewFrame.cxx | 27 +- src/Plot2d/Plot2d_ViewFrame.h | 12 +- .../SALOME_ResourcesManager.cxx | 19 +- .../SALOMEDS_AttributeExternalFileDef_i.cxx | 12 + .../SALOMEDS_AttributeExternalFileDef_i.hxx | 3 + src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx | 14 + src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx | 3 + src/SALOMEDS/SALOMEDS_StudyManager_i.cxx | 6 +- src/SALOMEGUI/CLIENT_msg_en.po | 6 +- src/SALOMEGUI/QAD_Desktop.cxx | 8 +- src/SALOMEGUI/QAD_Desktop.h | 5 + src/SALOMEGUI/QAD_RightFrame.cxx | 73 ++++- src/SALOMEGUI/QAD_StudyFrame.cxx | 41 ++- src/SALOMEGUI/QAD_ViewFrame.cxx | 27 +- src/SALOMEGUI/QAD_ViewFrame.h | 7 + src/SALOMEGUI/QAD_XmlHandler.cxx | 5 +- src/SALOMEGUI/QAD_msg_en.po | 3 + src/SALOMELocalTrace/utilities.h | 4 +- src/SALOME_PYQT/Makefile.in | 119 ++++---- src/SALOME_PYQT/SalomePyQt_v4.sip | 62 ++++ src/SALOME_SWIG/Makefile.in | 2 +- src/SALOME_SWIG/libSALOME_Swig.i | 1 + src/Session/SALOME_Session_Server.cxx | 2 +- src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx | 31 +- src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx | 3 + src/Utils/Utils_SINGLETON.hxx | 4 +- .../SALOME_ExtractUnstructuredGrid.cxx | 33 +++ .../SALOME_ExtractUnstructuredGrid.h | 14 +- src/VTKViewer/VTKViewer_Algorithm.h | 2 +- src/VTKViewer/VTKViewer_RenderWindow.cxx | 2 + src/VTKViewer/VTKViewer_RenderWindow.h | 1 + src/VTKViewer/VTKViewer_ViewFrame.cxx | 1 + 100 files changed, 1754 insertions(+), 688 deletions(-) delete mode 100644 resources/Plugin create mode 100755 resources/Plugin.in delete mode 100644 src/Communication/Receiver.cxx create mode 100644 src/Communication/libSALOME_Comm.i create mode 100644 src/SALOME_PYQT/SalomePyQt_v4.sip diff --git a/INSTALL b/INSTALL index b4672cadd..a63e887a7 100644 --- 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 diff --git a/Makefile.in b/Makefile.in index 3eda287c4..e26d509bd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/bin/VERSION b/bin/VERSION index aaa365137..9ba43eb6b 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - KERNEL VERSION: 2.2.2 +THIS IS SALOME - KERNEL VERSION: 2.2.4 diff --git a/bin/killSalome.py b/bin/killSalome.py index 96e923980..7ed1d6372 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -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: diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 7c8dcd2ed..bf02709cf 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -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') diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 403e0299b..d66bdedf9 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -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() diff --git a/bin/runNS.sh b/bin/runNS.sh index 76b7452bf..b5c155a6c 100755 --- a/bin/runNS.sh +++ b/bin/runNS.sh @@ -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} & diff --git a/bin/runSalome b/bin/runSalome index 1112c8433..9bd7d4ace 100755 --- a/bin/runSalome +++ b/bin/runSalome @@ -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} " diff --git a/bin/runSalome.py b/bin/runSalome.py index 1c47d008a..4d3441561 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -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 = [] diff --git a/idl/SALOME_Comm.idl b/idl/SALOME_Comm.idl index a01eca1a6..e1736c616 100644 --- a/idl/SALOME_Comm.idl +++ b/idl/SALOME_Comm.idl @@ -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 diff --git a/resources/KERNELCatalog.xml b/resources/KERNELCatalog.xml index 70151724e..0ca69b478 100644 --- a/resources/KERNELCatalog.xml +++ b/resources/KERNELCatalog.xml @@ -16,7 +16,7 @@ Salome Other NRI - 2.2.2 + 2.2.4 GUI Neutral Context 1 @@ -27,7 +27,7 @@ SalomeTestComponent Other NRI - 2.2.2 + 2.2.4 GUI Neutral Context 1 'linux' ~ OS @@ -37,7 +37,7 @@ SALOME_TestComponentPy Other NRI - 2.2.2 + 2.2.4 GUI Neutral Context 1 'linux' ~ OS diff --git a/resources/Plugin b/resources/Plugin deleted file mode 100644 index 82126243f..000000000 --- a/resources/Plugin +++ /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 index 000000000..3d4fad5e5 --- /dev/null +++ b/resources/Plugin.in @@ -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@ diff --git a/salome_adm/Makefile.in b/salome_adm/Makefile.in index 2982ad06c..4dfafb94b 100644 --- a/salome_adm/Makefile.in +++ b/salome_adm/Makefile.in @@ -41,5 +41,7 @@ uninstall-idl: distclean: +clean: + distclean-other: diff --git a/salome_adm/unix/config_files/check_boost.m4 b/salome_adm/unix/config_files/check_boost.m4 index 789167b4c..ed3a09302 100644 --- a/salome_adm/unix/config_files/check_boost.m4 +++ b/salome_adm/unix/config_files/check_boost.m4 @@ -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) diff --git a/salome_adm/unix/config_files/check_cas.m4 b/salome_adm/unix/config_files/check_cas.m4 index b27c7deac..99fd4be6b 100644 --- a/salome_adm/unix/config_files/check_cas.m4 +++ b/salome_adm/unix/config_files/check_cas.m4 @@ -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" diff --git a/salome_adm/unix/config_files/check_hdf5.m4 b/salome_adm/unix/config_files/check_hdf5.m4 index b3658afc1..b20db13ac 100644 --- a/salome_adm/unix/config_files/check_hdf5.m4 +++ b/salome_adm/unix/config_files/check_hdf5.m4 @@ -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 diff --git a/salome_adm/unix/config_files/check_lam.m4 b/salome_adm/unix/config_files/check_lam.m4 index 9a303a054..994a2b0a5 100644 --- a/salome_adm/unix/config_files/check_lam.m4 +++ b/salome_adm/unix/config_files/check_lam.m4 @@ -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" diff --git a/salome_adm/unix/config_files/check_lsf.m4 b/salome_adm/unix/config_files/check_lsf.m4 index 5fb9e0b10..4e448bafa 100755 --- a/salome_adm/unix/config_files/check_lsf.m4 +++ b/salome_adm/unix/config_files/check_lsf.m4 @@ -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} diff --git a/salome_adm/unix/config_files/check_med2.m4 b/salome_adm/unix/config_files/check_med2.m4 index 3b8fd9f8d..c13888195 100644 --- a/salome_adm/unix/config_files/check_med2.m4 +++ b/salome_adm/unix/config_files/check_med2.m4 @@ -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 diff --git a/salome_adm/unix/config_files/check_mico.m4 b/salome_adm/unix/config_files/check_mico.m4 index b839d1e5c..5d97e2aa1 100644 --- a/salome_adm/unix/config_files/check_mico.m4 +++ b/salome_adm/unix/config_files/check_mico.m4 @@ -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" diff --git a/salome_adm/unix/config_files/check_mpi.m4 b/salome_adm/unix/config_files/check_mpi.m4 index d746ac055..e8255a2e4 100644 --- a/salome_adm/unix/config_files/check_mpi.m4 +++ b/salome_adm/unix/config_files/check_mpi.m4 @@ -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" diff --git a/salome_adm/unix/config_files/check_mpich.m4 b/salome_adm/unix/config_files/check_mpich.m4 index de0e6d50a..c5971aa35 100644 --- a/salome_adm/unix/config_files/check_mpich.m4 +++ b/salome_adm/unix/config_files/check_mpich.m4 @@ -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" diff --git a/salome_adm/unix/config_files/check_omniorb.m4 b/salome_adm/unix/config_files/check_omniorb.m4 index f3d5abcdb..1f63365bf 100644 --- a/salome_adm/unix/config_files/check_omniorb.m4 +++ b/salome_adm/unix/config_files/check_omniorb.m4 @@ -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" diff --git a/salome_adm/unix/config_files/check_opengl.m4 b/salome_adm/unix/config_files/check_opengl.m4 index ad1ccbd1e..dd43d25a0 100644 --- a/salome_adm/unix/config_files/check_opengl.m4 +++ b/salome_adm/unix/config_files/check_opengl.m4 @@ -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 diff --git a/salome_adm/unix/config_files/check_openpbs.m4 b/salome_adm/unix/config_files/check_openpbs.m4 index 9598285c9..220528574 100644 --- a/salome_adm/unix/config_files/check_openpbs.m4 +++ b/salome_adm/unix/config_files/check_openpbs.m4 @@ -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} diff --git a/salome_adm/unix/config_files/check_pyqt.m4 b/salome_adm/unix/config_files/check_pyqt.m4 index 9374319a6..573ebc44f 100644 --- a/salome_adm/unix/config_files/check_pyqt.m4 +++ b/salome_adm/unix/config_files/check_pyqt.m4 @@ -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 diff --git a/salome_adm/unix/config_files/check_qt.m4 b/salome_adm/unix/config_files/check_qt.m4 index b1557decd..3faa1e990 100644 --- a/salome_adm/unix/config_files/check_qt.m4 +++ b/salome_adm/unix/config_files/check_qt.m4 @@ -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 diff --git a/salome_adm/unix/config_files/check_qwt.m4 b/salome_adm/unix/config_files/check_qwt.m4 index 21b15fa3a..760cc7dac 100644 --- a/salome_adm/unix/config_files/check_qwt.m4 +++ b/salome_adm/unix/config_files/check_qwt.m4 @@ -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) diff --git a/salome_adm/unix/config_files/check_sip.m4 b/salome_adm/unix/config_files/check_sip.m4 index 84d35f629..dde9bc31f 100644 --- a/salome_adm/unix/config_files/check_sip.m4 +++ b/salome_adm/unix/config_files/check_sip.m4 @@ -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 diff --git a/salome_adm/unix/config_files/check_swig.m4 b/salome_adm/unix/config_files/check_swig.m4 index 10408c009..f20599e95 100644 --- a/salome_adm/unix/config_files/check_swig.m4 +++ b/salome_adm/unix/config_files/check_swig.m4 @@ -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) diff --git a/salome_adm/unix/config_files/check_vtk.m4 b/salome_adm/unix/config_files/check_vtk.m4 index 4b4b1454f..b37edf89e 100644 --- a/salome_adm/unix/config_files/check_vtk.m4 +++ b/salome_adm/unix/config_files/check_vtk.m4 @@ -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 diff --git a/salome_adm/unix/depend.in b/salome_adm/unix/depend.in index 09a46645a..45d6d0ca0 100644 --- a/salome_adm/unix/depend.in +++ b/salome_adm/unix/depend.in @@ -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 - - diff --git a/salome_adm/unix/make_commence.in b/salome_adm/unix/make_commence.in index faf3e9a0e..9137541af 100644 --- a/salome_adm/unix/make_commence.in +++ b/salome_adm/unix/make_commence.in @@ -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 diff --git a/salome_adm/unix/make_conclude.in b/salome_adm/unix/make_conclude.in index 2b8f95495..839e1b084 100644 --- a/salome_adm/unix/make_conclude.in +++ b/salome_adm/unix/make_conclude.in @@ -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)) diff --git a/src/Communication/Makefile.in b/src/Communication/Makefile.in index 736fbe560..a5d3d18c4 100644 --- a/src/Communication/Makefile.in +++ b/src/Communication/Makefile.in @@ -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 index 559f8158e..000000000 --- a/src/Communication/Receiver.cxx +++ /dev/null @@ -1,26 +0,0 @@ -#include "Receiver.hxx" -#include -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); -} - diff --git a/src/Communication/Receiver.hxx b/src/Communication/Receiver.hxx index 56c65ad7e..d155e3360 100644 --- a/src/Communication/Receiver.hxx +++ b/src/Communication/Receiver.hxx @@ -5,16 +5,38 @@ /*! Abstract class factorizing common methods of all the receivers. All of the receivers have to inheritate from it. */ +template 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 +T *Receiver::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 +T *Receiver::getValue(long &size,senderPtr sender) +{ + senderSrv* data=senderSrv::find(sender); + if(data) + return getLocalValue(size,data); + else + return getDistValue(size); +} + #endif diff --git a/src/Communication/ReceiverFactory.cxx b/src/Communication/ReceiverFactory.cxx index f3f0da6b1..1a2bd9125 100644 --- a/src/Communication/ReceiverFactory.cxx +++ b/src/Communication/ReceiverFactory.cxx @@ -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 rec(cncD_ptr); + return rec.getValue(size); + } + else if(!CORBA::is_nil(cwcD_ptr)) + { + CORBA::release(sender); + CorbaDWithCopyReceiver rec(cwcD_ptr); + return rec.getValue(size); + } +#ifdef HAVE_MPI2 + else if(!CORBA::is_nil(mpi_ptr)) + { + CORBA::release(sender); + MPIReceiver 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 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 rec(cncD_ptr); - return rec.getValue(size); - } - else if(!CORBA::is_nil(cwcD_ptr)) - { - CORBA::release(sender); - CorbaDWithCopyReceiver 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 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 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 rec(cncL_ptr); - return rec.getValue(size); - } - else if(!CORBA::is_nil(cwcL_ptr)) - { - CORBA::release(sender); - CorbaIWithCopyReceiver 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 rec(cncL_ptr); + return rec.getValue(size); + } + else if(!CORBA::is_nil(cwcL_ptr)) + { + CORBA::release(sender); + CorbaIWithCopyReceiver rec(cwcL_ptr); + return rec.getValue(size); + } #ifdef HAVE_MPI2 - else if(!CORBA::is_nil(mpi_ptr)) - { - CORBA::release(sender); - MPIReceiver rec(mpi_ptr); - return rec.getValue(size); - } + else if(!CORBA::is_nil(mpi_ptr)) + { + CORBA::release(sender); + MPIReceiver rec(mpi_ptr); + return rec.getValue(size); + } #endif #ifdef HAVE_SOCKET - else if(!CORBA::is_nil(sock_ptr)) - { - CORBA::release(sender); - SocketReceiver rec(sock_ptr); - return rec.getValue(size); - } + else if(!CORBA::is_nil(sock_ptr)) + { + CORBA::release(sender); + SocketReceiver 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; } } diff --git a/src/Communication/ReceiverFactory.hxx b/src/Communication/ReceiverFactory.hxx index e5072c999..28eac49f6 100644 --- a/src/Communication/ReceiverFactory.hxx +++ b/src/Communication/ReceiverFactory.hxx @@ -12,9 +12,11 @@ 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 diff --git a/src/Communication/Receivers.cxx b/src/Communication/Receivers.cxx index a5d65ae15..19ea8c164 100644 --- a/src/Communication/Receivers.cxx +++ b/src/Communication/Receivers.cxx @@ -5,42 +5,40 @@ using namespace std; #define TAILLE_SPLIT 100000 #define TIMEOUT 20 -template -CorbaNCNoCopyReceiver::CorbaNCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){ +template +CorbaNCNoCopyReceiver::CorbaNCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){ } -template -CorbaNCNoCopyReceiver::~CorbaNCNoCopyReceiver(){ +template +CorbaNCNoCopyReceiver::~CorbaNCNoCopyReceiver(){ _mySender->release(); - CORBA::release(_mySender); } -template -void *CorbaNCNoCopyReceiver::getDistValue(long &size) +template +T *CorbaNCNoCopyReceiver::getDistValue(long &size) { TSeqCorba seq=_mySender->send(); size=seq->length(); - return seq->get_buffer(1); + return (T *)seq->get_buffer(1); } -template -void *CorbaNCNoCopyReceiver::getValue(long &size) +template +T *CorbaNCNoCopyReceiver::getValue(long &size) { - return Receiver::getValue(size,_mySender); + return Receiver::getValue(size,_mySender); } -template -CorbaNCWithCopyReceiver::CorbaNCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){ +template +CorbaNCWithCopyReceiver::CorbaNCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){ } -template -CorbaNCWithCopyReceiver::~CorbaNCWithCopyReceiver(){ +template +CorbaNCWithCopyReceiver::~CorbaNCWithCopyReceiver(){ _mySender->release(); - CORBA::release(_mySender); } -template -void *CorbaNCWithCopyReceiver::getDistValue(long &size){ +template +T *CorbaNCWithCopyReceiver::getDistValue(long &size){ size=_mySender->getSize(); long n; T *ret=new T[size]; @@ -59,24 +57,23 @@ void *CorbaNCWithCopyReceiver::getDistValue(long return ret; } -template -void *CorbaNCWithCopyReceiver::getValue(long &size) +template +T *CorbaNCWithCopyReceiver::getValue(long &size) { - return Receiver::getValue(size,_mySender); + return Receiver::getValue(size,_mySender); } -template -CorbaWCNoCopyReceiver::CorbaWCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){ +template +CorbaWCNoCopyReceiver::CorbaWCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){ } -template -CorbaWCNoCopyReceiver::~CorbaWCNoCopyReceiver(){ +template +CorbaWCNoCopyReceiver::~CorbaWCNoCopyReceiver(){ _mySender->release(); - CORBA::release(_mySender); } -template -void *CorbaWCNoCopyReceiver::getDistValue(long &size){ +template +T *CorbaWCNoCopyReceiver::getDistValue(long &size){ size=_mySender->getSize(); long n; T *ret=new T[size]; @@ -95,24 +92,23 @@ void *CorbaWCNoCopyReceiver::getDistValue(long & return ret; } -template -void *CorbaWCNoCopyReceiver::getValue(long &size) +template +T *CorbaWCNoCopyReceiver::getValue(long &size) { - return Receiver::getValue(size,_mySender); + return Receiver::getValue(size,_mySender); } -template -CorbaWCWithCopyReceiver::CorbaWCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){ +template +CorbaWCWithCopyReceiver::CorbaWCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){ } -template -CorbaWCWithCopyReceiver::~CorbaWCWithCopyReceiver(){ +template +CorbaWCWithCopyReceiver::~CorbaWCWithCopyReceiver(){ _mySender->release(); - CORBA::release(_mySender); } -template -void *CorbaWCWithCopyReceiver::getDistValue(long &size){ +template +T *CorbaWCWithCopyReceiver::getDistValue(long &size){ size=_mySender->getSize(); long n; T *ret=new T[size]; @@ -131,26 +127,25 @@ void *CorbaWCWithCopyReceiver::getDistValue(long return ret; } -template -void *CorbaWCWithCopyReceiver::getValue(long &size) +template +T *CorbaWCWithCopyReceiver::getValue(long &size) { - return Receiver::getValue(size,_mySender); + return Receiver::getValue(size,_mySender); } #ifdef HAVE_MPI2 -template -MPIReceiver::MPIReceiver(SALOME::MPISender_ptr mySender):_mySender(mySender){ +template +MPIReceiver::MPIReceiver(CorbaSender mySender):_mySender(mySender){ } -template -MPIReceiver::~MPIReceiver(){ +template +MPIReceiver::~MPIReceiver(){ _mySender->release(); - CORBA::release(_mySender); } -template -void *MPIReceiver::getDistValue(long &size){ +template +T *MPIReceiver::getDistValue(long &size){ int i=0; int myproc; int sproc; @@ -204,10 +199,10 @@ void *MPIReceiver::getDistValue(long &size){ return _v; } -template -void *MPIReceiver::getValue(long &size) +template +T *MPIReceiver::getValue(long &size) { - return Receiver::getValue(size,_mySender); + return Receiver::getValue(size,_mySender); } #endif @@ -221,31 +216,30 @@ void *MPIReceiver::getValue(long &size) #include #include -template -SocketReceiver::SocketReceiver(SALOME::SocketSender_ptr mySender) : _mySender(mySender) +template +SocketReceiver::SocketReceiver(CorbaSender mySender) : _mySender(mySender) { _clientSockfd = -1; _senderDestruc=true; } -template -SocketReceiver::~SocketReceiver() +template +SocketReceiver::~SocketReceiver() { if(_senderDestruc) { _mySender->release(); - CORBA::release(_mySender); } } -template -void *SocketReceiver::getValue(long &size) +template +T *SocketReceiver::getValue(long &size) { - return Receiver::getValue(size,_mySender); + return Receiver::getValue(size,_mySender); } -template -void* SocketReceiver::getDistValue(long &size) +template +T* SocketReceiver::getDistValue(long &size) { int n=0, m; T *v; @@ -296,8 +290,8 @@ void* SocketReceiver::getDistValue(long &size) return v; } -template -void SocketReceiver::initCom() +template +void SocketReceiver::initCom() { try{ _mySender->initCom(); @@ -325,8 +319,8 @@ void SocketReceiver::initCom() } -template -void SocketReceiver::connectCom(const char *dest_address, int port) +template +void SocketReceiver::connectCom(const char *dest_address, int port) { struct sockaddr_in serv_addr; struct hostent * server; @@ -377,8 +371,8 @@ void SocketReceiver::connectCom(const char *dest_address, int port) } -template -void SocketReceiver::closeCom() +template +void SocketReceiver::closeCom() { _mySender->closeCom(); if( _clientSockfd >= 0 ){ diff --git a/src/Communication/Receivers.hxx b/src/Communication/Receivers.hxx index 4fd2581ee..c4309b754 100644 --- a/src/Communication/Receivers.hxx +++ b/src/Communication/Receivers.hxx @@ -10,82 +10,82 @@ /*! Receiver used for transfert with CORBA when no copy is required remotely and locally. */ -template -class CorbaNCNoCopyReceiver : public Receiver +template +class CorbaNCNoCopyReceiver : public Receiver { 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 CorbaNCWithCopyReceiver : public Receiver +template +class CorbaNCWithCopyReceiver : public Receiver { 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 CorbaWCNoCopyReceiver : public Receiver +template +class CorbaWCNoCopyReceiver : public Receiver { 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 CorbaWCWithCopyReceiver : public Receiver +template +class CorbaWCWithCopyReceiver : public Receiver { 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 MPIReceiver : public Receiver +template +class MPIReceiver : public Receiver { 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 SocketReceiver : public Receiver +template +class SocketReceiver : public Receiver { 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(); diff --git a/src/Communication/SALOME_Comm_i.cxx b/src/Communication/SALOME_Comm_i.cxx index c9b677a84..aed4140b5 100644 --- a/src/Communication/SALOME_Comm_i.cxx +++ b/src/Communication/SALOME_Comm_i.cxx @@ -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(ret); + return dynamic_cast(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(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 #include -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 diff --git a/src/Communication/SALOME_Comm_i.hxx b/src/Communication/SALOME_Comm_i.hxx index 7b6e8df43..485b4ea8d 100644 --- a/src/Communication/SALOME_Comm_i.hxx +++ b/src/Communication/SALOME_Comm_i.hxx @@ -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 diff --git a/src/Communication/SenderFactory.cxx b/src/Communication/SenderFactory.cxx index 3b1f81165..04f8056d0 100644 --- a/src/Communication/SenderFactory.cxx +++ b/src/Communication/SenderFactory.cxx @@ -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); +} diff --git a/src/Communication/SenderFactory.hxx b/src/Communication/SenderFactory.hxx index d85a842ba..ce3a0ad91 100644 --- a/src/Communication/SenderFactory.hxx +++ b/src/Communication/SenderFactory.hxx @@ -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 +struct mapCppSender { + typedef T SenderVarType; +}; + +template<> +struct mapCppSender +{ + typedef SALOME::SenderInt_var SenderVarType; +}; + +template<> +struct mapCppSender +{ + typedef SALOME::SenderDouble_var SenderVarType; }; #endif diff --git a/src/Communication/libSALOME_Comm.i b/src/Communication/libSALOME_Comm.i new file mode 100644 index 000000000..35c8e6061 --- /dev/null +++ b/src/Communication/libSALOME_Comm.i @@ -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; +} +%} diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index b474c2e7d..0c06e153b 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -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 ; } diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index d419c3596..2b8a301f5 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -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, diff --git a/src/LifeCycleCORBA_SWIG/Makefile.in b/src/LifeCycleCORBA_SWIG/Makefile.in index c4c55c81d..48fa79e78 100644 --- a/src/LifeCycleCORBA_SWIG/Makefile.in +++ b/src/LifeCycleCORBA_SWIG/Makefile.in @@ -47,6 +47,6 @@ CPPFLAGS+= $(PYTHON_INCLUDES) LIBS+= $(PYTHON_LIBS) -lSalomeLifeCycleCORBA -LDFLAGS+= +LDFLAGS+= -lSalomeLifeCycleCORBA @CONCLUDE@ diff --git a/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py b/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py index 2cfb6d174..2fef32d5f 100644 --- a/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py +++ b/src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py @@ -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') diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index 07034b25f..b0cedeb17 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -37,10 +37,18 @@ 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)); @@ -80,6 +88,11 @@ } $1 = param; } + else + { + printf("pas un dico\n"); + return NULL; + } } %typemap(python,freearg) const Engines::MachineParameters & diff --git a/src/MEDWrapper/Base/MED_Common.hxx b/src/MEDWrapper/Base/MED_Common.hxx index a4d5af9f3..279489642 100644 --- a/src/MEDWrapper/Base/MED_Common.hxx +++ b/src/MEDWrapper/Base/MED_Common.hxx @@ -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)]; } }; diff --git a/src/Makefile.in b/src/Makefile.in index 9912d266b..b65fc9126 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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) diff --git a/src/ModuleGenerator/IDLparser.py b/src/ModuleGenerator/IDLparser.py index a653da09e..77b4b037e 100644 --- a/src/ModuleGenerator/IDLparser.py +++ b/src/ModuleGenerator/IDLparser.py @@ -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) diff --git a/src/OCCViewer/OCCViewer_ViewFrame.cxx b/src/OCCViewer/OCCViewer_ViewFrame.cxx index 90645fdb2..8396a6a6c 100644 --- a/src/OCCViewer/OCCViewer_ViewFrame.cxx +++ b/src/OCCViewer/OCCViewer_ViewFrame.cxx @@ -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() ) ) ); } //======================================================================= diff --git a/src/OCCViewer/OCCViewer_ViewPort.h b/src/OCCViewer/OCCViewer_ViewPort.h index 6f80c7816..1ddf54a18 100644 --- a/src/OCCViewer/OCCViewer_ViewPort.h +++ b/src/OCCViewer/OCCViewer_ViewPort.h @@ -171,6 +171,8 @@ signals: void vpPaint (QPaintEvent*); void vpDrawExternal (QPainter* painter); + void vpDumpView(); + protected slots: virtual void onChangeBackgroundColor() = 0; diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 0ace89025..6b39a2add 100644 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -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())) ); // } } } diff --git a/src/OCCViewer/OCCViewer_Viewer3d.cxx b/src/OCCViewer/OCCViewer_Viewer3d.cxx index c79b20136..245332b39 100644 --- a/src/OCCViewer/OCCViewer_Viewer3d.cxx +++ b/src/OCCViewer/OCCViewer_Viewer3d.cxx @@ -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 ); } } diff --git a/src/PatchQt/Makefile.in b/src/PatchQt/Makefile.in index 7909f104a..48769299c 100644 --- a/src/PatchQt/Makefile.in +++ b/src/PatchQt/Makefile.in @@ -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) diff --git a/src/PatchQt/qactionP.cxx b/src/PatchQt/qactionP.cxx index 0d1269dac..75aaa4c15 100644 --- a/src/PatchQt/qactionP.cxx +++ b/src/PatchQt/qactionP.cxx @@ -43,6 +43,10 @@ #include "qactionP.h" +#if (QT_VERSION < 0x030303) + +#include "qactionP_moc.cxx" + #ifndef QT_NO_ACTION #include @@ -1778,3 +1782,5 @@ void QActionPGroup::addedTo( int index, QPopupMenu *menu ) } #endif + +#endif diff --git a/src/PatchQt/qactionP.h b/src/PatchQt/qactionP.h index 160324087..1af693795 100644 --- a/src/PatchQt/qactionP.h +++ b/src/PatchQt/qactionP.h @@ -44,6 +44,18 @@ #ifndef QACTIONP_H #define QACTIONP_H +#include +#if (QT_VERSION >= 0x030303) + +// mpv: do not use patches for qt version >= 3.3.3 +#include +#define QActionPPrivate QActionPrivate +#define QActionPGroupPrivate QActionGroupPrivate +#define QActionPGroup QActionGroup +#define QActionP QAction + +#else + #ifndef QT_H #include #include @@ -52,12 +64,7 @@ #endif // QT_H #ifndef QT_NO_ACTION - -#if QT_VERSION > 0x030005 -#include -#define QActionP QAction -#define QActionPGroup QActionGroup -#else +#include // mpv: for QAD_Desktop compilability class QActionPPrivate; class QActionPGroupPrivate; @@ -190,6 +197,6 @@ public: #endif -#endif // QT_VERSION +#endif #endif diff --git a/src/PatchQt/qfiledialogP.cxx b/src/PatchQt/qfiledialogP.cxx index 0b3ca637b..5a71ec597 100644 --- a/src/PatchQt/qfiledialogP.cxx +++ b/src/PatchQt/qfiledialogP.cxx @@ -41,8 +41,6 @@ ** **********************************************************************/ -#include "qplatformdefs.h" - // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED. #if defined(connect) #undef connect @@ -50,6 +48,11 @@ #include "qfiledialogP.h" +#if (QT_VERSION < 0x030303) + +#include +#include "qfiledialogP_moc.cxx" + #ifndef QT_NO_FILEDIALOG #include "qlineedit.h" @@ -5976,3 +5979,5 @@ QFilePreviewP::QFilePreviewP() */ #endif + +#endif diff --git a/src/PatchQt/qfiledialogP.h b/src/PatchQt/qfiledialogP.h index ab615b753..9cf6ee7fb 100644 --- a/src/PatchQt/qfiledialogP.h +++ b/src/PatchQt/qfiledialogP.h @@ -44,6 +44,17 @@ #ifndef QFILEDIALOGP_H #define QFILEDIALOGP_H +#include +#if (QT_VERSION >= 0x030303) + +#include +// 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 -#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 diff --git a/src/PatchQt/qsplitterP.cxx b/src/PatchQt/qsplitterP.cxx index 15d5ed2aa..85a1b5017 100644 --- a/src/PatchQt/qsplitterP.cxx +++ b/src/PatchQt/qsplitterP.cxx @@ -42,13 +42,17 @@ **********************************************************************/ #include "qsplitterP.h" + +#if (QT_VERSION < 0x030303) + +#include "qsplitterP_moc.cxx" + #ifndef QT_NO_COMPLEXWIDGETS #include #include #include #include -#include #include #if QT_VERSION < 300 #include @@ -1402,3 +1406,5 @@ void QSplitterP::updateSplitterHandles() const { s = data->list.next(); } } + +#endif diff --git a/src/PatchQt/qsplitterP.h b/src/PatchQt/qsplitterP.h index 263a90429..da94e7e40 100644 --- a/src/PatchQt/qsplitterP.h +++ b/src/PatchQt/qsplitterP.h @@ -43,6 +43,18 @@ #ifndef QSPLITTERP_H #define QSPLITTERP_H +#include +#if (QT_VERSION >= 0x030303) + +#include +// 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 #include @@ -211,5 +223,6 @@ private: QPushButton* unright; }; +#endif #endif // QSPLITTERP_H diff --git a/src/PatchQt/qworkspaceP.cxx b/src/PatchQt/qworkspaceP.cxx index 1a959ae47..558c545fa 100644 --- a/src/PatchQt/qworkspaceP.cxx +++ b/src/PatchQt/qworkspaceP.cxx @@ -43,6 +43,10 @@ #include "qworkspaceP.h" +#if (QT_VERSION < 0x030303) + +#include "qworkspaceP_moc.cxx" + #include #include #include @@ -3402,3 +3406,4 @@ QSize QTitleBarP::sizeHint() const return QSize( menur.width(), style().pixelMetric( QStyle::PM_TitleBarHeight, this ) ); } +#endif diff --git a/src/PatchQt/qworkspaceP.h b/src/PatchQt/qworkspaceP.h index 2197da251..0ce92b6f0 100644 --- a/src/PatchQt/qworkspaceP.h +++ b/src/PatchQt/qworkspaceP.h @@ -44,6 +44,20 @@ #ifndef QWORKSPACEP_H #define QWORKSPACEP_H +#include +#if (QT_VERSION >= 0x030303) + +#include +// 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 #include @@ -54,11 +68,6 @@ #include #endif // QT_H -#if QT_VERSION > 0x030005 -#include -#define QWorkspaceP QWorkspace -#else - class QWorkspacePChild; class QShowEvent; class QWorkspacePPrivate; @@ -355,5 +364,6 @@ private: QTitleBarPPrivate *d; }; -#endif // QT_VERSION +#endif + #endif // QWORKSPACEP_H diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index cde7a3961..3af1cbd5c 100644 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -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 ) diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 275c432fb..93cb990e3 100644 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -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 ); diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index b9954ade1..fe5b1b4f7 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -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& hosts,co //Warning need an updated parsed list : _resourcesList void SALOME_ResourcesManager::KeepOnlyResourcesWithModule(vector& hosts,const char *moduleName) const throw(SALOME_Exception) { - for(vector::iterator iter=hosts.begin();iter!=hosts.end();iter++) + for(vector::iterator iter=hosts.begin();iter!=hosts.end();) { MapOfParserResourcesType::const_iterator it=_resourcesList.find(*iter); const map& mapOfModulesOfCurrentHost=(((*it).second).ModulesPath); if(mapOfModulesOfCurrentHost.find(moduleName)==mapOfModulesOfCurrentHost.end()) - { - hosts.erase(iter); - } + hosts.erase(iter); + else + iter++; } } diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx index 1dd93ea10..ecf0cad06 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx @@ -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); +} + + diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx index 12b203356..592a614bf 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx @@ -46,6 +46,9 @@ class SALOMEDS_AttributeExternalFileDef_i: public: char* Value(); void SetValue(const char* value); + + char* Store(); + void Restore(const char*); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx index c41320e90..7c69bc9ba 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx @@ -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); +} + + diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx index e31e23b2e..61a57db71 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx @@ -46,6 +46,9 @@ class SALOMEDS_AttributeFileType_i: public: char* Value(); void SetValue(const char* value); + + char* Store(); + void Restore(const char*); }; diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index d0464d63f..3207f78a0 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -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 diff --git a/src/SALOMEGUI/CLIENT_msg_en.po b/src/SALOMEGUI/CLIENT_msg_en.po index 6ce59fb23..2afd3473f 100644 --- a/src/SALOMEGUI/CLIENT_msg_en.po +++ b/src/SALOMEGUI/CLIENT_msg_en.po @@ -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" diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index cbc5a92e7..0397011fa 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -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" ; diff --git a/src/SALOMEGUI/QAD_Desktop.h b/src/SALOMEGUI/QAD_Desktop.h index 35c71416e..caa0e8603 100644 --- a/src/SALOMEGUI/QAD_Desktop.h +++ b/src/SALOMEGUI/QAD_Desktop.h @@ -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(); diff --git a/src/SALOMEGUI/QAD_RightFrame.cxx b/src/SALOMEGUI/QAD_RightFrame.cxx index 96e3d69b6..583540cb7 100644 --- a/src/SALOMEGUI/QAD_RightFrame.cxx +++ b/src/SALOMEGUI/QAD_RightFrame.cxx @@ -26,13 +26,15 @@ // 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 @@ -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 +} diff --git a/src/SALOMEGUI/QAD_StudyFrame.cxx b/src/SALOMEGUI/QAD_StudyFrame.cxx index fa1642d6d..0cfc30df7 100644 --- a/src/SALOMEGUI/QAD_StudyFrame.cxx +++ b/src/SALOMEGUI/QAD_StudyFrame.cxx @@ -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 } /*! diff --git a/src/SALOMEGUI/QAD_ViewFrame.cxx b/src/SALOMEGUI/QAD_ViewFrame.cxx index c22c7a4a8..ff25d5aa3 100644 --- a/src/SALOMEGUI/QAD_ViewFrame.cxx +++ b/src/SALOMEGUI/QAD_ViewFrame.cxx @@ -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 ); +} diff --git a/src/SALOMEGUI/QAD_ViewFrame.h b/src/SALOMEGUI/QAD_ViewFrame.h index 7ea86fb5f..572eccddf 100644 --- a/src/SALOMEGUI/QAD_ViewFrame.h +++ b/src/SALOMEGUI/QAD_ViewFrame.h @@ -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 diff --git a/src/SALOMEGUI/QAD_XmlHandler.cxx b/src/SALOMEGUI/QAD_XmlHandler.cxx index 85df10900..5044fa001 100644 --- a/src/SALOMEGUI/QAD_XmlHandler.cxx +++ b/src/SALOMEGUI/QAD_XmlHandler.cxx @@ -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); } diff --git a/src/SALOMEGUI/QAD_msg_en.po b/src/SALOMEGUI/QAD_msg_en.po index feca9f9e5..631141152 100644 --- a/src/SALOMEGUI/QAD_msg_en.po +++ b/src/SALOMEGUI/QAD_msg_en.po @@ -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" diff --git a/src/SALOMELocalTrace/utilities.h b/src/SALOMELocalTrace/utilities.h index 40238630f..fe0a12238 100644 --- a/src/SALOMELocalTrace/utilities.h +++ b/src/SALOMELocalTrace/utilities.h @@ -52,8 +52,8 @@ #define MESS_INIT(deb) std::ostringstream os; os<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 diff --git a/src/SALOME_PYQT/Makefile.in b/src/SALOME_PYQT/Makefile.in index a581f99b1..bb6fe1b4a 100644 --- a/src/SALOME_PYQT/Makefile.in +++ b/src/SALOME_PYQT/Makefile.in @@ -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 index 000000000..69bbcfd13 --- /dev/null +++ b/src/SALOME_PYQT/SalomePyQt_v4.sip @@ -0,0 +1,62 @@ +%Module SalomePyQt + +%Import qtmod.sip + +class SALOME_Selection : QObject +{ +%TypeHeaderCode +#include +%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 +%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&); +}; diff --git a/src/SALOME_SWIG/Makefile.in b/src/SALOME_SWIG/Makefile.in index a5dd3b7c9..a704ad5b0 100644 --- a/src/SALOME_SWIG/Makefile.in +++ b/src/SALOME_SWIG/Makefile.in @@ -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@ diff --git a/src/SALOME_SWIG/libSALOME_Swig.i b/src/SALOME_SWIG/libSALOME_Swig.i index 988ad4cbc..69fb59866 100644 --- a/src/SALOME_SWIG/libSALOME_Swig.i +++ b/src/SALOME_SWIG/libSALOME_Swig.i @@ -28,4 +28,5 @@ //%include "SALOME_NamingService.i" %include "SALOMEGUI_Swig.i" +%include "libSALOME_Comm.i" diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 6748448d5..5fbb99c69 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -32,6 +32,7 @@ #include #include +#include "Container_init_python.hxx" #include #include #include @@ -49,7 +50,6 @@ #include "Utils_CorbaException.hxx" #include "SALOMEGUI_QtCatchCorbaException.hxx" #include "SALOME_Event.hxx" -#include "Container_init_python.hxx" #include #include CORBA_SERVER_HEADER(SALOME_Session) diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx index 62ce955ef..aa8406cc4 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx @@ -46,7 +46,7 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif -static list *Destructeurs=0 ; +std::list *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 ; // Destructeurs alloué dynamiquement (cf. ci-dessous) , + DESTRUCTEUR_GENERIQUE_::Destructeurs = + new std::list ; // 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::iterator it = Destructeurs->end() ; + std::list::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 ; } diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx index 6cf3432c1..1d95176ec 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx @@ -29,6 +29,7 @@ # if !defined( __DESTRUCTEUR_GENERIQUE__H__ ) # define __DESTRUCTEUR_GENERIQUE__H__ +# include # include # include "utilities.h" @@ -56,6 +57,8 @@ class DESTRUCTEUR_GENERIQUE_ { public : + static std::list *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 diff --git a/src/Utils/Utils_SINGLETON.hxx b/src/Utils/Utils_SINGLETON.hxx index 79d484389..4447b3de7 100644 --- a/src/Utils/Utils_SINGLETON.hxx +++ b/src/Utils/Utils_SINGLETON.hxx @@ -147,11 +147,11 @@ template int SINGLETON_::Destruction( void ) std::list::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 ; } } diff --git a/src/VTKFilter/SALOME_ExtractUnstructuredGrid.cxx b/src/VTKFilter/SALOME_ExtractUnstructuredGrid.cxx index 2cc4930bc..6de6d5ac9 100644 --- a/src/VTKFilter/SALOME_ExtractUnstructuredGrid.cxx +++ b/src/VTKFilter/SALOME_ExtractUnstructuredGrid.cxx @@ -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 = "< namespace SALOME{ namespace VTK{ diff --git a/src/VTKViewer/VTKViewer_RenderWindow.cxx b/src/VTKViewer/VTKViewer_RenderWindow.cxx index 08dbc0eda..bd97dd202 100644 --- a/src/VTKViewer/VTKViewer_RenderWindow.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindow.cxx @@ -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())) ); // } } } diff --git a/src/VTKViewer/VTKViewer_RenderWindow.h b/src/VTKViewer/VTKViewer_RenderWindow.h index 34fd61ff0..e19e67966 100644 --- a/src/VTKViewer/VTKViewer_RenderWindow.h +++ b/src/VTKViewer/VTKViewer_RenderWindow.h @@ -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; diff --git a/src/VTKViewer/VTKViewer_ViewFrame.cxx b/src/VTKViewer/VTKViewer_ViewFrame.cxx index 067cc6aee..783b60bae 100644 --- a/src/VTKViewer/VTKViewer_ViewFrame.cxx +++ b/src/VTKViewer/VTKViewer_ViewFrame.cxx @@ -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(); -- 2.39.2