-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
uc_new.png \
uc_clear.png \
channel.cfg \
-Plugin \
SALOMEDS_Resources
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:
@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
-THIS IS SALOME - KERNEL VERSION: 2.2.2
+THIS IS SALOME - KERNEL VERSION: 2.2.4
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:
########## 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')
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()
\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} &
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} "
#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 = []
+#ifndef _SALOME_COMM_IDL_
+#define _SALOME_COMM_IDL_
+
#include "SALOME_Exception.idl"
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);
};
void close(in param p);
};
+ interface MPISenderDouble : SenderDouble,MPISender {
+ };
+
+ interface MPISenderInt : SenderInt,MPISender {
+ };
+
interface SocketSender : Sender {
typedef struct Parameter {
unsigned long lstart;
void send();
};
+ interface SocketSenderDouble : SenderDouble,SocketSender {
+ };
+
+ interface SocketSenderInt : SenderInt,SocketSender {
+ };
};
+
+#endif
<component-username>Salome</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>2.2.2</component-version>
+ <component-version>2.2.4</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
<component-username>SalomeTestComponent</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>2.2.2</component-version>
+ <component-version>2.2.4</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
<constraint>'linux' ~ OS</constraint>
<component-username>SALOME_TestComponentPy</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>2.2.2</component-version>
+ <component-version>2.2.4</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
<constraint>'linux' ~ OS</constraint>
+++ /dev/null
-! 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
--- /dev/null
+! 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@
distclean:
+clean:
+
distclean-other:
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)
AC_SUBST(CAS_DATAEXCHANGE)
AC_SUBST(CAS_LDFLAGS)
AC_SUBST(CAS_LDPATH)
+AC_SUBST(CAS_STDPLUGIN)
OWN_CONFIG_H=no
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)
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
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
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"
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
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"
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}
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
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"
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"
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"
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"
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)
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
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}
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 ],
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
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"
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)
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
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(
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
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"
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)
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(
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)
AC_DEFUN([CHECK_SIP],[
AC_REQUIRE([CHECK_PYTHON])dnl
+AC_REQUIRE([CHECK_QT])dnl
sip_ok=yes
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
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)
AC_MSG_RESULT($swig_ok)
fi
+AC_SUBST(SWIG_VERSION)
AC_SUBST(SWIG_FLAGS)
AC_SUBST(SWIG)
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"
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
# 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 \
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) \
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) \
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; \
# idl depend
-include $(top_builddir)/idl/.depidl
-
-
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
# 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)))
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
-$(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))
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
+++ /dev/null
-#include "Receiver.hxx"
-#include <string.h>
-using namespace std;
-
-/*!
- return a deep copy of the array contained in the servant.
- */
-void *Receiver::getLocalValue(long &size,SALOME_Sender_i* servant)
-{
- const void *src=servant->getData(size);
- long lgr=size*servant->getSizeOf();
- void *ret=new char[lgr];
- memcpy(ret,src,lgr);
- return ret;
- //return (void *)servant->getData(size);
-}
-
-void *Receiver::getValue(long &size,SALOME::Sender_ptr sender)
-{
- SALOME_Sender_i* data=SALOME_Sender_i::find(sender);
- if(data)
- return getLocalValue(size,data);
- else
- return getDistValue(size);
-}
-
/*! Abstract class factorizing common methods of all the receivers. All of the receivers have to inheritate from it.
*/
+template<class T,class senderPtr, class senderSrv>
class Receiver
{
public:
- virtual void *getValue(long &size)=0;
+ virtual T *getValue(long &size)=0;
virtual ~Receiver() {}
protected:
- virtual void *getValue(long &size,SALOME::Sender_ptr sender);
- static inline void *getLocalValue(long &size,SALOME_Sender_i* servant);
- virtual void *getDistValue(long &size)=0;
+ virtual T *getValue(long &size,senderPtr sender);
+ static inline T *getLocalValue(long &size,senderSrv* servant);
+ virtual T *getDistValue(long &size)=0;
};
+template<class T,class senderPtr, class senderSrv>
+T *Receiver<T,senderPtr,senderSrv>::getLocalValue(long &size,senderSrv* servant)
+{
+ const T *src=(const T *)servant->getData(size);
+ long lgr=size*servant->getSizeOf();
+ void *ret=new char[lgr];
+ memcpy(ret,src,lgr);
+ return (T *)ret;
+ //return (void *)servant->getData(size);
+}
+
+template<class T,class senderPtr, class senderSrv>
+T *Receiver<T,senderPtr,senderSrv>::getValue(long &size,senderPtr sender)
+{
+ senderSrv* data=senderSrv::find(sender);
+ if(data)
+ return getLocalValue(size,data);
+ else
+ return getDistValue(size);
+}
+
#endif
#endif
/*!
- This method performs the transfert with the remote sender given. If it fails with this sender it tries with an another protocol (CORBA by default).
+ This method performs the transfert of double array with the remote SenderDouble given. If it fails with this SenderDouble it tries with an another protocol (CORBA by default).
*/
-void *ReceiverFactory::getValue(SALOME::Sender_ptr sender,long &size)throw(MultiCommException)
+double *ReceiverFactory::getValue(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException)
{
- void *ret;
+ double *ret;
try{
ret=getValueOneShot(sender,size);
}
catch(MultiCommException&)
{
- SALOME::Sender_ptr newSender=sender->buildOtherWithProtocol(SALOME::CORBA_);
+ SALOME::SenderDouble_ptr newSender=sender->buildOtherWithProtocol(SALOME::CORBA_);
+ MESSAGE("PROTOCOL CHANGED TO CORBA");
+ sender->release();
+ ret=getValueOneShot(newSender,size);
+ CORBA::release(newSender);
+ }
+ return ret;
+}
+
+/*!
+ This method performs the transfert of int array with the remote SenderInt given. If it fails with this SenderInt it tries with an another protocol (CORBA by default).
+ */
+int *ReceiverFactory::getValue(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException)
+{
+ int *ret;
+ try{
+ ret=getValueOneShot(sender,size);
+ }
+ catch(MultiCommException&)
+ {
+ SALOME::SenderInt_ptr newSender=sender->buildOtherWithProtocol(SALOME::CORBA_);
MESSAGE("PROTOCOL CHANGED TO CORBA");
sender->release();
- CORBA::release(sender);
ret=getValueOneShot(newSender,size);
+ CORBA::release(newSender);
}
return ret;
}
/*!
- This method performs the transfert with the remote sender given. If it fails an exception is thrown.
+ This method performs the transfert with the remote SenderDouble given. If it fails an exception is thrown.
*/
-void *ReceiverFactory::getValueOneShot(SALOME::Sender_ptr sender,long &size)throw(MultiCommException)
+double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException)
{
SALOME::CorbaDoubleNCSender_ptr cncD_ptr;
SALOME::CorbaDoubleCSender_ptr cwcD_ptr;
- SALOME::CorbaLongNCSender_ptr cncL_ptr;
- SALOME::CorbaLongCSender_ptr cwcL_ptr;
#ifdef HAVE_MPI2
- SALOME::MPISender_ptr mpi_ptr=SALOME::MPISender::_narrow(sender);
+ SALOME::MPISenderDouble_ptr mpi_ptr=SALOME::MPISenderDouble::_narrow(sender);
+#endif
+#ifdef HAVE_SOCKET
+ SALOME::SocketSenderDouble_ptr sock_ptr=SALOME::SocketSenderDouble::_narrow(sender);
+#endif
+ cncD_ptr=SALOME::CorbaDoubleNCSender::_narrow(sender);
+ cwcD_ptr=SALOME::CorbaDoubleCSender::_narrow(sender);
+ if(!CORBA::is_nil(cncD_ptr))
+ {
+ CORBA::release(sender);
+ CorbaDNoCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleNCSender_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(cncD_ptr);
+ return rec.getValue(size);
+ }
+ else if(!CORBA::is_nil(cwcD_ptr))
+ {
+ CORBA::release(sender);
+ CorbaDWithCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleCSender_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(cwcD_ptr);
+ return rec.getValue(size);
+ }
+#ifdef HAVE_MPI2
+ else if(!CORBA::is_nil(mpi_ptr))
+ {
+ CORBA::release(sender);
+ MPIReceiver<double,MPI_DOUBLE,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
+ return rec.getValue(size);
+ }
#endif
#ifdef HAVE_SOCKET
- SALOME::SocketSender_ptr sock_ptr=SALOME::SocketSender::_narrow(sender);
+ else if(!CORBA::is_nil(sock_ptr))
+ {
+ CORBA::release(sender);
+ SocketReceiver<double,xdr_double,SALOME::SocketSenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(sock_ptr);
+ return rec.getValue(size);
+ }
#endif
- switch(sender->getTypeOfDataTransmitted())
+ else
{
- case SALOME::DOUBLE_:
- cncD_ptr=SALOME::CorbaDoubleNCSender::_narrow(sender);
- cwcD_ptr=SALOME::CorbaDoubleCSender::_narrow(sender);
- if(!CORBA::is_nil(cncD_ptr))
- {
- CORBA::release(sender);
- CorbaDNoCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleNCSender_ptr> rec(cncD_ptr);
- return rec.getValue(size);
- }
- else if(!CORBA::is_nil(cwcD_ptr))
- {
- CORBA::release(sender);
- CorbaDWithCopyReceiver<double,CORBA::Double,SALOME::vectorOfDouble_var,SALOME::CorbaDoubleCSender_ptr> rec(cwcD_ptr);
- return rec.getValue(size);
- }
+ throw MultiCommException("Unknown sender protocol");
+ return 0;
+ }
+}
+
+/*!
+ This method performs the transfert with the remote SenderInt given. If it fails an exception is thrown.
+ */
+int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException)
+{
+ SALOME::CorbaLongNCSender_ptr cncL_ptr;
+ SALOME::CorbaLongCSender_ptr cwcL_ptr;
#ifdef HAVE_MPI2
- else if(!CORBA::is_nil(mpi_ptr))
- {
- CORBA::release(sender);
- MPIReceiver<double,MPI_DOUBLE> rec(mpi_ptr);
- return rec.getValue(size);
- }
+ SALOME::MPISenderInt_ptr mpi_ptr=SALOME::MPISenderInt::_narrow(sender);
#endif
#ifdef HAVE_SOCKET
- else if(!CORBA::is_nil(sock_ptr))
- {
- CORBA::release(sender);
- SocketReceiver<double,xdr_double> rec(sock_ptr);
- return rec.getValue(size);
- }
+ SALOME::SocketSenderInt_ptr sock_ptr=SALOME::SocketSenderInt::_narrow(sender);
#endif
- else
- {
- throw MultiCommException("Unknown sender protocol");
- return 0;
- }
- case SALOME::INT_:
- cncL_ptr=SALOME::CorbaLongNCSender::_narrow(sender);
- cwcL_ptr=SALOME::CorbaLongCSender::_narrow(sender);
- if(!CORBA::is_nil(cncL_ptr))
- {
- CORBA::release(sender);
- CorbaINoCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongNCSender_ptr> rec(cncL_ptr);
- return rec.getValue(size);
- }
- else if(!CORBA::is_nil(cwcL_ptr))
- {
- CORBA::release(sender);
- CorbaIWithCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongCSender_ptr> rec(cwcL_ptr);
- return rec.getValue(size);
- }
+ cncL_ptr=SALOME::CorbaLongNCSender::_narrow(sender);
+ cwcL_ptr=SALOME::CorbaLongCSender::_narrow(sender);
+ if(!CORBA::is_nil(cncL_ptr))
+ {
+ CORBA::release(sender);
+ CorbaINoCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongNCSender_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(cncL_ptr);
+ return rec.getValue(size);
+ }
+ else if(!CORBA::is_nil(cwcL_ptr))
+ {
+ CORBA::release(sender);
+ CorbaIWithCopyReceiver<int,CORBA::Long,SALOME::vectorOfLong_var,SALOME::CorbaLongCSender_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(cwcL_ptr);
+ return rec.getValue(size);
+ }
#ifdef HAVE_MPI2
- else if(!CORBA::is_nil(mpi_ptr))
- {
- CORBA::release(sender);
- MPIReceiver<int,MPI_INT> rec(mpi_ptr);
- return rec.getValue(size);
- }
+ else if(!CORBA::is_nil(mpi_ptr))
+ {
+ CORBA::release(sender);
+ MPIReceiver<int,MPI_INT,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
+ return rec.getValue(size);
+ }
#endif
#ifdef HAVE_SOCKET
- else if(!CORBA::is_nil(sock_ptr))
- {
- CORBA::release(sender);
- SocketReceiver<int,xdr_int> rec(sock_ptr);
- return rec.getValue(size);
- }
+ else if(!CORBA::is_nil(sock_ptr))
+ {
+ CORBA::release(sender);
+ SocketReceiver<int,xdr_int,SALOME::SocketSenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(sock_ptr);
+ return rec.getValue(size);
+ }
#endif
- else
- {
- throw MultiCommException("Unknown sender protocol");
- return 0;
- }
- default:
- throw MultiCommException("unknown type of data transfered");
+ else
+ {
+ throw MultiCommException("Unknown sender protocol");
return 0;
}
}
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
#define TAILLE_SPLIT 100000
#define TIMEOUT 20
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaNCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaNCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaNCNoCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaNCNoCopyReceiver(){
_mySender->release();
- CORBA::release(_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size)
{
TSeqCorba seq=_mySender->send();
size=seq->length();
- return seq->get_buffer(1);
+ return (T *)seq->get_buffer(1);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
- return Receiver::getValue(size,_mySender);
+ return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaNCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaNCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaNCWithCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaNCWithCopyReceiver(){
_mySender->release();
- CORBA::release(_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
size=_mySender->getSize();
long n;
T *ret=new T[size];
return ret;
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaNCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
- return Receiver::getValue(size,_mySender);
+ return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaWCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaWCNoCopyReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaWCNoCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaWCNoCopyReceiver(){
_mySender->release();
- CORBA::release(_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
size=_mySender->getSize();
long n;
T *ret=new T[size];
return ret;
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCNoCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
- return Receiver::getValue(size,_mySender);
+ return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::CorbaWCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::CorbaWCWithCopyReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::~CorbaWCWithCopyReceiver(){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::~CorbaWCWithCopyReceiver(){
_mySender->release();
- CORBA::release(_mySender);
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getDistValue(long &size){
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
size=_mySender->getSize();
long n;
T *ret=new T[size];
return ret;
}
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-void *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender>::getValue(long &size)
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+T *CorbaWCWithCopyReceiver<T,TCorba,TSeqCorba,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
- return Receiver::getValue(size,_mySender);
+ return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
#ifdef HAVE_MPI2
-template<class T,MPI_Datatype T2>
-MPIReceiver<T,T2>::MPIReceiver(SALOME::MPISender_ptr mySender):_mySender(mySender){
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,MPI_Datatype T2>
-MPIReceiver<T,T2>::~MPIReceiver(){
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
_mySender->release();
- CORBA::release(_mySender);
}
-template<class T,MPI_Datatype T2>
-void *MPIReceiver<T,T2>::getDistValue(long &size){
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
int i=0;
int myproc;
int sproc;
return _v;
}
-template<class T,MPI_Datatype T2>
-void *MPIReceiver<T,T2>::getValue(long &size)
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
- return Receiver::getValue(size,_mySender);
+ return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
#endif
#include <unistd.h>
#include <rpc/xdr.h>
-template<class T,int (*myFunc)(XDR*,T*)>
-SocketReceiver<T,myFunc>::SocketReceiver(SALOME::SocketSender_ptr mySender) : _mySender(mySender)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::SocketReceiver(CorbaSender mySender) : _mySender(mySender)
{
_clientSockfd = -1;
_senderDestruc=true;
}
-template<class T,int (*myFunc)(XDR*,T*)>
-SocketReceiver<T,myFunc>::~SocketReceiver()
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::~SocketReceiver()
{
if(_senderDestruc)
{
_mySender->release();
- CORBA::release(_mySender);
}
}
-template<class T,int (*myFunc)(XDR*,T*)>
-void *SocketReceiver<T,myFunc>::getValue(long &size)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+T *SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
- return Receiver::getValue(size,_mySender);
+ return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
-template<class T,int (*myFunc)(XDR*,T*)>
-void* SocketReceiver<T,myFunc>::getDistValue(long &size)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+T* SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::getDistValue(long &size)
{
int n=0, m;
T *v;
return v;
}
-template<class T,int (*myFunc)(XDR*,T*)>
-void SocketReceiver<T,myFunc>::initCom()
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+void SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::initCom()
{
try{
_mySender->initCom();
}
-template<class T,int (*myFunc)(XDR*,T*)>
-void SocketReceiver<T,myFunc>::connectCom(const char *dest_address, int port)
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+void SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::connectCom(const char *dest_address, int port)
{
struct sockaddr_in serv_addr;
struct hostent * server;
}
-template<class T,int (*myFunc)(XDR*,T*)>
-void SocketReceiver<T,myFunc>::closeCom()
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+void SocketReceiver<T,myFunc,CorbaSender,servForT,ptrForT>::closeCom()
{
_mySender->closeCom();
if( _clientSockfd >= 0 ){
/*!
Receiver used for transfert with CORBA when no copy is required remotely and locally.
*/
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaNCNoCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaNCNoCopyReceiver : public Receiver<T,servForT,ptrForT>
{
private:
CorbaSender _mySender;
public:
CorbaNCNoCopyReceiver(CorbaSender mySender);
~CorbaNCNoCopyReceiver();
- void *getValue(long &size);
+ T *getValue(long &size);
private:
- void *getDistValue(long &size);
+ T *getDistValue(long &size);
};
/*!
Receiver used for transfert with CORBA when copy is not required remotely but required locally.
*/
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaNCWithCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaNCWithCopyReceiver : public Receiver<T,servForT,ptrForT>
{
private:
CorbaSender _mySender;
public:
CorbaNCWithCopyReceiver(CorbaSender mySender);
~CorbaNCWithCopyReceiver();
- void *getValue(long &size);
+ T *getValue(long &size);
private:
- void *getDistValue(long &size);
+ T *getDistValue(long &size);
};
/*!
Receiver used for transfert with CORBA when copy is required remotely but not required locally.
*/
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaWCNoCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaWCNoCopyReceiver : public Receiver<T,servForT,ptrForT>
{
private:
CorbaSender _mySender;
public:
CorbaWCNoCopyReceiver(CorbaSender mySender);
~CorbaWCNoCopyReceiver();
- void *getValue(long &size);
+ T *getValue(long &size);
private:
- void *getDistValue(long &size);
+ T *getDistValue(long &size);
};
/*!
Receiver used for transfert with CORBA when copy is required both remotely and locally.
*/
-template<class T,class TCorba,class TSeqCorba,class CorbaSender>
-class CorbaWCWithCopyReceiver : public Receiver
+template<class T,class TCorba,class TSeqCorba,class CorbaSender,class servForT,class ptrForT>
+class CorbaWCWithCopyReceiver : public Receiver<T,servForT,ptrForT>
{
private:
CorbaSender _mySender;
public:
CorbaWCWithCopyReceiver(CorbaSender mySender);
~CorbaWCWithCopyReceiver();
- void *getValue(long &size);
+ T *getValue(long &size);
private:
- void *getDistValue(long &size);
+ T *getDistValue(long &size);
};
#ifdef HAVE_MPI2
/*!
Receiver for MPI transfert.
*/
-template<class T,MPI_Datatype T2>
-class MPIReceiver : public Receiver
+template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+class MPIReceiver : public Receiver<T,servForT,ptrForT>
{
private:
- SALOME::MPISender_ptr _mySender;
+ CorbaSender _mySender;
public:
- MPIReceiver(SALOME::MPISender_ptr mySender);
+ MPIReceiver(CorbaSender mySender);
~MPIReceiver();
- void *getValue(long &size);
+ T *getValue(long &size);
private:
- void *getDistValue(long &size);
+ T *getDistValue(long &size);
};
#endif
/*!
Receiver for transfert with sockets.
*/
-template<class T,int (*myFunc)(XDR*,T*)>
-class SocketReceiver : public Receiver
+template<class T,int (*myFunc)(XDR*,T*),class CorbaSender,class servForT,class ptrForT>
+class SocketReceiver : public Receiver<T,servForT,ptrForT>
{
private:
- SALOME::SocketSender_ptr _mySender;
+ CorbaSender _mySender;
int _clientSockfd;
bool _senderDestruc;
public:
- SocketReceiver(SALOME::SocketSender_ptr mySender);
+ SocketReceiver(CorbaSender mySender);
~SocketReceiver();
- void *getValue(long &size);
+ T *getValue(long &size);
private:
- void *getDistValue(long &size);
+ T *getDistValue(long &size);
void initCom();
void connectCom(const char *, int);
void closeCom();
}
/*! 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);
return 0;
}
ret->_remove_ref();
- return dynamic_cast<SALOME_Sender_i *>(ret);
+ return dynamic_cast<SALOME_SenderDouble_i *>(ret);
}
-/*! Method for the remote destroy of the current servant. This method is used by the receiver to destroy the sender when the transfert is complete.
- */
-void SALOME_Sender_i::release()
+SALOME_SenderInt_i::SALOME_SenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend)
{
- PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
- _default_POA()->deactivate_object(oid);
- _remove_ref();
}
-/*! Return the type of the element that compose the array. Used by receiverfactory to build the correct receiver.
+/*! Destructor.
*/
-SALOME::TypeOfDataTransmitted SALOME_Sender_i::getTypeOfDataTransmitted()
+SALOME_SenderInt_i::~SALOME_SenderInt_i()
{
- return _type;
+ if(_ownTabToSend)
+ delete [] (int *)_tabToSend;
}
/*! Return a new sender of the same array but with an another protocol.
*/
-SALOME::Sender_ptr SALOME_Sender_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
+SALOME::SenderInt_ptr SALOME_SenderInt_i::buildOtherWithProtocol(SALOME::TypeOfCommunication type)
{
return SenderFactory::buildSender(type,this);
}
-SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend):SALOME_Sender_i(SALOME::DOUBLE_,tabToSend,lgrTabToSend,sizeof(double)){
+/*! Method to establish if the CORBA object refered by pCorba is collocalised.\n
+ If it is, the pointer to the servant that incarnates the CORBA object is returned.
+*/
+SALOME_SenderInt_i *SALOME_SenderInt_i::find(SALOME::SenderInt_ptr pCorba){
+ PortableServer::ServantBase *ret;
+ try {
+ ret=PortableServer::POA::_the_root_poa()->reference_to_servant(pCorba);
+ }
+ catch(...){
+ return 0;
+ }
+ ret->_remove_ref();
+ return dynamic_cast<SALOME_SenderInt_i *>(ret);
+}
+
+SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){
}
SALOME_CorbaDoubleNCSender_i::~SALOME_CorbaDoubleNCSender_i(){
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(){
////////////////////////
-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(){
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(){
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];
}
void SALOME_MPISender_i::send()
{
+ _type=getTypeOfDataTransmitted();
_argsForThr=new (void *)[8];
_argsForThr[0]=_portName;
_argsForThr[1]=&_lgrTabToSend;
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)
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
#include <netdb.h>
#include <unistd.h>
-SALOME_SocketSender_i::SALOME_SocketSender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf):SALOME_Sender_i(type,tabToSend,lgrTabToSend,sizeOf){
+SALOME_SocketSender_i::SALOME_SocketSender_i(const void *tabToSend,long lgrTabToSend,int sizeOf,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeOf,ownTabToSend){
_IPAddress = inetAddress();
_serverSockfd = -1;
_clientSockfd = -1;
void SALOME_SocketSender_i::send()
{
+ _type=getTypeOfDataTransmitted();
_argsForThr=new void *[6];
_argsForThr[0]=&_serverSockfd;
_argsForThr[1]=&_clientSockfd;
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)
void SALOME_SocketSender_i::acceptCom() throw(SALOME::SALOME_Exception)
{
socklen_t sin_size;
- int new_fd;
struct sockaddr_in client_addr;
SALOME::ExceptionStruct es;
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
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);
/*! 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);
/*! 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);
/*! 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);
/*! 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;
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();
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;
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();
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
#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
{
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);
+}
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.
class SenderFactory
{
public:
- static SALOME::Sender_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr) throw(MultiCommException);
- static SALOME::Sender_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr) throw(MultiCommException);
- static SALOME::Sender_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_Sender_i *src);
+ static SALOME::SenderDouble_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab=false) throw(MultiCommException);
+ static SALOME::SenderInt_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab=false) throw(MultiCommException);
+ static SALOME::SenderDouble_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderDouble_i *src);
+ static SALOME::SenderInt_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderInt_i *src);
+};
+
+template<class T>
+struct mapCppSender {
+ typedef T SenderVarType;
+};
+
+template<>
+struct mapCppSender<int>
+{
+ typedef SALOME::SenderInt_var SenderVarType;
+};
+
+template<>
+struct mapCppSender<double>
+{
+ typedef SALOME::SenderDouble_var SenderVarType;
};
#endif
--- /dev/null
+%{
+ #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;
+}
+%}
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 {
}
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 ;
}
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,
LIBS+= $(PYTHON_LIBS) -lSalomeLifeCycleCORBA
-LDFLAGS+=
+LDFLAGS+= -lSalomeLifeCycleCORBA
@CONCLUDE@
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')
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;
while (PyDict_Next($input, &pos, &key, &value))
{
char* keystr = PyString_AsString(key);
- MESSAGE("key: " << keystr);
+ printf("key: %s\n", keystr);
if (strcmp(keystr,"container_name")==0)
{
param->container_name = CORBA::string_dup(PyString_AsString(value));
}
$1 = param;
}
+ else
+ {
+ printf("pas un dico\n");
+ return NULL;
+ }
}
%typemap(python,freearg) const Engines::MachineParameters &
operator const T& () const
{
- return *get();
+ return *(this->get());
}
operator T& ()
{
- return *get();
+ return *(this->get());
}
};
typename TSupperClass::TValue& operator[](size_t theId)
{
- return myContainer[GetID(theId)];
+ return myContainer[this->GetID(theId)];
}
};
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)
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)
# 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:
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"])
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)
this, SIGNAL( vfKeyPress( QKeyEvent* ) ) ) );
QAD_ASSERT( connect( myViewPort, SIGNAL( vpKeyRelease( QKeyEvent* ) ),
this, SIGNAL( vfKeyRelease( QKeyEvent* ) ) ) );
+ QAD_ASSERT( connect( myViewPort, SIGNAL( vpDumpView() ),
+ this, SLOT( onProcessViewDump() ) ) );
}
//=======================================================================
void vpPaint (QPaintEvent*);
void vpDrawExternal (QPainter* painter);
+ void vpDumpView();
+
protected slots:
virtual void onChangeBackgroundColor() = 0;
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())) );
// }
}
}
}
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 );
}
}
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
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)
#include "qactionP.h"
+#if (QT_VERSION < 0x030303)
+
+#include "qactionP_moc.cxx"
+
#ifndef QT_NO_ACTION
#include <qtoolbar.h>
}
#endif
+
+#endif
#ifndef QACTIONP_H
#define QACTIONP_H
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+// mpv: do not use patches for qt version >= 3.3.3
+#include <qaction.h>
+#define QActionPPrivate QActionPrivate
+#define QActionPGroupPrivate QActionGroupPrivate
+#define QActionPGroup QActionGroup
+#define QActionP QAction
+
+#else
+
#ifndef QT_H
#include <qobject.h>
#include <qiconset.h>
#endif // QT_H
#ifndef QT_NO_ACTION
-
-#if QT_VERSION > 0x030005
-#include <qaction.h>
-#define QActionP QAction
-#define QActionPGroup QActionGroup
-#else
+#include <qaction.h> // mpv: for QAD_Desktop compilability
class QActionPPrivate;
class QActionPGroupPrivate;
#endif
-#endif // QT_VERSION
+#endif
#endif
**
**********************************************************************/
-#include "qplatformdefs.h"
-
// Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED.
#if defined(connect)
#undef connect
#include "qfiledialogP.h"
+#if (QT_VERSION < 0x030303)
+
+#include <qplatformdefs.h>
+#include "qfiledialogP_moc.cxx"
+
#ifndef QT_NO_FILEDIALOG
#include "qlineedit.h"
*/
#endif
+
+#endif
#ifndef QFILEDIALOGP_H
#define QFILEDIALOGP_H
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+#include <qfiledialog.h>
+// mpv: do not use patches for qt version >= 3.3.3
+#define QFileIconProviderP QFileIconProvider
+#define QFilePreviewP QFilePreview
+#define QFileDialogP QFileDialog
+
+#else
+
class QPushButton;
class QButton;
class QLabel;
#include "qlineedit.h"
#endif // QT_H
-#if QT_VERSION > 0x030005
-#include <qfiledialog.h>
-#define QFileDialogP QFileDialog
-#else
-
#ifndef QT_NO_FILEDIALOG
class Q_EXPORT QFileIconProviderP : public QObject
#endif
-#endif // QT_VERSION
+#endif
#endif // QFILEDIALOG_H
**********************************************************************/
#include "qsplitterP.h"
+
+#if (QT_VERSION < 0x030303)
+
+#include "qsplitterP_moc.cxx"
+
#ifndef QT_NO_COMPLEXWIDGETS
#include <qglobal.h>
#include <qpainter.h>
#include <qdrawutil.h>
#include <qbitmap.h>
-#include <qlayout.h>
#include <private/qlayoutengine_p.h>
#if QT_VERSION < 300
#include <qlist.h>
s = data->list.next();
}
}
+
+#endif
#ifndef QSPLITTERP_H
#define QSPLITTERP_H
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+#include <qsplitter.h>
+// mpv: do not use patches for qt version >= 3.3.3
+#define QSplitterPHandle QSplitterHandle
+#define QSplitterPData QSplitterData
+#define QSplitterPLayoutStruct QSplitterLayoutStruct
+#define QSplitterP QSplitter
+
+#else
+
#ifndef QT_H
#include <qframe.h>
#include <qvaluelist.h>
QPushButton* unright;
};
+#endif
#endif // QSPLITTERP_H
#include "qworkspaceP.h"
+#if (QT_VERSION < 0x030303)
+
+#include "qworkspaceP_moc.cxx"
+
#include <qapplication.h>
#include <qobjectlist.h>
#include <qlayout.h>
return QSize( menur.width(), style().pixelMetric( QStyle::PM_TitleBarHeight, this ) );
}
+#endif
#ifndef QWORKSPACEP_H
#define QWORKSPACEP_H
+#include <qglobal.h>
+#if (QT_VERSION >= 0x030303)
+
+#include <qworkspace.h>
+// mpv: do not use patches for qt version >= 3.3.3
+#define QWorkspacePChild QWorkspaceChild
+#define QWorkspacePPrivate QWorkspacePrivate
+#define QWidgetResizeHandlerP QWidgetResizeHandler
+#define QTitleBarP QTitleBar
+#define QWorkspaceP QWorkspace
+#define QTitleBarPPrivate QTitleBarPrivate
+
+#else
+
#ifndef QT_H
#include <qobject.h>
#include <qwidget.h>
#include <qlabel.h>
#endif // QT_H
-#if QT_VERSION > 0x030005
-#include <qworkspace.h>
-#define QWorkspaceP QWorkspace
-#else
-
class QWorkspacePChild;
class QShowEvent;
class QWorkspacePPrivate;
QTitleBarPPrivate *d;
};
-#endif // QT_VERSION
+#endif
+
#endif // QWORKSPACEP_H
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 );
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") ) ,
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") ) ,
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
// Change background
myPopup->insertSeparator();
myActions[ ChangeBackgroundId ]->addTo( myPopup );
+ myActions[ DumpViewId ]->addTo( myPopup );
}
}
/*!
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 )
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 = "" );
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 );
// 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;
//Warning need an updated parsed list : _resourcesList
void SALOME_ResourcesManager::KeepOnlyResourcesWithModule(vector<string>& hosts,const char *moduleName) const throw(SALOME_Exception)
{
- for(vector<string>::iterator iter=hosts.begin();iter!=hosts.end();iter++)
+ for(vector<string>::iterator iter=hosts.begin();iter!=hosts.end();)
{
MapOfParserResourcesType::const_iterator it=_resourcesList.find(*iter);
const map<string,string>& mapOfModulesOfCurrentHost=(((*it).second).ModulesPath);
if(mapOfModulesOfCurrentHost.find(moduleName)==mapOfModulesOfCurrentHost.end())
- {
- hosts.erase(iter);
- }
+ hosts.erase(iter);
+ else
+ iter++;
}
}
// 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);
+}
+
+
public:
char* Value();
void SetValue(const char* value);
+
+ char* Store();
+ void Restore(const char*);
};
// 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);
+}
+
+
public:
char* Value();
void SetValue(const char* value);
+
+ char* Store();
+ void Restore(const char*);
};
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);
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];
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
#---------------
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"
#: 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"
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();
#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" ;
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();
// Module : SALOME
// $Header$
-#include "QAD_PyEditor.h" // this include must be first (see PyInterp_base.h)!
+// mpv 28.02.2005: if Python 2.4 python includes must be first: it uses "slots" field, redefined in qt
+#include "QAD_PyInterp.h"
+
#include "QAD_RightFrame.h"
#include "QAD_Application.h"
#include "QAD_Desktop.h"
#include "QAD_StudyFrame.h"
#include "QAD_Tools.h"
-#include "QAD_PyInterp.h"
+#include "QAD_PyEditor.h"
#include <qvaluelist.h>
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();
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 );
*/
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
}
/*!
*/
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
}
/*!
*/
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
}
/*!
*/
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
+}
\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"
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 );
*/
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
}
/*!
{
if (!getViewWidget())
return;
-
QApplication::setOverrideCursor( Qt::waitCursor );
QPixmap px = QPixmap::grabWindow(getViewWidget()->winId());
QApplication::restoreOverrideCursor();
}
}
}
+
+#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 );
+}
QAD_ViewFrame(QWidget* parent = 0);
virtual ~QAD_ViewFrame();
+ bool event ( QEvent* e );
+
void cleanup();
virtual ViewType getTypeView() const = 0;
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
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);
}
msgid "MEN_VP3D_CHANGEBGR"
msgstr "Change background..."
+msgid "MEN_VP3D_DUMPVIEW"
+msgstr "Camera Dump..."
+
msgid "MEN_APP_DISPLAY"
msgstr "Display"
#define MESS_INIT(deb) std::ostringstream os; os<<deb
#define MESS_BEGIN(deb) MESS_INIT(deb)<<__FILE__ <<" ["<<__LINE__<<"] : "
-#define MESS_END endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
-#define MESS_ABORT endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
+#define MESS_END std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
+#define MESS_ABORT std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
// --- Some macros are always defined (without _DEBUG_): for use with release version
# $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) $<
--- /dev/null
+%Module SalomePyQt
+
+%Import qtmod.sip
+
+class SALOME_Selection : QObject
+{
+%TypeHeaderCode
+#include <SALOME_Selection.h>
+%End
+
+public:
+ SALOME_Selection(const QString &);
+ void Clear();
+ void ClearIObjects();
+
+signals:
+ void currentSelectionChanged();
+};
+
+enum MenuName {
+ File = 1,
+ View = 2,
+ Edit = 3,
+ Preferences = 4,
+ Tools = 5,
+ Window = 6,
+ Help = 7
+};
+
+class SalomePyQt
+{
+%TypeHeaderCode
+#include <SalomePyQt.hxx>
+%End
+
+public:
+ static QWidget* getDesktop();
+ static QWorkspace* getMainFrame();
+ static QMenuBar* getMainMenuBar();
+ static QPopupMenu* getPopupMenu( const MenuName );
+ static SALOME_Selection* getSelection();
+ static int getStudyId();
+ static void putInfo( const QString& );
+ static void putInfo( const QString&, int );
+
+ static const QString& getActiveComponent();
+
+ static void updateObjBrowser( int, bool );
+
+
+ static bool removeSettings(QString);
+ static QString getSetting(QString);
+ static void addStringSetting(QString, QString, bool);
+ static void addIntSetting(QString, int, bool);
+ static void addDoubleSetting(QString, double, bool);
+
+ static QString getFileName(QWidget*, const QString&, const QStringList&, const QString&, bool);
+ static QStringList getOpenFileNames(QWidget*, const QString&, const QStringList&, const QString&);
+ static QString getExistingDirectory(QWidget*, const QString&, const QString&);
+ static void helpContext(const QString&, const QString&);
+ static bool dumpView(const QString&);
+};
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -DHAVE_CONFIG_H
LIBS+= $(PYTHON_LIBS)
-LDFLAGS+= -lSalomeGUI
+LDFLAGS+= -lSalomeGUI -lSalomeCommunication
@CONCLUDE@
//%include "SALOME_NamingService.i"
%include "SALOMEGUI_Swig.i"
+%include "libSALOME_Comm.i"
#include <iostream>
#include <unistd.h>
+#include "Container_init_python.hxx"
#include <qthread.h>
#include <qapplication.h>
#include <qlabel.h>
#include "Utils_CorbaException.hxx"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
#include "SALOME_Event.hxx"
-#include "Container_init_python.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Session)
static int MYDEBUG = 0;
#endif
-static list<DESTRUCTEUR_GENERIQUE_*> *Destructeurs=0 ;
+std::list<DESTRUCTEUR_GENERIQUE_*> *DESTRUCTEUR_GENERIQUE_::Destructeurs=0 ;
/*! \class ATEXIT_
*
//CCRT
if ( Make_ATEXIT && !ATEXIT_Done ) {
//CCRT
- ASSERT (Destructeurs==0);
+ ASSERT (DESTRUCTEUR_GENERIQUE_::Destructeurs==0);
if(MYDEBUG) MESSAGE("Construction ATEXIT"); // message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561)
- Destructeurs = new list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeurs alloué dynamiquement (cf. ci-dessous) ,
+ DESTRUCTEUR_GENERIQUE_::Destructeurs =
+ new std::list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeurs alloué dynamiquement (cf. ci-dessous) ,
// il est utilisé puis détruit par la fonction Nettoyage
int cr = atexit( Nettoyage ); // exécute Nettoyage lors de exit, après la destruction des données statiques !
ASSERT(cr==0) ;
void Nettoyage( void )
{
if(MYDEBUG) BEGIN_OF("Nettoyage( void )") ;
- ASSERT(Destructeurs) ;
- if(MYDEBUG) SCRUTE( Destructeurs->size() ) ;
- if( Destructeurs->size() )
+ ASSERT(DESTRUCTEUR_GENERIQUE_::Destructeurs) ;
+ if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
+ if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() )
{
- list<DESTRUCTEUR_GENERIQUE_*>::iterator it = Destructeurs->end() ;
+ std::list<DESTRUCTEUR_GENERIQUE_*>::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ;
do
{
if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON");
it-- ;
DESTRUCTEUR_GENERIQUE_* ptr = *it ;
- //Destructeurs->remove( *it ) ;
+ //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ;
(*ptr)() ;
delete ptr ;
- }while( it!= Destructeurs->begin() ) ;
+ }while( it!= DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ;
- Destructeurs->clear() ;
- if(MYDEBUG) SCRUTE( Destructeurs->size() ) ;
- ASSERT( Destructeurs->size()==0 ) ;
- ASSERT( Destructeurs->empty() ) ;
+ DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ;
+ if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
+ ASSERT( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ;
+ ASSERT( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ;
}
- delete Destructeurs;
- Destructeurs=0;
+ delete DESTRUCTEUR_GENERIQUE_::Destructeurs;
+ DESTRUCTEUR_GENERIQUE_::Destructeurs=0;
if(MYDEBUG) END_OF("Nettoyage( void )") ;
return ;
}
# if !defined( __DESTRUCTEUR_GENERIQUE__H__ )
# define __DESTRUCTEUR_GENERIQUE__H__
+# include <list>
# include <CORBA.h>
# include "utilities.h"
class DESTRUCTEUR_GENERIQUE_
{
public :
+ static std::list<DESTRUCTEUR_GENERIQUE_*> *Destructeurs;
+
virtual ~DESTRUCTEUR_GENERIQUE_() {}//!< virtual destructor
static const int Ajout( DESTRUCTEUR_GENERIQUE_ &objet );//!< adds a destruction object to the list of destructions
virtual void operator()( void )=0 ;//!< performs the destruction
std::list<DESTRUCTEUR_GENERIQUE_ *>::iterator k ;
- for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs.begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs.end();k++)
+ for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++)
{
if ( *k == PtrSingleton->_Instance )
{
- DESTRUCTEUR_GENERIQUE_::Destructeurs.erase( k ) ;
+ DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ;
break ;
}
}
SALOME_ExtractUnstructuredGrid::~SALOME_ExtractUnstructuredGrid(){}
+void
+SALOME_ExtractUnstructuredGrid::
+SetModeOfChanging(SALOME_ExtractUnstructuredGrid::EChanging theChangeMode)
+{
+ if(theChangeMode != myChangeMode){
+ myChangeMode = theChangeMode;
+ Modified();
+ }
+}
+
+
+void
+SALOME_ExtractUnstructuredGrid::
+SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::EExtraction theExtractionMode)
+{
+ if(theExtractionMode != myExtractionMode){
+ myExtractionMode = theExtractionMode;
+ Modified();
+ }
+}
+
+
+void
+SALOME_ExtractUnstructuredGrid::
+ClearRegisteredCellsWithType()
+{
+ if(IsCellsWithTypeRegistered()){
+ myCellTypes.clear();
+ Modified();
+ }
+}
+
+
void SALOME_ExtractUnstructuredGrid::RegisterCell(vtkIdType theCellId){
if(0 && MYDEBUG) MESSAGE("RegisterCell - theCellId = "<<theCellId);
myCellIds.insert(theCellId);
static SALOME_ExtractUnstructuredGrid *New();
enum EExtraction{ eCells, ePoints};
- void SetModeOfExtraction(EExtraction theExtractionMode){
- myExtractionMode = theExtractionMode; Modified();
- }
+ void SetModeOfExtraction(EExtraction theExtractionMode);
EExtraction GetModeOfExtraction(){ return myExtractionMode;}
enum EChanging{ ePassAll, eAdding, eRemoving};
- void SetModeOfChanging(EChanging theChangeMode){
- myChangeMode = theChangeMode;
- Modified();
- }
+ void SetModeOfChanging(EChanging theChangeMode);
EChanging GetModeOfChanging(){ return myChangeMode;}
// Remove the cell from the output
// Remove every cells with the type from the output
void RegisterCellsWithType(vtkIdType theCellType);
int IsCellsWithTypeRegistered() { return !myCellTypes.empty();}
- void ClearRegisteredCellsWithType() {
- myCellTypes.clear();
- Modified();
- }
+ void ClearRegisteredCellsWithType();
// Do the filter do some real work
int IsChanging() { return IsCellsRegistered() || IsCellsWithTypeRegistered();}
#define VTKViewer_Algorithm_H
class vtkActor;
-class vtkActorCollection;
+#include <vtkActorCollection.h>
namespace SALOME{
namespace VTK{
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())) );
// }
}
}
void ButtonPressed(const QMouseEvent *event) ;
void ButtonReleased(const QMouseEvent *event) ;
void KeyPressed(QKeyEvent *event) ;
+ void DumpView();
protected:
vtkRenderWindow* myRW;
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();