Salome HOME
Merge from V6_main_20120808 08Aug12
authorvsr <vsr@opencascade.com>
Thu, 9 Aug 2012 12:00:50 +0000 (12:00 +0000)
committervsr <vsr@opencascade.com>
Thu, 9 Aug 2012 12:00:50 +0000 (12:00 +0000)
32 files changed:
CALCULATOR_version.h.in
Makefile.am
adm_local/Makefile.am
adm_local/unix/Makefile.am
adm_local/unix/config_files/Makefile.am
adm_local/unix/config_files/check_CALCULATOR.m4
adm_local/unix/make_common_starter.am
bin/Makefile.am
bin/VERSION.in
bin/myrunSalome.py
bin/runAppli.in
build_configure
clean_configure
configure.ac
doc/Makefile.am
idl/CALCULATOR_Gen.idl
idl/Makefile.am
resources/CALCULATORCatalog.xml.in
resources/CALCULATOR_en.xml
resources/CALCULATOR_fr.xml
resources/Makefile.am
resources/SalomeApp.xml [deleted file]
resources/SalomeApp.xml.in [new file with mode: 0644]
src/CALCULATOR/CALCULATOR.cxx
src/CALCULATOR/CALCULATOR.hxx
src/CALCULATOR/CALCULATOR_TEST.py
src/CALCULATOR/CALCULATOR_TEST_STUDY_WITHOUTIHM.py
src/CALCULATOR/CALCULATOR_TEST_WITHOUTIHM.py
src/CALCULATOR/Makefile.am
src/CALCULATOR/graphe1.py
src/CALCULATOR/graphe1.xml
src/Makefile.am

index 3d15c722602005aa31f53f0e809ffd8ed4c419d6..8412d9386c6e1375c1b651f4c8a67b76ca683f4a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : CALCULATOR_version.h
 //  Author : Vadim SANDLER
 //  Module : SALOME
@@ -32,5 +33,6 @@
 
 #define CALCULATOR_VERSION_STR "@VERSION@"
 #define CALCULATOR_VERSION     @XVERSION@
+#define CALCULATOR_DEVELOPMENT @VERSION_DEV@
 
 #endif // __CALCULATOR_VERSION_H__
index 2e8c0e7646e2221e54aebe4eedab572f6376ad5e..7c9751afb54b50c8ff55da3c209ed3e705d793d1 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *-
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 28/06/2001
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-if CALCULATOR_ENABLE_GUI
-  ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
-                    -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-                    -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-                    -I ${MED_ROOT_DIR}/adm_local/unix/config_files
-else !CALCULATOR_ENABLE_GUI
-  ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
-                    -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-                    -I ${MED_ROOT_DIR}/adm_local/unix/config_files
-endif
+ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
+                  -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+                  -I ${MED_ROOT_DIR}/adm_local/unix/config_files
 
 SUBDIRS = idl adm_local resources src bin doc
 
-DISTCLEANFILES = a.out aclocal.m4 configure
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool
 
 salomeinclude_DATA = CALCULATOR_version.h
 
index f35273fac7de52921e587cdc5f9641c7f3116fc3..9863d295024770439bf76fa8f9f4bec8bea2bc46 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 SUBDIRS = unix
index 5f6d5f7536c72fc43090c511c2a26518cb92af5d..0d5ee76b8ee459c88d1404514f27bade7d926b59 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 SUBDIRS = config_files
index b2c1ac4589c9f4330790125fa4bf8ab53048a8b2..76861aaea54304c27023b21e628e6a5285a574bd 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 dist_admlocalm4_DATA = \
index e129111a0e9f7fa265af814ecbe4123c78014d5a..f33d1e867b2d70608750a2e9ec6160883183b5bf 100755 (executable)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #  Check availability of CALCULATOR binary distribution
 #
 #  Author : Marc Tajchman (CEA, 2002)
index 36ad8c3a7c7e37c3da0591452c8cc09f24250858..4f70a7077a6ba24a12fb78f8200de1078912de4f 100644 (file)
@@ -1,24 +1,30 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
 #
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+
 # ============================================================
 # This file defines the common definitions used in several
 # Makefile. This file must be included, if needed, by the file
index a38f289dd76e245e39f3a8d5d7dc97f4cd04908d..3f2293ec8089c90a3bd6f5729b030f4951039dd9 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *- 
 # Author : Guillaume Boulant (CSSI)
 # Module : COMPONENT
index ad934e12336dcbd5f6c90e6840fca664c96d669b..d1e3e0736f34e9701b334d2cfd8a5281e0c2ebde 100755 (executable)
@@ -1 +1,3 @@
-SALOME 2 EXEMPLE MODULE C++ - CALCULATOR VERSION: @VERSION@
+[SALOME CALCULATOR] : @VERSION@
+[DEVELOPMENT]       : @VERSION_DEV@
+[DESCRIPTION]       : Sample SALOME module
index adac95379d3bd26ecb69a964a78e8d83816f48c6..17f87adb3302b95dffd92bba14dc280a589fa4a6 100755 (executable)
@@ -1,26 +1,26 @@
 #!/usr/bin/env python
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 def test(clt):
    """
         Test function that creates an instance of CALCULATOR component
index 5561270603cb6dfc9606ea1b9a75d5c180351605..6c8e5bc532f62eac18c43f92709374e707ce4167 100755 (executable)
@@ -1,24 +1,24 @@
 #!/bin/sh
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 if [ -z "${KERNEL_ROOT_DIR}" ] ; then 
index 401e8483bdb6dbe0d59b3da88f9c432535f570d2..e530a2515610453068681d38b5289806c7ea45c0 100755 (executable)
@@ -1,25 +1,26 @@
 #!/bin/bash
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # Tool for updating list of .in file for the SALOME project
 # and regenerating configure script
 # Author : 
@@ -37,36 +38,6 @@ if test ! -d "${KERNEL_ROOT_DIR}"; then
     exit
 fi
 
-CALCULATOR_WITH_GUI="no"
-
-for option
-do
-  case $option in
-      -with-ihm | --with-ihm)
-          CALCULATOR_WITH_GUI="yes"
-          break;;
-      -with-gui | --with-gui)
-          CALCULATOR_WITH_GUI="yes"
-          break;;
-      -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
-          CALCULATOR_WITH_GUI="no"
-          break;;
-      -without-gui | --without-gui | -with-gui=no | --with-gui=no )
-          CALCULATOR_WITH_GUI="no"
-          break;;
-  esac
-done
-
-########################################################################
-# Test if the GUI_ROOT_DIR is set correctly
-
-if test ${CALCULATOR_WITH_GUI} = yes; then
-    if test ! -d "${GUI_ROOT_DIR}"; then
-        echo "failed : GUI_ROOT_DIR variable is not correct !"
-        exit
-    fi
-fi
-
 ########################################################################
 # Test if the MED_ROOT_DIR is set correctly
 
@@ -79,49 +50,18 @@ cd ${CONF_DIR}
 ABS_CONF_DIR=`pwd`
 
 #######################################################################
-# Update configure.ac script: to set CALCULATOR_WITH_GUI variable
-sed -e s/CALCULATOR_WITH_GUI=[a-z]*/CALCULATOR_WITH_GUI=${CALCULATOR_WITH_GUI}/g configure.ac > configure.tmp
-mv -f configure.tmp configure.ac
-
-mkdir -p salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
-
-cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
-
-#if test ${CALCULATOR_WITH_GUI} = yes; then
-#    cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
-#fi
-
-#cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
-
-# remove KERNEL deprecated configure files
-#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
-#  check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
-#    check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
-#    do
-#      rm -f salome_adm/unix/config_files/${deprecated}
-#      done
-
 
 # ____________________________________________________________________
 # aclocal creates the aclocal.m4 file from the standard macro and the
-# custom macro embedded in the directory salome_adm/unix/config_files
+# custom macro embedded in the directory adm_local/unix/config_files
 # and KERNEL config_files directory.
 # output:
 #   aclocal.m4
 #   autom4te.cache (directory)
-echo "====================================================== aclocal"
-if test ${CALCULATOR_WITH_GUI} = yes; then
-    aclocal -I adm_local/unix/config_files \
-            -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-            -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-           -I ${MED_ROOT_DIR}/adm_local/unix/config_files || exit 1
-else
-    aclocal -I adm_local/unix/config_files \
-            -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-           -I ${MED_ROOT_DIR}/adm_local/unix/config_files || exit 1
-fi
+echo "======================================================= aclocal"
+aclocal -I adm_local/unix/config_files \
+        -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+        -I ${MED_ROOT_DIR}/adm_local/unix/config_files || exit 1
 
 # ____________________________________________________________________
 # libtoolize creates some configuration files (ltmain.sh,
@@ -129,10 +69,10 @@ fi
 # version. The files are created in the directory specified with the
 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
 # output:
-#   salome_adm/unix/config_files/config.guess
-#   salome_adm/unix/config_files/config.sub
-#   salome_adm/unix/config_files/ltmain.sh
-#echo "====================================================== libtoolize"
+#   adm_local/unix/config_files/config.guess
+#   adm_local/unix/config_files/config.sub
+#   adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
 
 libtoolize --force --copy --automake || exit 1
 
@@ -152,11 +92,11 @@ autoconf
 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
 # creates the Makefile.in files from the Makefile.am files.
 # output:
-#   salome_adm/unix/config_files/compile
-#   salome_adm/unix/config_files/depcomp
-#   salome_adm/unix/config_files/install-sh
-#   salome_adm/unix/config_files/missing
-#   salome_adm/unix/config_files/py-compile
+#   adm_local/unix/config_files/compile
+#   adm_local/unix/config_files/depcomp
+#   adm_local/unix/config_files/install-sh
+#   adm_local/unix/config_files/missing
+#   adm_local/unix/config_files/py-compile
 #   Makefile.in (from Makefile.am)
 echo "====================================================== automake"
 
index f57f7b3bf98d03cab5f0acc1a75b80d039d61886..25c411748cbb7bf77db05480163b591d855095cb 100755 (executable)
@@ -1,35 +1,25 @@
 #!/bin/sh
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 rm -rf autom4te.cache aclocal.m4 configure make_config
 find . -name "*~" -print -exec rm {} \;
 find . -name "*.pyc" -print -exec rm {} \;
-#exit
-# ==================== ON SORT AVANT
-
-find bin -name Makefile.in | xargs rm -f
-find doc -name Makefile.in | xargs rm -f
-find idl -name Makefile.in | xargs rm -f
-find resources -name Makefile.in | xargs rm -f
-find salome_adm -name Makefile.in | xargs rm -f
-find src -name Makefile.in | xargs rm -f
-rm -f Makefile.in
+find . -name Makefile.in | xargs rm -f
+( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh l*.m4 ltmain.sh missing py-compile )
index 4b5b3288e285aead618fc05fd6d6d20ddb1fc7ed..31244c3875bfc600c7f32e6dda3e465081ba2474 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  PLEASE DO NOT MODIFY configure.in FILE
 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
 #  build_configure COMMAND
 # Modified by : Patrick GOLDBRONN (CEA)
 # Modified by : Marc Tajchman (CEA)
 #
-AC_INIT([Salome2 Project CALCULATOR module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeCALCULATOR])
-AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
+AC_INIT([Salome2 Project CALCULATOR module], [6.5.0], [webmaster.salome@opencascade.com], [SalomeCALCULATOR])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
 
 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
 AC_SUBST(XVERSION)
+VERSION_DEV=1
+AC_SUBST(VERSION_DEV)
 
 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
 MODULE_NAME=calculator
@@ -80,6 +80,7 @@ echo
 
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
+AC_LOCAL_INSTALL
 dnl 
 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
 
@@ -101,7 +102,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the
 dnl full-path to the binary instead.
 case "$INSTALL" in
    *install-sh*)
-     #INSTALL='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
+     #INSTALL='\${ROOT_BUILDDIR}'/adm_local/unix/config_files/install-sh
      #;;
      case $host_os in
        osf*)
@@ -169,6 +170,14 @@ echo
 
 ENABLE_PTHREADS
 
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
+
 echo
 echo ---------------------------------------------
 echo testing python
@@ -205,11 +214,11 @@ CHECK_BOOST
 
 echo
 echo ---------------------------------------------
-echo testing MED2
+echo testing MED3
 echo ---------------------------------------------
 echo
 
-CHECK_MED2
+CHECK_MED3
 
 echo
 echo ---------------------------------------------
@@ -251,34 +260,6 @@ CHECK_MED
 dnl For the sake of $MACHINE needed for MED Wrapper
 AC_DEPEND_FLAG
 
-
-CALCULATOR_WITH_GUI=no
-
-AM_CONDITIONAL(CALCULATOR_ENABLE_GUI, [test "${CALCULATOR_WITH_GUI}" = "yes"])
-
-if test "${CALCULATOR_WITH_GUI}" = "yes"; then
-    echo
-    echo ---------------------------------------------
-    echo Testing GUI
-    echo ---------------------------------------------
-    echo
-
-    CHECK_SALOME_GUI
-
-    echo
-    echo ---------------------------------------------
-    echo Testing full GUI
-    echo ---------------------------------------------
-    echo
-
-    CHECK_CORBA_IN_GUI
-    if test "x${CORBA_IN_GUI}" != "xyes"; then
-      echo "failed : For configure CALCULATOR module necessary full GUI !"
-      exit
-    fi
-
-fi
-
 echo
 echo ---------------------------------------------
 echo Testing Kernel
@@ -324,27 +305,35 @@ AC_OUTPUT_COMMANDS([ \
       chmod +x ./bin/*; \
 ])
 
+AC_HACK_LIBTOOL
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+  $(pwd)/hack_libtool \1 \"\$[@]\" \n\
+}\n\
+CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1  if ! test -d \$sss; then continue; fi\n\1  ssss=\$(cd \$sss; pwd)\n\1  if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1    case \$ssss in\n\1      /usr/lib | /usr/lib64 ) ;;\n\1      * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1    esac\n\1  fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
+],[])
+
 # This list is initiated using autoscan and must be updated manually
 # when adding a new file <filename>.in to manage. When you execute
 # autoscan, the Makefile list is generated in the output file configure.scan.
 # This could be helpfull to update de configuration.
 AC_OUTPUT([ \
-  ./salome_adm/unix/SALOMEconfig.h \
-  ./adm_local/Makefile \
-  ./adm_local/unix/Makefile \
-  ./adm_local/unix/config_files/Makefile \
-  ./bin/VERSION \
-  ./bin/runAppli \
-  ./bin/Makefile \
-  ./doc/Makefile \
-  ./CALCULATOR_version.h \
-  ./src/Makefile \
-  ./src/CALCULATOR/Makefile \
-  ./resources/Makefile \
-  ./resources/CALCULATORCatalog.xml \
-  ./idl/Makefile \
+  adm_local/Makefile \
+  adm_local/unix/Makefile \
+  adm_local/unix/config_files/Makefile \
+  bin/VERSION \
+  bin/runAppli \
+  bin/Makefile \
+  doc/Makefile \
+  CALCULATOR_version.h \
+  src/Makefile \
+  src/CALCULATOR/Makefile \
+  resources/Makefile \
+  resources/CALCULATORCatalog.xml \
+  resources/SalomeApp.xml \
+  idl/Makefile \
   Makefile \
 ])
-
-dnl To avoid recompiling half of the sources because of SALOMEconfig.h recreating
-touch -d 01Jan2007 ./salome_adm/unix/SALOMEconfig.h
index 00b32c32b42e920767f352b368c6100b0eb40c73..8b8a48df3dfcaad3edb8e2761a5890b4b966be60 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 dist_doc_DATA = Calculator_guide.sxw calculator.pdf
index e62e735497b3f565c6060bdc2dadbe05f03e41bb..902f05a96f1a04cb498c6e29b51dceec337038cc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef __CALCULATOR_GEN__
 #define __CALCULATOR_GEN__
 /*!
@@ -27,7 +28,7 @@
 
 #include "SALOME_Component.idl"
 #include "SALOME_Exception.idl"
-#include "MED.idl"
+#include "MEDCouplingCorbaServant.idl"
 
 
 /*!  \ingroup EXAMPLES
@@ -49,62 +50,62 @@ module CALCULATOR_ORB
        
   /*! \brief Interface of the %CALCULATOR component
    */
-  interface CALCULATOR_Gen : Engines::Component
+  interface CALCULATOR_Gen : Engines::EngineComponent
   {
      /*!
          Calculate the maximum relative difference of field with the previous one.
          At first call, store passed field and return 1.
       */
-     double convergenceCriteria(in SALOME_MED::FIELDDOUBLE field);
+     double convergenceCriteria(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
      /*!
          Apply to each (scalar) field component the linear function x -> ax+b.
          Release field1 after use.
       */
-     SALOME_MED::FIELDDOUBLE applyLin(in SALOME_MED::FIELDDOUBLE field1, in double a1, in double a2);
+     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface applyLin(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field1, in double a1, in double a2);
 
      /*!
          Addition of fields. 
          Release field1 and field2 after use.
      */
-     SALOME_MED::FIELDDOUBLE add(in SALOME_MED::FIELDDOUBLE field1, in SALOME_MED::FIELDDOUBLE field2);
+     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface add(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field1, in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field2);
 
      /*!
         return euclidian norm of field
          Release field after use.
       */
-     double norm2(in SALOME_MED::FIELDDOUBLE field);
+     double norm2(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
 
      /*!
         return L2 norm of field
          Release field after use.
       */
-     double normL2(in SALOME_MED::FIELDDOUBLE field);
+     double normL2(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
 
      /*!
         return L1 norm of field
          Release field after use.
       */
-     double normL1(in SALOME_MED::FIELDDOUBLE field);
+     double normL1(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
 
      /*!
         return max norm of field
          Release field after use.
       */
-     double normMax(in SALOME_MED::FIELDDOUBLE field);
+     double normMax(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
 
      /*!
          This utility method print in standard output the coordinates & field values
          Release field after use.
       */
-     void printField(in SALOME_MED::FIELDDOUBLE field);
+     void printField(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
 
      /*!
          This method clones field in four examples.
          Release field after use.
       */
-     void cloneField(in SALOME_MED::FIELDDOUBLE field, out SALOME_MED::FIELDDOUBLE clone1, 
-                     out SALOME_MED::FIELDDOUBLE clone2, out SALOME_MED::FIELDDOUBLE clone3,
-                    out SALOME_MED::FIELDDOUBLE clone4 );
+     void cloneField(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field, out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone1, 
+                     out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone2, out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone3,
+                    out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone4 );
 
      /*!
          This method returns True if the operation succeded.
@@ -120,4 +121,3 @@ module CALCULATOR_ORB
 };
 
 #endif
-
index c14f2c738ade65dfb79dd7957b744222a8898f8e..82902cff76609ff188ec4c53ac795445287ac76a 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # This Makefile is responsible of generating the client and server
 # implementation of IDL interfaces for both C++ and python usage.
 # The building process of the C++ files is in charge of each source
@@ -28,6 +26,8 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 BASEIDL_FILES = CALCULATOR_Gen.idl
 
+BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py)
+
 # This variable defines the files to be installed
 dist_salomeidl_DATA = $(BASEIDL_FILES)
 
@@ -46,7 +46,6 @@ nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
 libSalomeIDLCALCULATOR_la_CPPFLAGS = \
        $(KERNEL_CXXFLAGS) \
        $(MED_CXXFLAGS) \
-       -I$(top_builddir)/salome_adm/unix \
        -I$(top_builddir)/idl \
        @CORBA_CXXFLAGS@ \
        @CORBA_INCLUDES@
@@ -71,8 +70,7 @@ IDLCXXFLAGS = \
        @IDLCXXFLAGS@ \
        -I$(top_builddir)/idl/salome \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
-       -I$(MED_ROOT_DIR)/idl/salome \
-       -I$(top_builddir)/salome_adm/unix
+       -I$(MED_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = \
        @IDLPYFLAGS@ \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
@@ -91,9 +89,15 @@ install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
          $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
        done
 
-# uninstall-local removes too much, but it works in distcheck
+# we want to remove only staff generated for IDL files and nothing more
 uninstall-local:
-       rm -rf $(DESTDIR)$(salomepythondir)/*
+       @for modulen in CALCULATOR_ORB ; do \
+         test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
+         test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
+       done ; \
+       for filen in $(BASEIDL_FILES_PY) ; do \
+         echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
+       done
 
 mostlyclean-local:
        -rm -f *.hh *.cc .depidl
index a85bfe61bfb6b3dcf61576a3d2b1b9155e56557d..5e358025b147291b1042bf0dee553a93b53427b2 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='us-ascii' ?>
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 <begin-catalog>
     <path-prefix-list></path-prefix-list>
+    <type-list>
+      <type name="ErrorCode" kind="int"/>
+      <objref name="SALOME_MED/MEDCouplingFieldDoubleCorbaInterface" id="IDL:SALOME_MED/MEDCouplingFieldDoubleCorbaInterface:1.0"/>
+    </type-list>
     <component-list>
         <component>
             <component-name>CALCULATOR</component-name>
             <component-username>CALCULATOR</component-username>
             <component-type>MED EXAMPLE</component-type>
-            <component-author>crouzet</component-author>
+            <component-author>ngore</component-author>
             <component-version>@VERSION@</component-version>
             <component-comment>unknown</component-comment>
             <component-multistudy>1</component-multistudy>
                 <component-service-list>
                     <component-service>
                         <service-name>convergenceCriteria</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>applyLin</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field1</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                             <inParameter>
@@ -88,7 +92,7 @@
                         <outParameter-list>
                             <outParameter>
                                 <outParameter-name>return</outParameter-name>
-                                <outParameter-type>FIELDDOUBLE</outParameter-type>
+                                <outParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                         </outParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>add</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field1</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                             <inParameter>
                                 <inParameter-name>field2</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                         <outParameter-list>
                             <outParameter>
                                 <outParameter-name>return</outParameter-name>
-                                <outParameter-type>FIELDDOUBLE</outParameter-type>
+                                <outParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                         </outParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>norm2</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>normL2</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>normL1</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>normMax</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>printField</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                     </component-service>
                     <component-service>
                         <service-name>cloneField</service-name>
-                        <service-author>crouzet</service-author>
-                        <service-version>2.2.2</service-version>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
                         <service-comment>unknown</service-comment>
                         <service-by-default>0</service-by-default>
                         <inParameter-list>
                             <inParameter>
                                 <inParameter-name>field</inParameter-name>
-                                <inParameter-type>FIELDDOUBLE</inParameter-type>
+                                <inParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</inParameter-type>
                                 <inParameter-comment>unknown</inParameter-comment>
                             </inParameter>
                         </inParameter-list>
                         <outParameter-list>
                             <outParameter>
                                 <outParameter-name>clone1</outParameter-name>
-                                <outParameter-type>FIELDDOUBLE</outParameter-type>
+                                <outParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                             <outParameter>
                                 <outParameter-name>clone2</outParameter-name>
-                                <outParameter-type>FIELDDOUBLE</outParameter-type>
+                                <outParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                             <outParameter>
                                 <outParameter-name>clone3</outParameter-name>
-                                <outParameter-type>FIELDDOUBLE</outParameter-type>
+                                <outParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                             <outParameter>
                                 <outParameter-name>clone4</outParameter-name>
-                                <outParameter-type>FIELDDOUBLE</outParameter-type>
+                                <outParameter-type>SALOME_MED/MEDCouplingFieldDoubleCorbaInterface</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>isDone</service-name>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list></inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>boolean</outParameter-type>
+                                <outParameter-comment>unknown</outParameter-comment>
+                            </outParameter>
+                        </outParameter-list>
+                        <DataStream-list></DataStream-list>
+                    </component-service>
+                    <component-service>
+                        <service-name>getErrorCode</service-name>
+                        <service-author>ngore</service-author>
+                        <service-version>6.3.1</service-version>
+                        <service-comment>unknown</service-comment>
+                        <service-by-default>0</service-by-default>
+                        <inParameter-list></inParameter-list>
+                        <outParameter-list>
+                            <outParameter>
+                                <outParameter-name>return</outParameter-name>
+                                <outParameter-type>ErrorCode</outParameter-type>
                                 <outParameter-comment>unknown</outParameter-comment>
                             </outParameter>
                         </outParameter-list>
index 02ce929efdb0091f932f5323eca51a630a8e1ac5..279f30a0a8a7917ea357949dd6643414e47b850a 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE application PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index 474fef4641e565bdbc41d29c6bce98ca4e143b36..878529d08c76425439eeb5df3d3678588ec25c51 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE application PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index 63aa7939353a2558783cca4ada6a5c129a42bd84..3e15737923dc7c1a987d772f9de2dd30a91e0179 100644 (file)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *- 
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 28/06/2001
@@ -31,8 +29,7 @@ dist_salomeres_DATA = \
        CALCULATOR_en.ps \
        CALCULATOR_en.xml \
        CALCULATOR_fr.xml \
-       ExecCALCULATOR.png \
-       SalomeApp.xml
+       ExecCALCULATOR.png
 
 # VSR: little trick to avoid putting if CALCULATORCatalog.xml to the distribution archive
-nodist_salomeres_SCRIPTS = CALCULATORCatalog.xml
+nodist_salomeres_SCRIPTS = CALCULATORCatalog.xml SalomeApp.xml
diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml
deleted file mode 100644 (file)
index 151a43b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-
-  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
-<document>
-  <section name="CALCULATOR">
-    <!-- Major module parameters -->
-    <parameter name="name" value="Calculator"/>
-    <parameter name="icon" value="CALCULATOR.png"/>
-  </section>
-  <section name="resources">
-    <!-- Module resources -->
-    <parameter name="CALCULATOR" value="${CALCULATOR_ROOT_DIR}/share/salome/resources/calculator"/>
-  </section>
-</document>
diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in
new file mode 100644 (file)
index 0000000..e355402
--- /dev/null
@@ -0,0 +1,35 @@
+<!--
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<document>
+  <section name="CALCULATOR">
+    <!-- Major module parameters -->
+    <parameter name="name" value="Calculator"/>
+    <parameter name="icon" value="CALCULATOR.png"/>
+    <parameter name="version" value="@VERSION@"/>
+  </section>
+  <section name="resources">
+    <!-- Module resources -->
+    <parameter name="CALCULATOR" value="%CALCULATOR_ROOT_DIR%/share/salome/resources/calculator"/>
+  </section>
+</document>
index 2a49c03b4ab02cf473b480c9bfc0776c92107d30..8f65736668c1cf076cd9258a235be2d02b029bda 100644 (file)
@@ -1,35 +1,38 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CALCULATOR.hxx"
 
-#include "FIELDClient.hxx"
-#include "MESHClient.hxx"
+#include "MEDCouplingFieldDoubleClient.hxx"
+#include "MEDCouplingMeshClient.hxx"
+
+#include "MEDCouplingMeshServant.hxx"
+#include "MEDCouplingFieldDoubleServant.hxx"
 
-#include "MEDMEM_Mesh_i.hxx"
-#include "MEDMEM_Support_i.hxx"
-#include "MEDMEM_FieldTemplate_i.hxx"
+#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MEDCouplingMemArray.hxx"
 
 #include <string>
-#include <strstream>
+#include <sstream>
 
 #include <iomanip>
 #include <cmath>
 #include <memory>
 
 using namespace std;
-using namespace MEDMEM;
-
-typedef FIELD<double,MEDMEM::FullInterlace> TFieldDouble;
-typedef FIELDClient<double,MEDMEM::FullInterlace> TFieldDouble_c;
-typedef FIELDTEMPLATE_I<double,MEDMEM::FullInterlace> TFieldDouble_i;
 
 CALCULATOR::CALCULATOR (CORBA::ORB_ptr orb,
                         PortableServer::POA_ptr poa,
@@ -52,7 +50,6 @@ CALCULATOR::CALCULATOR (CORBA::ORB_ptr orb,
   : Engines_Component_i(orb, poa, contId, instanceName, interfaceName, true),
     _errorCode(CALCULATOR_ORB::NO_ERROR)
 {
-  MESSAGE("activate object");
   _thisObj = this;
   _id = _poa->activate_object(_thisObj);
 }
@@ -61,388 +58,332 @@ CALCULATOR::~CALCULATOR()
 {
 }
 
-CORBA::Double CALCULATOR::norm2(SALOME_MED::FIELDDOUBLE_ptr field1)
+CORBA::Double CALCULATOR::norm2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1)
 {
-    beginService( "CALCULATOR::norm2");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::Norm2(SALOME_MED::FIELDDOUBLE_ptr field1)";
-  BEGIN_OF(LOC);
-       
-       if(CORBA::is_nil(field1)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return 0.0;
-       }
-
-       CORBA::Double norme = 0.0;
-       // Create a local field from corba field, apply method normMax on it.
-       // When exiting the function, f1 is deleted, and with it the remote corba field.
-       TFieldDouble_c f1(field1);
-       
-       try {
-               norme = f1.norm2();
-       }
-       catch(...) {
-         _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
-       }
-
-  END_OF(LOC);
-    endService( "CALCULATOR::norm2");
-    return norme;
+  beginService( "CALCULATOR::norm2");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
+  //const char* LOC = "CALCULATOR::Norm2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1)";
+        
+  if(CORBA::is_nil(field1))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return 0.0;
+    }
+
+  CORBA::Double norme = 0.0;
+  // Create a local field from corba field, apply method normMax on it.
+  // When exiting the function, f1 is deleted, and with it the remote corba field.
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field1);
+  /*ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> d=ParaMEDMEM::DataArrayDouble::Multiply(f1->getArray(),f1->getArray());
+  d->rearrange(1);
+  try {
+    norme = d->accumulate(0);
+  }
+  catch(...) {
+    _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+  }*/
+  try
+    {
+      norme = f1->norm2();
+    }    
+  catch(...)
+    {
+      _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+    }
+
+  endService( "CALCULATOR::norm2");
+  return norme;
 }
 
-CORBA::Double CALCULATOR::normL2(SALOME_MED::FIELDDOUBLE_ptr field1)
+CORBA::Double CALCULATOR::normL2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1)
 {
-    beginService( "CALCULATOR::normL2");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::NormL2(SALOME_MED::FIELDDOUBLE_ptr field1)";
-  BEGIN_OF(LOC);
-
-       if(CORBA::is_nil(field1)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return 0.0;
-       }
-
-    //Check that the Field is not on the Nodes (a limitation of normL2)
-       SALOME_MED::SUPPORT_var aSupport = field1->getSupport();
-       if(CORBA::is_nil(aSupport) || aSupport->getEntity() == SALOME_MED::MED_NODE) {
-          _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
-          return 0.0;
-       }
-
-    // Create a local field (on the stack) from corba field, apply method normMax on it.
-    // When exiting the function, FIELDClient f1 is deleted, and with it the remote corba field.
-    TFieldDouble_c  f1(field1);
-       
-    CORBA::Double norme = 0.0;
-       try {
-               norme = f1.normL2();
-       }       
-       catch(...) {
-         _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
-       }
+  beginService( "CALCULATOR::normL2");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
+  //const char* LOC = "CALCULATOR::NormL2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1)";
+  //BEGIN_OF(LOC);
+
+  if(CORBA::is_nil(field1))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return 0.0;
+    }
+
+  //Check that the Field is not on the Nodes (a limitation of normL2)
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field1);
+  
+  if(f1->getTypeOfField()==ParaMEDMEM::ON_NODES)
+    {
+      _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
+      return 0.0;
+    }
+        
+  CORBA::Double norme = 0.0;
+  try
+    {
+      norme = f1->normL2(0);
+    }    
+  catch(...)
+    {
+      _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+    }
     
-       // Send a notification message to supervision
-    ostringstream message("CALCULATOR::normL2 : ");
-    message << norme;
-    sendMessage("warning",message.str().c_str());
-  END_OF(LOC);
-    endService( "CALCULATOR::normL2");
-    return norme;
+  // Send a notification message to supervision
+  ostringstream message("CALCULATOR::normL2 : ");
+  message << norme;
+  sendMessage("warning",message.str().c_str());
+  //END_OF(LOC);
+  endService( "CALCULATOR::normL2");
+  return norme;
 }
 
-CORBA::Double CALCULATOR::normMax(SALOME_MED::FIELDDOUBLE_ptr field1)
+CORBA::Double CALCULATOR::normMax(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1)
 {
-    beginService( "CALCULATOR::normMax");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::NormMax(SALOME_MED::FIELDDOUBLE_ptr field1)";
-  BEGIN_OF(LOC);
-       
-       if(CORBA::is_nil(field1)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return 0.0;
-       }
-
-       CORBA::Double norme = 0.0;
-       // An other way to do it : create an local field on the heap, inside an auto_ptr.
-       // When exiting the function, auto_ptr is deleted, and with it the local field and 
-       // the remote field if ownership was transferred.
-       auto_ptr<TFieldDouble> f1 (new TFieldDouble_c(field1) );
-
-       try {
-               norme = f1->normMax();
-       }
-       catch(...) {
-         _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
-       }
+  beginService( "CALCULATOR::normMax");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
+         
+  if(CORBA::is_nil(field1))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return 0.0;
+    }
+
+  CORBA::Double norme = 0.0;
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field1);
+  try
+    {
+      norme = f1->normMax();
+    }
+  catch(...)
+    {
+      _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+    }
     
-  END_OF(LOC);
-    endService( "CALCULATOR::normMax");
-    return norme;
+  endService( "CALCULATOR::normMax");
+  return norme;
 }
 
-CORBA::Double CALCULATOR::normL1(SALOME_MED::FIELDDOUBLE_ptr field1)
+CORBA::Double CALCULATOR::normL1(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1)
 {
-    beginService( "CALCULATOR::normL1");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::NormL1(SALOME_MED::FIELDDOUBLE_ptr field1)";
-  BEGIN_OF(LOC);
-
-       if(CORBA::is_nil(field1)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return 0.0;
-       }
-
-       //Check that the Field is not on the Nodes (a limitation of normL1)
-       SALOME_MED::SUPPORT_var aSupport = field1->getSupport();
-
-       if(CORBA::is_nil(aSupport) || aSupport->getEntity() == SALOME_MED::MED_NODE) {
-          _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
-          return 0.0;
-       }       
-       
-       CORBA::Double norme = 0.0;
-       auto_ptr<TFieldDouble> f1 (new TFieldDouble_c(field1) );
-
-       try {
-               norme = f1->normL1();
-       }
-       catch(...) {
-         _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
-       }
-
-  END_OF(LOC);
-    endService( "CALCULATOR::normL1");
-    return norme;
-}
+  beginService( "CALCULATOR::normL1");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
 
+  if(CORBA::is_nil(field1)) {
+    _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+    return 0.0;
+  }
 
-SALOME_MED::FIELDDOUBLE_ptr CALCULATOR::applyLin(SALOME_MED::FIELDDOUBLE_ptr field1,CORBA::Double a,CORBA::Double b)
+  //Check that the Field is not on the Nodes (a limitation of normL1)
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field1);
+  if (f1->getTypeOfField()==ParaMEDMEM::ON_NODES) {
+    _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
+    return 0.0;
+  }       
+        
+  CORBA::Double norme = 0.0;
+  try {
+    norme = f1->normL1(0);
+  }
+  catch(...) {
+    _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+  }
+
+  endService( "CALCULATOR::normL1");
+  return norme;
+}
+
+SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr CALCULATOR::applyLin(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1,CORBA::Double a,CORBA::Double b)
 {
-    beginService( "CALCULATOR::applyLin");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "applyLin(SALOME_MED::FIELDDOUBLE_ptr field1,CORBA::Double a,CORBA::Double b)";
-  BEGIN_OF(LOC);
+  beginService( "CALCULATOR::applyLin");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
     
-       if(CORBA::is_nil(field1)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return NULL;
-       }
-
-       SALOME_MED::FIELDDOUBLE_ptr myFieldIOR = NULL;
-       // create a local field on the heap, because it has to remain after exiting the function
-       TFieldDouble * f1 = new TFieldDouble_c(field1);
-       TFieldDouble_i * NewField = NULL;
-
-       try {
-               f1->applyLin(a,b);
-               // create servant from f1, give it the property of c++ field (parameter true).
-               // This imply that when the client will release it's field, it will delete NewField,
-               // and f1.
-               NewField = new TFieldDouble_i(f1,true) ;
-               // activate object
-               myFieldIOR = NewField->_this() ;
-       }
-       catch(...) {
-         _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
-       }
-
-  END_OF(LOC);
-    endService( "CALCULATOR::applyLin");
-    return myFieldIOR;
+  if(CORBA::is_nil(field1))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return NULL;
+    }
+
+  // create a local field on the heap, because it has to remain after exiting the function
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field1);
+  int nbOfCompo=f1->getArray()->getNumberOfComponents();
+  f1->getArray()->rearrange(1);
+  ParaMEDMEM::MEDCouplingFieldDoubleServant *NewField=NULL;
+  SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr myFieldIOR = NULL;
+
+  try
+    {
+      f1->applyLin(a,b,0);
+      f1->getArray()->rearrange(nbOfCompo);
+      // create servant from f1, give it the property of c++ field (parameter true).
+      // This imply that when the client will release it's field, it will delete NewField,
+      // and f1.
+      NewField = new ParaMEDMEM::MEDCouplingFieldDoubleServant(f1);
+      // activate object
+      myFieldIOR = NewField->_this() ;
+    }
+  catch(...)
+    {
+      _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+    }
+  
+  endService( "CALCULATOR::applyLin");
+  return myFieldIOR;
 }
 
-SALOME_MED::FIELDDOUBLE_ptr CALCULATOR::add(SALOME_MED::FIELDDOUBLE_ptr field1, SALOME_MED::FIELDDOUBLE_ptr field2) 
+SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr CALCULATOR::add(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field2) 
 {
-    beginService( "CALCULATOR::add");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::add(SALOME_MED::FIELDDOUBLE_ptr field1, SALOME_MED::FIELDDOUBLE_ptr field2)";
-  BEGIN_OF(LOC);
-
-       if(CORBA::is_nil(field1) || CORBA::is_nil(field2)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return NULL;
-       }
-
-    // Create local fields from corba field
-    TFieldDouble_c f1(field1);
-    TFieldDouble_c f2(field2);
-
-    // Create new c++ field on the heap by copying f1, add f2 to it.
-    TFieldDouble* fres = new TFieldDouble(f1);
+  beginService( "CALCULATOR::add");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
+  //const char* LOC = "CALCULATOR::add(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field2)";
+
+  if(CORBA::is_nil(field1) || CORBA::is_nil(field2))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return NULL;
+    }
+
+  // Create local fields from corba field
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field1);
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f2=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field2);
     
-       // catch exception for non compatible fields
-    try
+  // catch exception for non compatible fields
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble>  fres;
+  try
     {
-        *fres+=f2;
+      f2->changeUnderlyingMesh(f1->getMesh(),0,1e-12);
+      fres = (*f1)+(*f2);
     }
-    catch(MEDEXCEPTION)
+  catch(INTERP_KERNEL::Exception)
     {
-                _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
-                return NULL;
+      _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
+      return NULL;
     }
 
-    // create CORBA field from c++ toField. give property to servant (true)
-    TFieldDouble_i * myFieldDoubleI = new TFieldDouble_i(fres,true);
-    SALOME_MED::FIELDDOUBLE_ptr myFieldIOR = myFieldDoubleI->_this() ;
-
-  END_OF(LOC);
-    endService( "CALCULATOR::add");
-    return myFieldIOR;
+  // create CORBA field from c++ toField. give property to servant (true)
+  ParaMEDMEM::MEDCouplingFieldDoubleServant *myFieldDoubleI=new ParaMEDMEM::MEDCouplingFieldDoubleServant(fres);
+  SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr myFieldIOR = myFieldDoubleI->_this();
+  endService( "CALCULATOR::add");
+  return myFieldIOR;
 }
 
-void CALCULATOR::cloneField(SALOME_MED::FIELDDOUBLE_ptr field,
-               SALOME_MED::FIELDDOUBLE_out clone1, SALOME_MED::FIELDDOUBLE_out clone2,
-                SALOME_MED::FIELDDOUBLE_out clone3, SALOME_MED::FIELDDOUBLE_out clone4)
+void CALCULATOR::cloneField(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field,
+                           SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone1, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone2,
+                           SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone3, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone4)
 {
-    beginService( "CALCULATOR::cloneField");
-       _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::cloneField";
-  BEGIN_OF(LOC);
-
-       if(CORBA::is_nil(field)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return;
-       }
-
-    // load local field, using MED ressource file pointe.med
-    TFieldDouble_c f(field);
-
-    // create three c++ field on the heap by copying myField_
-    // All this fields share with f the same SUPPORT and MESH client.
-    // Both SUPPORT and MESH client are connected to a reference count, and will 
-    // be deleted after release of all the fields.
-    TFieldDouble* fc1 = new TFieldDouble(f);
-    TFieldDouble* fc2 = new TFieldDouble(f);
-    TFieldDouble* fc3 = new TFieldDouble(f);
-    TFieldDouble* fc4 = new TFieldDouble(f);
+  beginService( "CALCULATOR::cloneField");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
+
+  if(CORBA::is_nil(field))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return;
+    }
+  
+  // load local field, using MED ressource file pointe.med
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
+
+  // create three c++ field on the heap by copying myField_
+  // All this fields share with f the same SUPPORT and MESH client.
+  // Both SUPPORT and MESH client are connected to a reference count, and will 
+  // be deleted after release of all the fields.
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> fc1=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> fc2=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> fc3=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> fc4=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
     
-    // Initialize out references : 
-    // Create three CORBA clones with cloned c++ fields - give property of c++ fields to servant (true)
-    TFieldDouble_i * myClone1 = new TFieldDouble_i(fc1, true);
-    TFieldDouble_i * myClone2 = new TFieldDouble_i(fc2, true);
-    TFieldDouble_i * myClone3 = new TFieldDouble_i(fc3, true);
-    TFieldDouble_i * myClone4 = new TFieldDouble_i(fc4, true);
-    clone1 = myClone1->_this();
-    clone2 = myClone2->_this();
-    clone3 = myClone3->_this();
-    clone4 = myClone4->_this();
-  END_OF(LOC);
-    endService( "CALCULATOR::cloneField");
-    return;
+  // Initialize out references : 
+  // Create three CORBA clones with cloned c++ fields - give property of c++ fields to servant (true)
+  ParaMEDMEM::MEDCouplingFieldDoubleServant * myClone1 = new ParaMEDMEM::MEDCouplingFieldDoubleServant(fc1);
+  ParaMEDMEM::MEDCouplingFieldDoubleServant * myClone2 = new ParaMEDMEM::MEDCouplingFieldDoubleServant(fc2);
+  ParaMEDMEM::MEDCouplingFieldDoubleServant * myClone3 = new ParaMEDMEM::MEDCouplingFieldDoubleServant(fc3);
+  ParaMEDMEM::MEDCouplingFieldDoubleServant * myClone4 = new ParaMEDMEM::MEDCouplingFieldDoubleServant(fc4);
+  clone1 = myClone1->_this();
+  clone2 = myClone2->_this();
+  clone3 = myClone3->_this();
+  clone4 = myClone4->_this();
+  endService( "CALCULATOR::cloneField");
+  return;
 }
 
-void CALCULATOR::printField(SALOME_MED::FIELDDOUBLE_ptr field)
+void CALCULATOR::printField(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field)
 {
-    beginService( "CALCULATOR::printField");
-    _errorCode = CALCULATOR_ORB::NO_ERROR;
-
-       if(CORBA::is_nil(field)) {
-               _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-               return;
-       }
-
-    // Create a local field from corba field.
-    // Use auto_ptr to perform automatic deletion after usage.
-    // The deletion of the FIELDClient will delete the remote Corba object.
-    auto_ptr<TFieldDouble> myField (new TFieldDouble_c(field) );
-
-    const SUPPORT * mySupport = myField->getSupport();
-    cout << "\n------------------ Field "<< myField->getName() << " : " <<myField->getDescription() << "------------------" <<  endl ;
-    int NumberOfComponents = myField->getNumberOfComponents() ;
-    cout << "- Type : " << mySupport->getEntity() << endl;
-    cout << "- Nombre de composantes : "<< NumberOfComponents << endl ;
-    cout << "- Nombre de valeurs     : "<< myField->getNumberOfValues() << endl ;
-    for (int i=1; i<NumberOfComponents+1; i++) {
-       cout << "  - composante "<<i<<" :"<<endl ;
-       cout << "      - nom         : "<<myField->getComponentName(i)<< endl;
-       cout << "      - description : "<<myField->getComponentDescription(i) << endl;
-       cout << "      - units       : "<<myField->getMEDComponentUnit(i) << endl;
-    }
-    cout << "- iteration :" << endl ;
-    cout << "    - numero : " << myField->getIterationNumber()<< endl  ;
-    cout << "    - ordre  : " << myField->getOrderNumber()<< endl  ;
-    cout << "    - temps  : " << myField->getTime()<< endl  ;
-    cout << "- Type : " << myField->getValueType()<< endl;
-    
-    cout << "- Valeurs :"<<endl;
-    int NumberOf = mySupport->getNumberOfElements(MED_ALL_ELEMENTS);
-
-    bool displayNode = mySupport->isOnAllElements() && mySupport->getEntity()==MED_NODE;
-    bool displayBary = mySupport->isOnAllElements() && mySupport->getEntity()==MED_CELL;
-    int dim_space = mySupport->getMesh()->getSpaceDimension();
-    const double * coord = mySupport->getMesh()->getCoordinates(MED_FULL_INTERLACE);
-
-    auto_ptr<TFieldDouble> barycenter(0);
-    if(displayBary)
-       barycenter=auto_ptr<TFieldDouble>(mySupport->getMesh()->getBarycenter(mySupport)) ;
-
-    const int width=10;
-    for (int i=1; i<NumberOf+1; i++) {
-       const double * value = myField->getRow(i) ;
-       if(displayNode)
-       {
-           int N=(i-1)*dim_space;
-           cout << setw(width) << i << setw(width) << coord[N] << " " << setw(width) << coord[N+1]<<  " " << setw(width) << coord[N+2] << "  : " ;
-       }
-       if(displayBary) {
-         cout << setw(width) << i;
-         for (int j=1; j<=dim_space; j++ ) 
-           cout<< setw(width) << barycenter->getValueIJ(i,j) << " " ;
-         cout<< "  : " ;
-       }
-       for (int j=0; j<NumberOfComponents; j++)
-         cout << value[j]<< " ";
-       cout<<endl;
+  beginService( "CALCULATOR::printField");
+  _errorCode = CALCULATOR_ORB::NO_ERROR;
+
+  if(CORBA::is_nil(field))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return;
     }
-    cout << endl;
-    cout << "Norme euclidienne : " << myField->norm2() << endl;
-    cout << "Norme max         : " << myField->normMax() << endl;
-    cout << "------------------------------------------------------------------------" << endl << endl;
-    endService( "CALCULATOR::printField");
-    return;
+
+  // Create a local field from corba field.
+  // Use auto_ptr to perform automatic deletion after usage.
+  // The deletion of the FIELDClient will delete the remote Corba object.
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> myField=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
+  cout << myField->advancedRepr() ; 
+
+  cout << endl;
+  cout << "Norme euclidienne : " << myField->norm2() << endl;
+  cout << "Norme max         : " << myField->normMax() << endl;
+  cout << "------------------------------------------------------------------------" << endl << endl;
+  endService( "CALCULATOR::printField");
+  return;
 
 }
 
-CORBA::Double CALCULATOR::convergenceCriteria(SALOME_MED::FIELDDOUBLE_ptr field)
+CORBA::Double CALCULATOR::convergenceCriteria(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field)
 {
   beginService( "CALCULATOR::convergenceCriteria");
   _errorCode = CALCULATOR_ORB::NO_ERROR;
-  const char* LOC = "CALCULATOR::convergenceCriteria(SALOME_MED::FIELDDOUBLE_ptr field)";
-  BEGIN_OF(LOC);
 
-  if(CORBA::is_nil(field)) {
-    _errorCode = CALCULATOR_ORB::INVALID_FIELD;
-    return 0.0;
-  }
+  if(CORBA::is_nil(field))
+    {
+      _errorCode = CALCULATOR_ORB::INVALID_FIELD;
+      return 0.0;
+    }
 
   double criteria=1;
-  static auto_ptr<TFieldDouble> fold(0);
-  auto_ptr<TFieldDouble> fnew (new TFieldDouble_c(field) );
+  static ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> fold(0);
+  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> fnew=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(field);
 
-  try {
-    if (fold.get() == NULL) // if old field is not set, set it and return 1
-      fold=fnew;
-    else
+  try
     {
-      // if size of fields are not equal, return 1
-      const int size=fold->getNumberOfValues()*fold->getNumberOfComponents();
-      if ( size == fnew->getNumberOfValues()*fnew->getNumberOfComponents() )
-      {
-        //MED_EN::medModeSwitch mode=fold->getInterlacingType(); // storage mode
-        const double* oldVal= fold->getValue(); // retrieve values
-        const double* newVal= fnew->getValue();
-        criteria=0.0;
-        double ecart_rel=0.0;
-        for (unsigned i=0; i!=size; ++i) // compute criteria
-        {
-          //if ( oldVal[i] != 0.0) // PAL14028
-          if ( std::abs( oldVal[i] ) > DBL_MIN )
-          {
-            ecart_rel = std::abs( (oldVal[i]-newVal[i])/oldVal[i] );
-            if ( ecart_rel>criteria )
-              criteria=ecart_rel;
-          }
-        }
-      }
+      if ((ParaMEDMEM::MEDCouplingFieldDouble*)fold == NULL) // if old field is not set, set it and return 1
+          fold=fnew;
+      else
+          {
+         // if size of fields are not equal, return 1
+             // catch exception for non compatible fields
+             ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble>  fres;
+             try
+               {
+                  fnew->changeUnderlyingMesh(fold->getMesh(),0,1e-12);
+                  fres = (*fnew)-(*fold);
+                  criteria = fres->normMax();
+               }
+             catch(INTERP_KERNEL::Exception)
+               {
+                  _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE;
+               }
+          }
     }
-  }
-  catch(...) {
-    _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
-  }
-
+  catch(...)
+    {
+      _errorCode = CALCULATOR_ORB::EXCEPTION_RAISED;
+    }
+  
   endService( "CALCULATOR::convergenceCriteria");
-  END_OF(LOC);
   return criteria;
 }
 
 CORBA::Boolean CALCULATOR::isDone()
 {
-       return (_errorCode == CALCULATOR_ORB::NO_ERROR);                
+  return (_errorCode == CALCULATOR_ORB::NO_ERROR);                
 }
 
 CALCULATOR_ORB::ErrorCode CALCULATOR::getErrorCode()
 {
-       return _errorCode;
+  return _errorCode;
 }
 
 
@@ -462,10 +403,8 @@ extern "C"
                                                        const char *instanceName,
                                                        const char *interfaceName)
   {
-    MESSAGE("PortableServer::ObjectId * CALCULATOREngine_factory()");
-    SCRUTE(interfaceName);
-    CALCULATOR * myCALCULATOR =
-      new CALCULATOR (orb, poa, contId, instanceName, interfaceName);
+    CALCULATOR * myCALCULATOR = new CALCULATOR (orb, poa, contId, instanceName, interfaceName);
     return myCALCULATOR->getId();
   }
 }
+
index 4ed21882587911075a86b9559ef497df73559002..4188f496ad0ddaa4871d4b4c87c9feb14e999f36 100644 (file)
@@ -1,30 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _CALCULATOR_HXX_
 #define _CALCULATOR_HXX_
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(CALCULATOR_Gen)
-#include CORBA_CLIENT_HEADER(MED)
+#include CORBA_CLIENT_HEADER(MEDCouplingCorbaServant)
 #include "SALOME_Component_i.hxx"
 
 class CALCULATOR:
@@ -40,17 +41,17 @@ public:
                const char *interfaceName);
     virtual ~CALCULATOR();
 
-    CORBA::Double convergenceCriteria(SALOME_MED::FIELDDOUBLE_ptr field);
-    CORBA::Double normMax(SALOME_MED::FIELDDOUBLE_ptr field1);
-    CORBA::Double normL2(SALOME_MED::FIELDDOUBLE_ptr field1);
-    CORBA::Double norm2(SALOME_MED::FIELDDOUBLE_ptr field1);
-    CORBA::Double normL1(SALOME_MED::FIELDDOUBLE_ptr field1);
-    SALOME_MED::FIELDDOUBLE_ptr applyLin(SALOME_MED::FIELDDOUBLE_ptr field1,CORBA::Double a,CORBA::Double b);
-    SALOME_MED::FIELDDOUBLE_ptr add(SALOME_MED::FIELDDOUBLE_ptr field1, SALOME_MED::FIELDDOUBLE_ptr field2);
-    void printField(SALOME_MED::FIELDDOUBLE_ptr field);
-    void cloneField(SALOME_MED::FIELDDOUBLE_ptr field,
-                    SALOME_MED::FIELDDOUBLE_out clone1, SALOME_MED::FIELDDOUBLE_out clone2,
-                   SALOME_MED::FIELDDOUBLE_out clone3, SALOME_MED::FIELDDOUBLE_out clone4);
+    CORBA::Double convergenceCriteria(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field);
+    CORBA::Double normMax(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1);
+    CORBA::Double normL2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1);
+    CORBA::Double norm2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1);
+    CORBA::Double normL1(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1);
+    SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr applyLin(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1,CORBA::Double a,CORBA::Double b);
+    SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr add(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field1, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field2);
+    void printField(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field);
+    void cloneField(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr field,
+                    SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone1, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone2,
+                   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone3, SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out clone4);
     CORBA::Boolean isDone();
     CALCULATOR_ORB::ErrorCode getErrorCode();
 
index b32ba045659e070c019eb61e80d7fff66a78d96e..8db8a90cd00df40bbb081247f0f34227ec8af432 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #CALCULATOR_TEST_WITHOUTIHM.py
 #
 from omniORB import CORBA
@@ -28,6 +29,10 @@ import SALOME
 import SALOME_MED
 import SALOMEDS
 
+from MEDCouplingCorba import *
+from MEDCoupling import *
+from MEDLoader import *
+
 import os
 host = os.getenv( 'HOST' )
 orb, lcc, naming_service, contmgr = salome.salome_kernel.salome_kernel_init()
@@ -40,6 +45,7 @@ filePath=os.environ["MED_ROOT_DIR"]
 filePath=filePath+"/share/salome/resources/med/"
 medFile=filePath+"pointe.med"
 fieldname = "fieldcelldoublevector"
+meshname = "maa1"
 
 # Launch the Med Component and use it to load into memory the test field 
 print "Launch the Med Component: "
@@ -47,16 +53,17 @@ med_comp = lcc.FindOrLoadComponent("FactoryServer", "MED")
 
 # Get a Corba field proxy on the distant field (located in the med_comp server).
 try:
-    obj = naming_service.Resolve('myStudyManager')
-    myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-    print "studyManager found"
-    myStudy = myStudyManager.NewStudy('CALCULATOR_TEST')
-    studynameId = myStudy._get_StudyId()
-    studyname = myStudy._get_Name()
-    print "We are working in the study ",studyname," with the ID ",studynameId
+    #TODO
+    #Manager = obj._narrow(SALOMEDS.StudyManager)
+    #print "studyManager found"
+    #myStudy = myStudyManager.NewStudy('CALCULATOR_TEST')
+    #studynameId = myStudy._get_StudyId()
+    #studyname = myStudy._get_Name()
+    #print "We are working in the study ",studyname," with the ID ",studynameId
     print "Read field ",fieldname
-    fieldcell  = med_comp.readFieldInFile(medFile,studyname,fieldname,-1,-1)
-    fieldcelldouble = fieldcell._narrow(SALOME_MED.FIELDDOUBLE)
+    
+    f = MEDLoader.ReadFieldCell(medFile,meshname,0,fieldname,-1,-1)
+    fieldcelldouble=MEDCouplingFieldDoubleServant._this(f)
 except SALOME.SALOME_Exception, ex:
     print ex.details
     print ex.details.type
@@ -66,10 +73,10 @@ except SALOME.SALOME_Exception, ex:
     raise
 
 print "Description of Field : "
-print fieldcelldouble
-print fieldcelldouble.getName()
-print fieldcelldouble.getDescription()
-print fieldcelldouble.getNumberOfComponents()
+print f
+print f.getName()
+print f.getDescription()
+print f.getNumberOfComponents()
 
 #
 #
index b60b1c275645c52fbf39bc28b0b6511011400518..251bfc5e4f840fb143f05da33058df2dee14123f 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 ####################################################################################################
 # CALCULATOR_TEST_STUDY_WITHOUTIHM.py
 # Test the calculator component: using Med Client classes with writing in a med file
@@ -157,6 +158,12 @@ def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName):
 
 fileName = "pointe.med"
 
+from MEDCoupling import *
+from MEDLoader import *
+from MEDCouplingCorba import *
+from MEDCouplingClient import *
+import MEDCouplingCorbaServant_idl
+
 #CCRTmedComp=salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
 medComp=lcc.FindOrLoadComponent("FactoryServer", "MED")
 
@@ -169,35 +176,25 @@ filePathName = filePath + fileName
 
 print "Reading the .med file ",filePathName," and pushing corba objects in the SALOME study"
 #CCRTmedComp.readStructFileWithFieldType(filePathName,salome.myStudyName)
-medComp.readStructFileWithFieldType(filePathName,studyname)
+##medComp.readStructFileWithFieldType(filePathName,studyname)
 #CCRTsg.updateObjBrowser(1)
 
-print "getting the MED object from the study"
-medObj = getMedObjectFromStudy(fileName)
+##print "getting the MED object from the study"
+##medObj = getMedObjectFromStudy(fileName)
 
-nbOfMeshes = medObj.getNumberOfMeshes()
-meshNames = medObj.getMeshNames()
+meshNames = MEDLoader.GetMeshNames(filePathName)
+nbOfMeshes = len(meshNames)#medObj.getNumberOfMeshes()
 
 print "in this med file there is(are) ",nbOfMeshes," mesh(es):"
 
 meshName = meshNames[0]
 
-meshObj = medObj.getMeshByName(meshName)
+#meshObj = medObj.getMeshByName(meshName)
+meshObj3D = MEDLoader.ReadUMeshFromFile(filePathName,meshName,0)
 
 fieldName = "fieldcelldoublevector"
-dt = -1
-it = -1
-entitySupport = "MED_MAILLE"
-supportName = "SupportOnAll_"+entitySupport
-
-fieldTypedObj,typeField = getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName)
-
-if(typeField == 1):
-    fieldTypedLocalCopy = FIELDDOUBLEClient(fieldTypedObj)
-elif (typeField == 0):
-    fieldTypedLocalCopy = FIELDINTClient(fieldTypedObj)
-else:
-    print "Problem with the type of the field"
+fieldTypedObj = MEDLoader.ReadFieldCell(filePathName,meshName,0,fieldName,-1,-1)
+fieldTypedObjCORBA=MEDCouplingFieldDoubleServant._this(fieldTypedObj)
 
 ##############  Load Calculator Component ###################
 # Calculator Component must be in the Container of MED
@@ -217,8 +214,8 @@ calculator = lcc.FindOrLoadComponent("FactoryServer", "CALCULATOR")
 #
 #
 print "Appel cloneField : fieldTypedObj -> f1,f2,f3,f4"
-fieldTypedObj.Register()
-(f1,f2,f3,f4)=calculator.cloneField(fieldTypedObj)  # fieldTypedObj is consumed
+#fieldTypedObj.Register()
+(f1,f2,f3,f4)=calculator.cloneField(fieldTypedObjCORBA)  # fieldTypedObj is consumed
 #
 ##f1.Register()
 ##calculator.printField(f1)
@@ -234,7 +231,7 @@ f_lin=calculator.applyLin(f4,2.0,1.0)
 ##calculator.printField( f_lin ) # f_lin is consumed
 #
 print "Appel Norme Max "
-f_lin.Register()
+#f_lin.Register()
 norme=calculator.normMax(f_lin) # f_lin is consumed
 print " -> norme = ",norme
 #
@@ -244,224 +241,32 @@ print " -> norme = ",norme
 ############  Creation of a MED file with fields created by Caculator  #################
 #                   via Client classes
 #
+f_addLocal=MEDCouplingFieldDoubleClient.New(f_add)
+f_add.UnRegister()
+f_addLocal.setName(fieldName+"add")
+f_linLocal=MEDCouplingFieldDoubleClient.New(f_lin)
+f_lin.UnRegister()
+f_linLocal.setName(fieldName+"lin")
 
-meshDistant = f_add.getSupport().getMesh()
-
-meshLocalCopy = MESHClient(meshDistant)
-
+meshLocal = f_addLocal.getMesh()
 
 print "      getting information from the local copy of the distant mesh"
-name = meshLocalCopy.getName()
-spaceDimension = meshLocalCopy.getSpaceDimension()
-meshDimension = meshLocalCopy.getMeshDimension()
-numberOfNodes = meshLocalCopy.getNumberOfNodes()
+name = meshLocal.getName()
+spaceDimension = meshLocal.getSpaceDimension()
+meshDimension = meshLocal.getMeshDimension()
+numberOfNodes = meshLocal.getNumberOfNodes()
 print "          Name = ", name, " space Dim = ", spaceDimension, " mesh Dim = ", meshDimension, " Nb of Nodes = ", numberOfNodes
-coordSyst = meshLocalCopy.getCoordinatesSystem()
-print "          The coordinates system is",coordSyst
-print "          The Coordinates :"
-coordNames = []
-coordUnits = []
-for isd in range(spaceDimension):
-    coordNames.append(meshLocalCopy.getCoordinateName(isd))
-    coordUnits.append(meshLocalCopy.getCoordinateUnit(isd))
-
-print "          names:", coordNames
-print "          units", coordUnits
-print "          values:"
-coordinates = meshLocalCopy.getCoordinates(MED_FULL_INTERLACE)
-for k in range(numberOfNodes):
-    kp1 = k+1
-    print "         ---- ", coordinates[k*spaceDimension:(kp1*spaceDimension)]
-print ""
-print "          The Cell Nodal Connectivity of the Cells:"
-nbTypesCell = meshLocalCopy.getNumberOfTypes(MED_CELL)
-print ""
-if (nbTypesCell>0):
-    print "      The Mesh has",nbTypesCell,"Type(s) of Cell"
-    types = meshLocalCopy.getTypes(MED_CELL)
-    for k in range(nbTypesCell):
-        type = types[k]
-        nbElemType = meshLocalCopy.getNumberOfElements(MED_CELL,type)
-        print "     For the type:",type,"there is(are)",nbElemType,"elemnt(s)"
-        connectivity = meshLocalCopy.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,type)
-        nbNodesPerCell = type%100
-        for j in range(nbElemType):
-            print "       Element",(j+1)," ",connectivity[j*nbNodesPerCell:(j+1)*nbNodesPerCell]
-            pass
-        pass
-    pass
-
-##
-## TEST METHODS ABOUT POLY ELEMENTS ##
-##
-nbTypesCellWithPoly = meshLocalCopy.getNumberOfTypesWithPoly(MED_CELL)
-if (nbTypesCell == nbTypesCellWithPoly):
-    print ""
-    print "          No Poly Cells in the mesh"
-    print ""
-    pass
-else:
-    print ""
-    print "          The Cell Nodal Connectivity of the Poly Cells:"
-    print ""
-    print "      The Mesh has",nbTypesCellWithPoly-nbTypesCell,"Type(s) of Poly Cell"
-    types = meshLocalCopy.getTypesWithPoly(MED_CELL)
-    for k in range(nbTypesCellWithPoly):
-        type = types[k]
-        if type == MED_POLYGON:
-            nbElemType = meshLocalCopy.getNumberOfPolygons()
-        elif type == MED_POLYHEDRA:
-            nbElemType = meshLocalCopy.getNumberOfPolyhedron()
-        else:
-            continue
-        print ""
-        print "     For the type:",type,"there is(are)",nbElemType,"elemnt(s)"
-        if type == MED_POLYGON:
-            connectivity = meshLocalCopy.getPolygonsConnectivity(MED_NODAL,MED_CELL)
-            index = meshLocalCopy.getPolygonsConnectivityIndex(MED_NODAL,MED_CELL)
-            for j in range(nbElemType):
-                print "       Polygon",(j+1)," ",connectivity[ index[j]-1 : index[j+1]-1 ]
-                pass
-            pass
-        else:
-            connectivity = meshLocalCopy.getPolyhedronConnectivity(MED_NODAL)
-            fIndex = meshLocalCopy.getPolyhedronFacesIndex()
-            index = meshLocalCopy.getPolyhedronIndex(MED_NODAL)
-            for j in range(nbElemType):
-                print     "       Polyhedra",(j+1)
-                iF1, iF2 = index[ j ]-1, index[ j+1 ]-1
-                for f in range( iF2 - iF1 ):
-                    iN1, iN2 = fIndex[ iF1+f ]-1, fIndex[ iF1+f+1 ]-1
-                    print "         Face",f+1," ",connectivity[ iN1 : iN2 ]
-                    pass
-                pass
-            pass
-        pass
-    pass
-pass
-
-f_addLocal = FIELDDOUBLEClient(f_add)
-
-f_addLocal.setName(f_addLocal.getName()+"add")
-
-f_linLocal = FIELDDOUBLEClient(f_lin)
-
-f_linLocal.setName(f_linLocal.getName()+"lin")
+
 
 #Warning : OutputMedFiles are removed here after =================================
-Outmed21File="OutCalculatorpointe21_V3.2.0b1.med"
-os.system( 'rm -fr ' + Outmed21File )
+#Outmed21File="OutCalculatorpointe21_V3.2.0b1.med"
+#os.system( 'rm -fr ' + Outmed21File )
 Outmed22File="OutCalculatorpointe22_V3.2.0b1.med"
 os.system( 'rm -fr ' + Outmed22File )
 
-# writting the mesh and the fields
-medFileVersion = getMedFileVersionForWriting()
-
-if (medFileVersion == V22):
-    setMedFileVersionForWriting(V21)
-
-idMed = meshLocalCopy.addDriver(MED_DRIVER, Outmed21File, meshLocalCopy.getName(), MED_REMP)
-meshLocalCopy.write(idMed)
-
-idMed = f_addLocal.addDriver(MED_DRIVER, Outmed21File, f_addLocal.getName())
-f_addLocal.write(idMed)
-
-idMed = f_linLocal.addDriver(MED_DRIVER, Outmed21File, f_linLocal.getName())
-f_linLocal.write(idMed)
-
-medFileVersion = getMedFileVersionForWriting()
-
-if (medFileVersion == V21):
-    setMedFileVersionForWriting(V22)
-
-idMed = meshLocalCopy.addDriver(MED_DRIVER, Outmed22File, meshLocalCopy.getName(), MED_REMP)
-meshLocalCopy.write(idMed)
-
-idMed = f_addLocal.addDriver(MED_DRIVER, Outmed22File, f_addLocal.getName())
-f_addLocal.write(idMed)
-
-idMed = f_linLocal.addDriver(MED_DRIVER, Outmed22File, f_linLocal.getName())
-f_linLocal.write(idMed)
-
-myStudy.GetObjectNames('/Med')
-myStudy.GetObjectNames('/Med/MED_OBJECT_FROM_FILE_pointe.med')
-myStudy.GetObjectNames('/Med/MEDMESH')
-myStudy.GetObjectNames('/Med/MEDMESH/maa1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_ELEMENT_1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_ELEMENT_2')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_ELEMENT_3')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_NOEUD_1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_NOEUD_2')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_NOEUD_3')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_NOEUD_4')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe2')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe3')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe4')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe5')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/SupportOnAll_MED_MAILLE')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/SupportOnAll_MED_NOEUD')
-
-myStudy.GetObjectNames('/Med/MEDFIELD')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldcelldoublevector')
-#myStudy.GetObjectNames('/Med/MEDFIELD/fieldcelldoublevector/(-1,-1)_ON_SupportOnAll_MED_MAILLE_OF_maa1')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldnodedouble')
-#myStudy.GetObjectNames('/Med/MEDFIELD/fieldnodedouble/(-1,-1)_ON_SupportOnAll_MED_NOEUD_OF_maa1')
-#myStudy.GetObjectNames('/Med/MEDFIELD/fieldnodedouble/1,-1)_ON_SupportOnAll_MED_NOEUD_OF_maa1')
-#myStudy.GetObjectNames('/Med/MEDFIELD/fieldnodedouble/(2,-1)_ON_SupportOnAll_MED_NOEUD_OF_maa1')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldnodeint')
-#myStudy.GetObjectNames('/Med/MEDFIELD/fieldnodeint/(-1,-1)_ON_SupportOnAll_MED_NOEUD_OF_maa1')
-
-#myStudyManager.Close(myStudy)
-#myStudy.Close()
-
-#
-#
-############   Output MED file with fields created by Caculator  #################
-#                   via Client classes
-#
-
-myStudy = myStudyManager.NewStudy('medClient_withoutIHM_add_lin')
-studynameId = myStudy._get_StudyId()
-studyname = myStudy._get_Name()
-print "We are working in the study ",studyname," with the ID ",studynameId
-
-print "Reading the .med file ",Outmed21File," and pushing corba objects in the SALOME study"
-
-medComp.readStructFileWithFieldType(Outmed21File,studyname)
-
-Outf_add  = medComp.readFieldInFile(Outmed21File,studyname,'fieldcelldoublevectoradd',-1,-1)
-Outf_lin  = medComp.readFieldInFile(Outmed21File,studyname,'fieldcelldoublevectorlin',-1,-1)
-
-myStudy.GetObjectNames('/Med')
-
-myStudy.GetObjectNames('/Med/MED_OBJECT_FROM_FILE_OutCalculatorpointe21_V3.2.0b1.med')
-
-myStudy.GetObjectNames('/Med/MEDMESH')
-myStudy.GetObjectNames('/Med/MEDMESH/maa1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_ELEMENT_1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_ELEMENT_2')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/FAMILLE_ELEMENT_3')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe1')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe2')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe3')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe4')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/groupe5')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/SupportOnAll_MED_MAILLE')
-myStudy.GetObjectNames('/Med/MEDMESH/MEDSUPPORTS_OF_maa1/SupportOnAll_MED_NOEUD')
-
-myStudy.GetObjectNames('/Med/MEDFIELD')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldcelldoublevectoradd')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldcelldoublevectoradd/(-1,-1)_ON_SupportOnAll_MED_MAILLE_OF_maa1')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldcelldoublevectorlin')
-myStudy.GetObjectNames('/Med/MEDFIELD/fieldcelldoublevectorlin/(-1,-1)_ON_SupportOnAll_MED_MAILLE_OF_maa1')
-
-#myStudyManager.Save(myStudy,1)
-#myStudy.DumpStudy("/tmp","medClient_withoutIHM_add_lin",1)
-
-myStudyManager.SaveAs(studyname+'.hdf',myStudy,0)
+MEDLoader.WriteUMesh(Outmed22File,meshLocal,True)
+MEDLoader.WriteFieldUsingAlreadyWrittenMesh(Outmed22File,f_addLocal)
+MEDLoader.WriteFieldUsingAlreadyWrittenMesh(Outmed22File,f_linLocal)
 
 print ""
 print "END of the Pyhton script ..... Ctrl D to exit"
index 09bf63a3a57ee6a197e5e268ce4f72363774aab0..29093ebe82c1f46ff9a2a602b6f073ab4748d97d 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #CALCULATOR_TEST_WITHOUTIHM.py
 #
 from omniORB import CORBA
@@ -28,6 +29,11 @@ import SALOME
 import SALOME_MED
 import SALOMEDS
 
+from MEDCouplingCorba import *
+from MEDCoupling import *
+from MEDLoader import *
+
+
 import os
 host = os.getenv( 'HOST' )
 orb, lcc, naming_service, contmgr = salome.salome_kernel.salome_kernel_init()
@@ -40,6 +46,7 @@ filePath=os.environ["MED_ROOT_DIR"]
 filePath=filePath+"/share/salome/resources/med/"
 medFile=filePath+"pointe.med"
 fieldname = "fieldcelldoublevector"
+meshname = "maa1"
 
 # Launch the Med Component and use it to load into memory the test field 
 print "Launch the Med Component: "
@@ -47,16 +54,17 @@ med_comp = lcc.FindOrLoadComponent("FactoryServer", "MED")
 
 # Get a Corba field proxy on the distant field (located in the med_comp server).
 try:
-    obj = naming_service.Resolve('myStudyManager')
-    myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-    print "studyManager found"
-    myStudy = myStudyManager.NewStudy('CALCULATOR_TEST_WITHOUTIHM')
-    studynameId = myStudy._get_StudyId()
-    studyname = myStudy._get_Name()
-    print "We are working in the study ",studyname," with the ID ",studynameId
+    #TODO
+    #obj = naming_service.Resolve('myStudyManager')
+    #myStudyManager = obj._narrow(SALOMEDS.StudyManager)
+    #print "studyManager found"
+    #myStudy = myStudyManager.NewStudy('CALCULATOR_TEST_WITHOUTIHM')
+    #studynameId = myStudy._get_StudyId()
+    #studyname = myStudy._get_Name()
+    #print "We are working in the study ",studyname," with the ID ",studynameId
     print "Read field ",fieldname
-    fieldcell  = med_comp.readFieldInFile(medFile,studyname,fieldname,-1,-1)
-    fieldcelldouble = fieldcell._narrow(SALOME_MED.FIELDDOUBLE)
+    f = MEDLoader.ReadFieldCell(medFile,meshname,0,fieldname,-1,-1)
+    fieldcelldouble=MEDCouplingFieldDoubleServant._this(f)
 except SALOME.SALOME_Exception, ex:
     print ex.details
     print ex.details.type
@@ -66,10 +74,10 @@ except SALOME.SALOME_Exception, ex:
     raise
 
 print "Description of Field : "
-print fieldcelldouble
-print fieldcelldouble.getName()
-print fieldcelldouble.getDescription()
-print fieldcelldouble.getNumberOfComponents()
+print f
+print f.getName()
+print f.getDescription()
+print f.getNumberOfComponents()
 
 #
 #
@@ -113,64 +121,24 @@ print " -> norme = ",norme
 ############  Creation of a MED file with fields created by Caculator  #################
 #                   via Client classes
 #
-from libMEDClient import *
-
-meshDistant = f_add.getSupport().getMesh()
-
-meshLocal = MESHClient(meshDistant)
-
-f_addLocal = FIELDDOUBLEClient(f_add)
+#from libMEDClient import *
+from MEDCouplingClient import *
+import MEDCouplingCorbaServant_idl
 
+f_addLocal=MEDCouplingFieldDoubleClient.New(f_add)
 f_addLocal.setName(f_addLocal.getName()+"add")
+f_add.UnRegister()
 
-f_linLocal = FIELDDOUBLEClient(f_lin)
-
+f_linLocal=MEDCouplingFieldDoubleClient.New(f_lin)
 f_linLocal.setName(f_linLocal.getName()+"lin")
+f_lin.UnRegister()
 
-# med file with 2.1 format
-OutmedFile21="Calculatorpointe_V21.med"
-os.system( 'rm -fr ' + OutmedFile21 )
-
-medFileVersion = getMedFileVersionForWriting()
-if (medFileVersion == V22):
-    print "setMedFileVersionForWriting(V21)"
-    setMedFileVersionForWriting(V21)
-
-# writting the mesh
-print "meshLocal.write :"
-idMed = meshLocal.addDriver(MED_DRIVER, OutmedFile21, meshLocal.getName(), MED_REMP)
-meshLocal.write(idMed)
 
-# writting the 2 fields
-print "f_addLocal.write :"
-idMed = f_addLocal.addDriver(MED_DRIVER, OutmedFile21, f_addLocal.getName())
-f_addLocal.write(idMed)
 
-print "f_linLocal.write :"
-idMed = f_linLocal.addDriver(MED_DRIVER, OutmedFile21, f_linLocal.getName())
-f_linLocal.write(idMed)
-
-# med file with 2.2 format
 OutmedFile22="Calculatorpointe_V22.med"
-os.system( 'rm -fr ' + OutmedFile22 )
-
-medFileVersion = getMedFileVersionForWriting()
-if (medFileVersion == V21):
-    print "setMedFileVersionForWriting(V22)"
-    setMedFileVersionForWriting(V22)
-
-# writting the mesh
-print "meshLocal.write :"
-idMed = meshLocal.addDriver(MED_DRIVER, OutmedFile22, meshLocal.getName(), MED_REMP)
-meshLocal.write(idMed)
-
-# writting the 2 fields
-print "f_addLocal.write :"
-idMed = f_addLocal.addDriver(MED_DRIVER, OutmedFile22, f_addLocal.getName())
-f_addLocal.write(idMed)
-
-print "f_linLocal.write :"
-idMed = f_linLocal.addDriver(MED_DRIVER, OutmedFile22, f_linLocal.getName())
-f_linLocal.write(idMed)
+#os.system( 'rm -fr ' + OutmedFile22 )
+MEDLoader.WriteField(OutmedFile22,f_addLocal,True)
+MEDLoader.WriteFieldUsingAlreadyWrittenMesh(OutmedFile22,f_linLocal)
+
 
 print "End of Calculator Test!"
index 016b63ccd248ef9e182a2f00d41a606389250874..8d82185700066b7fba36abbec40ce4f89c185576 100755 (executable)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SuperVisionTest AddComponent : example of component that adds two numbers
 #  File   : Makefile.in
 #  Author : , CEA
@@ -37,17 +35,12 @@ dist_libCALCULATOREngine_la_SOURCES = \
 libCALCULATOREngine_la_CPPFLAGS = \
        $(CORBA_CXXFLAGS) \
        $(CORBA_INCLUDES) \
-       $(CAS_CPPFLAGS) \
-       $(MED2_INCLUDES) \
-       $(HDF5_INCLUDES) \
-       $(KERNEL_CXXFLAGS) \
        $(MED_CXXFLAGS) \
-       -I$(top_builddir)/idl \
-       -I$(top_builddir)/salome_adm/unix
+       $(KERNEL_CXXFLAGS) \
+       -I$(top_builddir)/idl
 
 libCALCULATOREngine_la_LDFLAGS = \
        $(CORBA_LIBS) \
-       $(CAS_OCAF) \
        $(HDF5_LIBS) \
        $(KERNEL_LDFLAGS) \
        -lSalomeContainer \
@@ -55,7 +48,8 @@ libCALCULATOREngine_la_LDFLAGS = \
        -lSalomeIDLKernel \
        $(MED_LDFLAGS) \
        -lSalomeIDLMED \
-       -lMEDClientcmodule \
+       -lmedcouplingclient \
+       -lmedcouplingcorba \
        $(top_builddir)/idl/libSalomeIDLCALCULATOR.la
 
 # Scripts to be installed
index f37c3d7b92df6e247c23417cdd9b079da1fdc147..2c5e528f524362fa6aecafc36b7c093cb5488c2e 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # Generated python file of Graph aNewDataFlow
 #
 from SuperV import *
index db068f3f2bcb9b4b4c4eb33fec43963c6942acdf..cc209ba485beac117f33ddc5e10a85756dad2cce 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE SuperGraph>
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index fe549216610c4d92565527870634f2d481d7d000..ed8fc250e8a6ecb1533f534cb93540972e452176 100755 (executable)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Patrick GOLDBRONN (CEA)
 #  Modified by : Alexander BORODIN (OCN) - autotools usage