From cb1b13ea4e5da9d76168d2c3ca74f718a5922045 Mon Sep 17 00:00:00 2001 From: nadir Date: Tue, 23 Sep 2003 13:15:43 +0000 Subject: [PATCH] Merging with the MAN_SALOME2 branch --- adm_local/unix/make_commence.in | 5 +- adm_local/unix/make_conclude.in | 346 ++++++++ configure.in.base | 2 +- idl/{Med_Gen.idl => MED_Gen.idl} | 4 +- idl/Makefile.in | 2 +- src/MED/MED_test1.py | 8 +- src/MED/MED_test2.py | 10 +- src/MED/Makefile.in | 4 +- src/MED/Med_Gen_i.cxx | 15 +- src/MED/Med_Gen_i.hxx | 4 +- src/MEDGUI/Makefile.in | 4 +- src/MEDGUI/MedGUI.cxx | 20 +- src/MEDGUI/MedGUI.h | 4 +- src/MEDMEM/MEDMEM_Array.hxx | 2 + src/MEDMEM/MEDMEM_CellModel.cxx | 5 +- src/MEDMEM/MEDMEM_CellModel.hxx | 3 + src/MEDMEM/MEDMEM_Connectivity.cxx | 3 +- src/MEDMEM/MEDMEM_Connectivity.hxx | 3 + src/MEDMEM/MEDMEM_Coordinate.cxx | 1 + src/MEDMEM/MEDMEM_Coordinate.hxx | 2 + src/MEDMEM/MEDMEM_DriverTools.cxx | 9 +- src/MEDMEM/MEDMEM_DriverTools.hxx | 3 +- src/MEDMEM/MEDMEM_DriversDef.cxx | 24 +- src/MEDMEM/MEDMEM_DriversDef.hxx | 9 +- src/MEDMEM/MEDMEM_Exception.cxx | 3 +- src/MEDMEM/MEDMEM_Exception.hxx | 2 + src/MEDMEM/MEDMEM_Family.cxx | 3 +- src/MEDMEM/MEDMEM_Family.hxx | 7 +- src/MEDMEM/MEDMEM_Field.cxx | 1 + src/MEDMEM/MEDMEM_Field.hxx | 8 +- src/MEDMEM/MEDMEM_GenDriver.cxx | 9 +- src/MEDMEM/MEDMEM_GenDriver.hxx | 6 +- src/MEDMEM/MEDMEM_GibiMeshDriver.cxx | 1 + src/MEDMEM/MEDMEM_GibiMeshDriver.hxx | 12 +- src/MEDMEM/MEDMEM_Grid.cxx | 1 + src/MEDMEM/MEDMEM_Grid.hxx | 3 + src/MEDMEM/MEDMEM_Group.cxx | 5 +- src/MEDMEM/MEDMEM_Group.hxx | 6 +- src/MEDMEM/MEDMEM_InterpolationWrappers.hxx | 2 + src/MEDMEM/MEDMEM_Med.cxx | 1 + src/MEDMEM/MEDMEM_Med.hxx | 4 +- src/MEDMEM/MEDMEM_MedFieldDriver.hxx | 4 +- src/MEDMEM/MEDMEM_MedMedDriver.cxx | 1 + src/MEDMEM/MEDMEM_MedMedDriver.hxx | 14 +- src/MEDMEM/MEDMEM_MedMeshDriver.cxx | 1 + src/MEDMEM/MEDMEM_MedMeshDriver.hxx | 11 +- src/MEDMEM/MEDMEM_Mesh.cxx | 3 +- src/MEDMEM/MEDMEM_Mesh.hxx | 19 +- src/MEDMEM/MEDMEM_Meshing.cxx | 1 + src/MEDMEM/MEDMEM_Meshing.hxx | 2 + src/MEDMEM/MEDMEM_ModulusArray.hxx | 4 +- src/MEDMEM/MEDMEM_PointerOf.hxx | 3 + src/MEDMEM/MEDMEM_STRING.hxx | 2 + src/MEDMEM/MEDMEM_SkyLineArray.cxx | 1 + src/MEDMEM/MEDMEM_SkyLineArray.hxx | 9 +- src/MEDMEM/MEDMEM_Support.cxx | 3 +- src/MEDMEM/MEDMEM_Support.hxx | 8 +- src/MEDMEM/MEDMEM_TypeMeshDriver.cxx | 4 +- src/MEDMEM/MEDMEM_TypeMeshDriver.hxx | 11 +- src/MEDMEM/MEDMEM_Unit.cxx | 1 + src/MEDMEM/MEDMEM_Unit.hxx | 3 + src/MEDMEM/MEDMEM_Utilities.hxx | 167 ++-- src/MEDMEM/MEDMEM_VtkFieldDriver.hxx | 7 +- src/MEDMEM/MEDMEM_VtkMedDriver.cxx | 1 + src/MEDMEM/MEDMEM_VtkMedDriver.hxx | 4 +- src/MEDMEM/MEDMEM_VtkMeshDriver.cxx | 1 + src/MEDMEM/MEDMEM_VtkMeshDriver.hxx | 10 +- src/MEDMEM/Makefile.in | 12 +- src/MEDMEM/duplicateMED.cxx | 1 + src/MEDMEM/duplicateMEDMESH.cxx | 1 + src/MEDMEM/med2vtk.cxx | 1 + src/MEDMEM/med_test.cxx | 1 + src/MEDMEM/test_MEDMEM_Array.cxx | 1 + src/MEDMEM/test_MEDMEM_CellModel.cxx | 1 + src/MEDMEM/test_MEDMEM_Meshing.cxx | 1 + src/MEDMEM/test_MEDMEM_ModulusArray.cxx | 1 + src/MEDMEM/test_MEDMEM_SkyLineArray.cxx | 1 + src/MEDMEM/test_affect_medarray.cxx | 1 + src/MEDMEM/test_copie_connectivity.cxx | 1 + src/MEDMEM/test_copie_coordinate.cxx | 1 + src/MEDMEM/test_copie_family.cxx | 1 + src/MEDMEM/test_copie_fieldT.cxx | 1 + src/MEDMEM/test_copie_field_.cxx | 1 + src/MEDMEM/test_copie_group.cxx | 1 + src/MEDMEM/test_copie_medarray.cxx | 1 + src/MEDMEM/test_copie_mesh.cxx | 1 + src/MEDMEM/test_copie_support.cxx | 1 + src/MEDMEM/test_gibi_driver.cxx | 4 +- src/MEDMEM/test_operation_fielddouble.cxx | 1 + src/MEDMEM/test_operation_fieldint.cxx | 1 + src/MEDMEM/tests/readCoordinate.cxx | 1 + src/MEDMEM/tests/readEntete.cxx | 1 + src/MEDMEM/tests/testUArray.cxx | 1 + src/MEDMEM/tests/testUArray.cxx.ok | 1 + src/MEDMEM/tests/testUCellModel.cxx | 1 + src/MEDMEM/tests/testUCoordinate.cxx | 1 + src/MEDMEM/tests/testUMedException.cxx | 1 + src/MEDMEM/tests/testUModulusArray.cxx | 1 + src/MEDMEM/tests/testUPointerOf.cxx | 1 + src/MEDMEM/tests/testUSkyLineArray.cxx | 1 + src/MEDMEM/tests/testUUnit.cxx | 1 + .../MEDMEM_Family_i.cxx} | 133 ++- src/MEDMEM_I/MEDMEM_Family_i.hxx | 57 ++ .../MEDMEM_FieldDouble_i.cxx} | 18 +- .../MEDMEM_FieldDouble_i.hxx} | 12 +- .../MEDMEM_FieldInt_i.cxx} | 18 +- .../MEDMEM_FieldInt_i.hxx} | 12 +- .../MEDMEM_FieldOf_i.hxx} | 113 ++- .../MEDMEM_Field_i.cxx} | 7 +- .../MEDMEM_Field_i.hxx} | 15 +- .../MEDMEM_Group_i.cxx} | 24 +- .../MEDMEM_Group_i.hxx} | 12 +- src/MEDMEM_I/MEDMEM_Med_i.cxx | 748 ++++++++++++++++ .../Med_i.hxx => MEDMEM_I/MEDMEM_Med_i.hxx} | 15 +- .../Mesh_i.cxx => MEDMEM_I/MEDMEM_Mesh_i.cxx} | 574 ++++++++++--- src/MEDMEM_I/MEDMEM_Mesh_i.hxx | 184 ++++ .../MEDMEM_Support_i.cxx} | 211 +++-- .../MEDMEM_Support_i.hxx} | 30 +- .../MEDMEM_convert.cxx} | 22 +- .../MEDMEM_convert.hxx} | 10 +- src/{MedMem => MEDMEM_I}/Makefile.in | 31 +- src/{MedMem => MEDMEM_I}/README | 0 src/MEDMEM_SWIG/MEDMEM_SWIG_FieldDouble.cxx | 1 + src/MEDMEM_SWIG/Makefile.in | 2 +- src/MED_SWIG/MED_shared_modules.py | 6 +- src/Makefile.in | 2 +- src/MedClient/src/CONNECTIVITYClient.cxx | 101 ++- src/MedClient/src/CONNECTIVITYClient.hxx | 2 + src/MedClient/src/COORDINATEClient.cxx | 67 +- src/MedClient/src/COORDINATEClient.hxx | 2 + src/MedClient/src/FAMILYClient.cxx | 35 +- src/MedClient/src/FAMILYClient.hxx | 2 + src/MedClient/src/FIELDClient.hxx | 2 + src/MedClient/src/GROUPClient.cxx | 23 +- src/MedClient/src/GROUPClient.hxx | 2 + src/MedClient/src/MESHClient.cxx | 101 ++- src/MedClient/src/MESHClient.hxx | 2 + src/MedClient/src/SUPPORTClient.cxx | 146 ++-- src/MedClient/src/SUPPORTClient.hxx | 2 + src/MedClient/src/UtilClient.hxx | 2 + src/MedClient/test/test1/Makefile.in | 17 +- .../{ => resources}/CatalogModuleTest.xml | 0 src/MedClient/test/test2/Makefile.in | 2 +- src/MedCorba_Swig/Makefile.in | 2 +- src/MedCorba_Swig/batchmode_medcorba_test.py | 7 +- src/MedCorba_Swig/libMedCorba_Swig.i | 20 +- src/MedCorba_Swig/medcorba_test.py | 7 +- src/MedMem/Family_i.hxx | 49 -- src/MedMem/Med_i.cxx | 806 ------------------ src/MedMem/Mesh_i.hxx | 152 ---- 150 files changed, 3000 insertions(+), 1717 deletions(-) create mode 100644 adm_local/unix/make_conclude.in rename idl/{Med_Gen.idl => MED_Gen.idl} (92%) rename src/{MedMem/Family_i.cxx => MEDMEM_I/MEDMEM_Family_i.cxx} (63%) create mode 100644 src/MEDMEM_I/MEDMEM_Family_i.hxx rename src/{MedMem/FieldDouble_i.cxx => MEDMEM_I/MEDMEM_FieldDouble_i.cxx} (86%) rename src/{MedMem/FieldDouble_i.hxx => MEDMEM_I/MEDMEM_FieldDouble_i.hxx} (71%) rename src/{MedMem/FieldInt_i.cxx => MEDMEM_I/MEDMEM_FieldInt_i.cxx} (86%) rename src/{MedMem/FieldInt_i.hxx => MEDMEM_I/MEDMEM_FieldInt_i.hxx} (71%) rename src/{MedMem/FieldOf_i.hxx => MEDMEM_I/MEDMEM_FieldOf_i.hxx} (86%) rename src/{MedMem/Field_i.cxx => MEDMEM_I/MEDMEM_Field_i.cxx} (69%) rename src/{MedMem/Field_i.hxx => MEDMEM_I/MEDMEM_Field_i.hxx} (86%) rename src/{MedMem/Group_i.cxx => MEDMEM_I/MEDMEM_Group_i.cxx} (86%) rename src/{MedMem/Group_i.hxx => MEDMEM_I/MEDMEM_Group_i.hxx} (78%) create mode 100644 src/MEDMEM_I/MEDMEM_Med_i.cxx rename src/{MedMem/Med_i.hxx => MEDMEM_I/MEDMEM_Med_i.hxx} (87%) rename src/{MedMem/Mesh_i.cxx => MEDMEM_I/MEDMEM_Mesh_i.cxx} (65%) create mode 100644 src/MEDMEM_I/MEDMEM_Mesh_i.hxx rename src/{MedMem/Support_i.cxx => MEDMEM_I/MEDMEM_Support_i.cxx} (69%) rename src/{MedMem/Support_i.hxx => MEDMEM_I/MEDMEM_Support_i.hxx} (64%) rename src/{MedMem/convert.cxx => MEDMEM_I/MEDMEM_convert.cxx} (92%) rename src/{MedMem/convert.hxx => MEDMEM_I/MEDMEM_convert.hxx} (85%) rename src/{MedMem => MEDMEM_I}/Makefile.in (73%) rename src/{MedMem => MEDMEM_I}/README (100%) rename src/MedClient/test/test1/{ => resources}/CatalogModuleTest.xml (100%) delete mode 100644 src/MedMem/Family_i.hxx delete mode 100644 src/MedMem/Med_i.cxx delete mode 100644 src/MedMem/Mesh_i.hxx diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index f6d5ea9cc..6def7e777 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -9,10 +9,13 @@ SHELL=/bin/sh HAVE_SSTREAM=@HAVE_SSTREAM@ -LIBS=@LIBS@ +LIBS=@LIBS@ +LIBSFORBIN=@LIBS@ LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome +LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome # add libstdc++ to link c++ library with libtool ! LDFLAGS+= -lstdc++ +LDFLAGSFORBIN+= -lstdc++ CP=@CP@ diff --git a/adm_local/unix/make_conclude.in b/adm_local/unix/make_conclude.in new file mode 100644 index 000000000..5b49c545c --- /dev/null +++ b/adm_local/unix/make_conclude.in @@ -0,0 +1,346 @@ +#======================================================================= +# This section of this makefile comes from the file +# 'adm/unix/make_conclude' which was generated with config.status +# from file adm/unix/make_conclude.in +#======================================================================= +# -* Makefile *- +# +# Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA) +# Date : 6/07/2001 +# $Header$ +# + +# ORB Specifics rules +@CORBA@ + +# transform idl reference in appropriate obj file +LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) +LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX)) +LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx) +LIB_SRC+=$(LIB_MOC_SRC) +LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx) +LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC) + +LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) +LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ)) + + +# transform c file in appropriate libtool obj file (.c, .cc and .cxx) +LIB_OBJ_C = $(patsubst %.c, %.lo, $(filter %.c, $(LIB_SRC))) +LIB_OBJ_CC = $(patsubst %.cc, %.lo, $(filter %.cc, $(LIB_SRC))) +LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC))) +LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo) +LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC))) + +# all libtool obj file in library +LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $(LIB_SERVER_OBJ:%.o=%.lo) $(LIB_SWIG_OBJ) $(LIB_OBJ_F) + +# LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib/salome/%.la) +LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib/salome/%.la, $(filter %.la, $(LIB))) +LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib/salome/%.a, $(filter %.a, $(LIB))) + +ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),) +LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB))) +else +LIB_SWIG = +endif + +lib: $(LIB_BUILD) $(LIB_CLIENT_PY) +# we don't build static library ! + +$(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la + -$(RM) $@ + -$(RM) $(patsubst %.la, %.so, $@) + -$(RM) $(patsubst %.la, %.a, $@) + ln -sf $(CURDIR)/$< $@ || true + ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \ + $(patsubst %.la, %.so, $@) || true + ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \ + $(patsubst %.la, %.so, $@).0 || true + + if ! test -z $(LIB_SWIG) ; then \ + ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\ + fi; + +$(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a + -$(RM) $@ + ln -sf $(CURDIR)/$< $@ || true + +$(LIB): $(LIB_OBJ) + @$(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) + +# transform idl reference in appropriate obj file +BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) +BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX)) +BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx) +BIN_SRC+=$(BIN_MOC_SRC) +BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC) + +BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) +BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ)) +# transform c file in appropriate libtool obj file (.c) +BIN_OBJ_C = $(patsubst %.c, %.o, $(filter %.c, $(BIN_SRC))) +# transform c++ file in appropriate libtool obj file (.cc and .cxx) +BIN_OBJ_CC = $(patsubst %.cc, %.o, $(filter %.cc, $(BIN_SRC))) +BIN_OBJ_CXX = $(patsubst %.cxx, %.o, $(filter %.cxx, $(BIN_SRC))) +# all obj file in bin target +BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ) + +bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts + +BIN_LIB=$(LIB:lib%.la=-l%) + +$(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: % + -$(RM) $@ + ln -sf $(CURDIR)/$< $@ + +$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ) + $(CXX) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) + +# copy python scripts in $(top_builddir)/bin/salome +# +DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%) +pyscripts: $(DEST_PYSCRIPTS) +$(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: % + cp -f $< $@ + +# copy pyqt files in $(PYTHON_SHARED_SITE) +# +PYTHON_SHARED_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/salome/shared_modules + +$(PYTHON_SHARED_SITE): + $(INSTALL) -d $@ + +DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%) +sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS) +$(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: % + cp -f $< $@ + +check: test + +tests: test + +test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%) + + +# copy header file in $(inc_builddir) +# +DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%) +inc: $(DEST_HEADERS) +$(DEST_HEADERS): $(inc_builddir)/%: % + cp -f $< $@ + +# build resources file (icons and messages) : .qm file from .po file +resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm) + +# Make installation directories if they don't exist. +$(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir): + $(INSTALL) -d $@ && chmod 755 $@ + +# Install the library, the public header files, and programs. +install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm + @for f in X $(LIB); do \ + if test $$f != X; then \ + ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \ + fi; \ + done + @if ! test -z $(LIB_SWIG) ; then \ + (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \ + fi; + @for f in X $(BIN); do \ + if test $$f != X; then \ + ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \ + fi; \ + done +# Install tests programmes in bindir + @for f in X $(TEST_PROGS); do \ + if test $$f != X; then \ + ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \ + fi; \ + done +# Install exported includes in includedir + @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \ + if test $$f != X; then \ + (cp -p $$f $(includedir) || exit 1); \ + fi; \ + done + +# Install python script in $(bindir) +install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) + +$(EXPORT_PYSCRIPTS:%=install-%): install-%: % + $(INSTALL_PROGRAM) $< $(bindir)/. + +#install-python: $(bindir) $(EXPORT_PYSCRIPTS) +# @for f in X $(EXPORT_PYSCRIPTS); do \ +# if test $$f != X; then \ +# ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \ +# fi; \ +# done + +# Install pyqt script in $(install-sharedpyqt) +install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%) + +$(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: % + $(INSTALL_PROGRAM) $< $(sharedpydir)/. + + +# generic rule to install .qm files : +install-qm: resources + $(INSTALL) -d $(datadir)/resources + @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \ + if test $$f != X; then \ + ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \ + fi; \ + done + +# Removes those things that `make install' (would have) installed. +uninstall: + @if test "X$(LIB)" != X; then \ + for f in $(LIB); do \ + $(LT_UNINSTALL) $(libdir)/$$f; \ + done; \ + fi + @if test "X$(BIN)" != X; then \ + for f in $(BIN); do \ + $(LT_UNINSTALL) $(bindir)/$$f; \ + done; \ + fi + @for f in X $(TEST_PROGS); do \ + if test $$f != X; then \ + $(LT_UNINSTALL) $(bindir)/$$f; \ + fi; \ + done +# Uninstall exported includes in includedir + @for f in X $(EXPORT_HEADERS); do \ + if test $$f != X; then \ + $(LT_UNINSTALL) $(includedir)/$$f; \ + fi; \ + done +# Uninstall python script in $(bindir) + @for f in X $(EXPORT_PYSCRIPTS); do \ + if test $$f != X; then \ + $(LT_UNINSTALL) $(bindir)/$$f ; \ + fi; \ + done + +# Uninstall pyqt script in $(sharedpydir) + @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \ + if test $$f != X; then \ + $(LT_UNINSTALL) $(sharedpydir)/$$f ; \ + fi; \ + done + +# Uninstall qm files + @for f in X $(PO_FILES:%.po=%.qm); do \ + if test $$f != X; then \ + $(LT_UNINSTALL) $(datadir)/resources/$$f ; \ + fi; \ + done + +# remove all dependencies files +# +cleandep: + -$(RM) .dep* + +# Removes temporary files without removing the final target files. That is, +# remove things like object files but not libraries or executables. +# +mostlyclean: cleandep + -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o) + -$(RM) $(BIN_OBJ) $(BIN:%=%.o) + -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o) + -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN) + +# Like `mostlyclean' except it also removes the final targets: things like +# libraries and executables. This target doesn't remove any file that +# is part of the SALOME distribution. +# +clean: mostlyclean + -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN) + -$(RM) TAGS *~ *# core *.core + -$(RM) -r .libs + -$(RM) $(top_builddir)/lib/salome/$(LIB) + -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN)) + -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib/salome/$(LIB)) + -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib/salome/$(LIB)) +# remove idl generated files (sources) + -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC) +# remove idl generated files (headers) + -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H)) + -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H)) + -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC) + -$(RM) $(LIB_SWIG_SRC) + +# Like `clean' except it also removes files that were created by running +# configure. If you've unpacked the source and built without creating +# any other files, then `make distclean' will leave only the files that were +# in the distribution. +# +distclean: clean + #remove qm file ! + -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm) + #remove include files + -$(RM) $(DEST_HEADERS) + -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep* + @if test -f $(srcdir)/Makefile.in; then \ + (@SETX@; $(RM) Makefile); \ + fi + + +#implicits rules +.cc.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + +.cc.lo: + $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + +.cxx.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + +.cxx.lo: + $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + +.c.o: + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + +.c.lo: + $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $< + +.f.o: + $(FC) $(FFLAGS) -c $< -o $@ + +.f.lo: + $(LT) --mode=compile $(FC) $(FFLAGS) -c $< + +.ui.h: + $(UIC) -o $@ $< + +.ui.cxx: + $(UIC) -o $@ -i $*.h $< + +#pattern rules +%_moc.cxx : %.h + $(MOC) $< -o $@ + +%_wrap.cxx : %.i + $(SWIG) $(SWIG_FLAGS) -o $@ $< + +$(top_builddir)/share/salome/resources/%.qm: %.po + if test -e ${KERNEL_ROOT_DIR}/bin/salome/msg2qm ; then \ + ${KERNEL_ROOT_DIR}/bin/salome/msg2qm $< $@ ; \ + else \ + $(top_builddir)/bin/salome/msg2qm $< $@ ; \ + fi + +#------------------------------------------------------------------------------ +# The following section of this makefile contains dependencies between the +# source files and the header files. If GNU make and GCC are being used then +# the dependencies are in the form of rules that cause the information to +# be kept updated automatically. Otherwise the dependencies are listed +# explicitly and come from the `.distdep' files in the various directories. +# These files are part of the distribution and are generated automatically on +# GNU/GCC systems. +#------------------------------------------------------------------------------ + +@DEPEND@ diff --git a/configure.in.base b/configure.in.base index 212a37556..064d002ba 100644 --- a/configure.in.base +++ b/configure.in.base @@ -279,7 +279,7 @@ echo dnl generals files which could be included in every makefile AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence -AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude +AC_SUBST_FILE(CONCLUDE) CONCLUDE=adm_local/unix/make_conclude AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module dnl les dependences diff --git a/idl/Med_Gen.idl b/idl/MED_Gen.idl similarity index 92% rename from idl/Med_Gen.idl rename to idl/MED_Gen.idl index 5b0ebf458..86a68ba5a 100644 --- a/idl/Med_Gen.idl +++ b/idl/MED_Gen.idl @@ -13,9 +13,9 @@ #include "SALOMEDS.idl" #include "MED.idl" -module Engines +module SALOME_MED { - interface Med_Gen : Engines::Component, SALOMEDS::Driver + interface MED_Gen : Engines::Component, SALOMEDS::Driver { SALOME_MED::MESH readMeshInFile(in string fileName, in string studyName, diff --git a/idl/Makefile.in b/idl/Makefile.in index 434a0fec7..49273ade4 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -12,7 +12,7 @@ VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome IDL_FILES = \ MED.idl \ - Med_Gen.idl \ + MED_Gen.idl \ Compo1Py.idl PY_CLIENT_IDL = $(IDL_FILES) diff --git a/src/MED/MED_test1.py b/src/MED/MED_test1.py index d5ac9907d..c2c342d49 100755 --- a/src/MED/MED_test1.py +++ b/src/MED/MED_test1.py @@ -31,12 +31,14 @@ import salome med=salome.lcc.FindOrLoadComponent("FactoryServer", "MED") import os -filePath=os.getenv("SALOME_BUILD") -filePath=filePath+"/../SALOME_ROOT/data/" +# +#befor running this script, please be sure about the path the file fileName +# +filePath=os.environ["MED_ROOT_DIR"] +filePath=filePath+"/share/salome/resources/" fileName="pointe.med" fileTout=filePath+fileName print fileTout med.readStructFile(fileTout,salome.myStudyName) - diff --git a/src/MED/MED_test2.py b/src/MED/MED_test2.py index 901ee2926..946583ead 100755 --- a/src/MED/MED_test2.py +++ b/src/MED/MED_test2.py @@ -30,13 +30,14 @@ import salome import SALOME import os -filePath=os.getenv("SALOME_BUILD") -filePath=filePath+"/../SALOME_ROOT/data/" +filePath=os.environ["MED_ROOT_DIR"] +filePath=filePath+"/share/salome/resources/" +medFile=filePath+"mesh.med" med=salome.lcc.FindOrLoadComponent("FactoryServer", "MED") try: - mesh=med.readMeshInFile(filePath+"/mesh.med", salome.myStudyName,"Mesh 1") + mesh=med.readMeshInFile(medFile, salome.myStudyName,"Mesh 1") except SALOME.SALOME_Exception, ex: print ex.details print ex.details.type @@ -49,8 +50,9 @@ except SALOME.SALOME_Exception, ex: print mesh.getName() print mesh.getNumberOfNodes() +medFile = filePath+"pointe.med" try: - field=med.readFieldInFile(filePath+"/pointe.med",salome.myStudyName,"fieldcelldouble",-1,-1) + field=med.readFieldInFile(medFile,salome.myStudyName,"fieldcelldouble",-1,-1) except SALOME.SALOME_Exception, ex: print ex.details print ex.details.type diff --git a/src/MED/Makefile.in b/src/MED/Makefile.in index c5a639de5..0ba0a5cb2 100644 --- a/src/MED/Makefile.in +++ b/src/MED/Makefile.in @@ -40,7 +40,7 @@ EXPORT_PYSCRIPTS = MED_test1.py MED_test2.py LIB = libMEDEngine.la LIB_SRC = Med_Gen_i.cxx -LIB_SERVER_IDL = Med_Gen.idl SALOME_Component.idl \ +LIB_SERVER_IDL = MED_Gen.idl SALOME_Component.idl \ SALOME_Exception.idl MED.idl LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_ModuleCatalog.idl @@ -54,7 +54,7 @@ BIN_SRC = CPPFLAGS += $(OCC_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+= $(OCC_LIBS) $(HDF5_LIBS) -lSalomeContainer -lSalomeHDFPersist -lSalomeDS -lSalomeNS -lRegistry -lOpUtil -lmedmem -lMEDImpl -L${KERNEL_ROOT_DIR}/lib/salome +LDFLAGS+= $(OCC_LIBS) $(HDF5_LIBS) -lSalomeContainer -lSalomeHDFPersist -lSalomeDS -lSalomeNS -lRegistry -lOpUtil -lMEDMEMImpl -L${KERNEL_ROOT_DIR}/lib/salome MED.hh MEDSK.cc: MED.idl diff --git a/src/MED/Med_Gen_i.cxx b/src/MED/Med_Gen_i.cxx index 347a8304c..b214dfb14 100755 --- a/src/MED/Med_Gen_i.cxx +++ b/src/MED/Med_Gen_i.cxx @@ -26,15 +26,14 @@ // Module : MED // $Header$ -using namespace std; using namespace std; #include "Med_Gen_i.hxx" -#include "Mesh_i.hxx" -#include "Med_i.hxx" -#include "FieldInt_i.hxx" -#include "FieldDouble_i.hxx" -#include "Support_i.hxx" +#include "MEDMEM_Mesh_i.hxx" +#include "MEDMEM_Med_i.hxx" +#include "MEDMEM_FieldInt_i.hxx" +#include "MEDMEM_FieldDouble_i.hxx" +#include "MEDMEM_Support_i.hxx" #include "MEDMEM_Mesh.hxx" @@ -61,6 +60,8 @@ using namespace std; #include #include "SALOMEDS_Tool.hxx" +using namespace MEDMEM; + // Initialisation des variables statiques map Med_Gen_i::_MedCorbaObj; string Med_Gen_i::_myFileName=""; @@ -934,7 +935,7 @@ SALOMEDS::SObject_ptr Med_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, if ( !Comp->_is_nil() ) { aName->SetValue( Comp->componentusername() ); } - aBuilder->DefineComponentInstance(aFather, Med_Gen::_this()); + aBuilder->DefineComponentInstance(aFather, MED_Gen::_this()); } if (CORBA::is_nil(theSObject)) { diff --git a/src/MED/Med_Gen_i.hxx b/src/MED/Med_Gen_i.hxx index cbc9db16e..630cb8f87 100644 --- a/src/MED/Med_Gen_i.hxx +++ b/src/MED/Med_Gen_i.hxx @@ -31,7 +31,7 @@ #include #include -#include CORBA_SERVER_HEADER(Med_Gen) +#include CORBA_SERVER_HEADER(MED_Gen) #include CORBA_SERVER_HEADER(MED) #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) @@ -41,7 +41,7 @@ #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) class Med_Gen_i: - public POA_Engines::Med_Gen, + public POA_SALOME_MED::MED_Gen, public Engines_Component_i { private: diff --git a/src/MEDGUI/Makefile.in b/src/MEDGUI/Makefile.in index 447045ff2..d42339648 100644 --- a/src/MEDGUI/Makefile.in +++ b/src/MEDGUI/Makefile.in @@ -50,7 +50,7 @@ LIB_SRC = MedGUI.cxx LIB_MOC = MedGUI.h LIB_CLIENT_IDL = SALOMEDS.idl SALOME_Exception.idl \ - Med_Gen.idl MED.idl \ + MED_Gen.idl MED.idl \ SALOMEDS_Attributes.idl # SMESH_Mesh.idl SMESH_Hypothesis.idl SMESH_BasicHypothesis.idl \ # GEOM_Shape.idl SALOMEDS_Attributes.idl @@ -62,7 +62,7 @@ LIB_SERVER_IDL = CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS += -lSalomeGUI -lmedmem -lMEDImpl -lMEDEngine -L${KERNEL_ROOT_DIR}/lib/salome +LDFLAGS += -lSalomeGUI -lMEDMEMImpl -lmedmem -lMEDEngine -L${KERNEL_ROOT_DIR}/lib/salome MED.hh MEDSK.cc: MED.idl diff --git a/src/MEDGUI/MedGUI.cxx b/src/MEDGUI/MedGUI.cxx index 09bdce969..392a96214 100644 --- a/src/MEDGUI/MedGUI.cxx +++ b/src/MEDGUI/MedGUI.cxx @@ -85,7 +85,7 @@ bool MedGUI::OnGUIEvent (int theCommandID, QAD_Desktop* parent) int myStudyId = myActiveStudy->getStudyId(); // load MED engine - Engines::Med_Gen_ptr medgen = InitMedGen(parent); + SALOME_MED::MED_Gen_ptr medgen = InitMedGen(parent); // Selection du Fichier file = QAD_FileDlg::getFileName(parent, @@ -139,7 +139,7 @@ bool MedGUI::OnGUIEvent (int theCommandID, QAD_Desktop* parent) int myStudyId = myActiveStudy->getStudyId(); // load MED engine - Engines::Med_Gen_ptr medgen = InitMedGen(parent); + SALOME_MED::MED_Gen_ptr medgen = InitMedGen(parent); // Selection du Fichier file = QAD_FileDlg::getFileName(parent, @@ -192,7 +192,7 @@ bool MedGUI::OnGUIEvent (int theCommandID, QAD_Desktop* parent) int myStudyId = myActiveStudy->getStudyId(); // load MED engine - Engines::Med_Gen_ptr medgen = InitMedGen(parent); + SALOME_MED::MED_Gen_ptr medgen = InitMedGen(parent); // Selection du Fichier file = QAD_FileDlg::getFileName(parent, @@ -458,7 +458,7 @@ bool MedGUI::DumpMesh( SALOME_MED::MESH_var MEDMesh) int k = MEDMesh->getNumberOfNodes() ; SCRUTE(k); - Engines::double_array_var coords = MEDMesh->getCoordinates( SALOME_MED::MED_FULL_INTERLACE ); + SALOME_MED::double_array_var coords = MEDMesh->getCoordinates( SALOME_MED::MED_FULL_INTERLACE ); int i = 0; int lu = 0; while (lu < k ) { @@ -487,7 +487,7 @@ bool MedGUI::DumpMesh( SALOME_MED::MESH_var MEDMesh) SCRUTE(identfam); int nbelemnts=Families[k]->getNumberOfElements(SALOME_MED::MED_NONE); SCRUTE(nbelemnts); - Engines::long_array_var tabnoeuds=Families[k]->getNumber(SALOME_MED::MED_NONE); + SALOME_MED::long_array_var tabnoeuds=Families[k]->getNumber(SALOME_MED::MED_NONE); for (int l=0;llength();l++) SCRUTE(tabnoeuds[l]); } @@ -499,7 +499,7 @@ bool MedGUI::DumpMesh( SALOME_MED::MESH_var MEDMesh) // SCRUTE(nomFam); // int identfam=Family->getIdentifier(); // SCRUTE(identfam); - // Engines::long_array_var tabnoeuds=Family->getNumber(SALOME_MED::MED_NONE); + // SALOME_MED::long_array_var tabnoeuds=Family->getNumber(SALOME_MED::MED_NONE); // for (int l=0;llength();l++) // SCRUTE(tabnoeuds[l]); @@ -520,7 +520,7 @@ bool MedGUI::DumpMesh( SALOME_MED::MESH_var MEDMesh) // if ( Fam->_is_nil() ) // return false; -// Engines::long_array_var tabnoeuds=Fam->getNumber(SALOME_MED::MED_NONE); +// SALOME_MED::long_array_var tabnoeuds=Fam->getNumber(SALOME_MED::MED_NONE); // for (int l=0;llength();l++) // SCRUTE(tabnoeuds[l]); @@ -537,7 +537,7 @@ bool MedGUI::DumpSubMesh( SALOME_MED::FAMILY_var Fam ) if ( Fam->_is_nil() ) return false; - Engines::long_array_var tabnoeuds=Fam->getNumber(SALOME_MED::MED_NONE); + SALOME_MED::long_array_var tabnoeuds=Fam->getNumber(SALOME_MED::MED_NONE); for (int l=0;llength();l++) SCRUTE(tabnoeuds[l]); @@ -549,12 +549,12 @@ bool MedGUI::DumpSubMesh( SALOME_MED::FAMILY_var Fam ) * */ //============================================================================= -Engines::Med_Gen_ptr MedGUI::InitMedGen(QAD_Desktop* parent) +SALOME_MED::MED_Gen_ptr MedGUI::InitMedGen(QAD_Desktop* parent) { Engines::Component_var comp = parent->getEngine("FactoryServer", "MED"); MESSAGE("_________________________________________"); - Engines::Med_Gen_var clr = Engines::Med_Gen::_narrow(comp); + SALOME_MED::MED_Gen_var clr = SALOME_MED::MED_Gen::_narrow(comp); ASSERT(!CORBA::is_nil(clr)); return clr._retn(); } diff --git a/src/MEDGUI/MedGUI.h b/src/MEDGUI/MedGUI.h index a0be4e6c0..45f3d6734 100644 --- a/src/MEDGUI/MedGUI.h +++ b/src/MEDGUI/MedGUI.h @@ -14,7 +14,7 @@ #include "QAD_StudyFrame.h" #include -#include CORBA_CLIENT_HEADER(Med_Gen) +#include CORBA_CLIENT_HEADER(MED_Gen) //#include CORBA_CLIENT_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) @@ -50,7 +50,7 @@ public: static void ActiveStudyChanged ( QAD_Desktop* parent ); - static Engines::Med_Gen_ptr InitMedGen(QAD_Desktop* parent); + static SALOME_MED::MED_Gen_ptr InitMedGen(QAD_Desktop* parent); static bool DumpMesh( SALOME_MED::MESH_var aMesh ); // static bool DumpSubMesh( SMESH::SMESH_subMesh_ptr aSubMesh ) ; diff --git a/src/MEDMEM/MEDMEM_Array.hxx b/src/MEDMEM/MEDMEM_Array.hxx index e0d049821..d032a9273 100644 --- a/src/MEDMEM/MEDMEM_Array.hxx +++ b/src/MEDMEM/MEDMEM_Array.hxx @@ -39,6 +39,7 @@ using namespace MED_EN; A simple test program (testUArray) allows to test this class. */ +namespace MEDMEM { template class MEDARRAY { private : @@ -96,6 +97,7 @@ public : bool isOtherCalculated() const {return (const T*)_valuesOther != NULL;} void clearOtherMode(); }; +} //-------------------------------------------------// // // diff --git a/src/MEDMEM/MEDMEM_CellModel.cxx b/src/MEDMEM/MEDMEM_CellModel.cxx index e45ed624b..5f272ef6b 100644 --- a/src/MEDMEM/MEDMEM_CellModel.cxx +++ b/src/MEDMEM/MEDMEM_CellModel.cxx @@ -6,6 +6,7 @@ using namespace std; #include "utilities.h" #include "MEDMEM_CellModel.hxx" +using namespace MEDMEM; CELLMODEL::CELLMODEL(medGeometryElement t) { @@ -1352,7 +1353,7 @@ CELLMODEL::CELLMODEL(medGeometryElement t) } } -ostream & operator<<(ostream &os,const CELLMODEL &my) +ostream & MEDMEM::operator<<(ostream &os,const CELLMODEL &my) { os << "Cell Model :" << endl ; os << " - name : " << my._name << endl; @@ -1380,6 +1381,8 @@ ostream & operator<<(ostream &os,const CELLMODEL &my) } return os; } +/* +*/ // Return number of constituents type (which dimension is _dimension-1). int CELLMODEL::getNumberOfConstituentsType() const diff --git a/src/MEDMEM/MEDMEM_CellModel.hxx b/src/MEDMEM/MEDMEM_CellModel.hxx index 068d7b443..97b905e4d 100644 --- a/src/MEDMEM/MEDMEM_CellModel.hxx +++ b/src/MEDMEM/MEDMEM_CellModel.hxx @@ -24,6 +24,7 @@ using namespace MED_EN; the cell model it describes as cell dimensions, number of nodes... */ +namespace MEDMEM { class CELLMODEL { @@ -135,12 +136,14 @@ public : map getNumberOfConstituentsForeachType() const; +}; }; // ------------------------------------------ // Methodes Inline // ------------------------------------------ +using namespace MEDMEM; inline CELLMODEL::CELLMODEL(): _type(MED_NONE), _dimension(0), diff --git a/src/MEDMEM/MEDMEM_Connectivity.cxx b/src/MEDMEM/MEDMEM_Connectivity.cxx index b785bdf50..9d57d54db 100644 --- a/src/MEDMEM/MEDMEM_Connectivity.cxx +++ b/src/MEDMEM/MEDMEM_Connectivity.cxx @@ -10,6 +10,7 @@ using namespace std; #include "MEDMEM_STRING.hxx" #include +using namespace MEDMEM; /*! Default Constructor. /n Default for Entity is MED_CELL and type of Connectivity is MED_NODAL */ @@ -1523,7 +1524,7 @@ medGeometryElement CONNECTIVITY::getElementType(medEntityMesh Entity,int globalN } -ostream & operator<<(ostream &os, CONNECTIVITY &co) +ostream & MEDMEM::operator<<(ostream &os, CONNECTIVITY &co) { os << endl << "------------- Entity = "; switch (co._entity) diff --git a/src/MEDMEM/MEDMEM_Connectivity.hxx b/src/MEDMEM/MEDMEM_Connectivity.hxx index c0ec8c098..9444b2257 100644 --- a/src/MEDMEM/MEDMEM_Connectivity.hxx +++ b/src/MEDMEM/MEDMEM_Connectivity.hxx @@ -9,6 +9,7 @@ using namespace MED_EN; +namespace MEDMEM { class MEDSKYLINEARRAY; class CELLMODEL; class FAMILY; @@ -189,10 +190,12 @@ public: const med_int* getNeighbourhood() const; +}; }; /*----------------------*/ /* Methodes Inline */ /*----------------------*/ +using namespace MEDMEM; /*! Returns the medEntityMesh */ //--------------------------------------------------// diff --git a/src/MEDMEM/MEDMEM_Coordinate.cxx b/src/MEDMEM/MEDMEM_Coordinate.cxx index caae4090b..d968d8ec0 100644 --- a/src/MEDMEM/MEDMEM_Coordinate.cxx +++ b/src/MEDMEM/MEDMEM_Coordinate.cxx @@ -4,6 +4,7 @@ using namespace std; #include "MEDMEM_STRING.hxx" #include "utilities.h" +using namespace MEDMEM; /*! Default Constructor : should not be used */ //----------------------------------------------------------// diff --git a/src/MEDMEM/MEDMEM_Coordinate.hxx b/src/MEDMEM/MEDMEM_Coordinate.hxx index d77b84839..b4d5454df 100644 --- a/src/MEDMEM/MEDMEM_Coordinate.hxx +++ b/src/MEDMEM/MEDMEM_Coordinate.hxx @@ -22,6 +22,7 @@ spaceDimension and numberOfNodes can be found in _coordinate object. */ +namespace MEDMEM { class COORDINATE { @@ -88,5 +89,6 @@ public : const string * getCoordinatesUnits() const; string getCoordinateUnit(int Axis) const; }; +}; #endif /* COORDINATE_HXX */ diff --git a/src/MEDMEM/MEDMEM_DriverTools.cxx b/src/MEDMEM/MEDMEM_DriverTools.cxx index 82451e50d..0c929d513 100644 --- a/src/MEDMEM/MEDMEM_DriverTools.cxx +++ b/src/MEDMEM/MEDMEM_DriverTools.cxx @@ -5,6 +5,7 @@ using namespace std; #include "MEDMEM_Mesh.hxx" #include "MEDMEM_Group.hxx" #include +using namespace MEDMEM; // Cet opérateur permet d'ordonner les mailles dans un set suivant l'ordre requis par MED @@ -66,7 +67,7 @@ return entity; END_OF(LOC); }; -std::ostream& operator << (std::ostream& os, const _maille& ma) +std::ostream& MEDMEM::operator << (std::ostream& os, const _maille& ma) { os << "maille " << ma.ordre << " (" << ma.geometricType << ") : < "; std::vector< std::map::iterator >::const_iterator i=ma.sommets.begin(); @@ -77,7 +78,7 @@ std::ostream& operator << (std::ostream& os, const _maille& ma) return os; } -std::ostream& operator << (std::ostream& os, const _groupe& gr) +std::ostream& MEDMEM::operator << (std::ostream& os, const _groupe& gr) { os << "--- Groupe " << gr.nom << " --- " << std::endl ; os << " -> liste des sous-groupes : "; @@ -89,7 +90,7 @@ std::ostream& operator << (std::ostream& os, const _groupe& gr) return os; } -std::ostream& operator << (std::ostream& os, const _noeud& no) +std::ostream& MEDMEM::operator << (std::ostream& os, const _noeud& no) { os << "noeud " << no.number << " : < "; std::vector::const_iterator i=no.coord.begin(); @@ -100,7 +101,7 @@ std::ostream& operator << (std::ostream& os, const _noeud& no) return os; } -std::ostream& operator << (std::ostream& os, const _intermediateMED& mi) +std::ostream& MEDMEM::operator << (std::ostream& os, const _intermediateMED& mi) { os << "Set des mailles : " << std::endl; for( std::set<_maille>::const_iterator i=mi.maillage.begin(); i!=mi.maillage.end(); ++i) diff --git a/src/MEDMEM/MEDMEM_DriverTools.hxx b/src/MEDMEM/MEDMEM_DriverTools.hxx index 7ea40d0e1..58d6d5a8a 100644 --- a/src/MEDMEM/MEDMEM_DriverTools.hxx +++ b/src/MEDMEM/MEDMEM_DriverTools.hxx @@ -11,11 +11,11 @@ #include #include +namespace MEDMEM { class MESH; class CONNECTIVITY; class COORDINATE; class GROUP; - struct _noeud { mutable int number; @@ -88,4 +88,5 @@ std::ostream& operator << (std::ostream& , const _groupe& ); std::ostream& operator << (std::ostream& , const _noeud& ); std::ostream& operator << (std::ostream& , const _intermediateMED& ); +}; #endif /* DRIVERTOOLS_HXX */ diff --git a/src/MEDMEM/MEDMEM_DriversDef.cxx b/src/MEDMEM/MEDMEM_DriversDef.cxx index da6b09546..2d38da5e8 100644 --- a/src/MEDMEM/MEDMEM_DriversDef.cxx +++ b/src/MEDMEM/MEDMEM_DriversDef.cxx @@ -28,12 +28,12 @@ GEO_NAME::GEO_NAME() : map() assert( table.find( (int)MED_PYRA13 ) != table.end() ) ; } -// GEO_NAME::~GEO_NAME() -// { +GEO_NAME::~GEO_NAME() +{ // MESSAGE(" destructor GEO_NAME::~GEO_NAME() "<< size() ); -// // clear(); +// clear(); // MESSAGE(" end of destructor GEO_NAME::~GEO_NAME() "<< size() ); -// } +} string & GEO_NAME::operator[]( const med_geometrie_element &c ) const { @@ -55,12 +55,12 @@ ENT_NAME::ENT_NAME() : map() table[(int)MED_NOEUD ] = "MED_NOEUD"; } -// ENT_NAME::~ENT_NAME() -// { +ENT_NAME::~ENT_NAME() +{ // MESSAGE(" destructor ENT_NAME::~ENT_NAME() "<< size() ); -// // clear(); +// clear(); // MESSAGE(" end of destructor ENT_NAME::~ENT_NAME() "<< size() ); -// } +} string & ENT_NAME::operator[]( const med_entite_maillage &c ) const { @@ -126,12 +126,12 @@ MESH_ENTITIES::MESH_ENTITIES () : map >() } -// MESH_ENTITIES::~MESH_ENTITIES() -// { +MESH_ENTITIES::~MESH_ENTITIES() +{ // MESSAGE(" destructor MESH_ENTITIES::~MESH_ENTITIES() "<< size() ); -// // clear(); +// clear(); // MESSAGE(" end of destructor MESH_ENTITIES::~MESH_ENTITIES() "<< size() ); -// } +} const list & MESH_ENTITIES::operator[]( const med_entite_maillage &c ) const { diff --git a/src/MEDMEM/MEDMEM_DriversDef.hxx b/src/MEDMEM/MEDMEM_DriversDef.hxx index c26be1766..981f0b7a5 100644 --- a/src/MEDMEM/MEDMEM_DriversDef.hxx +++ b/src/MEDMEM/MEDMEM_DriversDef.hxx @@ -10,8 +10,7 @@ using namespace std ; #include "MEDMEM_define.hxx" #include "utilities.h" -namespace MED_FR -{ +namespace MED_FR { /*! This Class inherits from map. /n It is a constant map association int (which is a med_geometrie_element) and string. /n @@ -28,7 +27,7 @@ class GEO_NAME : public map public : GEO_NAME(); - // ~GEO_NAME(); + ~GEO_NAME(); string & operator[]( const MED_FR::med_geometrie_element &c ) const; } ; @@ -52,7 +51,7 @@ class ENT_NAME : public map public : ENT_NAME (); - // ~ENT_NAME(); + ~ENT_NAME(); string & operator[]( const MED_FR::med_entite_maillage &c ) const; } ; @@ -77,7 +76,7 @@ class MESH_ENTITIES : public map public : MESH_ENTITIES (); - // ~MESH_ENTITIES(); + ~MESH_ENTITIES(); const list & operator[]( const MED_FR::med_entite_maillage &c ) const; private: diff --git a/src/MEDMEM/MEDMEM_Exception.cxx b/src/MEDMEM/MEDMEM_Exception.cxx index bafedca54..ccd7c216a 100644 --- a/src/MEDMEM/MEDMEM_Exception.cxx +++ b/src/MEDMEM/MEDMEM_Exception.cxx @@ -8,6 +8,7 @@ using namespace std; #include "utilities.h" #include "MEDMEM_Exception.hxx" +using namespace MEDMEM; extern "C" { @@ -130,7 +131,7 @@ MEDEXCEPTION::MEDEXCEPTION( const MEDEXCEPTION &ex ): _text(duplicate(ex._text)) Operator << : put the message to the given stream. */ // ------------------------------------------------------- // -ostream & operator<<( ostream &os , const MEDEXCEPTION &ex ) +ostream & MEDMEM::operator<<( ostream &os , const MEDEXCEPTION &ex ) // ------------------------------------------------------- // { os << ex._text ; diff --git a/src/MEDMEM/MEDMEM_Exception.hxx b/src/MEDMEM/MEDMEM_Exception.hxx index e6eb49a4c..43906d2ce 100644 --- a/src/MEDMEM/MEDMEM_Exception.hxx +++ b/src/MEDMEM/MEDMEM_Exception.hxx @@ -21,6 +21,7 @@ using namespace std; Class used to throws exception.\n Inherits from public exception. */ +namespace MEDMEM { //--------------------------------------// class MEDEXCEPTION : public exception //--------------------------------------// @@ -55,5 +56,6 @@ public : ~MED_DRIVER_NOT_FOUND_EXCEPTION() throw(); }; +}; #endif /* MEDEXCEPTION_HXX */ diff --git a/src/MEDMEM/MEDMEM_Family.cxx b/src/MEDMEM/MEDMEM_Family.cxx index 45d647b2f..14da5dd6e 100644 --- a/src/MEDMEM/MEDMEM_Family.cxx +++ b/src/MEDMEM/MEDMEM_Family.cxx @@ -6,6 +6,7 @@ using namespace std; #include "MEDMEM_Mesh.hxx" #include "MEDMEM_Family.hxx" +using namespace MEDMEM; FAMILY::FAMILY():_identifier(0), _numberOfAttribute(0), _attributeIdentifier((int*)NULL),_attributeValue((int*)NULL), _attributeDescription((string*)NULL), @@ -229,7 +230,7 @@ FAMILY & FAMILY::operator=(const FAMILY &fam) return *this; }; -ostream & operator<<(ostream &os, FAMILY &myFamily) +ostream & MEDMEM::operator<<(ostream &os, FAMILY &myFamily) { // how do cast without duplicate ? os << (SUPPORT) myFamily; diff --git a/src/MEDMEM/MEDMEM_Family.hxx b/src/MEDMEM/MEDMEM_Family.hxx index 2be15c6c0..55c442c55 100644 --- a/src/MEDMEM/MEDMEM_Family.hxx +++ b/src/MEDMEM/MEDMEM_Family.hxx @@ -14,7 +14,7 @@ All families on one entity represent a mesh partition for this entity. */ - +namespace MEDMEM { class FAMILY : virtual public SUPPORT { protected : @@ -119,9 +119,10 @@ public: inline string getAttributeDescription(int i) const; inline string getGroupName(int i) const; }; +}; +using namespace MEDMEM; // inline methods : - /*! Sets the attribute _identifier to Identifier. */ //---------------------------------------------- inline void FAMILY::setIdentifier(int Identifier) @@ -261,6 +262,4 @@ inline string FAMILY::getGroupName(int i) const { return _groupName[i-1] ; } - - #endif /* FAMILY_HXX */ diff --git a/src/MEDMEM/MEDMEM_Field.cxx b/src/MEDMEM/MEDMEM_Field.cxx index 7c52fc42f..c36f44dc9 100644 --- a/src/MEDMEM/MEDMEM_Field.cxx +++ b/src/MEDMEM/MEDMEM_Field.cxx @@ -1,5 +1,6 @@ using namespace std; #include "MEDMEM_Field.hxx" +using namespace MEDMEM; // --------------------------------- // FIELD_ : Constructors diff --git a/src/MEDMEM/MEDMEM_Field.hxx b/src/MEDMEM/MEDMEM_Field.hxx index b1127f69d..f086d493a 100644 --- a/src/MEDMEM/MEDMEM_Field.hxx +++ b/src/MEDMEM/MEDMEM_Field.hxx @@ -36,6 +36,7 @@ using namespace MED_EN; */ +namespace MEDMEM { class FIELD_ // GENERIC POINTER TO a template class FIELD { protected: @@ -220,10 +221,12 @@ public: inline med_type_champ getValueType () const; }; +}; // --------------------------------- // Implemented Methods : constructor // --------------------------------- +using namespace MEDMEM; // ----------------- // Methodes Inline @@ -535,6 +538,7 @@ inline void FIELD_::setValueType (const med_type_champ ValueType) */ +namespace MEDMEM { template class FIELD : public FIELD_ { @@ -703,10 +707,12 @@ public: */ void getBarycenter() const throw (MEDEXCEPTION) ; }; +}; // -------------------- // Implemented Methods // -------------------- +using namespace MEDMEM; /*! Constructor with no parameter, most of the attribut members are set to NULL. @@ -719,7 +725,7 @@ template FIELD::FIELD(): /*! Constructor with parameters such that all attrribut are set but the _value - attrribut is allocated but not set. + attribut is allocated but not set. */ template FIELD::FIELD(const SUPPORT * Support, const int NumberOfComponents, const medModeSwitch Mode) throw (MEDEXCEPTION) : diff --git a/src/MEDMEM/MEDMEM_GenDriver.cxx b/src/MEDMEM/MEDMEM_GenDriver.cxx index 1545acf2b..e99ec8af4 100644 --- a/src/MEDMEM/MEDMEM_GenDriver.cxx +++ b/src/MEDMEM/MEDMEM_GenDriver.cxx @@ -2,6 +2,7 @@ using namespace std; #include "MEDMEM_GenDriver.hxx" #include "MEDMEM_STRING.hxx" #include "MEDMEM_Exception.hxx" +using namespace MEDMEM; GENDRIVER::GENDRIVER(): _id(MED_INVALID), _fileName(""), @@ -28,11 +29,11 @@ GENDRIVER::GENDRIVER(const GENDRIVER & genDriver): GENDRIVER::~GENDRIVER() {} -GENDRIVER & GENDRIVER::operator=(const GENDRIVER & genDriver) { +GENDRIVER & MEDMEM::GENDRIVER::operator=(const GENDRIVER & genDriver) +{ const char * LOC = " GENDRIVER & GENDRIVER::operator=(const GENDRIVER & genDriver) : "; BEGIN_OF(LOC); - _fileName = genDriver._fileName; _accessMode = genDriver._accessMode; _status = genDriver._status; @@ -109,7 +110,7 @@ med_mode_acces GENDRIVER::getAccessMode() const { END_OF(LOC); } -ostream & operator<<(ostream &os,const GENDRIVER & drv) +ostream & MEDMEM::operator<<(ostream &os,const GENDRIVER & drv) { switch (drv._accessMode) { @@ -139,7 +140,7 @@ ostream & operator<<(ostream &os,const GENDRIVER & drv) } // Test if this driver has been created from MED driver -bool GENDRIVER::operator ==(const GENDRIVER &genDriver) const { +bool MEDMEM::GENDRIVER::operator ==(const GENDRIVER &genDriver) const { const char * LOC = "bool GENDRIVER::operator ==(const GENDRIVER &genDriver) const : "; diff --git a/src/MEDMEM/MEDMEM_GenDriver.hxx b/src/MEDMEM/MEDMEM_GenDriver.hxx index 0fcdeda65..3f95c40f6 100644 --- a/src/MEDMEM/MEDMEM_GenDriver.hxx +++ b/src/MEDMEM/MEDMEM_GenDriver.hxx @@ -8,8 +8,6 @@ /* Generic Read/Write Driver Class for Meshes & Fields */ -/* Modify the following line to add a new driver type (step 1) */ -typedef enum { MED_DRIVER = 0, GIBI_DRIVER = 1, VTK_DRIVER = 254, NO_DRIVER = 255 } driverTypes; using namespace MED_EN; using namespace std; @@ -19,7 +17,10 @@ using namespace std; Virtual class GENDRIVER use by all driver. */ +namespace MEDMEM { +/* Modify the following line to add a new driver type (step 1) */ +typedef enum { MED_DRIVER = 0, GIBI_DRIVER = 1, VTK_DRIVER = 254, NO_DRIVER = 255 } driverTypes; class GENDRIVER { protected : @@ -107,6 +108,7 @@ public: void setFileName ( const string & fileName); med_mode_acces getAccessMode() const; }; +}; #endif /* GENDRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx b/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx index 0de7ab1a8..7c6c4e4ab 100644 --- a/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx +++ b/src/MEDMEM/MEDMEM_GibiMeshDriver.cxx @@ -17,6 +17,7 @@ using namespace std; ///// using namespace MED_EN; +using namespace MEDMEM; ///// diff --git a/src/MEDMEM/MEDMEM_GibiMeshDriver.hxx b/src/MEDMEM/MEDMEM_GibiMeshDriver.hxx index bc25416b9..4d8148a91 100644 --- a/src/MEDMEM/MEDMEM_GibiMeshDriver.hxx +++ b/src/MEDMEM/MEDMEM_GibiMeshDriver.hxx @@ -17,11 +17,6 @@ #include ///// -class MESH; -class FAMILY; -class GROUP; -class CONNECTIVITY; - /*! Driver GIBI for MESH. @@ -30,7 +25,11 @@ class CONNECTIVITY; */ - +namespace MEDMEM { +class MESH; +class FAMILY; +class GROUP; +class CONNECTIVITY; class GIBI_MESH_DRIVER : public GENDRIVER { protected: @@ -227,6 +226,7 @@ private: GENDRIVER * copy(void) const ; }; +}; #endif /* GIBI_MESH_DRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_Grid.cxx b/src/MEDMEM/MEDMEM_Grid.cxx index d6f2d6b6a..1aa63e7b9 100644 --- a/src/MEDMEM/MEDMEM_Grid.cxx +++ b/src/MEDMEM/MEDMEM_Grid.cxx @@ -13,6 +13,7 @@ using namespace std; #include "MEDMEM_Grid.hxx" #include #include +using namespace MEDMEM; //======================================================================= //function : GRID diff --git a/src/MEDMEM/MEDMEM_Grid.hxx b/src/MEDMEM/MEDMEM_Grid.hxx index 4c19f2149..d39659b9b 100644 --- a/src/MEDMEM/MEDMEM_Grid.hxx +++ b/src/MEDMEM/MEDMEM_Grid.hxx @@ -15,6 +15,7 @@ // class containing structured mesh data +namespace MEDMEM { class GRID: public MESH { protected: @@ -249,6 +250,8 @@ class GRID: public MESH friend class MED_MESH_WRONLY_DRIVER; }; +}; +using namespace MEDMEM; //----------------------------------// diff --git a/src/MEDMEM/MEDMEM_Group.cxx b/src/MEDMEM/MEDMEM_Group.cxx index b59d981a5..0d7abc27c 100644 --- a/src/MEDMEM/MEDMEM_Group.cxx +++ b/src/MEDMEM/MEDMEM_Group.cxx @@ -7,6 +7,7 @@ using namespace std; #include "MEDMEM_Group.hxx" #include "MEDMEM_Family.hxx" +using namespace MEDMEM; GROUP::GROUP():_numberOfFamilies(0),_family() { @@ -26,7 +27,7 @@ GROUP & GROUP::operator=(const GROUP &group) return *this; }; -ostream & operator<<(ostream &os, GROUP &myGroup) +ostream & MEDMEM::operator<<(ostream &os, GROUP &myGroup) { os << (SUPPORT) myGroup; @@ -107,7 +108,7 @@ GROUP::GROUP(const string & name, const list & families) throw (MEDEXCE it++ ; } - MESSAGE(LOC<<"Printing of the object GROUP built "<< *this); + MESSAGE(LOC<<"Printing of the object GROUP built "<< (GROUP)*this); END_OF(LOC); }; diff --git a/src/MEDMEM/MEDMEM_Group.hxx b/src/MEDMEM/MEDMEM_Group.hxx index 46e3ab9ef..f0cde2141 100644 --- a/src/MEDMEM/MEDMEM_Group.hxx +++ b/src/MEDMEM/MEDMEM_Group.hxx @@ -8,10 +8,8 @@ #include #include -//#include "MEDMEM_Support.hxx" #include "MEDMEM_Family.hxx" -class FAMILY; /*! @@ -21,6 +19,8 @@ class FAMILY; */ +namespace MEDMEM { +class FAMILY; class GROUP : virtual public SUPPORT { protected : @@ -63,8 +63,10 @@ public: inline FAMILY * getFamily(int i) const ; }; +}; // inline method : +using namespace MEDMEM; /*! set the attribut _numberOfFamilies to numberOfFamilies */ //---------------------------------------------------------- diff --git a/src/MEDMEM/MEDMEM_InterpolationWrappers.hxx b/src/MEDMEM/MEDMEM_InterpolationWrappers.hxx index 766994fed..6f5462768 100644 --- a/src/MEDMEM/MEDMEM_InterpolationWrappers.hxx +++ b/src/MEDMEM/MEDMEM_InterpolationWrappers.hxx @@ -4,6 +4,7 @@ // les classes de wrapping +namespace MEDMEM { template class Wrapper_Noeud { protected : @@ -71,5 +72,6 @@ template class Wrapper_Nuage } int size() const {return nbr_noeuds;} }; +}; #endif diff --git a/src/MEDMEM/MEDMEM_Med.cxx b/src/MEDMEM/MEDMEM_Med.cxx index 31821b8cc..1ba0f9ba5 100644 --- a/src/MEDMEM/MEDMEM_Med.cxx +++ b/src/MEDMEM/MEDMEM_Med.cxx @@ -11,6 +11,7 @@ using namespace std; # include "MEDMEM_Exception.hxx" # include "utilities.h" +using namespace MEDMEM; /*! Constructor. diff --git a/src/MEDMEM/MEDMEM_Med.hxx b/src/MEDMEM/MEDMEM_Med.hxx index 137120ae3..adf96c1b6 100644 --- a/src/MEDMEM/MEDMEM_Med.hxx +++ b/src/MEDMEM/MEDMEM_Med.hxx @@ -15,9 +15,10 @@ # include "MEDMEM_VtkMedDriver.hxx" # include "MEDMEM_Exception.hxx" -//using namespace MED_EN; +using namespace MED_EN; +namespace MEDMEM { class MESH; class FIELD_; class SUPPORT ; @@ -144,6 +145,7 @@ public: //friend ostream & operator<<(ostream &os,const MED & med); }; +}; #endif diff --git a/src/MEDMEM/MEDMEM_MedFieldDriver.hxx b/src/MEDMEM/MEDMEM_MedFieldDriver.hxx index 490fd4b56..a95deb874 100644 --- a/src/MEDMEM/MEDMEM_MedFieldDriver.hxx +++ b/src/MEDMEM/MEDMEM_MedFieldDriver.hxx @@ -18,6 +18,7 @@ //using namespace MED_FR ; +namespace MEDMEM { template class FIELD; // A QD LA CLASSE MED_ALL_ELEMENTS_DRIVER.... :) pour mutualiser le open ..... avec led _medIdt... @@ -305,12 +306,14 @@ private: GENDRIVER * copy( void ) const ; }; +} /*-------------------------*/ /* template implementation */ /*-------------------------*/ +using namespace MEDMEM; /*--------------------- DRIVER PART -------------------------------*/ template void MED_FIELD_DRIVER::setFieldName(const string & fieldName) @@ -795,7 +798,6 @@ template void MED_FIELD_RDWR_DRIVER::read (void) MED_FIELD_RDONLY_DRIVER::read(); END_OF("MED_FIELD_RDWR_DRIVER::read(void)"); } - /*-----------------------------------------------------------------*/ #endif /* MED_FIELD_DRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_MedMedDriver.cxx b/src/MEDMEM/MEDMEM_MedMedDriver.cxx index fe58c36c6..c07475635 100644 --- a/src/MEDMEM/MEDMEM_MedMedDriver.cxx +++ b/src/MEDMEM/MEDMEM_MedMedDriver.cxx @@ -15,6 +15,7 @@ using namespace std; # include "MEDMEM_define.hxx" using namespace MED_FR; +using namespace MEDMEM; MED_MED_DRIVER::MED_MED_DRIVER(): GENDRIVER(), _ptrMed((MED * const)MED_NULL),_medIdt(MED_INVALID) diff --git a/src/MEDMEM/MEDMEM_MedMedDriver.hxx b/src/MEDMEM/MEDMEM_MedMedDriver.hxx index 0b401b81d..579e36330 100644 --- a/src/MEDMEM/MEDMEM_MedMedDriver.hxx +++ b/src/MEDMEM/MEDMEM_MedMedDriver.hxx @@ -5,17 +5,9 @@ #include "MEDMEM_STRING.hxx" #include "utilities.h" #include "MEDMEM_Exception.hxx" - #include "MEDMEM_GenDriver.hxx" - #include "MEDMEM_define.hxx" -//using namaspace MED_FR ; - -class MESH; -class FIELD_; -class MED; - /*! Driver Med for MED. @@ -25,6 +17,11 @@ class MED; */ // This driver pilots within a MED class read/write accesses of fields/meshes +namespace MEDMEM { +class MESH; +class FIELD_; +class MED; + class MED_MED_DRIVER : public GENDRIVER { protected: @@ -238,5 +235,6 @@ private: virtual GENDRIVER * copy ( void ) const ; }; +}; #endif /* MED_MED_DRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver.cxx b/src/MEDMEM/MEDMEM_MedMeshDriver.cxx index 1c5e9e232..7ac848673 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver.cxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver.cxx @@ -11,6 +11,7 @@ using namespace std; #include "MEDMEM_CellModel.hxx" #include "MEDMEM_Grid.hxx" +using namespace MEDMEM; extern "C" { extern med_idt _MEDdatagroupOuvrir(med_idt pid, char *nom); extern med_err _MEDdatagroupFermer(med_idt id); diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver.hxx b/src/MEDMEM/MEDMEM_MedMeshDriver.hxx index 9762d263c..348a3337c 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver.hxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver.hxx @@ -10,11 +10,6 @@ #include "MEDMEM_Exception.hxx" #include "utilities.h" -class MESH; -class FAMILY; -class GROUP; -class CONNECTIVITY; - /*! Driver Med for MESH. @@ -23,6 +18,11 @@ class CONNECTIVITY; */ +namespace MEDMEM { +class MESH; +class FAMILY; +class GROUP; +class CONNECTIVITY; class MED_MESH_DRIVER : public GENDRIVER { protected: @@ -232,5 +232,6 @@ private: GENDRIVER * copy(void) const ; }; +}; #endif /* MED_MESH_DRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_Mesh.cxx b/src/MEDMEM/MEDMEM_Mesh.cxx index 93d7cfc59..c635c30be 100644 --- a/src/MEDMEM/MEDMEM_Mesh.cxx +++ b/src/MEDMEM/MEDMEM_Mesh.cxx @@ -19,6 +19,7 @@ using namespace std; #include "MEDMEM_Coordinate.hxx" #include "MEDMEM_Connectivity.hxx" #include "MEDMEM_CellModel.hxx" +using namespace MEDMEM; //#include "MEDMEM_Grid.hxx" this inclision should have never be here !!! //update Families with content list @@ -398,7 +399,7 @@ MESH::MESH(driverTypes driverType, const string & fileName/*=""*/, const string // return N; // } -ostream & operator<<(ostream &os, const MESH &myMesh) +ostream & MEDMEM::operator<<(ostream &os, const MESH &myMesh) { int spacedimension = myMesh.getSpaceDimension(); int meshdimension = myMesh.getMeshDimension(); diff --git a/src/MEDMEM/MEDMEM_Mesh.hxx b/src/MEDMEM/MEDMEM_Mesh.hxx index ac8954cee..2179a54c4 100644 --- a/src/MEDMEM/MEDMEM_Mesh.hxx +++ b/src/MEDMEM/MEDMEM_Mesh.hxx @@ -20,12 +20,7 @@ #include "MEDMEM_VtkMeshDriver.hxx" -class CELLMODEL; -class FAMILY; -class GROUP; -class SUPPORT; -template class FIELD; //class GENDRIVER; //class MED_MESH_RDONLY_DRIVER; @@ -46,6 +41,14 @@ using namespace MED_EN; */ +namespace MEDMEM { + +template class FIELD; + +class CELLMODEL; +class FAMILY; +class GROUP; +class SUPPORT; class MESH { @@ -264,7 +267,9 @@ public : */ SUPPORT * intersectSupports(const vector Supports) const throw (MEDEXCEPTION) ; }; +}; +using namespace MEDMEM; // --------------------------------------- // Methodes Inline // --------------------------------------- @@ -669,7 +674,7 @@ inline int MESH::getNumberOfGroups (medEntityMesh entity) const throw MEDEXCEPTION("MESH::getNumberOfGroups : Unknown entity"); } } -const vector MESH::getFamilies(medEntityMesh entity) const +const vector MESH::getFamilies(medEntityMesh entity) const { switch (entity) { case MED_NODE : @@ -701,7 +706,7 @@ const vector MESH::getGroups(medEntityMesh entity) const } } -const FAMILY* MESH::getFamily(medEntityMesh entity, int i) const +const MEDMEM::FAMILY* MESH::getFamily(medEntityMesh entity, int i) const { if (i<=0) throw MEDEXCEPTION("MESH::getFamily(i) : argument i must be > 0"); diff --git a/src/MEDMEM/MEDMEM_Meshing.cxx b/src/MEDMEM/MEDMEM_Meshing.cxx index 2f90a5df3..0291fcc97 100644 --- a/src/MEDMEM/MEDMEM_Meshing.cxx +++ b/src/MEDMEM/MEDMEM_Meshing.cxx @@ -13,6 +13,7 @@ using namespace std; #include "MEDMEM_Meshing.hxx" #include "MEDMEM_Group.hxx" +using namespace MEDMEM; /*! Create an empty MESH. */ MESHING::MESHING(): MESH() diff --git a/src/MEDMEM/MEDMEM_Meshing.hxx b/src/MEDMEM/MEDMEM_Meshing.hxx index cb68c5466..164ed112c 100644 --- a/src/MEDMEM/MEDMEM_Meshing.hxx +++ b/src/MEDMEM/MEDMEM_Meshing.hxx @@ -14,6 +14,7 @@ using namespace MED_EN; This class MESHING is a special class to set a MESH object. */ +namespace MEDMEM { class MESHING: public MESH { public : @@ -63,5 +64,6 @@ public : void addGroup (const GROUP & Group) throw (MEDEXCEPTION) ; }; +}; #endif /* MESHING_HXX */ diff --git a/src/MEDMEM/MEDMEM_ModulusArray.hxx b/src/MEDMEM/MEDMEM_ModulusArray.hxx index 956c1d69c..706324b60 100644 --- a/src/MEDMEM/MEDMEM_ModulusArray.hxx +++ b/src/MEDMEM/MEDMEM_ModulusArray.hxx @@ -11,7 +11,7 @@ they are the same (positive or negative cycle) ! */ - +namespace MEDMEM { class MEDMODULUSARRAY { private: int _length ; @@ -26,6 +26,8 @@ public: int compare(const MEDMODULUSARRAY &modulusArray) const; }; +}; +using namespace MEDMEM; MEDMODULUSARRAY::MEDMODULUSARRAY(int length, const int * array) : _length(length), _array(array) diff --git a/src/MEDMEM/MEDMEM_PointerOf.hxx b/src/MEDMEM/MEDMEM_PointerOf.hxx index 1b7b6ede2..be3201043 100644 --- a/src/MEDMEM/MEDMEM_PointerOf.hxx +++ b/src/MEDMEM/MEDMEM_PointerOf.hxx @@ -13,6 +13,7 @@ In these cases, memory will be desallocated at object destruction. In all other cases, the desallocator will only nullify pointers. */ +namespace MEDMEM { template class PointerOf { @@ -37,6 +38,7 @@ public : void set( const int &size, const T *pointer ) ; PointerOf& operator=( const PointerOf &pointer ) ; } ; +} ; // ------------------------------------------------------------ // // // @@ -44,6 +46,7 @@ public : // // // ------------------------------------------------------------ // +using namespace MEDMEM; /*! Creates a null T* pointer and sets the boolean (for desallocation) to false. */ template PointerOf::PointerOf() : _pointer(0), _done(false) diff --git a/src/MEDMEM/MEDMEM_STRING.hxx b/src/MEDMEM/MEDMEM_STRING.hxx index fde1ee095..3965a6527 100644 --- a/src/MEDMEM/MEDMEM_STRING.hxx +++ b/src/MEDMEM/MEDMEM_STRING.hxx @@ -14,6 +14,7 @@ using namespace std; msgErr << "This Object cannot be instanciated by now ! Try "<< 11 << "times just to see what happens "; throw SALOME_EXCEPTION (LOCALIZED(msgErr)) ; */ +namespace MEDMEM { class STRING : public string { @@ -65,5 +66,6 @@ public : } } ; +} ; # endif diff --git a/src/MEDMEM/MEDMEM_SkyLineArray.cxx b/src/MEDMEM/MEDMEM_SkyLineArray.cxx index 13f24e3be..00cf6fac4 100644 --- a/src/MEDMEM/MEDMEM_SkyLineArray.cxx +++ b/src/MEDMEM/MEDMEM_SkyLineArray.cxx @@ -1,6 +1,7 @@ using namespace std; #include "MEDMEM_SkyLineArray.hxx" #include "utilities.h" +using namespace MEDMEM; MEDSKYLINEARRAY::MEDSKYLINEARRAY(): _count(0), _length(0), _index((med_int*)NULL),_value((med_int*)NULL) diff --git a/src/MEDMEM/MEDMEM_SkyLineArray.hxx b/src/MEDMEM/MEDMEM_SkyLineArray.hxx index 5440f6fdf..c2e822af3 100644 --- a/src/MEDMEM/MEDMEM_SkyLineArray.hxx +++ b/src/MEDMEM/MEDMEM_SkyLineArray.hxx @@ -6,8 +6,9 @@ #include "MEDMEM_PointerOf.hxx" #include "MEDMEM_define.hxx" -using MED_EN::med_int ; +using MED_EN::med_int; +namespace MEDMEM { class MEDSKYLINEARRAY { private : @@ -41,8 +42,9 @@ public : inline void setIJ(med_int i, med_int j, med_int value) throw (MEDEXCEPTION) ; inline void setIndexValue(med_int i, med_int value) throw (MEDEXCEPTION) ; -} ; - +}; +} +using namespace MEDMEM; // --------------------------------------- // Methodes Inline // --------------------------------------- @@ -140,5 +142,4 @@ inline void MEDSKYLINEARRAY::setIndexValue(med_int i, med_int value) throw (MEDE throw MEDEXCEPTION("MEDSKYLINEARRAY::setIndexValue : argument is out of range") ; _value[i-1]=value ; } - # endif diff --git a/src/MEDMEM/MEDMEM_Support.cxx b/src/MEDMEM/MEDMEM_Support.cxx index 0cdfe0192..6b9c0d759 100644 --- a/src/MEDMEM/MEDMEM_Support.cxx +++ b/src/MEDMEM/MEDMEM_Support.cxx @@ -17,6 +17,7 @@ using namespace std; #include "MEDMEM_Mesh.hxx" using namespace MED_EN; +using namespace MEDMEM; /* This class is a generic class for family and group */ @@ -136,7 +137,7 @@ SUPPORT::~SUPPORT() operator <<. */ //-------------------------------------------------- -ostream & operator<<(ostream &os, const SUPPORT &my) +ostream & MEDMEM::operator<<(ostream &os, const SUPPORT &my) //-------------------------------------------------- { os << "Name : "<< my.getName() << endl ; diff --git a/src/MEDMEM/MEDMEM_Support.hxx b/src/MEDMEM/MEDMEM_Support.hxx index 378df16d8..be8fa933b 100644 --- a/src/MEDMEM/MEDMEM_Support.hxx +++ b/src/MEDMEM/MEDMEM_Support.hxx @@ -13,13 +13,11 @@ #include "MEDMEM_STRING.hxx" #include "MEDMEM_Exception.hxx" #include "MEDMEM_define.hxx" - #include "MEDMEM_SkyLineArray.hxx" -//#include "MEDMEM_Mesh.hxx" using namespace MED_EN; +using namespace MEDMEM; -class MESH ; /*! @@ -30,6 +28,8 @@ class MESH ; */ +namespace MEDMEM { +class MESH ; class SUPPORT { protected: @@ -194,10 +194,12 @@ public: void intersecting(SUPPORT * mySupport) throw (MEDEXCEPTION) ; }; +}; // _____________________ // Methodes Inline // _____________________ +using namespace MEDMEM; /*! This method returns the number of all elements of the type GeometricType. diff --git a/src/MEDMEM/MEDMEM_TypeMeshDriver.cxx b/src/MEDMEM/MEDMEM_TypeMeshDriver.cxx index 721d61692..d290d76f9 100644 --- a/src/MEDMEM/MEDMEM_TypeMeshDriver.cxx +++ b/src/MEDMEM/MEDMEM_TypeMeshDriver.cxx @@ -1,5 +1,6 @@ -#include "MEDMEM_TypeMeshDriver.hxx" +using namespace std; +#include "MEDMEM_TypeMeshDriver.hxx" #include "MEDMEM_DriversDef.hxx" #include "MEDMEM_Family.hxx" @@ -8,6 +9,7 @@ #include "MEDMEM_Connectivity.hxx" #include "MEDMEM_Mesh.hxx" #include "MEDMEM_CellModel.hxx" +using namespace MEDMEM; // Every memory allocation made in the MedDriver members function are desallocated in the Mesh destructor diff --git a/src/MEDMEM/MEDMEM_TypeMeshDriver.hxx b/src/MEDMEM/MEDMEM_TypeMeshDriver.hxx index 1354d3ef3..c729dac00 100644 --- a/src/MEDMEM/MEDMEM_TypeMeshDriver.hxx +++ b/src/MEDMEM/MEDMEM_TypeMeshDriver.hxx @@ -11,10 +11,7 @@ #include "MEDMEM_Exception.hxx" #include "utilities.h" -class MESH; -class FAMILY; -class GROUP; -class CONNECTIVITY; +using namesapce MEDMEM; /*! @@ -25,6 +22,11 @@ class CONNECTIVITY; */ +namespace MEDMEM { +class MESH; +class FAMILY; +class GROUP; +class CONNECTIVITY; class TYPE_MESH_DRIVER : public GENDRIVER { protected: @@ -204,6 +206,7 @@ private: GENDRIVER * copy(void) const ; }; +}; #endif /* TYPE_MESH_DRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_Unit.cxx b/src/MEDMEM/MEDMEM_Unit.cxx index 8648722bb..accea0a21 100644 --- a/src/MEDMEM/MEDMEM_Unit.cxx +++ b/src/MEDMEM/MEDMEM_Unit.cxx @@ -5,6 +5,7 @@ using namespace std; */ #include "MEDMEM_Unit.hxx" +using namespace MEDMEM; UNIT::UNIT():_name(""),_description(""),_masse(0),_length(0),_time(0),_temperature(0),_matterQuantity(0),_currentStrength(0),_lightIntensity(0) { MESSAGE("UNIT()"); diff --git a/src/MEDMEM/MEDMEM_Unit.hxx b/src/MEDMEM/MEDMEM_Unit.hxx index 81a24f860..924273da1 100644 --- a/src/MEDMEM/MEDMEM_Unit.hxx +++ b/src/MEDMEM/MEDMEM_Unit.hxx @@ -13,6 +13,7 @@ #include "MEDMEM_define.hxx" //using namespace MED_EN; +namespace MEDMEM { class UNIT { protected: string _name ; @@ -58,9 +59,11 @@ public: inline int getLightIntensity() const ; } ; +} ; // inline method : +using namespace MEDMEM; inline void UNIT::setName(string Name) { _name = Name ; }; diff --git a/src/MEDMEM/MEDMEM_Utilities.hxx b/src/MEDMEM/MEDMEM_Utilities.hxx index 8c281321d..b7d76b620 100644 --- a/src/MEDMEM/MEDMEM_Utilities.hxx +++ b/src/MEDMEM/MEDMEM_Utilities.hxx @@ -1,81 +1,86 @@ -#ifdef _SALOME - -# include - -#else - -# include -# include -using namespace std; - -/* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */ - -# define HEREWEARE {cout< + +#else + +#ifndef __MEDMEM_UTILITIES +#define __MEDMEM_UTILITIES + +# include +# include +using namespace std; + +/* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */ + +# define HEREWEARE {cout< class FIELD; /*! @@ -29,6 +28,8 @@ template class FIELD; */ +namespace MEDMEM { +template class FIELD; template class VTK_FIELD_DRIVER : public GENDRIVER { protected: @@ -262,6 +263,7 @@ private: GENDRIVER * copy ( void ) const ; }; +}; /*-------------------------*/ /* template implementation */ @@ -269,6 +271,7 @@ private: /*--------------------- DRIVER PART -------------------------------*/ +using namespace MEDMEM; template void VTK_FIELD_DRIVER::setFieldName(const string & fieldName) { _fieldName = fieldName; diff --git a/src/MEDMEM/MEDMEM_VtkMedDriver.cxx b/src/MEDMEM/MEDMEM_VtkMedDriver.cxx index 78e3e982b..4fa27bae7 100644 --- a/src/MEDMEM/MEDMEM_VtkMedDriver.cxx +++ b/src/MEDMEM/MEDMEM_VtkMedDriver.cxx @@ -9,6 +9,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Mesh.hxx" #include "MEDMEM_CellModel.hxx" +using namespace MEDMEM; VTK_MED_DRIVER::VTK_MED_DRIVER(): GENDRIVER(), _ptrMed((MED * const)MED_NULL) diff --git a/src/MEDMEM/MEDMEM_VtkMedDriver.hxx b/src/MEDMEM/MEDMEM_VtkMedDriver.hxx index 72ee1d0a7..a3bd2fbfa 100644 --- a/src/MEDMEM/MEDMEM_VtkMedDriver.hxx +++ b/src/MEDMEM/MEDMEM_VtkMedDriver.hxx @@ -12,11 +12,12 @@ using namespace std ; + +namespace MEDMEM { class MESH; class SUPPORT; class FIELD_; class MED; - // This driver pilots within a VTK class read/write accesses of fields/meshes class VTK_MED_DRIVER : public GENDRIVER { @@ -55,6 +56,7 @@ private : void writeField(FIELD_ * myField,string name) const ; }; +}; #endif /* VTK_MED_DRIVER_HXX */ diff --git a/src/MEDMEM/MEDMEM_VtkMeshDriver.cxx b/src/MEDMEM/MEDMEM_VtkMeshDriver.cxx index b991bcd10..258aac37c 100644 --- a/src/MEDMEM/MEDMEM_VtkMeshDriver.cxx +++ b/src/MEDMEM/MEDMEM_VtkMeshDriver.cxx @@ -12,6 +12,7 @@ using namespace std; #include "MEDMEM_Grid.hxx" #include +using namespace MEDMEM; VTK_MESH_DRIVER::VTK_MESH_DRIVER(): GENDRIVER(), _ptrMesh((MESH * const)MED_NULL) diff --git a/src/MEDMEM/MEDMEM_VtkMeshDriver.hxx b/src/MEDMEM/MEDMEM_VtkMeshDriver.hxx index dd795f46c..033e5dc3b 100644 --- a/src/MEDMEM/MEDMEM_VtkMeshDriver.hxx +++ b/src/MEDMEM/MEDMEM_VtkMeshDriver.hxx @@ -12,10 +12,6 @@ #include -class MESH; -class FAMILY; -class GROUP; -class CONNECTIVITY; /*! @@ -24,6 +20,11 @@ class CONNECTIVITY; Generic part : implement open and close methods. */ +namespace MEDMEM { +class MESH; +class FAMILY; +class GROUP; +class CONNECTIVITY; class VTK_MESH_DRIVER : public GENDRIVER { protected: @@ -76,5 +77,6 @@ private: GENDRIVER * copy ( void ) const; }; +}; #endif /* VTK_MESH_DRIVER_HXX */ diff --git a/src/MEDMEM/Makefile.in b/src/MEDMEM/Makefile.in index 99295e104..c8718cb8b 100644 --- a/src/MEDMEM/Makefile.in +++ b/src/MEDMEM/Makefile.in @@ -112,10 +112,18 @@ CPPFLAGS+=$(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS+=-ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome +LDFLAGSFORBIN+=$(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome + +LIBSFORBIN= + +LDFLAGS= + +LIBS= + # build create_mesh : bin: create_mesh create_mesh_c2q4s2 create_mesh_c3h8q4 create_mesh_c3h8q4_wrong create_mesh_c2q4s2_wrong create_grid create_mesh_c2q4 create_mesh_c3h8 -create_mesh create_mesh_c2q4s2 create_mesh_c3h8q4 create_grid create_mesh_c2q4 create_mesh_c3h8: %: %.c - $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(MED2_LIBS) $(HDF5_LIBS) $(LDFLAGS) $< +create_mesh create_mesh_c2q4s2 create_mesh_c3h8q4 create_grid create_mesh_c2q4 create_mesh_c3h8 create_mesh_c3h8q4_wrong create_mesh_c2q4s2_wrong: %: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(MED2_LIBS) $(HDF5_LIBS) $< @CONCLUDE@ diff --git a/src/MEDMEM/duplicateMED.cxx b/src/MEDMEM/duplicateMED.cxx index 75a3e23e9..4bfe99192 100644 --- a/src/MEDMEM/duplicateMED.cxx +++ b/src/MEDMEM/duplicateMED.cxx @@ -4,6 +4,7 @@ using namespace std; #include "MEDMEM_Exception.hxx" #include "MEDMEM_Med.hxx" +using namespace MEDMEM; void usage(char * name) { cout << " " << name << " " < " <y)?x:y;} diff --git a/src/MEDMEM/test_MEDMEM_Array.cxx b/src/MEDMEM/test_MEDMEM_Array.cxx index be5040b3e..e030a8623 100644 --- a/src/MEDMEM/test_MEDMEM_Array.cxx +++ b/src/MEDMEM/test_MEDMEM_Array.cxx @@ -2,6 +2,7 @@ using namespace std; #include "utilities.h" #include "MEDMEM_Array.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { int SpaceDimension = 3 ; diff --git a/src/MEDMEM/test_MEDMEM_CellModel.cxx b/src/MEDMEM/test_MEDMEM_CellModel.cxx index c125aed14..695be92a9 100644 --- a/src/MEDMEM/test_MEDMEM_CellModel.cxx +++ b/src/MEDMEM/test_MEDMEM_CellModel.cxx @@ -3,6 +3,7 @@ using namespace std; #include "MEDMEM_CellModel.hxx" #include "MEDMEM_DriversDef.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { list geomList = MED_FR::meshEntities[MED_FR::MED_MAILLE] ; list::iterator itGeomList ; diff --git a/src/MEDMEM/test_MEDMEM_Meshing.cxx b/src/MEDMEM/test_MEDMEM_Meshing.cxx index feea08dea..df7346404 100644 --- a/src/MEDMEM/test_MEDMEM_Meshing.cxx +++ b/src/MEDMEM/test_MEDMEM_Meshing.cxx @@ -3,6 +3,7 @@ #include "MEDMEM_Field.hxx" using namespace std; +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/test_MEDMEM_ModulusArray.cxx b/src/MEDMEM/test_MEDMEM_ModulusArray.cxx index 97f6bf302..d7103e87c 100644 --- a/src/MEDMEM/test_MEDMEM_ModulusArray.cxx +++ b/src/MEDMEM/test_MEDMEM_ModulusArray.cxx @@ -2,6 +2,7 @@ using namespace std; #include "utilities.h" #include "MEDMEM_ModulusArray.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx b/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx index 6d7dc268e..a03100fd1 100644 --- a/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx +++ b/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx @@ -1,6 +1,7 @@ using namespace std; #include "utilities.h" #include "MEDMEM_SkyLineArray.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/test_affect_medarray.cxx b/src/MEDMEM/test_affect_medarray.cxx index eb72d86d3..055fff524 100644 --- a/src/MEDMEM/test_affect_medarray.cxx +++ b/src/MEDMEM/test_affect_medarray.cxx @@ -17,6 +17,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_medarray(MEDARRAY & myMedArray) diff --git a/src/MEDMEM/test_copie_connectivity.cxx b/src/MEDMEM/test_copie_connectivity.cxx index 962de0640..e27c3e2a3 100644 --- a/src/MEDMEM/test_copie_connectivity.cxx +++ b/src/MEDMEM/test_copie_connectivity.cxx @@ -17,6 +17,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_connectivity(const CONNECTIVITY * myConnectivity, MESH * myMesh) { diff --git a/src/MEDMEM/test_copie_coordinate.cxx b/src/MEDMEM/test_copie_coordinate.cxx index 4a40c89df..612b023bd 100644 --- a/src/MEDMEM/test_copie_coordinate.cxx +++ b/src/MEDMEM/test_copie_coordinate.cxx @@ -17,6 +17,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_tableau(const double * myArray, int nb_lignes, int nb_colonnes) diff --git a/src/MEDMEM/test_copie_family.cxx b/src/MEDMEM/test_copie_family.cxx index 34633dc27..4c825af0e 100644 --- a/src/MEDMEM/test_copie_family.cxx +++ b/src/MEDMEM/test_copie_family.cxx @@ -15,6 +15,7 @@ using namespace std; #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_support(const SUPPORT * mySupport) { diff --git a/src/MEDMEM/test_copie_fieldT.cxx b/src/MEDMEM/test_copie_fieldT.cxx index fc9ad2142..21faeeede 100644 --- a/src/MEDMEM/test_copie_fieldT.cxx +++ b/src/MEDMEM/test_copie_fieldT.cxx @@ -17,6 +17,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_field_(FIELD_ * myField, const SUPPORT * mySupport) diff --git a/src/MEDMEM/test_copie_field_.cxx b/src/MEDMEM/test_copie_field_.cxx index 0598a26b1..13f3054f9 100644 --- a/src/MEDMEM/test_copie_field_.cxx +++ b/src/MEDMEM/test_copie_field_.cxx @@ -16,6 +16,7 @@ #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_field(FIELD_ * myField, const SUPPORT * mySupport) diff --git a/src/MEDMEM/test_copie_group.cxx b/src/MEDMEM/test_copie_group.cxx index 96e464f7d..d45c9c2ca 100644 --- a/src/MEDMEM/test_copie_group.cxx +++ b/src/MEDMEM/test_copie_group.cxx @@ -15,6 +15,7 @@ using namespace std; #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_support(const SUPPORT * mySupport) { diff --git a/src/MEDMEM/test_copie_medarray.cxx b/src/MEDMEM/test_copie_medarray.cxx index 3cd8745bc..bbb6561e6 100644 --- a/src/MEDMEM/test_copie_medarray.cxx +++ b/src/MEDMEM/test_copie_medarray.cxx @@ -18,6 +18,7 @@ using namespace std; #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_medarray(MEDARRAY & myMedArray) { diff --git a/src/MEDMEM/test_copie_mesh.cxx b/src/MEDMEM/test_copie_mesh.cxx index c8e83c56e..4fd1ebdad 100644 --- a/src/MEDMEM/test_copie_mesh.cxx +++ b/src/MEDMEM/test_copie_mesh.cxx @@ -14,6 +14,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/test_copie_support.cxx b/src/MEDMEM/test_copie_support.cxx index 5abfe4f5e..6a7367ddb 100644 --- a/src/MEDMEM/test_copie_support.cxx +++ b/src/MEDMEM/test_copie_support.cxx @@ -14,6 +14,7 @@ using namespace std; #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; void affiche_support(const SUPPORT * mySupport) diff --git a/src/MEDMEM/test_gibi_driver.cxx b/src/MEDMEM/test_gibi_driver.cxx index cfa50ec21..216da9797 100644 --- a/src/MEDMEM/test_gibi_driver.cxx +++ b/src/MEDMEM/test_gibi_driver.cxx @@ -1,6 +1,8 @@ +using namespace std; + #include "MEDMEM_GibiMeshDriver.hxx" #include "MEDMEM_Mesh.hxx" - +using namespace MEDMEM; int main (int argc, char ** argv) { /* process the arguments */ diff --git a/src/MEDMEM/test_operation_fielddouble.cxx b/src/MEDMEM/test_operation_fielddouble.cxx index 4338f6ed5..5dfa91737 100644 --- a/src/MEDMEM/test_operation_fielddouble.cxx +++ b/src/MEDMEM/test_operation_fielddouble.cxx @@ -23,6 +23,7 @@ double myfunction1(double x) using namespace std; +using namespace MEDMEM; void affiche_field_(FIELD_ * myField, const SUPPORT * mySupport) { cout << "Field "<< myField->getName() << " : " <getDescription() << endl ; diff --git a/src/MEDMEM/test_operation_fieldint.cxx b/src/MEDMEM/test_operation_fieldint.cxx index 48e33eaba..e0389cfbd 100644 --- a/src/MEDMEM/test_operation_fieldint.cxx +++ b/src/MEDMEM/test_operation_fieldint.cxx @@ -16,6 +16,7 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" +using namespace MEDMEM; int myfunction1(int x) { return 2*x; diff --git a/src/MEDMEM/tests/readCoordinate.cxx b/src/MEDMEM/tests/readCoordinate.cxx index 1e8d451b0..71f0d1008 100755 --- a/src/MEDMEM/tests/readCoordinate.cxx +++ b/src/MEDMEM/tests/readCoordinate.cxx @@ -27,6 +27,7 @@ using namespace std; #include "MEDMEM_Exception.hxx" #include "MEDMEM_define.hxx" #include "MEDMEM_Mesh.hxx" +using namespace MEDMEM; void usage(char * name) { diff --git a/src/MEDMEM/tests/readEntete.cxx b/src/MEDMEM/tests/readEntete.cxx index 56f008638..01e83ce3a 100755 --- a/src/MEDMEM/tests/readEntete.cxx +++ b/src/MEDMEM/tests/readEntete.cxx @@ -28,6 +28,7 @@ using namespace std; #include "MEDMEM_define.hxx" #include "MEDMEM_Mesh.hxx" #include "MEDMEM_DriversDef.hxx" +using namespace MEDMEM; void usage(char * name) { diff --git a/src/MEDMEM/tests/testUArray.cxx b/src/MEDMEM/tests/testUArray.cxx index 7f9b534e8..405de1350 100755 --- a/src/MEDMEM/tests/testUArray.cxx +++ b/src/MEDMEM/tests/testUArray.cxx @@ -26,6 +26,7 @@ using namespace std; #include // pour l'acces à EXIT_SUCCESS et EXIT_FAILURE #include "utilities.h" #include "MEDMEM_Array.hxx" +using namespace MEDMEM; void imprime(string titre,const int * myValues,const int * myOthers, int lignes, int colonnes) { diff --git a/src/MEDMEM/tests/testUArray.cxx.ok b/src/MEDMEM/tests/testUArray.cxx.ok index 73b0b894a..8ed37162c 100755 --- a/src/MEDMEM/tests/testUArray.cxx.ok +++ b/src/MEDMEM/tests/testUArray.cxx.ok @@ -1,6 +1,7 @@ #include // pour l'acces à EXIT_SUCCESS et EXIT_FAILURE #include "utilities.h" #include "MEDMEM_Array.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/tests/testUCellModel.cxx b/src/MEDMEM/tests/testUCellModel.cxx index d8119e65c..96f6e3d01 100755 --- a/src/MEDMEM/tests/testUCellModel.cxx +++ b/src/MEDMEM/tests/testUCellModel.cxx @@ -30,6 +30,7 @@ using namespace std; #include "MEDMEM_CellModel.hxx" #include "MEDMEM_define.hxx" #include "MEDMEM_DriversDef.hxx" +using namespace MEDMEM; void usage(char * name) { diff --git a/src/MEDMEM/tests/testUCoordinate.cxx b/src/MEDMEM/tests/testUCoordinate.cxx index 41529316a..53841bdbc 100755 --- a/src/MEDMEM/tests/testUCoordinate.cxx +++ b/src/MEDMEM/tests/testUCoordinate.cxx @@ -31,6 +31,7 @@ using namespace std; #include "MEDMEM_Array.hxx" #include "MEDMEM_Coordinate.hxx" #include +using namespace MEDMEM; void usage(char * name) { diff --git a/src/MEDMEM/tests/testUMedException.cxx b/src/MEDMEM/tests/testUMedException.cxx index 5a2b501d7..7b735f1d4 100644 --- a/src/MEDMEM/tests/testUMedException.cxx +++ b/src/MEDMEM/tests/testUMedException.cxx @@ -26,6 +26,7 @@ using namespace std; #include #include "MEDMEM_STRING.hxx" #include "MEDMEM_Exception.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/tests/testUModulusArray.cxx b/src/MEDMEM/tests/testUModulusArray.cxx index bfa5890b4..663197935 100644 --- a/src/MEDMEM/tests/testUModulusArray.cxx +++ b/src/MEDMEM/tests/testUModulusArray.cxx @@ -27,6 +27,7 @@ using namespace std; #include #include "utilities.h" #include "MEDMEM_ModulusArray.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/tests/testUPointerOf.cxx b/src/MEDMEM/tests/testUPointerOf.cxx index b3c213a92..ce6c48d5d 100644 --- a/src/MEDMEM/tests/testUPointerOf.cxx +++ b/src/MEDMEM/tests/testUPointerOf.cxx @@ -9,6 +9,7 @@ using namespace std; #include "utilities.h" #include "MEDMEM_PointerOf.hxx" #include "MEDMEM_Exception.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) diff --git a/src/MEDMEM/tests/testUSkyLineArray.cxx b/src/MEDMEM/tests/testUSkyLineArray.cxx index c48cfae10..b3d6f3dcb 100644 --- a/src/MEDMEM/tests/testUSkyLineArray.cxx +++ b/src/MEDMEM/tests/testUSkyLineArray.cxx @@ -26,6 +26,7 @@ using namespace std; #include #include "utilities.h" #include "MEDMEM_SkyLineArray.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MEDMEM/tests/testUUnit.cxx b/src/MEDMEM/tests/testUUnit.cxx index 8cc40135f..a4fbe348c 100755 --- a/src/MEDMEM/tests/testUUnit.cxx +++ b/src/MEDMEM/tests/testUUnit.cxx @@ -27,6 +27,7 @@ using namespace std; #include #include "MEDMEM_Unit.hxx" +using namespace MEDMEM; int main (int argc, char ** argv) { diff --git a/src/MedMem/Family_i.cxx b/src/MEDMEM_I/MEDMEM_Family_i.cxx similarity index 63% rename from src/MedMem/Family_i.cxx rename to src/MEDMEM_I/MEDMEM_Family_i.cxx index 3f2d3fb37..33f00038f 100644 --- a/src/MedMem/Family_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Family_i.cxx @@ -1,15 +1,16 @@ //============================================================================= -// File : Family_i.cxx +// File : MEDMEM_Family_i.cxx // Project : SALOME // Copyright : EDF 2002 // Author : EDF -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Family_i.cxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Family_i.cxx //============================================================================= #include "utilities.h" -#include "Family_i.hxx" #include "Utils_CorbaException.hxx" +#include "MEDMEM_Family_i.hxx" #include "MEDMEM_Family.hxx" +using namespace MEDMEM; //============================================================================= /*! @@ -68,11 +69,10 @@ throw (SALOME::SALOME_Exception) { return _family->getIdentifier(); } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces Family Identifier"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object" - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } } @@ -91,11 +91,10 @@ throw (SALOME::SALOME_Exception) { return _family->getNumberOfAttributes(); } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to get number of attributes"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object" - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -103,13 +102,13 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for attributes identifiers */ //============================================================================= -Engines::long_array* FAMILY_i::getAttributesIdentifiers() +SALOME_MED::long_array* FAMILY_i::getAttributesIdentifiers() throw (SALOME::SALOME_Exception) { if (_family==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ SALOME::INTERNAL_ERROR); - Engines::long_array_var myseq= new Engines::long_array; + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { int nbAttribute=_family->getNumberOfAttributes(); @@ -120,11 +119,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=identifiers[i]; } } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces Family Identifiers"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -143,11 +141,10 @@ throw (SALOME::SALOME_Exception) { return _family->getAttributeIdentifier(i); } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces Family Identifier"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } } @@ -156,13 +153,13 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for attributes values */ //============================================================================= -Engines::long_array* FAMILY_i::getAttributesValues() +SALOME_MED::long_array* FAMILY_i::getAttributesValues() throw (SALOME::SALOME_Exception) { if (_family==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ SALOME::INTERNAL_ERROR); - Engines::long_array_var myseq= new Engines::long_array; + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { int nbAttribute=_family->getNumberOfAttributes(); @@ -173,11 +170,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=values[i]; } } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces attributs values"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object" - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -196,11 +192,10 @@ throw (SALOME::SALOME_Exception) { return _family->getAttributeValue(i); } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces specified attribut value"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -208,14 +203,14 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for attributes desriptions */ //============================================================================= -Engines::string_array * FAMILY_i::getAttributesDescriptions() +SALOME_MED::string_array * FAMILY_i::getAttributesDescriptions() throw (SALOME::SALOME_Exception) { if (_family==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ SALOME::INTERNAL_ERROR); - Engines::string_array_var myseq = new Engines::string_array; + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; try { int nbAttribute=_family->getNumberOfAttributes(); @@ -226,11 +221,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=CORBA::string_dup(descattribute[i].c_str()); } } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces attributs descriptions"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } return myseq._retn(); @@ -250,11 +244,84 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_family->getAttributeDescription(i).c_str()); } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces specified attribut description"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); + } +} + +//============================================================================= +/*! + * CORBA: Accessor for number of groups the family belongs to + */ +//============================================================================= +CORBA::Long FAMILY_i::getNumberOfGroups() +throw (SALOME::SALOME_Exception) +{ + if (_family==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ + SALOME::INTERNAL_ERROR); + try + { + return _family->getNumberOfGroups(); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces specified attribut value"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: Accessor for groups names + */ +//============================================================================= +SALOME_MED::string_array * FAMILY_i::getGroupsNames() +throw (SALOME::SALOME_Exception) +{ + if (_family==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Family",\ + SALOME::INTERNAL_ERROR); + + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; + try + { + int nbGroups=_family->getNumberOfGroups(); + myseq->length(nbGroups); + string * descGroups=_family->getGroupsNames(); + for (int i=0;igetGroupName(i).c_str()); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces specified attribut description"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(),SALOME::INTERNAL_ERROR); } } diff --git a/src/MEDMEM_I/MEDMEM_Family_i.hxx b/src/MEDMEM_I/MEDMEM_Family_i.hxx new file mode 100644 index 000000000..20ac7ce88 --- /dev/null +++ b/src/MEDMEM_I/MEDMEM_Family_i.hxx @@ -0,0 +1,57 @@ +//============================================================================= +// File : MEDMEM_Family_i.hxx +// Project : SALOME +// Copyright : EDF 2002 +// Author : EDF +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Family_i.hxx +//============================================================================= +#ifndef MED_FAMILY_I_HXX_ +#define MED_FAMILY_I_HXX_ + + +#include "MEDMEM_Support_i.hxx" + +namespace MEDMEM { +class FAMILY; +class FAMILY_i: + public POA_SALOME_MED::FAMILY, + public SUPPORT_i +{ +protected : + FAMILY_i(); + ~FAMILY_i(); + + // C++ object containing values + const ::MEDMEM::FAMILY * const _family ; + +public : + // Constructors and associated internal methods + FAMILY_i(const ::MEDMEM::FAMILY * const f); + FAMILY_i(const FAMILY_i & f); + + CORBA::Long getIdentifier() + throw (SALOME::SALOME_Exception); + CORBA::Long getNumberOfAttributes() + throw (SALOME::SALOME_Exception); + SALOME_MED::long_array* getAttributesIdentifiers() + throw (SALOME::SALOME_Exception); + CORBA::Long getAttributeIdentifier(CORBA::Long i) + throw (SALOME::SALOME_Exception); + SALOME_MED::long_array* getAttributesValues() + throw (SALOME::SALOME_Exception); + CORBA::Long getAttributeValue(CORBA::Long i) + throw (SALOME::SALOME_Exception); + SALOME_MED::string_array* getAttributesDescriptions() + throw (SALOME::SALOME_Exception); + char* getAttributeDescription( CORBA::Long i) + throw (SALOME::SALOME_Exception); + CORBA::Long getNumberOfGroups() + throw (SALOME::SALOME_Exception); + char * getGroupName( CORBA::Long i) + throw (SALOME::SALOME_Exception); + SALOME_MED::string_array* getGroupsNames() + throw (SALOME::SALOME_Exception); + +}; +} +#endif /* MED_FAMILY_I_HXX_ */ diff --git a/src/MedMem/FieldDouble_i.cxx b/src/MEDMEM_I/MEDMEM_FieldDouble_i.cxx similarity index 86% rename from src/MedMem/FieldDouble_i.cxx rename to src/MEDMEM_I/MEDMEM_FieldDouble_i.cxx index f10252705..2ea79bba3 100644 --- a/src/MedMem/FieldDouble_i.cxx +++ b/src/MEDMEM_I/MEDMEM_FieldDouble_i.cxx @@ -1,14 +1,15 @@ //============================================================================= -// File : Fielddouble_i.hxx +// File : MEDMEM_Fielddouble_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Fielddouble_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Fielddouble_i.hxx //============================================================================= -#include "FieldDouble_i.hxx" +#include "MEDMEM_FieldDouble_i.hxx" #include "utilities.h" -#include "convert.hxx" +#include "MEDMEM_convert.hxx" +using namespace MEDMEM; //============================================================================= /*! @@ -58,13 +59,13 @@ FIELDDOUBLE_i::FIELDDOUBLE_i(SALOME_MED::SUPPORT_ptr mySupportIOR,::FIELDgetNumberOfComponents(); @@ -92,11 +93,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=values[i]; }; } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces Field "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } diff --git a/src/MedMem/FieldDouble_i.hxx b/src/MEDMEM_I/MEDMEM_FieldDouble_i.hxx similarity index 71% rename from src/MedMem/FieldDouble_i.hxx rename to src/MEDMEM_I/MEDMEM_FieldDouble_i.hxx index fe149dd37..d103ad445 100644 --- a/src/MedMem/FieldDouble_i.hxx +++ b/src/MEDMEM_I/MEDMEM_FieldDouble_i.hxx @@ -1,9 +1,9 @@ //============================================================================= -// File : Fielddouble_i.hxx +// File : MEDMEM_Fielddouble_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Fielddouble_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Fielddouble_i.hxx //============================================================================= #ifndef MED_FIELDDOUBLE_I_HXX_ @@ -13,11 +13,12 @@ #include CORBA_SERVER_HEADER(MED) -#include "Field_i.hxx" -#include "FieldOf_i.hxx" +#include "MEDMEM_Field_i.hxx" +#include "MEDMEM_FieldOf_i.hxx" #include "MEDMEM_Field.hxx" +namespace MEDMEM { class FIELDDOUBLE_i: public FIELDOF_i { private: @@ -28,9 +29,10 @@ public: FIELDDOUBLE_i(SALOME_MED::SUPPORT_ptr mySupportIOR,::FIELD * const f); FIELDDOUBLE_i(FIELDDOUBLE_i & f); - Engines::double_array * getValue (SALOME_MED::medModeSwitch mode ) + SALOME_MED::double_array * getValue (SALOME_MED::medModeSwitch mode ) throw (SALOME::SALOME_Exception); }; +} #endif /* MED_FIELDDOUBLE_I_HXX_ */ diff --git a/src/MedMem/FieldInt_i.cxx b/src/MEDMEM_I/MEDMEM_FieldInt_i.cxx similarity index 86% rename from src/MedMem/FieldInt_i.cxx rename to src/MEDMEM_I/MEDMEM_FieldInt_i.cxx index c0a52b84d..f3d40e209 100644 --- a/src/MedMem/FieldInt_i.cxx +++ b/src/MEDMEM_I/MEDMEM_FieldInt_i.cxx @@ -1,14 +1,15 @@ //============================================================================= -// File : Fieldint_i.hxx +// File : MEDMEM_Fieldint_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Fieldint_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Fieldint_i.hxx //============================================================================= -#include "FieldInt_i.hxx" #include "utilities.h" -#include "convert.hxx" +#include "MEDMEM_FieldInt_i.hxx" +#include "MEDMEM_convert.hxx" +using namespace MEDMEM; //============================================================================= /*! @@ -58,13 +59,13 @@ FIELDINT_i::FIELDINT_i(FIELDINT_i &fi): */ //============================================================================= -Engines::long_array* FIELDINT_i::getValue( SALOME_MED::medModeSwitch mode ) +SALOME_MED::long_array* FIELDINT_i::getValue( SALOME_MED::medModeSwitch mode ) throw (SALOME::SALOME_Exception) { if (_fieldTptr==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Field", \ SALOME::INTERNAL_ERROR); - Engines::long_array_var myseq = new Engines::long_array; + SALOME_MED::long_array_var myseq = new SALOME_MED::long_array; try { int nbval=_fieldTptr->getNumberOfComponents(); @@ -92,11 +93,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=values[i]; }; } - catch(...) + catch(MEDEXCEPTION &ex) { MESSAGE("Unable to acces Field"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } diff --git a/src/MedMem/FieldInt_i.hxx b/src/MEDMEM_I/MEDMEM_FieldInt_i.hxx similarity index 71% rename from src/MedMem/FieldInt_i.hxx rename to src/MEDMEM_I/MEDMEM_FieldInt_i.hxx index a5f20621c..c72aa27fa 100644 --- a/src/MedMem/FieldInt_i.hxx +++ b/src/MEDMEM_I/MEDMEM_FieldInt_i.hxx @@ -1,9 +1,9 @@ //============================================================================= -// File : FieldInt_i.hxx +// File : MEDMEM_FieldInt_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/FieldInt_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_FieldInt_i.hxx //============================================================================= #ifndef MED_FIELDINT_I_HXX_ @@ -13,11 +13,12 @@ #include CORBA_SERVER_HEADER(MED) -#include "Field_i.hxx" -#include "FieldOf_i.hxx" +#include "MEDMEM_Field_i.hxx" +#include "MEDMEM_FieldOf_i.hxx" #include "MEDMEM_Field.hxx" +namespace MEDMEM { class FIELDINT_i: public FIELDOF_i { private: @@ -27,7 +28,8 @@ public: ~FIELDINT_i(); FIELDINT_i(SALOME_MED::SUPPORT_ptr mySupportIOR, ::FIELD * const f); FIELDINT_i(FIELDINT_i & f); - Engines::long_array * getValue (SALOME_MED::medModeSwitch mode ) + SALOME_MED::long_array * getValue (SALOME_MED::medModeSwitch mode ) throw (SALOME::SALOME_Exception); }; +} #endif /* MED_FIELDINT_I_HXX_ */ diff --git a/src/MedMem/FieldOf_i.hxx b/src/MEDMEM_I/MEDMEM_FieldOf_i.hxx similarity index 86% rename from src/MedMem/FieldOf_i.hxx rename to src/MEDMEM_I/MEDMEM_FieldOf_i.hxx index 11679ba70..3b0e93b44 100644 --- a/src/MedMem/FieldOf_i.hxx +++ b/src/MEDMEM_I/MEDMEM_FieldOf_i.hxx @@ -1,9 +1,9 @@ //============================================================================= -// File : FieldOf_i.hxx +// File : MEDMEM_FieldOf_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/FieldOf_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_FieldOf_i.hxx //============================================================================= @@ -22,25 +22,26 @@ #include CORBA_SERVER_HEADER(MED) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) -#include "Field_i.hxx" -#include "Support_i.hxx" +#include "MEDMEM_Field_i.hxx" +#include "MEDMEM_Support_i.hxx" -#include "convert.hxx" +#include "MEDMEM_convert.hxx" #include "MEDMEM_Support.hxx" #include "MEDMEM_Field.hxx" +namespace MEDMEM { template class FIELDOF_i: public FIELD_i { public : - static map < int, ::FIELD * > fieldMap ; + static map < int, ::MEDMEM::FIELD * > fieldMap ; protected : static int fieldIndex ; protected : // C++ object containing values - ::FIELD * const _fieldTptr; + ::MEDMEM::FIELD * const _fieldTptr; const int _corbaIndex; string _FieldId; @@ -71,10 +72,12 @@ public : CORBA::Double getTime() throw (SALOME::SALOME_Exception); CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception); - Engines::string_array * getComponentsNames() throw (SALOME::SALOME_Exception); - Engines::string_array * getComponentsUnits() throw (SALOME::SALOME_Exception); + SALOME_MED::string_array * getComponentsNames() throw (SALOME::SALOME_Exception); + SALOME_MED::string_array * getComponentsUnits() throw (SALOME::SALOME_Exception); void addInStudy(SALOMEDS::Study_ptr myStudy, - SALOME_MED::FIELD_ptr myIor) throw (SALOME::SALOME_Exception); + SALOME_MED::FIELD_ptr myIor) + throw (SALOME::SALOME_Exception, + SALOMEDS::StudyBuilder::LockProtection); CORBA::Long addDriver (SALOME_MED::medDriverTypes driverType, const char* fileName, const char* fieldName) @@ -88,6 +91,8 @@ public : ::FIELD * constructConstField() const; }; +} +using namespace MEDMEM; template map < int, ::FIELD * > FIELDOF_i::fieldMap ; template int FIELDOF_i::fieldIndex = 0; //============================================================================= @@ -183,11 +188,10 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_fieldTptr->getName().c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au nom"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -205,11 +209,10 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_fieldTptr->getDescription().c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant a la description"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -255,11 +258,10 @@ throw (SALOME::SALOME_Exception) { return _fieldTptr->getNumberOfComponents(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au support"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -277,11 +279,10 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_fieldTptr->getComponentName(i).c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au nom d un component"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -299,11 +300,10 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_fieldTptr->getMEDComponentUnit(i).c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au nom d un component"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -321,11 +321,10 @@ throw (SALOME::SALOME_Exception) { return _fieldTptr->getIterationNumber(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -357,11 +356,10 @@ throw (SALOME::SALOME_Exception) { return _fieldTptr->getOrderNumber(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -379,11 +377,10 @@ throw (SALOME::SALOME_Exception) { return _fieldTptr->getTime(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -391,13 +388,13 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for Fields's Components names */ //============================================================================= -template Engines::string_array * FIELDOF_i::getComponentsNames() +template SALOME_MED::string_array * FIELDOF_i::getComponentsNames() throw (SALOME::SALOME_Exception) { if (_fieldTptr==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Field", \ SALOME::INTERNAL_ERROR); - Engines::string_array_var myseq = new Engines::string_array; + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; try { int nbcom = _fieldTptr->getNumberOfComponents(); @@ -408,11 +405,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=CORBA::string_dup(namecom[i].c_str()); } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -421,13 +417,13 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for Fields's Components units */ //============================================================================= -template Engines::string_array * FIELDOF_i::getComponentsUnits() +template SALOME_MED::string_array * FIELDOF_i::getComponentsUnits() throw (SALOME::SALOME_Exception) { if (_fieldTptr==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Field", \ SALOME::INTERNAL_ERROR); - Engines::string_array_var myseq = new Engines::string_array; + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; try { int nbcom = _fieldTptr->getNumberOfComponents(); @@ -438,11 +434,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=CORBA::string_dup(unitcom[i].c_str()); } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -453,7 +448,7 @@ throw (SALOME::SALOME_Exception) //============================================================================= template void FIELDOF_i::addInStudy(SALOMEDS::Study_ptr myStudy, SALOME_MED::FIELD_ptr myIor ) -throw (SALOME::SALOME_Exception) + throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection) { BEGIN_OF(" FIELDOF_i::addInStudy"); if (_fieldTptr==NULL) @@ -473,10 +468,9 @@ throw (SALOME::SALOME_Exception) SALOMEDS::AttributeIOR_var aIOR; // Create SComponent labelled 'Med' - // SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) - THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'MED' not Found",SALOME::INTERNAL_ERROR); // Create SObject labelled 'MEDFIELD' if it doesn't already exit SALOMEDS::SObject_var medfieldfather = myStudy->FindObject("MEDFIELD"); @@ -524,12 +518,16 @@ throw (SALOME::SALOME_Exception) aIOR->SetValue(iorStr.c_str()); SALOMEDS::SObject_var supportObject = myStudy->FindObject(_support->getName()); - if ( CORBA::is_nil(supportObject) ) { + if ( CORBA::is_nil(supportObject) ) + { MESSAGE("FIELDOF_i::addInStudy : SUPPORT not found") ; - } else { + } + else + { SALOMEDS::SObject_var newObjSupport = myBuilder->NewObject(newObj); myBuilder->Addreference(newObjSupport,supportObject); } + myBuilder->CommitCommand(); _FieldId = newObj->GetID(); MESSAGE("FIELDOF_i::addInStudy _FieldId="<< _FieldId); @@ -551,7 +549,7 @@ throw (SALOME::SALOME_Exception) { _fieldTptr->write(i,driverFieldName); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ @@ -573,11 +571,10 @@ throw (SALOME::SALOME_Exception) { _fieldTptr->read(i); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -595,11 +592,10 @@ throw (SALOME::SALOME_Exception) { _fieldTptr->rmDriver(i); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -621,11 +617,10 @@ template CORBA::Long FIELDOF_i::addDriver (SALOME_MED::medDriverTyp fieldName); return drivernum; } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Exception en accedant au champ"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Field C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } diff --git a/src/MedMem/Field_i.cxx b/src/MEDMEM_I/MEDMEM_Field_i.cxx similarity index 69% rename from src/MedMem/Field_i.cxx rename to src/MEDMEM_I/MEDMEM_Field_i.cxx index a4c941c85..84584e430 100644 --- a/src/MedMem/Field_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Field_i.cxx @@ -1,12 +1,13 @@ //============================================================================= -// File : Field_i.cxx +// File : MEDMEM_Field_i.cxx // Created : mer fév 20 15:47:57 CET 2002 // Author : EDF // Project : SALOME // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Field_i.cxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Field_i.cxx //============================================================================= -# include "Field_i.hxx" +# include "MEDMEM_Field_i.hxx" +using namespace MEDMEM; FIELD_i::FIELD_i() { diff --git a/src/MedMem/Field_i.hxx b/src/MEDMEM_I/MEDMEM_Field_i.hxx similarity index 86% rename from src/MedMem/Field_i.hxx rename to src/MEDMEM_I/MEDMEM_Field_i.hxx index 22fa2d998..e0f195cac 100644 --- a/src/MedMem/Field_i.hxx +++ b/src/MEDMEM_I/MEDMEM_Field_i.hxx @@ -1,21 +1,20 @@ //============================================================================= -// File : Field_i.hxx +// File : MEDMEM_Field_i.hxx // Created : mer fév 20 15:47:57 CET 2002 // Author : EDF // Project : SALOME // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Field_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Field_i.hxx //============================================================================= # ifndef __FIELD_I_H__ # define __FIELD_I_H__ # include -//# include "SALOME_Component_i.hxx" # include CORBA_SERVER_HEADER(MED) - # include "Utils_CorbaException.hxx" +namespace MEDMEM { class FIELD_i { @@ -45,13 +44,14 @@ public : throw (SALOME::SALOME_Exception) = 0; virtual CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception) = 0; - virtual Engines::string_array * getComponentsNames() + virtual SALOME_MED::string_array * getComponentsNames() throw (SALOME::SALOME_Exception) = 0; - virtual Engines::string_array * getComponentsUnits() + virtual SALOME_MED::string_array * getComponentsUnits() throw (SALOME::SALOME_Exception) = 0; virtual void addInStudy(SALOMEDS::Study_ptr myStudy , SALOME_MED::FIELD_ptr myIor) - throw (SALOME::SALOME_Exception) = 0; + throw (SALOME::SALOME_Exception, + SALOMEDS::StudyBuilder::LockProtection) = 0; virtual CORBA::Long addDriver (SALOME_MED::medDriverTypes driverType, const char* fileName, const char* fieldName) @@ -64,4 +64,5 @@ public : const char* driverFieldName) throw (SALOME::SALOME_Exception) = 0; }; +}; # endif /* ifndef ____FIELD_I_H__ */ diff --git a/src/MedMem/Group_i.cxx b/src/MEDMEM_I/MEDMEM_Group_i.cxx similarity index 86% rename from src/MedMem/Group_i.cxx rename to src/MEDMEM_I/MEDMEM_Group_i.cxx index d9e89d87e..d405cdf50 100644 --- a/src/MedMem/Group_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Group_i.cxx @@ -1,9 +1,9 @@ //============================================================================= -// File : Group_i.cxx +// File : MEDMEM_Group_i.cxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/ +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Group_i.cxx //============================================================================= #include @@ -11,11 +11,12 @@ #include "utilities.h" #include "Utils_CorbaException.hxx" -#include "Group_i.hxx" -#include "Family_i.hxx" +#include "MEDMEM_Group_i.hxx" +#include "MEDMEM_Family_i.hxx" #include "MEDMEM_Group.hxx" #include "MEDMEM_Family.hxx" +using namespace MEDMEM; //============================================================================= /*! @@ -74,11 +75,10 @@ throw (SALOME::SALOME_Exception) { return _group->getNumberOfFamilies(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to get number of families of the group"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Group C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } }; //============================================================================= @@ -109,11 +109,10 @@ throw (SALOME::SALOME_Exception) myseq[i] = f2; } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access families"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); }; @@ -137,10 +136,9 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FAMILY::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces to the specified family"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } }; diff --git a/src/MedMem/Group_i.hxx b/src/MEDMEM_I/MEDMEM_Group_i.hxx similarity index 78% rename from src/MedMem/Group_i.hxx rename to src/MEDMEM_I/MEDMEM_Group_i.hxx index 12419693b..5af4b6122 100644 --- a/src/MedMem/Group_i.hxx +++ b/src/MEDMEM_I/MEDMEM_Group_i.hxx @@ -1,15 +1,16 @@ //============================================================================= -// File : Group_i.hxx +// File : MEDMEM_Group_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Group_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Group_i.hxx //============================================================================= #ifndef MED_GROUP_I_HXX_ #define MED_GROUP_I_HXX_ -#include "Support_i.hxx" +#include "MEDMEM_Support_i.hxx" +namespace MEDMEM { class FAMILY_i; class GROUP; @@ -22,11 +23,11 @@ protected : ~GROUP_i(); // C++ object containing values - const ::GROUP * const _group; + const ::MEDMEM::GROUP * const _group; public : // Constructors and associated internal methods - GROUP_i(const ::GROUP * const g); + GROUP_i(const ::MEDMEM::GROUP * const g); GROUP_i(const GROUP_i & g); CORBA::Long getNumberOfFamilies() @@ -36,5 +37,6 @@ public : SALOME_MED::FAMILY_ptr getFamily(CORBA::Long i) throw (SALOME::SALOME_Exception); }; +} #endif /* MED_GROUP_I_HXX_ */ diff --git a/src/MEDMEM_I/MEDMEM_Med_i.cxx b/src/MEDMEM_I/MEDMEM_Med_i.cxx new file mode 100644 index 000000000..2efef40bc --- /dev/null +++ b/src/MEDMEM_I/MEDMEM_Med_i.cxx @@ -0,0 +1,748 @@ +using namespace std; +//============================================================================= +// File : MEDMEM_Med_i.cxx +// Project : SALOME +// Author : EDF +// Copyright : EDF 2002 +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_i.cxx +//============================================================================= + +#include + +//#include "MEDMEM_Field.hxx" + +#include "MEDMEM_Med_i.hxx" +#include "MEDMEM_Mesh_i.hxx" +#include "MEDMEM_FieldDouble_i.hxx" +#include "MEDMEM_FieldInt_i.hxx" +#include "MEDMEM_Support_i.hxx" +#include "MEDMEM_Family_i.hxx" +#include "MEDMEM_Group_i.hxx" +#include "MEDMEM_convert.hxx" + +#include "MEDMEM_DriversDef.hxx" +#include "utilities.h" +#include "Utils_CorbaException.hxx" +using namespace MEDMEM; + +//============================================================================= +/*! + * Default constructor + */ +//=================================POA_SALOME_MED::FAMILY::_============================================ +MED_i::MED_i():_med((::MED*)NULL) +{ + BEGIN_OF("Default Constructor MED_i"); + END_OF("Default Constructor MED_i"); +} +//============================================================================= +/*! + * methods + */ +//============================================================================= +void MED_i::init(SALOMEDS::Study_ptr myStudy,driverTypes driverType, const string & fileName) +{ + const char * LOC = "MED_i::init(driverTypes, const string &)"; + BEGIN_OF(LOC); + + // we create all IOR from _med + _med = new ::MED(driverType,fileName); + + // MESHES : + deque meshesNames = _med->getMeshNames(); + int numberOfMeshes = meshesNames.size(); + for (int i=0; igetMesh(meshesNames[i]); + myMesh->read(); + MESH_i * myMeshI = new MESH_i(myMesh); + SALOME_MED::MESH_ptr myMeshIOR = myMeshI->_this(); + _meshes[meshesNames[i]] = myMeshIOR; + myMeshI->addInStudy(myStudy,myMeshIOR,fileName); + } + + // SUPPORTS : + _med->updateSupport(); + + // FAMILIES : + // we add all families + vector familyVector; + vector::iterator familyVectorIt; + // GROUPS : + // we add all groups + vector groupVector; + vector::iterator groupVectorIt; + + MED_FR::MESH_ENTITIES::const_iterator currentEntity; + for (int i=0; igetMesh(meshesNames[i]); + for (currentEntity = MED_FR::meshEntities.begin(); + currentEntity != MED_FR::meshEntities.end(); + currentEntity++) + { + // family : + familyVector = ptrMesh->getFamilies((MED_EN::medEntityMesh)(*currentEntity).first); + for (familyVectorIt = familyVector.begin(); + familyVectorIt != familyVector.end(); + familyVectorIt++) + { + FAMILY_i * myFamilyI = new FAMILY_i(*familyVectorIt); + SALOME_MED::FAMILY_ptr myFamilyIOR = myFamilyI->POA_SALOME_MED::FAMILY::_this(); + myFamilyI->addInStudy(myStudy,myFamilyIOR); + } + + // group : + groupVector = ptrMesh->getGroups((MED_EN::medEntityMesh)(*currentEntity).first); + for (groupVectorIt = groupVector.begin(); + groupVectorIt != groupVector.end(); + groupVectorIt++) + { + GROUP_i * myGroupI = new GROUP_i(*groupVectorIt); + SALOME_MED::GROUP_ptr myGroupIOR = myGroupI->POA_SALOME_MED::GROUP::_this(); + myGroupI->addInStudy(myStudy,myGroupIOR); + } + } + } + + for (int i=0; i mySupports = _med->getSupports(meshesNames[i]); + map::const_iterator itSupport; + map & mySupportsIOR + = _supports[meshesNames[i]]; + for ( itSupport = mySupports.begin(); itSupport != mySupports.end(); itSupport++ ) + { + SUPPORT_i * mySupportI = new SUPPORT_i((*itSupport).second); + SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this(); + mySupportsIOR[(*itSupport).first] = mySupportIOR; + mySupportI->addInStudy(myStudy,mySupportIOR); + } + } + + // FIELDS : + deque fieldsNames = _med->getFieldNames(); + int numberOfFields = fieldsNames.size(); + for (int i=0; i myIteration = _med->getFieldIteration (fieldsNames[i]); + int numberOfIteration = myIteration.size(); + for (int j=0; jgetField(fieldsNames[i], myIteration[j].dt, myIteration[j].it); + string meshName = myField->getSupport()->getMesh()->getName(); + medEntityMesh myEntity = myField->getSupport()->getEntity(); + map >::const_iterator + itSupportOnMesh = _supports.find(meshName); + if ( itSupportOnMesh == _supports.end() ) + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + << "There is no support on mesh named |" + << meshName << "|" )); + const map & SupportOnMesh + = (*itSupportOnMesh).second; + map::const_iterator itSupport + = SupportOnMesh.find((MED_FR::med_entite_maillage)myEntity); + if (itSupport == SupportOnMesh.end()) + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + << "There is no support on entity " + << entity << " in mesh named |" + << meshName << "|")); + SALOME_MED::SUPPORT_ptr mySupportIOR = (*itSupport).second; + med_type_champ type = myField->getValueType(); + SALOME_MED::FIELD_ptr myFieldIOR; + switch (type) + { + case MED_FR::MED_INT32 : + { + ((FIELD*)myField)->read(); + FIELDINT_i * myFieldIntI = new FIELDINT_i(mySupportIOR,(FIELD*)myField); + POA_SALOME_MED::FIELD_tie * myFieldTie + = new POA_SALOME_MED::FIELD_tie(myFieldIntI); + myFieldIOR = myFieldTie->_this(); + myFieldIntI->addInStudy(myStudy,myFieldIOR); + break; + } + + case MED_FR::MED_REEL64: + { + ((FIELD*)myField)->read(); + FIELDDOUBLE_i * myFieldDoubleI + = new FIELDDOUBLE_i(mySupportIOR,(FIELD*)myField); + POA_SALOME_MED::FIELD_tie * myFieldTie + = new POA_SALOME_MED::FIELD_tie(myFieldDoubleI); + myFieldIOR = myFieldTie->_this(); + myFieldDoubleI->addInStudy(myStudy,myFieldIOR); + break; + } + default: + { + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + <<" * Iteration "< meshesNames = _med->getMeshNames(); + int numberOfMeshes = meshesNames.size(); + for (int i=0; igetMesh(meshesNames[i]); + myMesh->read(); + MESH_i * myMeshI = new MESH_i(myMesh); + SALOME_MED::MESH_ptr myMeshIOR = myMeshI->_this(); + _meshes[meshesNames[i]]=myMeshIOR; + myMeshI->addInStudy(myStudy,myMeshIOR); + } + + // SUPPORTS : + _med->updateSupport(); + for (int i=0; i mySupports = _med->getSupports(meshesNames[i]); + map::const_iterator itSupport; + map & + mySupportsIOR = _supports[meshesNames[i]]; + for (itSupport=mySupports.begin(); itSupport!=mySupports.end(); itSupport++ ) + { + SUPPORT_i * mySupportI = new SUPPORT_i((*itSupport).second); + SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this(); + mySupportsIOR[(*itSupport).first]= mySupportIOR; + mySupportI->addInStudy(myStudy,mySupportIOR); + } + } + + // FIELDS : + deque fieldsNames = _med->getFieldNames(); + int numberOfFields = fieldsNames.size(); + for (int i=0; i myIteration = _med->getFieldIteration (fieldsNames[i]); + int numberOfIteration = myIteration.size(); + for (int j=0; jgetField(fieldsNames[i],myIteration[j].dt,myIteration[j].it); + string meshName = myField->getSupport()->getMesh()->getName(); + medEntityMesh myEntity = myField->getSupport()->getEntity(); + map >::const_iterator + itSupportOnMesh = _supports.find(meshName); + if (itSupportOnMesh == _supports.end() ) + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + << "There is no support on mesh named |" + << meshName << "|")); + const map & SupportOnMesh + = (*itSupportOnMesh).second; + map::const_iterator itSupport + = SupportOnMesh.find((MED_FR::med_entite_maillage)myEntity); + if (itSupport == SupportOnMesh.end() ) + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + << "There is no support on entity " + << entity << " in mesh named |" + << meshName << "|")); + SALOME_MED::SUPPORT_ptr mySupportIOR = (*itSupport).second; + med_type_champ type = myField->getValueType(); + + DT_IT_ dtIt; + dtIt.dt = myIteration[j].dt; + dtIt.it = myIteration[j].it; + + switch (type) + { + case MED_FR::MED_INT32: + { + ((FIELD*)myField)->read(); + FIELDINT_i * myFieldIntI + = new FIELDINT_i(mySupportIOR,(FIELD*)myField); + SALOME_MED::FIELDINT_ptr myFieldIntIOR; + POA_SALOME_MED::FIELDINT_tie * myFieldIntTie + = new POA_SALOME_MED::FIELDINT_tie(myFieldIntI); + myFieldIntIOR = myFieldIntTie->_this(); + myFieldIntI->addInStudy(myStudy,myFieldIntIOR); + _fields[fieldsNames[i]][dtIt] = myFieldIntIOR; + break; + } + + case MED_FR::MED_REEL64: + { + ((FIELD*)myField)->read(); + FIELDDOUBLE_i * myFieldDoubleI + = new FIELDDOUBLE_i(mySupportIOR,(FIELD*)myField); + SALOME_MED::FIELDDOUBLE_ptr myFieldDoubleIOR; + POA_SALOME_MED::FIELDDOUBLE_tie * myFieldDoubleTie + = new POA_SALOME_MED::FIELDDOUBLE_tie(myFieldDoubleI); + myFieldDoubleIOR = myFieldDoubleTie->_this(); + myFieldDoubleI->addInStudy(myStudy,myFieldDoubleIOR); + _fields[fieldsNames[i]][dtIt] = myFieldDoubleIOR; + break; + } + + default: + { + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + <<" * Iteration "<getNumberOfMeshes(); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to get the number of meshes in Med Object"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: Accessor for Number of fields + */ +//============================================================================= +CORBA::Long MED_i::getNumberOfFields() +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + return _med->getNumberOfFields(); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to get the number of fields in Med Object"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: Accessor for meshes names + */ +//============================================================================= +SALOME_MED::string_array * MED_i::getMeshNames() +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; + try + { + int nbMeshes=_med->getNumberOfMeshes(); + myseq->length(nbMeshes); + string * nameMeshes = new string[nbMeshes]; + _med->getMeshNames(nameMeshes); + for (int i=0;igetNumberOfFields(); + myseq->length(nbFields); + string * nameFields = new string[nbFields]; + _med->getFieldNames(nameFields); + for (int i=0;igetMesh(meshName); + MESH_i * m1 = new MESH_i(mesh); + SALOME_MED::MESH_ptr m2 = m1->POA_SALOME_MED::MESH::_this(); + m1->_remove_ref(); + return (SALOME_MED::MESH::_duplicate(m2)); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to get the specified mesh"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + +} +//============================================================================= +/*! + * CORBA: Accessor for a specific mesh + */ +//============================================================================= +SALOME_MED::MESH_ptr MED_i::getMesh(SALOME_MED::FIELD_ptr fieldPtr) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + int ind=fieldPtr->getCorbaIndex(); + SCRUTE(ind); + + MESH * mesh; + SALOME_MED::FIELDINT_var fieldint =SALOME_MED::FIELDINT::_narrow(fieldPtr); + if (CORBA::is_nil(fieldint)) + { + MESSAGE("Double"); + SALOME_MED::FIELDDOUBLE_var fielddouble = + SALOME_MED::FIELDDOUBLE::_narrow(fieldPtr); + ASSERT(!CORBA::is_nil(fielddouble)); + ASSERT(FIELDOF_i::fieldMap.find(ind) + !=FIELDOF_i::fieldMap.end()); + ::FIELD * fdouble = FIELDOF_i::fieldMap[ind]; + MESH * mesh=_med->getMesh(fdouble); + } + else + { + MESSAGE("Integer"); + ASSERT(FIELDOF_i::fieldMap.find(ind)!=FIELDOF_i::fieldMap.end()); + ::FIELD * fint = FIELDOF_i::fieldMap[ind]; + MESH * mesh=_med->getMesh(fint); + } + MESH_i * meshi = new MESH_i(mesh); + SALOME_MED::MESH_ptr meshptr = meshi->POA_SALOME_MED::MESH::_this(); + meshi->_remove_ref(); + return (SALOME_MED::MESH::_duplicate(meshptr)); + +} +//============================================================================= +/*! + * CORBA: Accessor for a specific field + */ +//============================================================================= +SALOME_MED::FIELD_ptr MED_i::getField(const char* fieldName, + CORBA::Long pasTemps, + CORBA::Long numOrdre ) +throw (SALOME::SALOME_Exception) +{ + const char * LOC="MED_i::getField(const char*,CORBA::Long,CORBA::Long) "; + BEGIN_OF(LOC); + + DT_IT_ dtIt; + + dtIt.dt= (int)pasTemps; + dtIt.it= (int)numOrdre; + + map::const_iterator itFields = _fields.find(fieldName); + + if ( itFields == _fields.end() ) + THROW_SALOME_CORBA_EXCEPTION("Field not found !", SALOME::INTERNAL_ERROR); + + const MAP_IOR_DT_IT_ & map_dtIt = (*itFields).second; + MAP_IOR_DT_IT_::const_iterator itMap_dtIt = map_dtIt.find(dtIt); + + if ( itMap_dtIt == map_dtIt.end() ) + THROW_SALOME_CORBA_EXCEPTION("Iteration not found !", SALOME::INTERNAL_ERROR); + + END_OF(LOC); + return (*itMap_dtIt).second; + +} +//============================================================================= +/*! + * CORBA: Accessor for a specific field + */ +//============================================================================= +CORBA::Long MED_i::addDriver(SALOME_MED::medDriverTypes driverType, const char* fileName) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + int driv=_med->addDriver(convertIdlDriverToMedDriver(driverType), + fileName); + return driv; + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to add a driver to the med object"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + +} +//============================================================================= +/*! + * CORBA: relase the driver (mandatory) + */ +//============================================================================= +void MED_i::rmDriver(CORBA::Long i) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + _med->rmDriver(i); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to unlink the driver from the med object"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: read med objects relations + */ +//============================================================================= +void MED_i::readFileStruct(CORBA::Long i) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + _med->readFileStruct(i); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to read the structure of this file "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: write specifics objects f + */ +//============================================================================= +void MED_i::writeFrom(CORBA::Long i) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + _med->writeFrom(i); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to write this driver "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: write objects + */ +//============================================================================= +void MED_i::write(CORBA::Long i) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + _med->write(i); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to write this file "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: Add Mesh in Med objects + */ +//============================================================================= +void MED_i::addMesh(SALOME_MED::MESH_ptr ptrMesh) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + try + { + int ind=ptrMesh->getCorbaIndex(); + SCRUTE(ind); + ASSERT(MESH_i::meshMap.find(ind) !=MESH_i::meshMap.end()); + MESH * mesh= MESH_i::meshMap[ind]; + _med->addMesh(mesh); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to link this mesh to this med object"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: Add field in Med objects + */ +//============================================================================= +void MED_i::addField(SALOME_MED::FIELD_ptr ptrField) +throw (SALOME::SALOME_Exception) +{ + if (_med==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ + SALOME::INTERNAL_ERROR); + int ind=ptrField->getCorbaIndex(); + SCRUTE(ind); + + SALOME_MED::FIELDINT_var fieldint =SALOME_MED::FIELDINT::_narrow(ptrField); + if (CORBA::is_nil(fieldint)) + { + MESSAGE("Double"); + SALOME_MED::FIELDDOUBLE_var fielddouble = + SALOME_MED::FIELDDOUBLE::_narrow(ptrField); + ASSERT(!CORBA::is_nil(fielddouble)); + ASSERT(FIELDOF_i::fieldMap.find(ind) + !=FIELDOF_i::fieldMap.end()); + ::FIELD * fdouble = FIELDOF_i::fieldMap[ind]; + // A modifier + //_med->addField(fdouble); + } + else + { + MESSAGE("Integer"); + ASSERT(FIELDOF_i::fieldMap.find(ind)!=FIELDOF_i::fieldMap.end()); + ::FIELD * fint = FIELDOF_i::fieldMap[ind]; + //_med->addField(fint); + } +} +//============================================================================= +/*! + * CORBA: Add Med in Study + */ +//============================================================================= +void MED_i::addInStudy(SALOMEDS::Study_ptr myStudy, SALOME_MED::MED_ptr myIor) +throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) +{ + BEGIN_OF("MED_Mesh_i::addInStudy"); + if ( _medId != "" ) + { + MESSAGE("Med already in Study"); + THROW_SALOME_CORBA_EXCEPTION("Med already in Study", \ + SALOME::BAD_PARAM); + }; + + SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); + myBuilder->NewCommand(); + SALOMEDS::GenericAttribute_var anAttr; + SALOMEDS::AttributeName_var aName; + SALOMEDS::AttributeIOR_var aIOR; + + // Create SComponent labelled 'MED' if it doesn't already exit + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); + if ( CORBA::is_nil(medfather) ) + { + THROW_SALOME_CORBA_EXCEPTION("Component Med not found", + SALOME::BAD_PARAM); + }; + + MESSAGE("Add a MED Object under Med"); + SALOMEDS::SObject_var newObj = myBuilder->NewObject(medfather); + + ORB_INIT &init = *SINGLETON_::Instance(); + ASSERT(SINGLETON_::IsAlreadyExisting()); + CORBA::ORB_var &orb = init(0,0); + string iorStr = orb->object_to_string(myIor); + anAttr = myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"); + aIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + aIOR->SetValue(iorStr.c_str()); + anAttr = myBuilder->FindOrCreateAttribute(newObj, "AttributeName"); + aName = SALOMEDS::AttributeName::_narrow(anAttr); + aName->SetValue("Objet MED"); + _medId = newObj->GetID(); + myBuilder->CommitCommand(); + + END_OF("Med_i::addInStudy(SALOMEDS::Study_ptr myStudy)"); +} + diff --git a/src/MedMem/Med_i.hxx b/src/MEDMEM_I/MEDMEM_Med_i.hxx similarity index 87% rename from src/MedMem/Med_i.hxx rename to src/MEDMEM_I/MEDMEM_Med_i.hxx index c50baec47..b2decc829 100644 --- a/src/MedMem/Med_i.hxx +++ b/src/MEDMEM_I/MEDMEM_Med_i.hxx @@ -1,9 +1,9 @@ //============================================================================= -// File : Med_i.hxx +// File : MEDMEM_Med_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Med_i.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Med_i.hxx //============================================================================= #ifndef _MED_MED_I_HXX_ @@ -19,6 +19,7 @@ #include "MEDMEM_Med.hxx" +namespace MEDMEM { typedef map MAP_IOR_DT_IT_; class MED_i: public POA_SALOME_MED::MED @@ -29,7 +30,7 @@ private : protected: // C++ object containing values //::MED * const _med; - ::MED * _med; + ::MEDMEM::MED * _med; string _medId; map _meshes; // We can't have two MESHes with the same name. @@ -52,8 +53,8 @@ public: // IDL Methods CORBA::Long getNumberOfMeshes() throw (SALOME::SALOME_Exception); CORBA::Long getNumberOfFields() throw (SALOME::SALOME_Exception); - Engines::string_array * getMeshNames() throw (SALOME::SALOME_Exception); - Engines::string_array * getFieldNames() throw (SALOME::SALOME_Exception); + SALOME_MED::string_array * getMeshNames() throw (SALOME::SALOME_Exception); + SALOME_MED::string_array * getFieldNames() throw (SALOME::SALOME_Exception); SALOME_MED::MESH_ptr getMeshByName(const char* meshName) throw (SALOME::SALOME_Exception); SALOME_MED::MESH_ptr getMesh(SALOME_MED::FIELD_ptr fieldPtr) @@ -79,7 +80,9 @@ public: throw (SALOME::SALOME_Exception); void addInStudy(SALOMEDS::Study_ptr myStudy, SALOME_MED::MED_ptr myIor) - throw (SALOME::SALOME_Exception); + throw (SALOME::SALOME_Exception, + SALOMEDS::StudyBuilder::LockProtection); }; +} #endif /* _MED_MED_I_HXX_ */ diff --git a/src/MedMem/Mesh_i.cxx b/src/MEDMEM_I/MEDMEM_Mesh_i.cxx similarity index 65% rename from src/MedMem/Mesh_i.cxx rename to src/MEDMEM_I/MEDMEM_Mesh_i.cxx index f984f0259..97abcd905 100644 --- a/src/MedMem/Mesh_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Mesh_i.cxx @@ -1,9 +1,9 @@ //============================================================================= -// File : Mesh_i.cxx +// File : MEDMEM_Mesh_i.cxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Mesh_i.cxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Mesh_i.cxx //============================================================================= #include @@ -13,17 +13,18 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" -#include "convert.hxx" -#include "Mesh_i.hxx" -#include "Support_i.hxx" -#include "Family_i.hxx" -#include "Group_i.hxx" -#include "FieldDouble_i.hxx" +#include "MEDMEM_convert.hxx" +#include "MEDMEM_Mesh_i.hxx" +#include "MEDMEM_Support_i.hxx" +#include "MEDMEM_Family_i.hxx" +#include "MEDMEM_Group_i.hxx" +#include "MEDMEM_FieldDouble_i.hxx" #include "MEDMEM_Mesh.hxx" #include "MEDMEM_Family.hxx" #include "MEDMEM_Group.hxx" #include "MEDMEM_CellModel.hxx" +using namespace MEDMEM; // Initialisation des variables statiques map < int, ::MESH *> MESH_i::meshMap ; @@ -63,7 +64,6 @@ MESH_i::MESH_i(::MESH * const m ) :_mesh(m), { BEGIN_OF("Constructor MESH_i(::MESH * const m )"); MESH_i::meshMap[_corbaIndex]=_mesh; - SCRUTE(_mesh); END_OF("Constructor MESH_i(::MESH * const m )"); @@ -108,11 +108,10 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_mesh->getName().c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the mesh name"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -143,11 +142,10 @@ throw (SALOME::SALOME_Exception) { return _mesh->getSpaceDimension(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the space dimension "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -165,13 +163,57 @@ throw (SALOME::SALOME_Exception) { return _mesh->getMeshDimension(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the mesh dimension "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } +//============================================================================= +/*! + * CORBA: boolean indicating if mesh is a Grid + */ +//============================================================================= +CORBA::Boolean MESH_i::getIsAGrid() +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + try + { + return _mesh->getIsAGrid(); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces mesh flag isAGrid"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: boolean indicating if connectivity exists + */ +//============================================================================= +CORBA::Boolean MESH_i::existConnectivity + (SALOME_MED::medConnectivity connectivityType, + SALOME_MED::medEntityMesh entity) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + try + { + return _mesh->existConnectivity(connectivityType, + convertIdlEntToMedEnt(entity)); } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces mesh flag existConnectivity"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} + //============================================================================= /*! * CORBA: Accessor for Coordinates System @@ -188,25 +230,45 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_mesh->getCoordinatesSystem().c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the type of CoordinatesSystem"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= +/*! + * CORBA: Accessor for a specific coordinate + */ +//============================================================================= +double MESH_i::getCoordinate(CORBA::Long Number, CORBA::Long Axis) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + try + { + return _mesh->getCoordinate(Number,Axis); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces this coordinate"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= /*! * CORBA: Accessor for Coordinates */ //============================================================================= -Engines::double_array * MESH_i::getCoordinates(SALOME_MED::medModeSwitch typeSwitch) +SALOME_MED::double_array * MESH_i::getCoordinates(SALOME_MED::medModeSwitch typeSwitch) throw (SALOME::SALOME_Exception) { if (_mesh==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ SALOME::INTERNAL_ERROR); - Engines::double_array_var myseq = new Engines::double_array; + SALOME_MED::double_array_var myseq = new SALOME_MED::double_array; try { int spaceDimension=_mesh->getSpaceDimension(); @@ -220,11 +282,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=coordinates[i]; }; } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the coordinates"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -233,13 +294,13 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for Coordinates Names */ //============================================================================= -Engines::string_array * MESH_i::getCoordinatesNames() +SALOME_MED::string_array * MESH_i::getCoordinatesNames() throw (SALOME::SALOME_Exception) { if (_mesh==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ SALOME::INTERNAL_ERROR); - Engines::string_array_var myseq = new Engines::string_array; + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; try { int spaceDimension=_mesh->getSpaceDimension(); @@ -250,11 +311,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=CORBA::string_dup(coordinatesName[i].c_str()); } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the coordinates names"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); @@ -264,13 +324,13 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for Coordinates Units */ //============================================================================= -Engines::string_array * MESH_i::getCoordinatesUnits() +SALOME_MED::string_array * MESH_i::getCoordinatesUnits() throw (SALOME::SALOME_Exception) { if (_mesh==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ SALOME::INTERNAL_ERROR); - Engines::string_array_var myseq = new Engines::string_array; + SALOME_MED::string_array_var myseq = new SALOME_MED::string_array; try { int spaceDimension=_mesh->getSpaceDimension(); @@ -281,11 +341,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=CORBA::string_dup(coordinatesUnits[i].c_str()); }; } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces the coordinates units"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -304,11 +363,10 @@ throw (SALOME::SALOME_Exception) { return _mesh->getNumberOfNodes(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces number of nodes"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -326,11 +384,32 @@ throw (SALOME::SALOME_Exception) { return _mesh->getNumberOfTypes(convertIdlEntToMedEnt(entity)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces number of differents types"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: Accessor for existing geometry element types + */ +//============================================================================= +SALOME_MED::medGeometryElement MESH_i::getElementType (SALOME_MED::medEntityMesh entity, + CORBA::Long number) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + try + { + return _mesh->getElementType(convertIdlEntToMedEnt(entity),number); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces number of differents element types"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } @@ -362,11 +441,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=convertMedEltToIdlElt(elemts[i]); }; } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces coordinates"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -393,11 +471,10 @@ throw (SALOME::SALOME_Exception) return _mesh->getNumberOfElements(convertIdlEntToMedEnt(entity), convertIdlEltToMedElt(geomElement)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces number of elements"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -405,7 +482,7 @@ throw (SALOME::SALOME_Exception) * CORBA: Accessor for connectivities */ //============================================================================= -Engines::long_array * MESH_i::getConnectivity(SALOME_MED::medModeSwitch typeSwitch, +SALOME_MED::long_array * MESH_i::getConnectivity(SALOME_MED::medModeSwitch typeSwitch, SALOME_MED::medConnectivity mode, SALOME_MED::medEntityMesh entity, SALOME_MED::medGeometryElement geomElement) @@ -417,7 +494,7 @@ throw (SALOME::SALOME_Exception) if (verifieParam(entity,geomElement)==false) THROW_SALOME_CORBA_EXCEPTION("parameters don't match",\ SALOME::BAD_PARAM); - Engines::long_array_var myseq= new Engines::long_array; + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { int nbelements; @@ -454,11 +531,10 @@ SCRUTE(nbelements); myseq[i]=numbers[i]; } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces connectivities"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -467,14 +543,14 @@ SCRUTE(nbelements); * CORBA: Accessor for connectivities */ //============================================================================= -Engines::long_array* MESH_i::getConnectivityIndex(SALOME_MED::medConnectivity mode, +SALOME_MED::long_array* MESH_i::getConnectivityIndex(SALOME_MED::medConnectivity mode, SALOME_MED::medEntityMesh entity) throw (SALOME::SALOME_Exception) { if (_mesh==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ SALOME::INTERNAL_ERROR); - Engines::long_array_var myseq= new Engines::long_array; + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { int nbelements = _mesh->getNumberOfElements( @@ -488,14 +564,43 @@ throw (SALOME::SALOME_Exception) myseq[i]=numbers[i]; } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces connectivities index"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + return myseq._retn(); +} +//============================================================================= +/*! + * CORBA: Accessor for connectivities + */ +//============================================================================= +SALOME_MED::long_array* MESH_i::getGlobalNumberingIndex( SALOME_MED::medEntityMesh entity) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; + try + { + int nbelements = _mesh->getNumberOfTypes( convertIdlEntToMedEnt(entity)) + 1; + myseq->length(nbelements); + const int * numbers=_mesh->getGlobalNumberingIndex( convertIdlEntToMedEnt(entity)); + for (int i=0;igetNumberOfFamilies(convertIdlEntToMedEnt(entity)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces number of families of the mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -652,11 +754,10 @@ throw (SALOME::SALOME_Exception) { return _mesh->getNumberOfGroups(convertIdlEntToMedEnt(entity)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces number of groups of the mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -686,14 +787,85 @@ throw (SALOME::SALOME_Exception) myseq[i] = f2; } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces families of the mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } +//============================================================================= +/*! + * CORBA: Returns Coordinates global informations + */ +//============================================================================= +SALOME_MED::MESH::coordinateInfos * MESH_i::getCoordGlobal() +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + SALOME_MED::MESH::coordinateInfos_var all = new SALOME_MED::MESH::coordinateInfos; + try + { + all->coordSystem = CORBA::string_dup(_mesh->getCoordinatesSystem().c_str()); + + int spaceDimension=_mesh->getSpaceDimension(); + const string * coordinatesUnits =_mesh->getCoordinatesUnits(); + const string * coordinatesName =_mesh->getCoordinatesNames(); + + all->coordUnits.length(spaceDimension); + all->coordNames.length(spaceDimension); + for (int i=0; icoordUnits[i]=CORBA::string_dup(coordinatesUnits[i].c_str()); + all->coordNames[i]=CORBA::string_dup(coordinatesName[i].c_str()); + } + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces coordinate information "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + return all._retn(); +} +//============================================================================= +/*! + * CORBA: Returns connectivity global informations + */ +//============================================================================= +SALOME_MED::MESH::connectivityInfos * MESH_i::getConnectGlobal + (SALOME_MED::medEntityMesh entity) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + SALOME_MED::MESH::connectivityInfos_var all=new SALOME_MED::MESH::connectivityInfos; + try + { + all->numberOfNodes = _mesh->getNumberOfNodes(); + + int nbTypes=_mesh->getNumberOfTypes(convertIdlEntToMedEnt(entity)); + const medGeometryElement * elemts =_mesh->getTypes( + convertIdlEntToMedEnt(entity)); + all->meshTypes.length(nbTypes); + all->numberOfElements.length(nbTypes); + for (int i=0; imeshTypes[i]=convertMedEltToIdlElt(elemts[i]); + all->numberOfElements[i]=_mesh->getNumberOfElements( + convertIdlEntToMedEnt(entity),elemts[i]); + } + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces connectivities informations"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + return all._retn(); +} + //============================================================================= /*! * CORBA: Returns references for family i within the mesh @@ -714,16 +886,139 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FAMILY::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces specified family of the mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Family C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= -/*! +/* + * CORBA: Returns Mesh global informations + */ +//============================================================================= +SALOME_MED::MESH::meshInfos * MESH_i::getMeshGlobal() +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + SALOME_MED::MESH::meshInfos_var all = new SALOME_MED::MESH::meshInfos; + try + { + all->name = CORBA::string_dup(_mesh->getName().c_str()); + all->spaceDimension = _mesh->getSpaceDimension(); + all->meshDimension = _mesh->getMeshDimension(); + all->numberOfNodes = _mesh->getNumberOfNodes(); + all->isAGrid = _mesh->getIsAGrid(); + + int nbFam= _mesh->getNumberOfFamilies(MED_NODE); + all->famNode.length(nbFam); + vector vNode (nbFam); + vNode = _mesh->getFamilies(MED_NODE); + for (int i=0;iPOA_SALOME_MED::FAMILY::_this(); + f1->_remove_ref(); + all->famNode[i] = f2; + } + + nbFam = _mesh->getNumberOfFamilies(MED_EDGE); + all->famEdge.length(nbFam); + vector vEdge (nbFam); + vEdge = _mesh->getFamilies(MED_EDGE); + for (int i=0;iPOA_SALOME_MED::FAMILY::_this(); + f1->_remove_ref(); + all->famEdge[i] = f2; + } + + nbFam = _mesh->getNumberOfFamilies(MED_FACE); + all->famFace.length(nbFam); + vector vFace (nbFam); + vFace = _mesh->getFamilies(MED_FACE); + for (int i=0;iPOA_SALOME_MED::FAMILY::_this(); + f1->_remove_ref(); + all->famFace[i] = f2; + } + + nbFam = _mesh->getNumberOfFamilies(MED_CELL); + all->famCell.length(nbFam); + vector vCell (nbFam); + vCell = _mesh->getFamilies(MED_CELL); + for (int i=0;iPOA_SALOME_MED::FAMILY::_this(); + f1->_remove_ref(); + all->famCell[i] = f2; + } + + int nbGroup = _mesh->getNumberOfGroups(MED_NODE); + all->groupNode.length(nbGroup); + vector gNode (nbGroup); + gNode = _mesh->getGroups(MED_NODE); + for (int i=0;iPOA_SALOME_MED::GROUP::_this(); + f1->_remove_ref(); + all->groupNode[i] = f2; + } + + nbGroup = _mesh->getNumberOfGroups(MED_EDGE); + all->groupEdge.length(nbGroup); + vector gEdge (nbGroup); + gEdge = _mesh->getGroups(MED_EDGE); + for (int i=0;iPOA_SALOME_MED::GROUP::_this(); + f1->_remove_ref(); + all->groupEdge[i] = f2; + } + nbGroup = _mesh->getNumberOfGroups(MED_FACE); + all->groupFace.length(nbGroup); + vector gFace (nbGroup); + gFace = _mesh->getGroups(MED_FACE); + for (int i=0;iPOA_SALOME_MED::GROUP::_this(); + f1->_remove_ref(); + all->groupFace[i] = f2; + } + + nbGroup = _mesh->getNumberOfGroups(MED_CELL); + all->groupCell.length(nbGroup); + vector gCell (nbGroup); + gCell = _mesh->getGroups(MED_CELL); + for (int i=0;iPOA_SALOME_MED::GROUP::_this(); + f1->_remove_ref(); + all->groupCell[i] = f2; + } + + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to acces mesh"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + return all._retn(); +} +//============================================================================= + /* * CORBA: Returns references for groups within the mesh */ //============================================================================= @@ -748,11 +1043,10 @@ throw (SALOME::SALOME_Exception) myseq[i] = f2; } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces number of groups of the mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -776,11 +1070,34 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::GROUP::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to acces specified group of the mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: + */ +//============================================================================= +SALOME_MED::SUPPORT_ptr MESH_i::getBoundaryElements(SALOME_MED::medEntityMesh entity) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + try + { + SUPPORT * myNewSupport = _mesh->getBoundaryElements(convertIdlEntToMedEnt(entity)); + SUPPORT_i * mySupportI = new SUPPORT_i(myNewSupport); + SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this() ; + return (SALOME_MED::SUPPORT::_duplicate(mySupportIOR)); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to get the volume "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -793,8 +1110,7 @@ throw (SALOME::SALOME_Exception) { if (_mesh==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ - SALOME::INTERNAL_ERROR); - try + SALOME::INTERNAL_ERROR); try { int sup = mySupport->getCorbaIndex(); ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end()); @@ -807,11 +1123,37 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FIELD::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to get the volume "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} +//============================================================================= +/*! + * CORBA: + */ +//============================================================================= +SALOME_MED::SUPPORT_ptr MESH_i::getSkin(SALOME_MED::SUPPORT_ptr mySupport3D) +throw (SALOME::SALOME_Exception) +{ + if (_mesh==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \ + SALOME::INTERNAL_ERROR); + try + { + int sup = mySupport3D->getCorbaIndex(); + ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end()); + const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup]; + SUPPORT * myNewSupport = _mesh->getSkin(myCppSupport); + SUPPORT_i * mySupportI = new SUPPORT_i(myNewSupport); + SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this() ; + return (SALOME_MED::SUPPORT::_duplicate(mySupportIOR)); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to get the volume "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -838,11 +1180,10 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FIELD::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to get the area "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -869,11 +1210,10 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FIELD::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to get the length "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -900,11 +1240,10 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FIELD::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to get the normal "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -931,11 +1270,10 @@ throw (SALOME::SALOME_Exception) f1->_remove_ref(); return (SALOME_MED::FIELD::_duplicate(f2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to get the barycenter "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -957,7 +1295,7 @@ throw (SALOME::SALOME_Exception) */ //============================================================================= void MESH_i::addInStudy(SALOMEDS::Study_ptr myStudy,SALOME_MED::MESH_ptr myIor ) -throw (SALOME::SALOME_Exception) +throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) { BEGIN_OF("MED_Mesh_i::addInStudy"); if ( _meshId != "" ) @@ -973,8 +1311,8 @@ throw (SALOME::SALOME_Exception) SALOMEDS::AttributeIOR_var aIOR; // Find SComponent labelled 'MED' - // SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); + myBuilder->NewCommand(); if ( CORBA::is_nil(medfather) ) THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); @@ -992,7 +1330,6 @@ throw (SALOME::SALOME_Exception) } ; MESSAGE("Add a mesh Object under MED/MEDMESH"); - myBuilder->NewCommand(); SALOMEDS::SObject_var newObj = myBuilder->NewObject(medmeshfather); ORB_INIT &init = *SINGLETON_::Instance() ; @@ -1016,7 +1353,7 @@ throw (SALOME::SALOME_Exception) */ //============================================================================= void MESH_i::addInStudy(SALOMEDS::Study_ptr myStudy,SALOME_MED::MESH_ptr myIor,const string & fileName ) -throw (SALOME::SALOME_Exception) +throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) { BEGIN_OF("MED_Mesh_i::addInStudy"); if ( _meshId != "" ) @@ -1033,7 +1370,6 @@ throw (SALOME::SALOME_Exception) SALOMEDS::AttributeComment_var aComment; // Find SComponent labelled 'Med' - // SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); @@ -1090,11 +1426,10 @@ throw (SALOME::SALOME_Exception) { _mesh->write(i,driverMeshName); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to write the mesh "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -1112,11 +1447,10 @@ throw (SALOME::SALOME_Exception) { _mesh->read(i); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to read the mesh "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } //============================================================================= @@ -1134,9 +1468,10 @@ throw (SALOME::SALOME_Exception) { _mesh->rmDriver(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to unlink the mesh from the driver "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ ,SALOME::INTERNAL_ERROR); } @@ -1161,11 +1496,10 @@ throw (SALOME::SALOME_Exception) meshName); return drivernum; } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to link the mesh to the driver "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } diff --git a/src/MEDMEM_I/MEDMEM_Mesh_i.hxx b/src/MEDMEM_I/MEDMEM_Mesh_i.hxx new file mode 100644 index 000000000..de4ba198a --- /dev/null +++ b/src/MEDMEM_I/MEDMEM_Mesh_i.hxx @@ -0,0 +1,184 @@ +//============================================================================= +// File : MEDMEM_Mesh_i.hxx +// Project : SALOME +// Author : EDF +// Copyright : EDF 2002 +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Mesh_i.hxx +//============================================================================= + +#ifndef _MED_MESH_I_HXX_ +#define _MED_MESH_I_HXX_ + +#include +#include + +#include +#include CORBA_SERVER_HEADER(MED) +#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) + +namespace MEDMEM { +class MESH; +class MESH_i: + public POA_SALOME_MED::MESH, + public PortableServer::RefCountServantBase +// public SALOME_MED_Component_i +{ +public : + static map < int,::MEDMEM::MESH *> meshMap; +private : + static int meshIndex; + +private : + +protected: + // C++ object containing values + ::MEDMEM::MESH * const _mesh; + const int _corbaIndex; + string _meshId; + + +public: + + // Constructors and associated internal methods + MESH_i(); + MESH_i(::MEDMEM::MESH * const m); + MESH_i(MESH_i & m); + ~MESH_i(); + + // IDL Methods + char * getName() throw (SALOME::SALOME_Exception); + + CORBA::Long getSpaceDimension() throw (SALOME::SALOME_Exception); + + CORBA::Long getMeshDimension() throw (SALOME::SALOME_Exception); + + CORBA::Boolean getIsAGrid() throw (SALOME::SALOME_Exception); + + CORBA::Boolean existConnectivity + ( SALOME_MED::medConnectivity connectivityType, + SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + char * getCoordinatesSystem() + throw (SALOME::SALOME_Exception); + + SALOME_MED::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch) + throw (SALOME::SALOME_Exception); + + double getCoordinate(CORBA::Long Number, CORBA::Long Axis) + throw (SALOME::SALOME_Exception); + + SALOME_MED::string_array* getCoordinatesNames() + throw (SALOME::SALOME_Exception); + + SALOME_MED::string_array* getCoordinatesUnits() + throw (SALOME::SALOME_Exception); + + CORBA::Long getNumberOfNodes() + throw (SALOME::SALOME_Exception); + + CORBA::Long getNumberOfTypes (SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + SALOME_MED::medGeometryElement getElementType(SALOME_MED::medEntityMesh entity, + CORBA::Long number) + throw (SALOME::SALOME_Exception); + + + CORBA::Long getNumberOfElements (SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement geomElement) + throw (SALOME::SALOME_Exception); + + SALOME_MED::long_array* getConnectivity(SALOME_MED::medModeSwitch typeSwitch, + SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement geomElement) + throw (SALOME::SALOME_Exception); + + SALOME_MED::long_array* getConnectivityIndex(SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + SALOME_MED::long_array* getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement type, + const SALOME_MED::long_array& connectivity) + throw (SALOME::SALOME_Exception); + + SALOME_MED::long_array* getReverseConnectivity(SALOME_MED::medConnectivity mode) + throw (SALOME::SALOME_Exception); + + SALOME_MED::long_array* getReverseConnectivityIndex(SALOME_MED::medConnectivity mode) + throw (SALOME::SALOME_Exception); + + // Family and Group + CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + SALOME_MED::Family_array* getFamilies(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + SALOME_MED::FAMILY_ptr getFamily (SALOME_MED::medEntityMesh entity, + CORBA::Long i) + throw (SALOME::SALOME_Exception); + SALOME_MED::Group_array* getGroups(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + SALOME_MED::GROUP_ptr getGroup (SALOME_MED::medEntityMesh entity, + CORBA::Long i) + throw (SALOME::SALOME_Exception); + // + SALOME_MED::SUPPORT_ptr getBoundaryElements(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + SALOME_MED::SUPPORT_ptr getSkin (SALOME_MED::SUPPORT_ptr mySupport3D) + throw (SALOME::SALOME_Exception); + // + SALOME_MED::FIELD_ptr getVolume (SALOME_MED::SUPPORT_ptr mySupport) + throw (SALOME::SALOME_Exception); + SALOME_MED::FIELD_ptr getArea (SALOME_MED::SUPPORT_ptr mySupport) + throw (SALOME::SALOME_Exception); + SALOME_MED::FIELD_ptr getLength (SALOME_MED::SUPPORT_ptr mySupport) + throw (SALOME::SALOME_Exception); + SALOME_MED::FIELD_ptr getNormal (SALOME_MED::SUPPORT_ptr mySupport) + throw (SALOME::SALOME_Exception); + SALOME_MED::FIELD_ptr getBarycenter (SALOME_MED::SUPPORT_ptr mySupport) + throw (SALOME::SALOME_Exception); + SALOME_MED::FIELD_ptr getNeighbourhood (SALOME_MED::SUPPORT_ptr mySupport) + throw (SALOME::SALOME_Exception); + + + // Others + void addInStudy (SALOMEDS::Study_ptr myStudy, + SALOME_MED::MESH_ptr myIor) + throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection); + void addInStudy (SALOMEDS::Study_ptr myStudy, + SALOME_MED::MESH_ptr myIor, + const string & fileName) + throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection); + CORBA::Long addDriver (SALOME_MED::medDriverTypes driverType, + const char* fileName, const char* meshName) + throw (SALOME::SALOME_Exception); + void rmDriver (CORBA::Long i) throw (SALOME::SALOME_Exception); + void read (CORBA::Long i) throw (SALOME::SALOME_Exception); + void write (CORBA::Long i, const char* driverMeshName) + throw (SALOME::SALOME_Exception); + + // Cuisine interne + CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception); + ::MEDMEM::MESH * constructConstMesh() const; + SALOME_MED::MESH::meshInfos * getMeshGlobal() + throw (SALOME::SALOME_Exception); + SALOME_MED::MESH::coordinateInfos * getCoordGlobal() + throw (SALOME::SALOME_Exception); + SALOME_MED::MESH::connectivityInfos * getConnectGlobal + (SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); +}; +} + +#endif /* _MED_MESH_I_HXX_ */ diff --git a/src/MedMem/Support_i.cxx b/src/MEDMEM_I/MEDMEM_Support_i.cxx similarity index 69% rename from src/MedMem/Support_i.cxx rename to src/MEDMEM_I/MEDMEM_Support_i.cxx index 31f3d1e84..3886faab2 100644 --- a/src/MedMem/Support_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Support_i.cxx @@ -1,9 +1,9 @@ //============================================================================= -// File : Support_i.cxx +// File : MEDMEM_Support_i.cxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Support_i.cxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Support_i.cxx //============================================================================= #include "utilities.h" @@ -18,9 +18,10 @@ #include "MEDMEM_define.hxx" #include "MEDMEM_Support.hxx" -#include "Support_i.hxx" -#include "Mesh_i.hxx" -#include "convert.hxx" +#include "MEDMEM_Support_i.hxx" +#include "MEDMEM_Mesh_i.hxx" +#include "MEDMEM_convert.hxx" +using namespace MEDMEM; // Initialisation des variables statiques map < int, ::SUPPORT *> SUPPORT_i::supportMap ; @@ -102,11 +103,10 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_support->getName().c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the name of the support "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } @@ -127,14 +127,52 @@ throw (SALOME::SALOME_Exception) { return CORBA::string_dup(_support->getDescription().c_str()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the description of the support "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } +//============================================================================= +/*! + * CORBA: Accessor for Description and Name + */ +//============================================================================= + +SALOME_MED::SUPPORT::supportInfos * SUPPORT_i::getSupportGlobal() +throw (SALOME::SALOME_Exception) +{ + if (_support==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ + SALOME::INTERNAL_ERROR); + SALOME_MED::SUPPORT::supportInfos_var all = new SALOME_MED::SUPPORT::supportInfos; + try + { + all->name = CORBA::string_dup(_support->getName().c_str()); + all->description = CORBA::string_dup(_support->getDescription().c_str()); + const int numberOfTypes = _support->getNumberOfTypes(); + all->numberOfGeometricType = numberOfTypes; + + all->types.length(numberOfTypes); + all->nbEltTypes.length(numberOfTypes); + const medGeometryElement * elemts = _support->getTypes(); + for (int i=0;itypes[i] = convertMedEltToIdlElt(elemts[i]); + all->nbEltTypes[i] = _support->getNumberOfElements(elemts[i]); + } + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to access the description of the support "); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + return all._retn(); + +} + + //============================================================================= /*! * CORBA: Accessor for Mesh @@ -157,9 +195,6 @@ throw (SALOME::SALOME_Exception) MESH_i * m1 = new MESH_i(mesh); SALOME_MED::MESH_ptr m2 = m1->POA_SALOME_MED::MESH::_this(); - - - MESSAGE("SALOME_MED::MESH_ptr SUPPORT_i::getMesh() checking des pointeurs CORBA"); SCRUTE(m1); @@ -171,11 +206,10 @@ throw (SALOME::SALOME_Exception) return (SALOME_MED::MESH::_duplicate(m2)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the assoicated mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } @@ -195,14 +229,37 @@ throw (SALOME::SALOME_Exception) { return _support->isOnAllElements(); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the type of the support"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } +//============================================================================= +/*! + * CORBA: + */ +//============================================================================= +CORBA::Long SUPPORT_i::getNumberOfTypes() +throw (SALOME::SALOME_Exception) +{ + if (_support==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ + SALOME::INTERNAL_ERROR); + try + { + return _support->getNumberOfTypes(); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to access number of support different types"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } + +} + + //============================================================================= /*! * CORBA: Accessor for type of support's entity @@ -222,11 +279,10 @@ throw (SALOME::SALOME_Exception) END_OF("SALOME_MED::medEntityMesh SUPPORT_i::getEntity()"); return convertMedEntToIdlEnt(_support->getEntity()); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access support s entity"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object", \ - SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } @@ -253,11 +309,10 @@ throw (SALOME::SALOME_Exception) myseq[i]=convertMedEltToIdlElt(elemts[i]); } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access support different types"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object", \ - SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } @@ -282,11 +337,10 @@ throw (SALOME::SALOME_Exception) { return _support->getNumberOfElements(convertIdlEltToMedElt(geomElement)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the number of support different types"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } @@ -297,7 +351,7 @@ throw (SALOME::SALOME_Exception) */ //============================================================================= -Engines::long_array * SUPPORT_i::getNumber(SALOME_MED::medGeometryElement geomElement) +SALOME_MED::long_array * SUPPORT_i::getNumber(SALOME_MED::medGeometryElement geomElement) throw (SALOME::SALOME_Exception) { SCRUTE(_support); @@ -307,7 +361,7 @@ throw (SALOME::SALOME_Exception) if (_support==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ SALOME::INTERNAL_ERROR); - Engines::long_array_var myseq= new Engines::long_array; + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { int nbelements=_support->getNumberOfElements(convertIdlEltToMedElt(geomElement)); @@ -322,11 +376,10 @@ SCRUTE(convertIdlEltToMedElt(geomElement)); SCRUTE(numbers[i]); } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the support optionnal index"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); @@ -338,13 +391,13 @@ SCRUTE(numbers[i]); */ //============================================================================= -Engines::long_array * SUPPORT_i::getNumberIndex() +SALOME_MED::long_array * SUPPORT_i::getNumberIndex() throw (SALOME::SALOME_Exception) { if (_support==NULL) THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ SALOME::INTERNAL_ERROR); - Engines::long_array_var myseq= new Engines::long_array; + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS"); @@ -356,15 +409,38 @@ throw (SALOME::SALOME_Exception) myseq[i]=numbers[i]; } } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access the support index"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } return myseq._retn(); } +//============================================================================= +/*! + * CORBA: + */ +//============================================================================= + +void SUPPORT_i::getBoundaryElements() +throw (SALOME::SALOME_Exception) +{ + if (_support==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ + SALOME::INTERNAL_ERROR); + try + { + (const_cast< ::SUPPORT *>(_support))->getBoundaryElements(); + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to access elements"); + THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ + ,SALOME::INTERNAL_ERROR); + } +} + //============================================================================= /*! @@ -372,7 +448,7 @@ throw (SALOME::SALOME_Exception) */ //============================================================================= -CORBA::Long SUPPORT_i::getNumberOfGaussPoints(SALOME_MED::medGeometryElement geomElement) +CORBA::Long SUPPORT_i::getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement) throw (SALOME::SALOME_Exception) { if (_support==NULL) @@ -382,21 +458,47 @@ throw (SALOME::SALOME_Exception) { return _support->getNumberOfGaussPoint(convertIdlEltToMedElt(geomElement)); } - catch(...) + catch (MEDEXCEPTION &ex) { MESSAGE("Unable to access number of Gauss points"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support C++ Object"\ - ,SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); } } - +//============================================================================= +/*! + * CORBA: Global Nodes Index (optionnaly designed by the user) + */ +//============================================================================= +SALOME_MED::long_array * SUPPORT_i::getNumbersOfGaussPoint() +throw (SALOME::SALOME_Exception) +{ + if (_support==NULL) + THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ + SALOME::INTERNAL_ERROR); + SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; + try + { + int mySeqLength=_support->getNumberOfTypes(); + myseq->length(mySeqLength); + const medGeometryElement * elemts = _support->getTypes(); + for (int i=0;igetNumberOfGaussPoint(elemts[i]); + } + } + catch (MEDEXCEPTION &ex) + { + MESSAGE("Unable to access number of Gauss points"); + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); + } +} //============================================================================= /*! * CORBA: add the Support in the StudyManager */ //============================================================================= void SUPPORT_i::addInStudy (SALOMEDS::Study_ptr myStudy, SALOME_MED::SUPPORT_ptr myIor) - throw (SALOME::SALOME_Exception) + throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) { BEGIN_OF("SUPPORT_i::addInStudy"); @@ -406,6 +508,14 @@ void SUPPORT_i::addInStudy (SALOMEDS::Study_ptr myStudy, SALOME_MED::SUPPORT_ptr THROW_SALOME_CORBA_EXCEPTION("Support already in Study", \ SALOME::BAD_PARAM); }; + + if ( CORBA::is_nil(myStudy) ) + { + MESSAGE("Study not found"); + THROW_SALOME_CORBA_EXCEPTION("Study deleted !!!", + SALOME::INTERNAL_ERROR); + } + SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); SALOMEDS::GenericAttribute_var anAttr; @@ -413,20 +523,19 @@ void SUPPORT_i::addInStudy (SALOMEDS::Study_ptr myStudy, SALOME_MED::SUPPORT_ptr SALOMEDS::AttributeIOR_var aIOR; // Find SComponent labelled 'Med' - MESSAGE("Find SComponent labelled 'Med'"); - // SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + MESSAGE("Find SComponent labelled 'MED'"); SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) + { + MESSAGE("MED not found"); THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); - - if ( CORBA::is_nil(myStudy) ) - THROW_SALOME_CORBA_EXCEPTION("Study deleted !!!",SALOME::INTERNAL_ERROR); + } // Find SObject MESH (represent mesh in support) SALOMEDS::SObject_var medmeshfather = myStudy->FindObject("MEDMESH"); if ( CORBA::is_nil(medmeshfather) ) { - cout << "On a leve l exception" << flush; + MESSAGE("No MEDMESH Found in study") THROW_SALOME_CORBA_EXCEPTION("SObject labelled 'MEDMESH' not Found",SALOME::INTERNAL_ERROR); } cout << "Find SObject MESH (represent mesh in support)"<< flush; diff --git a/src/MedMem/Support_i.hxx b/src/MEDMEM_I/MEDMEM_Support_i.hxx similarity index 64% rename from src/MedMem/Support_i.hxx rename to src/MEDMEM_I/MEDMEM_Support_i.hxx index 8929bf5fd..03afd5a87 100644 --- a/src/MedMem/Support_i.hxx +++ b/src/MEDMEM_I/MEDMEM_Support_i.hxx @@ -1,9 +1,9 @@ //============================================================================= -// File : Support_i.hxx +// File : MEDMEM_Support_i.hxx // Project : SALOME // Author : EDF // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Support_i.hxx +// $Header: /export/home/PAL/MED/src/MEDMEM_I/MEDMEM_Support_i.hxx //============================================================================= #ifndef _MED_SUPPORT_I_HXX_ @@ -16,6 +16,7 @@ #include CORBA_SERVER_HEADER(MED) +namespace MEDMEM { class SUPPORT; class SALOME_MED::MESH; @@ -24,14 +25,14 @@ class SUPPORT_i: public PortableServer::RefCountServantBase { public : - static map < int,::SUPPORT *> supportMap; + static map < int,::MEDMEM::SUPPORT *> supportMap; private : static int supportIndex; protected : // C++ object containing values - const ::SUPPORT * const _support; + const ::MEDMEM::SUPPORT * const _support; const int _corbaIndex ; string _supportId ; @@ -41,7 +42,7 @@ public: ~SUPPORT_i(); // Constructors and associated internal methods - SUPPORT_i(const ::SUPPORT * const s); + SUPPORT_i(const ::MEDMEM::SUPPORT * const s); SUPPORT_i(const SUPPORT_i & s); // IDL Methods @@ -52,22 +53,33 @@ public: SALOME_MED::medEntityMesh getEntity() throw (SALOME::SALOME_Exception); CORBA::Long getNumberOfElements(SALOME_MED::medGeometryElement geomElement) throw (SALOME::SALOME_Exception); - Engines::long_array* getNumber(SALOME_MED::medGeometryElement geomElement) + CORBA::Long getNumberOfTypes() + throw (SALOME::SALOME_Exception); + SALOME_MED::long_array* getNumber(SALOME_MED::medGeometryElement geomElement) throw (SALOME::SALOME_Exception); - Engines::long_array* getNumberIndex() + SALOME_MED::long_array* getNumberIndex() throw (SALOME::SALOME_Exception); - CORBA::Long getNumberOfGaussPoints(SALOME_MED::medGeometryElement geomElement) + CORBA::Long getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement) throw (SALOME::SALOME_Exception); + SALOME_MED::long_array* getNumbersOfGaussPoint() + throw (SALOME::SALOME_Exception); + SALOME_MED::medGeometryElement_array* getTypes() throw (SALOME::SALOME_Exception); + void getBoundaryElements() throw (SALOME::SALOME_Exception); + + // Others void addInStudy (SALOMEDS::Study_ptr myStudy, SALOME_MED::SUPPORT_ptr myIor) - throw (SALOME::SALOME_Exception); + throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection); + // Cuisine interne CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception); + SALOME_MED::SUPPORT::supportInfos * getSupportGlobal() throw (SALOME::SALOME_Exception); }; +} #endif /* _MED_SUPPORT_I_HXX_ */ diff --git a/src/MedMem/convert.cxx b/src/MEDMEM_I/MEDMEM_convert.cxx similarity index 92% rename from src/MedMem/convert.cxx rename to src/MEDMEM_I/MEDMEM_convert.cxx index 9bd0ee293..1e6cdaa76 100644 --- a/src/MedMem/convert.cxx +++ b/src/MEDMEM_I/MEDMEM_convert.cxx @@ -1,16 +1,16 @@ //============================================================================= -// File : convert.cxx +// File : MEDMEM_convert.cxx // Created : mer fév 20 15:47:57 CET 2002 // Author : EDF // Project : SALOME // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/convert.cxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_convert.cxx //============================================================================= #include "utilities.h" #include "Utils_CorbaException.hxx" -#include "convert.hxx" +#include "MEDMEM_convert.hxx" SALOME_MED::medGeometryElement convertMedEltToIdlElt(medGeometryElement element) @@ -169,14 +169,14 @@ throw (SALOME::SALOME_Exception) } } } -SALOME_MED::medDriverTypes convertMedDriverToIdlDriver(driverTypes driverType) +SALOME_MED::medDriverTypes convertMedDriverToIdlDriver(MEDMEM::driverTypes driverType) throw (SALOME::SALOME_Exception) { switch (driverType) { - case MED_DRIVER : return SALOME_MED::MED_DRIVER; - case VTK_DRIVER : return SALOME_MED::VTK_DRIVER; - case NO_DRIVER : return SALOME_MED::NO_DRIVER; + case MEDMEM::MED_DRIVER : return SALOME_MED::MED_DRIVER; + case MEDMEM::VTK_DRIVER : return SALOME_MED::VTK_DRIVER; + case MEDMEM::NO_DRIVER : return SALOME_MED::NO_DRIVER; default : { MESSAGE("Unknown driver type"); THROW_SALOME_CORBA_EXCEPTION("Unknown driver type", @@ -185,14 +185,14 @@ throw (SALOME::SALOME_Exception) } } -driverTypes convertIdlDriverToMedDriver(SALOME_MED::medDriverTypes driverType) +MEDMEM::driverTypes convertIdlDriverToMedDriver(SALOME_MED::medDriverTypes driverType) throw (SALOME::SALOME_Exception) { switch (driverType) { - case SALOME_MED::MED_DRIVER : return MED_DRIVER; - case SALOME_MED::VTK_DRIVER : return VTK_DRIVER; - case SALOME_MED::NO_DRIVER : return NO_DRIVER; + case SALOME_MED::MED_DRIVER : return MEDMEM::MED_DRIVER; + case SALOME_MED::VTK_DRIVER : return MEDMEM::VTK_DRIVER; + case SALOME_MED::NO_DRIVER : return MEDMEM::NO_DRIVER; default : { MESSAGE("Unknown driver type"); THROW_SALOME_CORBA_EXCEPTION("Unknown driver type", diff --git a/src/MedMem/convert.hxx b/src/MEDMEM_I/MEDMEM_convert.hxx similarity index 85% rename from src/MedMem/convert.hxx rename to src/MEDMEM_I/MEDMEM_convert.hxx index 78a5de6e9..abdef9937 100644 --- a/src/MedMem/convert.hxx +++ b/src/MEDMEM_I/MEDMEM_convert.hxx @@ -1,18 +1,16 @@ //============================================================================= -// File : convert.hxx +// File : MEDMEM_convert.hxx // Created : mer fév 20 15:47:57 CET 2002 // Author : EDF // Project : SALOME // Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/convert.hxx +// $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_convert.hxx //============================================================================= # if ! defined ( __CONVERT_H__ ) # define __CONVERT_H__ #include - #include CORBA_SERVER_HEADER(MED) - #include "MEDMEM_define.hxx" using namespace MED_EN; @@ -25,7 +23,7 @@ SALOME_MED::medEntityMesh convertMedEntToIdlEnt(medEntityMesh entity) throw (SALOME::SALOME_Exception); SALOME_MED::medModeSwitch convertMedModeToIdlMode(medModeSwitch mode) throw (SALOME::SALOME_Exception); -SALOME_MED::medDriverTypes convertMedDriverToIdlDriver(driverTypes driverType) +SALOME_MED::medDriverTypes convertMedDriverToIdlDriver(MEDMEM::driverTypes driverType) throw (SALOME::SALOME_Exception); SALOME_MED::medConnectivity convertMedConnToIdlConn(medConnectivity connectivite) throw (SALOME::SALOME_Exception); @@ -36,7 +34,7 @@ medEntityMesh convertIdlEntToMedEnt(SALOME_MED::medEntityMesh entity) throw (SALOME::SALOME_Exception); medModeSwitch convertIdlModeToMedMode(SALOME_MED::medModeSwitch mode) throw (SALOME::SALOME_Exception); -driverTypes convertIdlDriverToMedDriver(SALOME_MED::medDriverTypes driverType) +MEDMEM::driverTypes convertIdlDriverToMedDriver(SALOME_MED::medDriverTypes driverType) throw (SALOME::SALOME_Exception); medConnectivity convertIdlConnToMedConn(SALOME_MED::medConnectivity connectivite) throw (SALOME::SALOME_Exception); diff --git a/src/MedMem/Makefile.in b/src/MEDMEM_I/Makefile.in similarity index 73% rename from src/MedMem/Makefile.in rename to src/MEDMEM_I/Makefile.in index d7144451a..ca4f62793 100644 --- a/src/MedMem/Makefile.in +++ b/src/MEDMEM_I/Makefile.in @@ -1,4 +1,4 @@ -# MED MedMem : MED idl descriptions implementation based on the classes of MEDMEM +# MED MEDMEM_I : MED idl descriptions implementation based on the classes of MEDMEM # # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -21,10 +21,9 @@ # # # -# File : Field_i.hxx # Author : Marc Tajchman # Module : MED -# $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Makefile.in +# $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/Makefile.in top_srcdir=@top_srcdir@ top_builddir=../.. @@ -40,21 +39,21 @@ MACHINE=PCLINUX # testMed.py EXPORT_HEADERS = \ - convert.hxx \ - Med_i.hxx \ - Family_i.hxx \ - FieldDouble_i.hxx \ - FieldInt_i.hxx \ - FieldOf_i.hxx \ - Field_i.hxx \ - Group_i.hxx \ - Mesh_i.hxx \ - Support_i.hxx + MEDMEM_convert.hxx \ + MEDMEM_Med_i.hxx \ + MEDMEM_Family_i.hxx \ + MEDMEM_FieldDouble_i.hxx \ + MEDMEM_FieldInt_i.hxx \ + MEDMEM_FieldOf_i.hxx \ + MEDMEM_Field_i.hxx \ + MEDMEM_Group_i.hxx \ + MEDMEM_Mesh_i.hxx \ + MEDMEM_Support_i.hxx # Libraries targets -LIB=libMEDImpl.la -LIB_SRC = Med_i.cxx Family_i.cxx FieldDouble_i.cxx FieldInt_i.cxx Field_i.cxx Group_i.cxx Mesh_i.cxx Support_i.cxx convert.cxx +LIB=libMEDMEMImpl.la +LIB_SRC = MEDMEM_Med_i.cxx MEDMEM_Family_i.cxx MEDMEM_FieldDouble_i.cxx MEDMEM_FieldInt_i.cxx MEDMEM_Field_i.cxx MEDMEM_Group_i.cxx MEDMEM_Mesh_i.cxx MEDMEM_Support_i.cxx MEDMEM_convert.cxx LIB_SERVER_IDL = MED.idl LIB_CLIENT_IDL= SALOME_Component.idl SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl @@ -66,7 +65,7 @@ BIN_CLIENT_IDL = CPPFLAGS+= $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS=-g -D_DEBUG_ -D__x86__ -D__linux__ -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+=-lmedmem -lOpUtil -L${KERNEL_ROOT_DIR}/lib/salome +LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lmedmem -lOpUtil -L${KERNEL_ROOT_DIR}/lib/salome #LDFLAGS+=-lmedmem -L. -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification # does we put only -lSalomeContainer and compiler retrieves -lSalomeNS -lRegistry -lOpUtil ???? diff --git a/src/MedMem/README b/src/MEDMEM_I/README similarity index 100% rename from src/MedMem/README rename to src/MEDMEM_I/README diff --git a/src/MEDMEM_SWIG/MEDMEM_SWIG_FieldDouble.cxx b/src/MEDMEM_SWIG/MEDMEM_SWIG_FieldDouble.cxx index 4a7d77514..ca035fdb1 100644 --- a/src/MEDMEM_SWIG/MEDMEM_SWIG_FieldDouble.cxx +++ b/src/MEDMEM_SWIG/MEDMEM_SWIG_FieldDouble.cxx @@ -1,5 +1,6 @@ using namespace std; #include "MEDMEM_SWIG_FieldDouble.hxx" +using namespace MEDMEM; //============================================================================= /*! diff --git a/src/MEDMEM_SWIG/Makefile.in b/src/MEDMEM_SWIG/Makefile.in index 8c5657104..327b82a75 100644 --- a/src/MEDMEM_SWIG/Makefile.in +++ b/src/MEDMEM_SWIG/Makefile.in @@ -59,7 +59,7 @@ CPPFLAGS+= $(PYTHON_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_ CXXFLAGS=-g -D_DEBUG_ -D__x86__ -D__linux__ CXXFLAGS+=-ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome LIBS= $(PYTHON_LIBS) -LDFLAGS+= -lmedmem $(MED2_LIBS) $(HDF5_LIBS) +LDFLAGS+= -lmedmem $(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome ############################################################################# diff --git a/src/MED_SWIG/MED_shared_modules.py b/src/MED_SWIG/MED_shared_modules.py index 036caa329..bf550b3e9 100644 --- a/src/MED_SWIG/MED_shared_modules.py +++ b/src/MED_SWIG/MED_shared_modules.py @@ -7,10 +7,10 @@ # (avoids incomplete import at run time) print "============== import MED_idl =======================" -print "============== import Med_Gen_idl =======================" +print "============== import MED_Gen_idl =======================" import MED_idl -import Med_Gen_idl +import MED_Gen_idl # this function is required @@ -18,4 +18,4 @@ def init_shared_modules(): """ This function initializes shared modules that need to be """ - pass \ No newline at end of file + pass diff --git a/src/Makefile.in b/src/Makefile.in index a46e29848..25fc25743 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -31,6 +31,6 @@ VPATH=.:@srcdir@ @COMMENCE@ -SUBDIRS = MEDMEM MEDMEM_SWIG MedMem MED MEDGUI MedCorba_Swig MED_SWIG MedClient +SUBDIRS = MEDMEM MEDMEM_SWIG MEDMEM_I MED MEDGUI MedCorba_Swig MED_SWIG MedClient @MODULE@ diff --git a/src/MedClient/src/CONNECTIVITYClient.cxx b/src/MedClient/src/CONNECTIVITYClient.cxx index 440ab6136..2a33eb8ca 100644 --- a/src/MedClient/src/CONNECTIVITYClient.cxx +++ b/src/MedClient/src/CONNECTIVITYClient.cxx @@ -1,7 +1,15 @@ -#include +#include "MEDMEM_convert.hxx" +#include "Utils_CorbaException.hxx" #include "UtilClient.hxx" #include "CONNECTIVITYClient.hxx" +using namespace MEDMEM; +//============================================================================= +/*! + * Constructeur + */ +//============================================================================= + CONNECTIVITYClient::CONNECTIVITYClient(const SALOME_MED::MESH_ptr m, medEntityMesh Entity) : CONNECTIVITY(m->getNumberOfTypes(Entity), Entity), @@ -18,6 +26,11 @@ CONNECTIVITYClient::CONNECTIVITYClient(const SALOME_MED::MESH_ptr m, END_OF("CONNECTIVITYClient::CONNECTIVITYClient()"); } +//============================================================================= +/*! + * Destructeur + */ +//============================================================================= CONNECTIVITYClient::~CONNECTIVITYClient() { BEGIN_OF("CONNECTIVITYClient::~CONNECTIVITYClient()"); @@ -28,18 +41,38 @@ CONNECTIVITYClient::~CONNECTIVITYClient() END_OF("CONNECTIVITYClient::~CONNECTIVITYClient()"); } +//============================================================================= +/*! + * Remplit les informations nécessaires + * 1 seul appel Corba + */ +//============================================================================= void CONNECTIVITYClient::blankCopy() { BEGIN_OF("CONNECTIVITYClient::blankCopy()"); - _numberOfNodes = IOR_Mesh->getNumberOfNodes(); + SALOME_MED::MESH::connectivityInfos *all = new SALOME_MED::MESH::connectivityInfos; + medEntityMesh Entity = getEntity(); + try + { + all= IOR_Mesh->getConnectGlobal(Entity); + } + catch (const exception & ex) + { + MESSAGE("Unable to acces Global information"); + THROW_SALOME_CORBA_EXCEPTION(ex.what() ,SALOME::INTERNAL_ERROR); + } + + //_numberOfNodes = IOR_Mesh->getNumberOfNodes(); + _numberOfNodes = all->numberOfNodes; - medEntityMesh Entity = getEntity(); medGeometryElement * Types; long iT, nT; + //convertCorbaArray + // (Types, nT, IOR_Mesh->getTypes(Entity)); convertCorbaArray - (Types, nT, IOR_Mesh->getTypes(Entity)); + (Types, nT, &all->meshTypes); ASSERT(nT == (int) getNumberOfTypes(Entity)); SCRUTE(nT); @@ -48,9 +81,11 @@ void CONNECTIVITYClient::blankCopy() _totalNumberOfElements_client = 0L; _numberOfElements_client = new long[nT]; - for (iT=0; iTgetNumberOfElements(Entity, Types[iT]); + for (iT=0; iTgetNumberOfElements(Entity, Types[iT]); + _numberOfElements_client[iT] = all->numberOfElements[iT]; _totalNumberOfElements_client += _numberOfElements_client[iT]; SCRUTE(iT); SCRUTE(_numberOfElements_client[iT]); @@ -61,6 +96,10 @@ void CONNECTIVITYClient::blankCopy() END_OF("CONNECTIVITYClient::blankCopy()"); } +//============================================================================= +/*! + */ +//============================================================================= void CONNECTIVITYClient::fillCopy() { @@ -109,6 +148,10 @@ void CONNECTIVITYClient::fillCopy() END_OF("void CONNECTIVITYClient::fillCopy()"); } +//============================================================================= +/*! + */ +//============================================================================= med_int CONNECTIVITYClient::getNumberOf(medEntityMesh Entity, medGeometryElement Type) const { @@ -146,6 +189,10 @@ med_int CONNECTIVITYClient::getNumberOf(medEntityMesh Entity, return n; } +//============================================================================= +/*! + */ +//============================================================================= const med_int * CONNECTIVITYClient::getConnectivity (medConnectivity ConnectivityType, medEntityMesh Entity, @@ -163,6 +210,10 @@ const med_int * CONNECTIVITYClient::getConnectivity return c; } +//============================================================================= +/*! + */ +//============================================================================= const med_int * CONNECTIVITYClient::getConnectivityIndex (medConnectivity ConnectivityType, medEntityMesh Entity) @@ -179,6 +230,10 @@ const med_int * CONNECTIVITYClient::getConnectivityIndex return c; } +//============================================================================= +/*! + */ +//============================================================================= void CONNECTIVITYClient::calculateConnectivity (medConnectivity connectivityType, medEntityMesh Entity) @@ -193,6 +248,10 @@ void CONNECTIVITYClient::calculateConnectivity END_OF("void CONNECTIVITYClient::calculateConnectivity()"); } +//============================================================================= +/*! + */ +//============================================================================= void CONNECTIVITYClient::updateFamily (vector myFamilies) { BEGIN_OF("void CONNECTIVITYClient::updateFamily()"); @@ -205,6 +264,10 @@ void CONNECTIVITYClient::updateFamily (vector myFamilies) END_OF("void CONNECTIVITYClient::updateFamily()"); } +//============================================================================= +/*! + */ +//============================================================================= const int * CONNECTIVITYClient::getGlobalNumberingIndex (medEntityMesh Entity) const throw (MEDEXCEPTION) { @@ -218,6 +281,10 @@ const int * CONNECTIVITYClient::getGlobalNumberingIndex END_OF("void CONNECTIVITYClient::getGlobalNumberingIndex()"); } +//============================================================================= +/*! + */ +//============================================================================= bool CONNECTIVITYClient::existConnectivity(medConnectivity ConnectivityType, medEntityMesh Entity) const { @@ -233,6 +300,10 @@ bool CONNECTIVITYClient::existConnectivity(medConnectivity ConnectivityType, return b; } +//============================================================================= +/*! + */ +//============================================================================= const med_int * CONNECTIVITYClient::getReverseConnectivity (medConnectivity ConnectivityType, medEntityMesh Entity) throw (MEDEXCEPTION) @@ -250,6 +321,10 @@ const med_int * CONNECTIVITYClient::getReverseConnectivity return c; } +//============================================================================= +/*! + */ +//============================================================================= const med_int * CONNECTIVITYClient::getReverseConnectivityIndex (medConnectivity ConnectivityType, medEntityMesh Entity) throw (MEDEXCEPTION) @@ -267,6 +342,10 @@ const med_int * CONNECTIVITYClient::getReverseConnectivityIndex return c; } +//============================================================================= +/*! + */ +//============================================================================= const med_int* CONNECTIVITYClient::getValue(medConnectivity TypeConnectivity, medGeometryElement Type) { @@ -282,6 +361,10 @@ const med_int* CONNECTIVITYClient::getValue(medConnectivity TypeConnectivity, return c; } +//============================================================================= +/*! + */ +//============================================================================= const med_int* CONNECTIVITYClient::getValueIndex(medConnectivity TypeConnectivity) { BEGIN_OF("void CONNECTIVITYClient::getValueIndex()"); @@ -296,6 +379,10 @@ const med_int* CONNECTIVITYClient::getValueIndex(medConnectivity TypeConnectivit return c; } +//============================================================================= +/*! + */ +//============================================================================= const med_int* CONNECTIVITYClient::getNeighbourhood() const { BEGIN_OF("void CONNECTIVITYClient::getNeighbourhood()"); diff --git a/src/MedClient/src/CONNECTIVITYClient.hxx b/src/MedClient/src/CONNECTIVITYClient.hxx index 9240db5e5..b3c611ccf 100644 --- a/src/MedClient/src/CONNECTIVITYClient.hxx +++ b/src/MedClient/src/CONNECTIVITYClient.hxx @@ -5,6 +5,7 @@ #include "MEDMEM_Connectivity.hxx" #include CORBA_CLIENT_HEADER(MED) +namespace MEDMEM { class CONNECTIVITYClient : public CONNECTIVITY { protected: @@ -57,6 +58,7 @@ public: const med_int* getValueIndex (medConnectivity TypeConnectivity); const med_int* getNeighbourhood() const; }; +}; #endif diff --git a/src/MedClient/src/COORDINATEClient.cxx b/src/MedClient/src/COORDINATEClient.cxx index f5ebf51b0..428ba09ff 100644 --- a/src/MedClient/src/COORDINATEClient.cxx +++ b/src/MedClient/src/COORDINATEClient.cxx @@ -1,6 +1,15 @@ +#define _DEBUG_ #include "COORDINATEClient.hxx" #include #include "UtilClient.hxx" +#include "Utils_CorbaException.hxx" + +using namespace MEDMEM; +//============================================================================= +/*! + * Constructeur + */ +//============================================================================= COORDINATEClient::COORDINATEClient(const SALOME_MED::MESH_ptr m, medModeSwitch Mode) : @@ -14,35 +23,59 @@ COORDINATEClient::COORDINATEClient(const SALOME_MED::MESH_ptr m, END_OF("COORDINATEClient::COORDINATEClient(...)"); } - +//============================================================================= +/*! + * Remplit les informations générales + */ +//============================================================================= void COORDINATEClient::blankCopy() { BEGIN_OF("void COORDINATEClient::blankCopy()"); std::string *tA; long nA; - - convertCorbaArray(tA, nA, IOR_Mesh->getCoordinatesNames()); + SALOME_MED::MESH::coordinateInfos *all = new SALOME_MED::MESH::coordinateInfos; + try + { + all= IOR_Mesh->getCoordGlobal(); + } + catch (const exception & ex) + { + MESSAGE("Unable to acces Global information"); + THROW_SALOME_CORBA_EXCEPTION(ex.what() ,SALOME::INTERNAL_ERROR); + } + + //convertCorbaArray(tA, nA, IOR_Mesh->getCoordinatesNames()); + convertCorbaArray(tA, nA, &all->coordNames); ASSERT(nA == getSpaceDimension()); setCoordinatesNames(tA); delete [] tA; - convertCorbaArray(tA, nA, IOR_Mesh->getCoordinatesUnits()); + //convertCorbaArray(tA, nA, IOR_Mesh->getCoordinatesUnits()); + convertCorbaArray(tA, nA, &all->coordUnits); ASSERT(nA == getSpaceDimension()); setCoordinatesUnits(tA); delete [] tA; - setCoordinatesSystem(IOR_Mesh->getCoordinatesSystem()); + + setCoordinatesSystem( CORBA::string_dup(all->coordSystem)); _complete = false; END_OF("void COORDINATEClient::blankCopy()"); } +//============================================================================= +/*! + * Remplit les coordonnées + */ +//============================================================================= void COORDINATEClient::fillCopy() { BEGIN_OF("void COORDINATEClient::fillCopy()"); + //PN ?? Est-ce qu on peut pas mettre une variable dans COORDINATEClient + // qu on remplirait dans blankCopy ?? long nN = IOR_Mesh->getNumberOfNodes(); double *tC; long nC; @@ -57,6 +90,11 @@ void COORDINATEClient::fillCopy() END_OF("void COORDINATEClient::fillCopy()"); } +//============================================================================= +/*! + * Retourne les coordonnées + */ +//============================================================================= const double * COORDINATEClient::getCoordinates(medModeSwitch Mode) { @@ -69,8 +107,13 @@ const double * COORDINATEClient::getCoordinates(medModeSwitch Mode) return c; } +//============================================================================= +/*! + * Retourne une coordonnée + */ +//============================================================================= -double COORDINATEClient::getCoordinate(int Number,int Axis) +double COORDINATEClient::getCoordinate(int Number,int Axis) { BEGIN_OF("void COORDINATEClient::getCoordinate()"); @@ -81,7 +124,11 @@ double COORDINATEClient::getCoordinate(int Number,int Axis) return d; } - +//============================================================================= +/*! + * Retourne un axe + */ +//============================================================================= const double * COORDINATEClient::getCoordinateAxis(int Axis) { BEGIN_OF("void COORDINATEClient::getCoordinateAxis()"); @@ -93,7 +140,11 @@ const double * COORDINATEClient::getCoordinateAxis(int Axis) return c; } - +//============================================================================= +/*! + * Retourne le nombre de noeuds + */ +//============================================================================= const int* COORDINATEClient::getNodesNumbers() const { BEGIN_OF("void COORDINATEClient::getNodesNumbers()"); diff --git a/src/MedClient/src/COORDINATEClient.hxx b/src/MedClient/src/COORDINATEClient.hxx index 2f64e4636..51037c880 100644 --- a/src/MedClient/src/COORDINATEClient.hxx +++ b/src/MedClient/src/COORDINATEClient.hxx @@ -5,6 +5,7 @@ #include "MEDMEM_Coordinate.hxx" #include CORBA_CLIENT_HEADER(MED) +namespace MEDMEM { class COORDINATEClient : public COORDINATE { protected: @@ -55,5 +56,6 @@ public: virtual const int* getNodesNumbers() const; }; +}; #endif diff --git a/src/MedClient/src/FAMILYClient.cxx b/src/MedClient/src/FAMILYClient.cxx index a648cd9a2..95aa12c27 100644 --- a/src/MedClient/src/FAMILYClient.cxx +++ b/src/MedClient/src/FAMILYClient.cxx @@ -1,23 +1,32 @@ #include "FAMILYClient.hxx" #include "MESHClient.hxx" #include "UtilClient.hxx" - -FAMILYClient::FAMILYClient(const SALOME_MED::FAMILY_ptr F, - MESH * M) - : SUPPORTClient(F, M), +using namespace MEDMEM; +//============================================================================= +/*! + * Constructeur + */ +//============================================================================= +FAMILYClient::FAMILYClient(const SALOME_MED::FAMILY_ptr S, + MESH * M) + : SUPPORTClient(S, M), FAMILY(), - IOR_Family(SALOME_MED::FAMILY::_duplicate(F)) + IOR_Family(SALOME_MED::FAMILY::_duplicate(S)) { BEGIN_OF("FAMILYClient::FAMILYClient(SALOME_MED::FAMILY_ptr m)"); - SCRUTE(F); + SCRUTE(S); SCRUTE(M); blankCopy(false); END_OF("FAMILYClient::FAMILYClient(SALOME_MED::FAMILY_ptr m)"); } - +//============================================================================= +/*! + * Remplit les informations générales + */ +//============================================================================= void FAMILYClient::blankCopy(bool blankSupport) { BEGIN_OF("FAMILYClient::blankCopy()"); @@ -25,8 +34,6 @@ void FAMILYClient::blankCopy(bool blankSupport) if (blankSupport) SUPPORTClient::blankCopy(); - MESSAGE(""); - // setIdentifier(IOR_Family->getIdentifier()); // int nAttr, nGr, n; @@ -60,6 +67,11 @@ void FAMILYClient::blankCopy(bool blankSupport) END_OF("FAMILYClient::blankCopy()"); } +//============================================================================= +/*! + * Remplit les informations générales + */ +//============================================================================= void FAMILYClient::fillCopy(bool fillSupport) { BEGIN_OF("FAMILYClient::fillCopy()"); @@ -75,6 +87,11 @@ void FAMILYClient::fillCopy(bool fillSupport) END_OF("FAMILYClient::fillCopy()"); } +//============================================================================= +/*! + * Destructeur + */ +//============================================================================= FAMILYClient::~FAMILYClient() { diff --git a/src/MedClient/src/FAMILYClient.hxx b/src/MedClient/src/FAMILYClient.hxx index c74ef20db..61b12302e 100644 --- a/src/MedClient/src/FAMILYClient.hxx +++ b/src/MedClient/src/FAMILYClient.hxx @@ -8,6 +8,7 @@ #include "SUPPORTClient.hxx" +namespace MEDMEM { class FAMILYClient : public SUPPORTClient, public FAMILY { @@ -27,5 +28,6 @@ public : virtual void fillCopy(bool fillSupport = true); }; +}; #endif diff --git a/src/MedClient/src/FIELDClient.hxx b/src/MedClient/src/FIELDClient.hxx index 0582515ef..ed097814a 100644 --- a/src/MedClient/src/FIELDClient.hxx +++ b/src/MedClient/src/FIELDClient.hxx @@ -6,6 +6,7 @@ #include "MEDMEM_Field.hxx" #include CORBA_CLIENT_HEADER(MED) +namespace MEDMEM { template class FIELDClient : virtual public FIELD { @@ -66,5 +67,6 @@ FIELDClient::~FIELDClient() END_OF("FIELDClient::~FIELDClient"); } +} #endif diff --git a/src/MedClient/src/GROUPClient.cxx b/src/MedClient/src/GROUPClient.cxx index 99ec27a1e..df0e753b4 100644 --- a/src/MedClient/src/GROUPClient.cxx +++ b/src/MedClient/src/GROUPClient.cxx @@ -1,5 +1,12 @@ #include "GROUPClient.hxx" #include "MESHClient.hxx" +using namespace MEDMEM; + +//============================================================================= +/*! + * Constructeur + */ +//============================================================================= GROUPClient::GROUPClient(const SALOME_MED::GROUP_ptr G, MESH * M) @@ -15,7 +22,11 @@ GROUPClient::GROUPClient(const SALOME_MED::GROUP_ptr G, END_OF("GROUPClient::GROUPClient()"); } - +//============================================================================= +/*! + * Remplit les informations générales + */ +//============================================================================= void GROUPClient::blankCopy() { BEGIN_OF("GROUPClient::blankCopy()"); @@ -25,6 +36,11 @@ void GROUPClient::blankCopy() END_OF("GROUPClient::blankCopy()"); } +//============================================================================= +/*! + * Remplit les informations + */ +//============================================================================= void GROUPClient::fillCopy() { @@ -36,6 +52,11 @@ void GROUPClient::fillCopy() END_OF("GROUPClient::fillCopy()"); } +//============================================================================= +/*! + * Destructeur + */ +//============================================================================= GROUPClient::~GROUPClient() { diff --git a/src/MedClient/src/GROUPClient.hxx b/src/MedClient/src/GROUPClient.hxx index fd6d32edd..869baa8e3 100644 --- a/src/MedClient/src/GROUPClient.hxx +++ b/src/MedClient/src/GROUPClient.hxx @@ -7,6 +7,7 @@ #include CORBA_CLIENT_HEADER(MED) #include "SUPPORTClient.hxx" +namespace MEDMEM { class GROUPClient : public SUPPORTClient, public GROUP @@ -28,5 +29,6 @@ public : virtual void fillCopy(); }; +} #endif diff --git a/src/MedClient/src/MESHClient.cxx b/src/MedClient/src/MESHClient.cxx index 4a530dfe9..a9d8e57da 100644 --- a/src/MedClient/src/MESHClient.cxx +++ b/src/MedClient/src/MESHClient.cxx @@ -1,10 +1,15 @@ #include "MESHClient.hxx" -#include +#include "MEDMEM_convert.hxx" #include "UtilClient.hxx" #include "COORDINATEClient.hxx" #include "CONNECTIVITYClient.hxx" #include "FAMILYClient.hxx" #include "GROUPClient.hxx" +//============================================================================= +/*! + * Constructeur + */ +//============================================================================= MESHClient::MESHClient(const SALOME_MED::MESH_ptr m) : MESH(), @@ -23,97 +28,122 @@ MESHClient::MESHClient(const SALOME_MED::MESH_ptr m) : END_OF("MESHClient::MESHClient(SALOME_MED::MESH_ptr m)"); } +//============================================================================= +/*! + * Transforme un IOR Famille en Famille Client + */ +//============================================================================= -FAMILY * convertFamily(const SALOME_MED::FAMILY_ptr &F, MESH *M) { +FAMILY * convertFamily(const SALOME_MED::FAMILY_ptr &F, MESH *M) +{ return new FAMILYClient(F, M); } - -GROUP * convertGroup(const SALOME_MED::GROUP_ptr &F, MESH *M) { +//============================================================================= +/*! + * Transforme un IOR groupe en groupe Client + */ +//============================================================================= +GROUP * convertGroup(const SALOME_MED::GROUP_ptr &F, MESH *M) +{ return new GROUPClient(F, M); } - +//============================================================================= +/*! + * Remplit les informations générales + */ +//============================================================================= void MESHClient::blankCopy() { BEGIN_OF("MESHClient::blankCopy()"); - - CORBA::String_var s; + SALOME_MED::MESH::meshInfos * all = new SALOME_MED::MESH::meshInfos; + all = IOR_Mesh->getMeshGlobal(); + + //CORBA::String_var s; + //s= IOR_Mesh->getName(); _name = s; + //_spaceDimension = IOR_Mesh->getSpaceDimension(); + //_meshDimension = IOR_Mesh->getMeshDimension(); + //_numberOfNodes = IOR_Mesh->getNumberOfNodes(); - s= IOR_Mesh->getName(); _name = s; - _spaceDimension = IOR_Mesh->getSpaceDimension(); - _meshDimension = IOR_Mesh->getMeshDimension(); - _numberOfNodes = IOR_Mesh->getNumberOfNodes(); - - COORDINATEClient *_coord - = dynamic_cast(_coordinate); - ASSERT(_coord); + _name = all->name; + _spaceDimension = all->spaceDimension; + _meshDimension = all->meshDimension; + _numberOfNodes = all->numberOfNodes; + + COORDINATEClient *_coord + = dynamic_cast(_coordinate); + ASSERT(_coord); CONNECTIVITYClient *_connect = dynamic_cast(_connectivity); ASSERT(_connect); - _coord->blankCopy(); + _coord->blankCopy(); _connect->blankCopy(); - MESSAGE(""); convertCorbaArray (_familyNode, _numberOfNodesFamilies, - IOR_Mesh->getFamilies(MED_NODE), + //IOR_Mesh->getFamilies(MED_NODE), + &all->famNode, (void *) (convertFamily), this); - MESSAGE(""); convertCorbaArray (_familyEdge, _numberOfEdgesFamilies, - IOR_Mesh->getFamilies(MED_EDGE), + //IOR_Mesh->getFamilies(MED_EDGE), + &all->famEdge, (void *) (convertFamily), this); - MESSAGE(""); convertCorbaArray (_familyFace, _numberOfFacesFamilies, - IOR_Mesh->getFamilies(MED_FACE), + //IOR_Mesh->getFamilies(MED_FACE), + &all->famFace, (void *) (convertFamily), this); - MESSAGE(""); convertCorbaArray (_familyCell, _numberOfCellsFamilies, - IOR_Mesh->getFamilies(MED_CELL), + //IOR_Mesh->getFamilies(MED_CELL), + &all->famCell, (void *) (convertFamily), this); - MESSAGE(""); convertCorbaArray (_groupNode, _numberOfNodesGroups, - IOR_Mesh->getGroups(MED_NODE), + //IOR_Mesh->getGroups(MED_NODE), + &all->groupNode, (void *) (convertGroup), this); - MESSAGE(""); convertCorbaArray (_groupEdge, _numberOfEdgesGroups, - IOR_Mesh->getGroups(MED_EDGE), + //IOR_Mesh->getGroups(MED_EDGE), + &all->groupEdge, (void *) (convertGroup), this); - MESSAGE(""); convertCorbaArray (_groupFace, _numberOfFacesGroups, - IOR_Mesh->getGroups(MED_FACE), + //IOR_Mesh->getGroups(MED_FACE), + &all->groupFace, (void *) (convertGroup), this); - MESSAGE(""); convertCorbaArray (_groupCell, _numberOfCellsGroups, - IOR_Mesh->getGroups(MED_CELL), + //IOR_Mesh->getGroups(MED_CELL), + &all->groupCell, (void *) (convertGroup), this); - MESSAGE(""); _complete = false; END_OF("MESHClient::blankCopy()"); } +//============================================================================= +/*! + * Remplit les informations sur les coordonnees et la connectivite + */ +//============================================================================= void MESHClient::fillCopy() { @@ -134,6 +164,11 @@ void MESHClient::fillCopy() END_OF("MESHClient::fillCopy()"); } +//============================================================================= +/*! + * Destructeur + */ +//============================================================================= MESHClient::~MESHClient() { diff --git a/src/MedClient/src/MESHClient.hxx b/src/MedClient/src/MESHClient.hxx index 4b268edbb..ffaf903b1 100644 --- a/src/MedClient/src/MESHClient.hxx +++ b/src/MedClient/src/MESHClient.hxx @@ -6,6 +6,7 @@ #include "MEDMEM_Mesh.hxx" #include CORBA_CLIENT_HEADER(MED) +namespace MEDMEM { class MESHClient : public MESH { private : @@ -25,6 +26,7 @@ public : void fillCopy(); }; +} #endif diff --git a/src/MedClient/src/SUPPORTClient.cxx b/src/MedClient/src/SUPPORTClient.cxx index 37ed8d6ef..83b573981 100644 --- a/src/MedClient/src/SUPPORTClient.cxx +++ b/src/MedClient/src/SUPPORTClient.cxx @@ -1,7 +1,16 @@ +#include "Utils_CorbaException.hxx" #include "UtilClient.hxx" #include "SUPPORTClient.hxx" #include "MESHClient.hxx" +using namespace MEDMEM; + +//============================================================================= +/*! + * Constructeur + */ +//============================================================================= + SUPPORTClient::SUPPORTClient(const SALOME_MED::SUPPORT_ptr S, MESH * M) : SUPPORT(), @@ -18,79 +27,95 @@ SUPPORTClient::SUPPORTClient(const SALOME_MED::SUPPORT_ptr S, END_OF("SUPPORTClient::SUPPORTClient(SALOME_MED::SUPPORT_ptr m)"); } - +//============================================================================= +/*! + * Remplit les informations générales + */ +//============================================================================= void SUPPORTClient::blankCopy() { BEGIN_OF("SUPPORTClient::blankCopy"); - setName(IOR_Support->getName()); - setDescription(IOR_Support->getDescription()); - setAll(IOR_Support->isOnAllElements()); - setEntity(IOR_Support->getEntity()); - - convertCorbaArray(_geometricType, _numberOfGeometricType, - IOR_Support->getTypes()); - - int *nE = new int[_numberOfGeometricType]; - int i; - for (i=0; i<_numberOfGeometricType; i++) - nE[i] = IOR_Support->getNumberOfElements(_geometricType[i]); - setNumberOfElements(nE); - SCRUTE(_totalNumberOfElements); - - SCRUTE(_name); - SCRUTE(_description); - - _complete_support = false; + try + { + SALOME_MED::SUPPORT::supportInfos *all = new SALOME_MED::SUPPORT::supportInfos; + all= IOR_Support->getSupportGlobal(); + + _name = all->name; + _description = all->description; + setAll(all->isOnAllElements); + setEntity(all->entity); +// modifs PN + setNumberOfGeometricType(all->numberOfGeometricType); + convertCorbaArray(_geometricType, _numberOfGeometricType, + &all->types); + + //_name = IOR_Support->getName(); + //_description = IOR_Support->getDescription(); + //setAll(IOR_Support->isOnAllElements()); + //setEntity(IOR_Support->getEntity()); + + SCRUTE(_name); + SCRUTE(_description); + //convertCorbaArray(_geometricType, _numberOfGeometricType, + // IOR_Support->getTypes()); + + int *nE = new int[_numberOfGeometricType]; + int i; + for (i=0; i<_numberOfGeometricType; i++) + { + nE[i] = all->nbEltTypes[i]; + } + setNumberOfElements(nE); + SCRUTE(_totalNumberOfElements); + _complete_support = false; + } + catch( const CORBA::Exception &ex ) + { + MESSAGE("Erreur CORBA dans la communication" ) ; + THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ + SALOME::INTERNAL_ERROR); + } END_OF("SUPPORTClient::blankCopy"); } - +//============================================================================= +/*! + * + */ +//============================================================================= void SUPPORTClient::fillCopy() { BEGIN_OF("SUPPORTClient::fillCopy"); - int * index, * value; - long n_index, n_value; - - MESSAGE(""); - try { - convertCorbaArray(value, n_value, - IOR_Support->getNumber(MED_ALL_ELEMENTS)); - } - catch (...) { - std::cerr << "erreur ...." << std::endl; - exit(-1); - } + if (!_complete_support) { - SCRUTE(n_value); - SCRUTE(value[0]); - SCRUTE(value[1]); - MESSAGE(""); + int * index, * value; + long n_index, n_value; - try { + convertCorbaArray(value, n_value, + IOR_Support->getNumber(MED_ALL_ELEMENTS)); convertCorbaArray(index, n_index, IOR_Support->getNumberIndex()); + + SCRUTE(n_index); + SCRUTE(n_value); + setNumber(index, value); + + delete [] index; + delete [] value; + + _complete_support = true; } - catch (...) { - std::cerr << "erreur ...." << std::endl; - exit(-1); - } - - SCRUTE(n_index); - SCRUTE(n_value); - setNumber(index, value); - - delete [] index; - delete [] value; - - _complete_support = true; END_OF("SUPPORTClient::fillCopy"); } - - +//============================================================================= +/*! + * Destructeur + */ +//============================================================================= SUPPORTClient::~SUPPORTClient() { BEGIN_OF("SUPPORTClient::~SUPPORTClient"); @@ -98,6 +123,11 @@ SUPPORTClient::~SUPPORTClient() END_OF("SUPPORTClient::~SUPPORTClient"); } +//============================================================================= +/*! + * Destructeur + */ +//============================================================================= MEDSKYLINEARRAY * SUPPORTClient::getnumber() const throw (MEDEXCEPTION) { BEGIN_OF("SUPPORTClient::getnumber()"); @@ -109,6 +139,11 @@ MEDSKYLINEARRAY * SUPPORTClient::getnumber() const throw (MEDEXCEPTION) return m; } +//============================================================================= +/*! + * + */ +//============================================================================= const int * SUPPORTClient::getNumber(medGeometryElement GeometricType) const throw (MEDEXCEPTION) { @@ -121,6 +156,11 @@ const int * SUPPORTClient::getNumber(medGeometryElement GeometricType) return n; } +//============================================================================= +/*! + * + */ +//============================================================================= const int * SUPPORTClient::getNumberIndex() const throw (MEDEXCEPTION) { BEGIN_OF("SUPPORTClient::getnumberIndex()"); diff --git a/src/MedClient/src/SUPPORTClient.hxx b/src/MedClient/src/SUPPORTClient.hxx index 6e03691db..4018cfed9 100644 --- a/src/MedClient/src/SUPPORTClient.hxx +++ b/src/MedClient/src/SUPPORTClient.hxx @@ -7,6 +7,7 @@ #include CORBA_CLIENT_HEADER(MED) +namespace MEDMEM { class SUPPORTClient : virtual public SUPPORT { private : @@ -32,6 +33,7 @@ public : const throw (MEDEXCEPTION); }; +} #endif diff --git a/src/MedClient/src/UtilClient.hxx b/src/MedClient/src/UtilClient.hxx index d497d3108..bbe64a6a2 100644 --- a/src/MedClient/src/UtilClient.hxx +++ b/src/MedClient/src/UtilClient.hxx @@ -4,6 +4,7 @@ #include #include +namespace MEDMEM { template @@ -109,5 +110,6 @@ inline void convertCorbaArray (vector & T, int &nT, } } +} #endif diff --git a/src/MedClient/test/test1/Makefile.in b/src/MedClient/test/test1/Makefile.in index 9f11c82d3..bbf3c0778 100644 --- a/src/MedClient/test/test1/Makefile.in +++ b/src/MedClient/test/test1/Makefile.in @@ -28,7 +28,7 @@ top_srcdir=@top_srcdir@ top_builddir=../../../.. srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:@top_builddir@/bin:@top_srcdir@/idl:${KERNEL_ROOT_DIR}/idl/salome +VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:@srcdir@/resources:@top_srcdir@/idl:${KERNEL_ROOT_DIR}/idl/salome @COMMENCE@ @@ -51,6 +51,21 @@ BIN_SRC = LDFLAGS+= +# copy python scripts in $(top_builddir)/bin/salome +# +DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%) +pyscripts: $(DEST_PYSCRIPTS) +$(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: % + cp -f $< $@ + +# Install python script in $(bindir) +install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) + +$(EXPORT_PYSCRIPTS:%=install-%): install-%: % + $(INSTALL_PROGRAM) $< $(bindir)/. @MODULE@ +bin: pyscripts + +install: install-python diff --git a/src/MedClient/test/test1/CatalogModuleTest.xml b/src/MedClient/test/test1/resources/CatalogModuleTest.xml similarity index 100% rename from src/MedClient/test/test1/CatalogModuleTest.xml rename to src/MedClient/test/test1/resources/CatalogModuleTest.xml diff --git a/src/MedClient/test/test2/Makefile.in b/src/MedClient/test/test2/Makefile.in index 8b2a5d4e2..3d323f8fd 100644 --- a/src/MedClient/test/test2/Makefile.in +++ b/src/MedClient/test/test2/Makefile.in @@ -43,7 +43,7 @@ LIB_SRC = Compo2.cxx LIB_CLIENT_IDL= SALOME_Component.idl SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl MED.idl CPPFLAGS += ${MED2_INCLUDES} ${HDF5_INCLUDES} ${PYTHON_INCLUDES} -I${KERNEL_ROOT_DIR}/include/salome -LIBS = -L${KERNEL_ROOT_DIR}/lib/salome -lMEDClientcmodule -lMEDMEM_Swigcmodule -lMEDImpl -lmedmem ${MED2_LIBS} ${HDF5_LIBS} +LIBS = -L${KERNEL_ROOT_DIR}/lib/salome -lMEDClientcmodule -lMEDMEM_Swigcmodule -lmedmem -lMEDMEMImpl ${MED2_LIBS} ${HDF5_LIBS} # Executables targets diff --git a/src/MedCorba_Swig/Makefile.in b/src/MedCorba_Swig/Makefile.in index cc7d34f40..47dd326ca 100644 --- a/src/MedCorba_Swig/Makefile.in +++ b/src/MedCorba_Swig/Makefile.in @@ -54,7 +54,7 @@ CPPFLAGS+= $(PYTHON_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_ CXXFLAGS=-g -D_DEBUG_ -D__x86__ -D__linux__ CXXFLAGS+=-ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome LIBS= $(PYTHON_LIBS) -LDFLAGS+= -lMEDImpl -lMEDMEM_Swigcmodule -L${KERNEL_ROOT_DIR}/lib/salome +LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lMEDMEMImpl -lmedmem -lMEDMEM_Swigcmodule -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome ############################################################################# diff --git a/src/MedCorba_Swig/batchmode_medcorba_test.py b/src/MedCorba_Swig/batchmode_medcorba_test.py index 2b2877259..cbd5273e1 100755 --- a/src/MedCorba_Swig/batchmode_medcorba_test.py +++ b/src/MedCorba_Swig/batchmode_medcorba_test.py @@ -15,6 +15,11 @@ from libMedCorba_Swig import * from random import * +import os + +filePath=os.environ["MED_ROOT_DIR"] +filePath=filePath+"/share/salome/resources/" + #============================================================================== def AnalyzeField(field): @@ -101,7 +106,7 @@ print "We are working in the study ",studyCurrent," with the ID ",studyCurrentId print "" #medFile = "carre_en_quad4_seg2.med" -medFile = "cube_hexa8_quad4.med" +medFile = filePath + "cube_hexa8_quad4.med" print "Loading of the Med Component" print "" diff --git a/src/MedCorba_Swig/libMedCorba_Swig.i b/src/MedCorba_Swig/libMedCorba_Swig.i index 6035d7b98..3c6755ebe 100644 --- a/src/MedCorba_Swig/libMedCorba_Swig.i +++ b/src/MedCorba_Swig/libMedCorba_Swig.i @@ -3,16 +3,16 @@ %include "libMEDMEM_Swig.i" %{ -#include "convert.hxx" -#include "Family_i.hxx" -#include "FieldDouble_i.hxx" -#include "Field_i.hxx" -#include "FieldInt_i.hxx" -#include "FieldOf_i.hxx" -#include "Group_i.hxx" -#include "Med_i.hxx" -#include "Mesh_i.hxx" -#include "Support_i.hxx" +#include "MEDMEM_convert.hxx" +#include "MEDMEM_Family_i.hxx" +#include "MEDMEM_FieldDouble_i.hxx" +#include "MEDMEM_Field_i.hxx" +#include "MEDMEM_FieldInt_i.hxx" +#include "MEDMEM_FieldOf_i.hxx" +#include "MEDMEM_Group_i.hxx" +#include "MEDMEM_Med_i.hxx" +#include "MEDMEM_Mesh_i.hxx" +#include "MEDMEM_Support_i.hxx" #include "MEDMEM_SWIG_FieldDouble.hxx" #include "MEDMEM_SWIG_FieldInt.hxx" %} diff --git a/src/MedCorba_Swig/medcorba_test.py b/src/MedCorba_Swig/medcorba_test.py index 46a45ea96..8bae396ea 100644 --- a/src/MedCorba_Swig/medcorba_test.py +++ b/src/MedCorba_Swig/medcorba_test.py @@ -32,6 +32,11 @@ from libMedCorba_Swig import * from random import * +import os + +filePath=os.environ["MED_ROOT_DIR"] +filePath=filePath+"/share/salome/resources/" + #============================================================================== def AnalyzeField(field): @@ -105,7 +110,7 @@ print "We are working in the study ",studyCurrent," with the ID ",studyCurrentId print "" #medFile = "carre_en_quad4_seg2.med" -medFile = "cube_hexa8_quad4.med" +medFile = filePath + "cube_hexa8_quad4.med" print "Loading of the Med Component" print "" diff --git a/src/MedMem/Family_i.hxx b/src/MedMem/Family_i.hxx deleted file mode 100644 index 11a9b3e7c..000000000 --- a/src/MedMem/Family_i.hxx +++ /dev/null @@ -1,49 +0,0 @@ -//============================================================================= -// File : Family_i.hxx -// Project : SALOME -// Copyright : EDF 2002 -// Author : EDF -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Family_i.hxx -//============================================================================= -#ifndef MED_FAMILY_I_HXX_ -#define MED_FAMILY_I_HXX_ - - -#include "Support_i.hxx" - -class FAMILY; -class FAMILY_i: - public POA_SALOME_MED::FAMILY, - public SUPPORT_i -{ -protected : - FAMILY_i(); - ~FAMILY_i(); - - // C++ object containing values - const ::FAMILY * const _family ; - -public : - // Constructors and associated internal methods - FAMILY_i(const ::FAMILY * const f); - FAMILY_i(const FAMILY_i & f); - - CORBA::Long getIdentifier() - throw (SALOME::SALOME_Exception); - CORBA::Long getNumberOfAttributes() - throw (SALOME::SALOME_Exception); - Engines::long_array* getAttributesIdentifiers() - throw (SALOME::SALOME_Exception); - CORBA::Long getAttributeIdentifier(CORBA::Long i) - throw (SALOME::SALOME_Exception); - Engines::long_array* getAttributesValues() - throw (SALOME::SALOME_Exception); - CORBA::Long getAttributeValue(CORBA::Long i) - throw (SALOME::SALOME_Exception); - Engines::string_array* getAttributesDescriptions() - throw (SALOME::SALOME_Exception); - char* getAttributeDescription( CORBA::Long i) - throw (SALOME::SALOME_Exception); - -}; -#endif /* MED_FAMILY_I_HXX_ */ diff --git a/src/MedMem/Med_i.cxx b/src/MedMem/Med_i.cxx deleted file mode 100644 index f31df036e..000000000 --- a/src/MedMem/Med_i.cxx +++ /dev/null @@ -1,806 +0,0 @@ -//============================================================================= -// File : Med_i.cxx -// Project : SALOME -// Author : EDF -// Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Med_i.cxx -//============================================================================= - -#include - -//#include "MEDMEM_Field.hxx" - -#include "Med_i.hxx" -#include "Mesh_i.hxx" -#include "FieldDouble_i.hxx" -#include "FieldInt_i.hxx" -#include "Support_i.hxx" -#include "Family_i.hxx" -#include "Group_i.hxx" - -#include "MEDMEM_DriversDef.hxx" -#include "convert.hxx" -#include "utilities.h" -#include "Utils_CorbaException.hxx" - -//============================================================================= -/*! - * Default constructor - */ -//=================================POA_SALOME_MED::FAMILY::_============================================ -MED_i::MED_i():_med((::MED*)NULL) -{ - BEGIN_OF("Default Constructor MED_i"); - END_OF("Default Constructor MED_i"); -} -//============================================================================= -/*! - * methods - */ -//============================================================================= -void MED_i::init(SALOMEDS::Study_ptr myStudy,driverTypes driverType, const string & fileName) -{ - const char * LOC = "MED_i::init(driverTypes, const string &)" ; - BEGIN_OF(LOC); - - _med = new ::MED(driverType,fileName) ; - // we create all IOR from _med - - // MESH : - deque meshesNames = _med->getMeshNames() ; - int numberOfMeshes = meshesNames.size() ; - for (int i=0; igetMesh(meshesNames[i]) ; - myMesh->read() ; - MESH_i * myMeshI = new MESH_i(myMesh) ; - SALOME_MED::MESH_ptr myMeshIOR = myMeshI->_this() ; - _meshes[meshesNames[i]]=myMeshIOR ; - myMeshI->addInStudy(myStudy,myMeshIOR,fileName) ; - } - - // SUPPORT : - _med->updateSupport() ; - - // we add all group and family in study : - // we add all families - vector familyVector ; - vector::iterator familyVectorIt ; - // we add all groups - vector groupVector ; - vector::iterator groupVectorIt ; - - MED_FR::MESH_ENTITIES::const_iterator currentEntity; - for (int i=0; igetMesh(meshesNames[i]) ; - for (currentEntity=MED_FR::meshEntities.begin();currentEntity != MED_FR::meshEntities.end(); currentEntity++) { - // family : - familyVector = ptrMesh->getFamilies((MED_EN::medEntityMesh)(*currentEntity).first) ; - for(familyVectorIt=familyVector.begin();familyVectorIt!=familyVector.end();familyVectorIt++) { - FAMILY_i * myFamilyI = new FAMILY_i(*familyVectorIt); - SALOME_MED::FAMILY_ptr myFamilyIOR = myFamilyI->POA_SALOME_MED::FAMILY::_this() ; - myFamilyI->addInStudy(myStudy,myFamilyIOR) ; - } - // group : - groupVector = ptrMesh->getGroups((MED_EN::medEntityMesh)(*currentEntity).first) ; - for(groupVectorIt=groupVector.begin();groupVectorIt!=groupVector.end();groupVectorIt++) { - GROUP_i * myGroupI = new GROUP_i(*groupVectorIt); - SALOME_MED::GROUP_ptr myGroupIOR = myGroupI->POA_SALOME_MED::GROUP::_this() ; - myGroupI->addInStudy(myStudy,myGroupIOR) ; - } - } - } - - for (int i=0; i mySupports = _med->getSupports(meshesNames[i]) ; - map::const_iterator itSupport ; - map & mySupportsIOR = _supports[meshesNames[i]] ; - for ( itSupport=mySupports.begin(); itSupport!=mySupports.end(); itSupport++ ) { - SUPPORT_i * mySupportI = new SUPPORT_i((*itSupport).second); - SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this() ; - mySupportsIOR[(*itSupport).first]= mySupportIOR ; - mySupportI->addInStudy(myStudy,mySupportIOR) ; - } - } - - // FIELD : - deque fieldsNames = _med->getFieldNames() ; - int numberOfFields = fieldsNames.size() ; - for (int i=0; i myIteration = _med->getFieldIteration (fieldsNames[i]) ; - int numberOfIteration = myIteration.size() ; - for (int j=0; jgetField(fieldsNames[i],myIteration[j].dt,myIteration[j].it) ; - string meshName = myField->getSupport()->getMesh()->getName() ; - medEntityMesh myEntity = myField->getSupport()->getEntity() ; - map >::const_iterator itSupportOnMesh = _supports.find(meshName) ; - if ( itSupportOnMesh == _supports.end() ) - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) - << "There is no support on mesh named |" - << meshName << "|" - ) - ); - const map & SupportOnMesh = (*itSupportOnMesh).second ; - map::const_iterator itSupport = SupportOnMesh.find((MED_FR::med_entite_maillage)myEntity) ; - if (itSupport == SupportOnMesh.end() ) - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) - << "There is no support on entity " - << entity << " in mesh named |" - << meshName << "|" - ) - ); - SALOME_MED::SUPPORT_ptr mySupportIOR = (*itSupport).second ; - med_type_champ type = myField->getValueType() ; - SALOME_MED::FIELD_ptr myFieldIOR ; - switch (type) { - case MED_FR::MED_INT32: { - ((FIELD*)myField)->read() ; - FIELDINT_i * myFieldIntI = new FIELDINT_i(mySupportIOR,(FIELD*)myField); - //SALOME_MED::FIELDINT_ptr myFieldIntIOR = myFieldIntI->_this() ; - POA_SALOME_MED::FIELD_tie * myFieldTie = new POA_SALOME_MED::FIELD_tie(myFieldIntI) ; - myFieldIOR = myFieldTie->_this() ; - myFieldIntI->addInStudy(myStudy,myFieldIOR) ; - - break ; - } - // else - case MED_FR::MED_REEL64: { - ((FIELD*)myField)->read() ; - FIELDDOUBLE_i * myFieldDoubleI = new FIELDDOUBLE_i(mySupportIOR,(FIELD*)myField); - //SALOME_MED::FIELDDOUBLE_ptr myFieldDoubleIOR = myFieldDoubleI->_this() ; - POA_SALOME_MED::FIELD_tie * myFieldTie= new POA_SALOME_MED::FIELD_tie(myFieldDoubleI) ; - myFieldIOR = myFieldTie->_this() ; - myFieldDoubleI->addInStudy(myStudy,myFieldIOR) ; - break ; - } - default: { - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) - <<" * Iteration "<POA_SALOME_MED::FIELD::_this() ; - DT_IT_ dtIt; - dtIt.dt = myIteration[j].dt ; - dtIt.it = myIteration[j].it ; - _fields[fieldsNames[i]][dtIt] = myFieldIOR ; - } - } - - END_OF(LOC); -} - -//============================================================================= -/*! - * methods - */ -//============================================================================= -void MED_i::initWithFieldType(SALOMEDS::Study_ptr myStudy,driverTypes driverType, const string & fileName) -{ - const char * LOC = "MED_i::initWithFieldType(driverTypes, const string &)" ; - BEGIN_OF(LOC); - - _med = new ::MED(driverType,fileName) ; - // we create all IOR from _med - - // MESH : - deque meshesNames = _med->getMeshNames() ; - int numberOfMeshes = meshesNames.size() ; - for (int i=0; igetMesh(meshesNames[i]) ; - myMesh->read() ; - MESH_i * myMeshI = new MESH_i(myMesh) ; - SALOME_MED::MESH_ptr myMeshIOR = myMeshI->_this() ; - //POA_SALOME_MED::MESH_tie * myMeshTie = new POA_SALOME_MED::MESH_tie(myMeshI) ; - //SALOME_MED::MESH_ptr myMeshIOR = myMeshTie->_this() ; - _meshes[meshesNames[i]]=myMeshIOR ; - myMeshI->addInStudy(myStudy,myMeshIOR) ; - } - - // SUPPORT : - _med->updateSupport() ; - for (int i=0; i mySupports = _med->getSupports(meshesNames[i]) ; - map::const_iterator itSupport ; - map & mySupportsIOR = _supports[meshesNames[i]] ; - for ( itSupport=mySupports.begin(); itSupport!=mySupports.end(); itSupport++ ) { - SUPPORT_i * mySupportI = new SUPPORT_i((*itSupport).second); - SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this() ; - //POA_SALOME_MED::SUPPORT_tie * mySupportTie = new POA_SALOME_MED::SUPPORT_tie(mySupportI) ; - //SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportTie->_this() ; - mySupportsIOR[(*itSupport).first]= mySupportIOR ; - mySupportI->addInStudy(myStudy,mySupportIOR) ; - } - } - - // FIELD : - deque fieldsNames = _med->getFieldNames() ; - int numberOfFields = fieldsNames.size() ; - for (int i=0; i myIteration = _med->getFieldIteration (fieldsNames[i]) ; - int numberOfIteration = myIteration.size() ; - for (int j=0; jgetField(fieldsNames[i],myIteration[j].dt,myIteration[j].it) ; - string meshName = myField->getSupport()->getMesh()->getName() ; - medEntityMesh myEntity = myField->getSupport()->getEntity() ; - map >::const_iterator itSupportOnMesh = _supports.find(meshName) ; - if ( itSupportOnMesh == _supports.end() ) - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) - << "There is no support on mesh named |" - << meshName << "|" - ) - ); - const map & SupportOnMesh = (*itSupportOnMesh).second ; - map::const_iterator itSupport = SupportOnMesh.find((MED_FR::med_entite_maillage)myEntity) ; - if (itSupport == SupportOnMesh.end() ) - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) - << "There is no support on entity " - << entity << " in mesh named |" - << meshName << "|" - ) - ); - SALOME_MED::SUPPORT_ptr mySupportIOR = (*itSupport).second ; - med_type_champ type = myField->getValueType() ; - // SALOME_MED::FIELD_ptr myFieldIOR ; - - DT_IT_ dtIt; - dtIt.dt = myIteration[j].dt ; - dtIt.it = myIteration[j].it ; - - switch (type) { - case MED_FR::MED_INT32: { - ((FIELD*)myField)->read() ; - FIELDINT_i * myFieldIntI = new FIELDINT_i(mySupportIOR,(FIELD*)myField); - //SALOME_MED::FIELDINT_ptr myFieldIntIOR = myFieldIntI->_this() ; - // POA_SALOME_MED::FIELD_tie * myFieldTie = new POA_SALOME_MED::FIELD_tie(myFieldIntI) ; - // myFieldIOR = myFieldTie->_this() ; - // myFieldIntI->addInStudy(myStudy,myFieldIOR) ; - - SALOME_MED::FIELDINT_ptr myFieldIntIOR ; - POA_SALOME_MED::FIELDINT_tie * myFieldIntTie = new POA_SALOME_MED::FIELDINT_tie(myFieldIntI) ; - myFieldIntIOR = myFieldIntTie->_this() ; - myFieldIntI->addInStudy(myStudy,myFieldIntIOR) ; - - _fields[fieldsNames[i]][dtIt] = myFieldIntIOR ; - - break ; - } - // else - case MED_FR::MED_REEL64: { - ((FIELD*)myField)->read() ; - FIELDDOUBLE_i * myFieldDoubleI = new FIELDDOUBLE_i(mySupportIOR,(FIELD*)myField); - //SALOME_MED::FIELDDOUBLE_ptr myFieldDoubleIOR = myFieldDoubleI->_this() ; - // POA_SALOME_MED::FIELD_tie * myFieldTie= new POA_SALOME_MED::FIELD_tie(myFieldDoubleI) ; - // myFieldIOR = myFieldTie->_this() ; - // myFieldDoubleI->addInStudy(myStudy,myFieldIOR) ; - - SALOME_MED::FIELDDOUBLE_ptr myFieldDoubleIOR ; - POA_SALOME_MED::FIELDDOUBLE_tie * myFieldDoubleTie = new POA_SALOME_MED::FIELDDOUBLE_tie(myFieldDoubleI) ; - myFieldDoubleIOR = myFieldDoubleTie->_this() ; - myFieldDoubleI->addInStudy(myStudy,myFieldDoubleIOR) ; - - _fields[fieldsNames[i]][dtIt] = myFieldDoubleIOR ; - - break ; - } - default: { - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) - <<" * Iteration "<POA_SALOME_MED::FIELD::_this() ; - // DT_IT_ dtIt; - // dtIt.dt = myIteration[j].dt ; - // dtIt.it = myIteration[j].it ; - // _fields[fieldsNames[i]][dtIt] = myFieldIOR ; - } - } - - END_OF(LOC); -} - -// MED_i::MED_i(::MED * const m):_med(m) -// { -// BEGIN_OF("Constructor MED_i"); -// END_OF("Constructor MED_i"); -// } -//============================================================================= -/*! - * Constructor par recopie - */ -//============================================================================= -// MED_i::MED_i(MED_i & m):_med(m._med) -// { -// BEGIN_OF("Constructor par recopie MED_i"); -// END_OF("Constructorpar recopie MED_i"); -// } -//============================================================================= -/*! - * Destructor - */ -//============================================================================= -MED_i::~MED_i() -{ -} -//============================================================================= -/*! - * CORBA: Accessor for Number of meshes - */ -//============================================================================= -CORBA::Long MED_i::getNumberOfMeshes() -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - return _med->getNumberOfMeshes(); - } - catch(...) - { - MESSAGE("Unable to get the number of meshes in Med Object"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: Accessor for Number of fields - */ -//============================================================================= -CORBA::Long MED_i::getNumberOfFields() -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - return _med->getNumberOfFields(); - } - catch(...) - { - MESSAGE("Unable to get the number of fields in Med Object"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: Accessor for meshes names - */ -//============================================================================= -Engines::string_array * MED_i::getMeshNames() -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - Engines::string_array_var myseq = new Engines::string_array; - try - { - int nbMeshes=_med->getNumberOfMeshes(); - myseq->length(nbMeshes); - string * nameMeshes = new string[nbMeshes]; - _med->getMeshNames(nameMeshes); - for (int i=0;igetNumberOfFields(); - myseq->length(nbFields); - string * nameFields = new string[nbFields]; - _med->getFieldNames(nameFields); - for (int i=0;igetMesh(meshName); - MESH_i * m1 = new MESH_i(mesh); - SALOME_MED::MESH_ptr m2 = m1->POA_SALOME_MED::MESH::_this(); - m1->_remove_ref(); - return (SALOME_MED::MESH::_duplicate(m2)); - } - catch(...) - { - MESSAGE("Unable to get the specified mesh"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } - -} -//============================================================================= -/*! - * CORBA: Accessor for a specific mesh - */ -//============================================================================= -SALOME_MED::MESH_ptr MED_i::getMesh(SALOME_MED::FIELD_ptr fieldPtr) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - int ind=fieldPtr->getCorbaIndex(); - SCRUTE(ind); - - MESH * mesh; - SALOME_MED::FIELDINT_var fieldint =SALOME_MED::FIELDINT::_narrow(fieldPtr); - if (CORBA::is_nil(fieldint)) - { - MESSAGE("Double"); - SALOME_MED::FIELDDOUBLE_var fielddouble = - SALOME_MED::FIELDDOUBLE::_narrow(fieldPtr); - ASSERT(!CORBA::is_nil(fielddouble)); - ASSERT(FIELDOF_i::fieldMap.find(ind) - !=FIELDOF_i::fieldMap.end()); - ::FIELD * fdouble = FIELDOF_i::fieldMap[ind]; - MESH * mesh=_med->getMesh(fdouble); - } - else - { - MESSAGE("Integer"); - ASSERT(FIELDOF_i::fieldMap.find(ind)!=FIELDOF_i::fieldMap.end()); - ::FIELD * fint = FIELDOF_i::fieldMap[ind]; - MESH * mesh=_med->getMesh(fint); - } - MESH_i * meshi = new MESH_i(mesh); - SALOME_MED::MESH_ptr meshptr = meshi->POA_SALOME_MED::MESH::_this(); - meshi->_remove_ref(); - return (SALOME_MED::MESH::_duplicate(meshptr)); - -} -//============================================================================= -/*! - * CORBA: Accessor for a specific field - */ -//============================================================================= -SALOME_MED::FIELD_ptr MED_i::getField(const char* fieldName, - CORBA::Long pasTemps, - CORBA::Long numOrdre ) -throw (SALOME::SALOME_Exception) -{ - const char * LOC="MED_i::getField(const char*,CORBA::Long,CORBA::Long) " ; - BEGIN_OF(LOC) ; - - DT_IT_ dtIt; - - dtIt.dt= (int)pasTemps; - dtIt.it= (int)numOrdre; - - map::const_iterator itFields = _fields.find(fieldName); - - if ( itFields == _fields.end() ) - THROW_SALOME_CORBA_EXCEPTION("Field not found !", SALOME::INTERNAL_ERROR) ; - - const MAP_IOR_DT_IT_ & map_dtIt = (*itFields).second ; - MAP_IOR_DT_IT_::const_iterator itMap_dtIt = map_dtIt.find(dtIt); - - if ( itMap_dtIt == map_dtIt.end() ) - THROW_SALOME_CORBA_EXCEPTION("Iteration not found !", SALOME::INTERNAL_ERROR) ; - - END_OF(LOC) ; - return (*itMap_dtIt).second; - -// if (_med==NULL) -// THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ -// SALOME::INTERNAL_ERROR); -// try -// { -// if (dynamic_cast * > -// (_med->getField(fieldName,pasTemps,numOrdre)) !=NULL) -// { -// MESSAGE("Champ d entier"); -// ::FIELD*f=dynamic_cast * > -// (_med->getField(fieldName,pasTemps,numOrdre)); -// FIELDINT_i * medf = new FIELDINT_i(f); -// POA_SALOME_MED::FIELDINT_tie * f1 = -// new POA_SALOME_MED::FIELDINT_tie(medf,true); -// SALOME_MED::FIELDINT_ptr f2 = f1->_this(); -// f1->_remove_ref(); -// return f2; - -// } -// else -// { -// ASSERT (dynamic_cast* >(_med->getField(fieldName,pasTemps,numOrdre))!=NULL); -// MESSAGE("Champ de double"); -// ::FIELD*f=dynamic_cast* > -// (_med->getField(fieldName,pasTemps,numOrdre)); -// FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(f); -// POA_SALOME_MED::FIELDDOUBLE_tie * f1 = -// new POA_SALOME_MED::FIELDDOUBLE_tie(medf,true); -// SALOME_MED::FIELDDOUBLE_ptr f2 = f1->_this(); -// f1->_remove_ref(); -// return f2; -// } -// } -// catch(...) -// { -// MESSAGE("Exception en accedant a l objet C++ Med"); -// THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" -// ,SALOME::INTERNAL_ERROR); -// } -} -//============================================================================= -/*! - * CORBA: Accessor for a specific field - */ -//============================================================================= -CORBA::Long MED_i::addDriver(SALOME_MED::medDriverTypes driverType, const char* fileName) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - int driv=_med->addDriver(convertIdlDriverToMedDriver(driverType), - fileName); - return driv; - } - catch(...) - { - MESSAGE("Unable to add a driver to the med object"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } - -} -//============================================================================= -/*! - * CORBA: relase the driver (mandatory) - */ -//============================================================================= -void MED_i::rmDriver(CORBA::Long i) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - _med->rmDriver(i); - } - catch(...) - { - MESSAGE("Unable to unlink the driver from the med object"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: read med objects relations - */ -//============================================================================= -void MED_i::readFileStruct(CORBA::Long i) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - _med->readFileStruct(i); - } - catch(...) - { - MESSAGE("Unable to read the structure of this file "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: write specifics objects f - */ -//============================================================================= -void MED_i::writeFrom(CORBA::Long i) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - _med->writeFrom(i); - } - catch(...) - { - MESSAGE("Unable to write this driver "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: write objects - */ -//============================================================================= -void MED_i::write(CORBA::Long i) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - _med->write(i); - } - catch(...) - { - MESSAGE("Unable to write this file "); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: Add Mesh in Med objects - */ -//============================================================================= -void MED_i::addMesh(SALOME_MED::MESH_ptr ptrMesh) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - try - { - int ind=ptrMesh->getCorbaIndex(); - SCRUTE(ind); - ASSERT(MESH_i::meshMap.find(ind) !=MESH_i::meshMap.end()); - MESH * mesh= MESH_i::meshMap[ind]; - _med->addMesh(mesh); - } - catch(...) - { - MESSAGE("Unable to link this mesh to this med object"); - THROW_SALOME_CORBA_EXCEPTION("Unable to acces MED C++ Object" - ,SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: Add field in Med objects - */ -//============================================================================= -void MED_i::addField(SALOME_MED::FIELD_ptr ptrField) -throw (SALOME::SALOME_Exception) -{ - if (_med==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Med object",\ - SALOME::INTERNAL_ERROR); - int ind=ptrField->getCorbaIndex(); - SCRUTE(ind); - - SALOME_MED::FIELDINT_var fieldint =SALOME_MED::FIELDINT::_narrow(ptrField); - if (CORBA::is_nil(fieldint)) - { - MESSAGE("Double"); - SALOME_MED::FIELDDOUBLE_var fielddouble = - SALOME_MED::FIELDDOUBLE::_narrow(ptrField); - ASSERT(!CORBA::is_nil(fielddouble)); - ASSERT(FIELDOF_i::fieldMap.find(ind) - !=FIELDOF_i::fieldMap.end()); - ::FIELD * fdouble = FIELDOF_i::fieldMap[ind]; - // A modifier - //_med->addField(fdouble); - } - else - { - MESSAGE("Integer"); - ASSERT(FIELDOF_i::fieldMap.find(ind)!=FIELDOF_i::fieldMap.end()); - ::FIELD * fint = FIELDOF_i::fieldMap[ind]; - //_med->addField(fint); - } -} -//============================================================================= -/*! - * CORBA: Add Med in Study - */ -//============================================================================= -void MED_i::addInStudy(SALOMEDS::Study_ptr myStudy, SALOME_MED::MED_ptr myIor) -throw (SALOME::SALOME_Exception) -{ - BEGIN_OF("MED_Mesh_i::addInStudy"); - if ( _medId != "" ) - { - MESSAGE("Med already in Study"); - THROW_SALOME_CORBA_EXCEPTION("Med already in Study", \ - SALOME::BAD_PARAM); - }; - - SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); - myBuilder->NewCommand(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var aIOR; - - // Create SComponent labelled 'MED' if it doesn't already exit - // SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); - if ( CORBA::is_nil(medfather) ) - { - THROW_SALOME_CORBA_EXCEPTION("Component Med not found", - SALOME::BAD_PARAM); - } ; - - MESSAGE("Add a MED Object under Med"); - SALOMEDS::SObject_var newObj = myBuilder->NewObject(medfather); - - ORB_INIT &init = *SINGLETON_::Instance() ; - ASSERT(SINGLETON_::IsAlreadyExisting()) ; - CORBA::ORB_var &orb = init(0,0); - string iorStr = orb->object_to_string(myIor); - anAttr = myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"); - aIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - aIOR->SetValue(iorStr.c_str()); - anAttr = myBuilder->FindOrCreateAttribute(newObj, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue("Objet MED"); - _medId = newObj->GetID(); - myBuilder->CommitCommand(); - - END_OF("Med_i::addInStudy(SALOMEDS::Study_ptr myStudy)"); -} - - - - diff --git a/src/MedMem/Mesh_i.hxx b/src/MedMem/Mesh_i.hxx deleted file mode 100644 index a2b167114..000000000 --- a/src/MedMem/Mesh_i.hxx +++ /dev/null @@ -1,152 +0,0 @@ -//============================================================================= -// File : Mesh_i.hxx -// Project : SALOME -// Author : EDF -// Copyright : EDF 2002 -// $Header: /export/home/CVS/SALOME_ROOT/MED/src/MedMem/Mesh_i.hxx -//============================================================================= - -#ifndef _MED_MESH_I_HXX_ -#define _MED_MESH_I_HXX_ - -#include -#include - -#include -//#include "SALOME_Component_i.hxx" -#include CORBA_SERVER_HEADER(MED) -#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) -//#include "MED.hh" - -class MESH; -class MESH_i: - public POA_SALOME_MED::MESH, - public PortableServer::RefCountServantBase -// public Engines_Component_i -{ -public : - static map < int,::MESH *> meshMap; -private : - static int meshIndex; - -private : - -protected: - // C++ object containing values - ::MESH * const _mesh; - const int _corbaIndex; - string _meshId; - - -public: - - // Constructors and associated internal methods - MESH_i(); - MESH_i(::MESH * const m); - MESH_i(MESH_i & m); - ~MESH_i(); - - // IDL Methods - char * getName() throw (SALOME::SALOME_Exception); - - CORBA::Long getSpaceDimension() throw (SALOME::SALOME_Exception); - - CORBA::Long getMeshDimension() throw (SALOME::SALOME_Exception); - - char * getCoordinatesSystem() - throw (SALOME::SALOME_Exception); - - Engines::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch) - throw (SALOME::SALOME_Exception); - - Engines::string_array* getCoordinatesNames() - throw (SALOME::SALOME_Exception); - - Engines::string_array* getCoordinatesUnits() - throw (SALOME::SALOME_Exception); - - CORBA::Long getNumberOfNodes() - throw (SALOME::SALOME_Exception); - - CORBA::Long getNumberOfTypes (SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - CORBA::Long getNumberOfElements (SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw (SALOME::SALOME_Exception); - - Engines::long_array* getConnectivity(SALOME_MED::medModeSwitch typeSwitch, - SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw (SALOME::SALOME_Exception); - - Engines::long_array* getConnectivityIndex(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement type, - const Engines::long_array& connectivity) - throw (SALOME::SALOME_Exception); - - Engines::long_array* getReverseConnectivity(SALOME_MED::medConnectivity mode) - throw (SALOME::SALOME_Exception); - - Engines::long_array* getReverseConnectivityIndex(SALOME_MED::medConnectivity mode) - throw (SALOME::SALOME_Exception); - - // Family and Group - CORBA::Long getNumberOfFamilies (SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - CORBA::Long getNumberOfGroups (SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - SALOME_MED::Family_array* getFamilies (SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - SALOME_MED::FAMILY_ptr getFamily (SALOME_MED::medEntityMesh entity, - CORBA::Long i) - throw (SALOME::SALOME_Exception); - SALOME_MED::Group_array* getGroups (SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - SALOME_MED::GROUP_ptr getGroup (SALOME_MED::medEntityMesh entity, - CORBA::Long i) - throw (SALOME::SALOME_Exception); - // - SALOME_MED::FIELD_ptr getVolume (SALOME_MED::SUPPORT_ptr mySupport) - throw (SALOME::SALOME_Exception); - SALOME_MED::FIELD_ptr getArea (SALOME_MED::SUPPORT_ptr mySupport) - throw (SALOME::SALOME_Exception); - SALOME_MED::FIELD_ptr getLength (SALOME_MED::SUPPORT_ptr mySupport) - throw (SALOME::SALOME_Exception); - SALOME_MED::FIELD_ptr getNormal (SALOME_MED::SUPPORT_ptr mySupport) - throw (SALOME::SALOME_Exception); - SALOME_MED::FIELD_ptr getBarycenter (SALOME_MED::SUPPORT_ptr mySupport) - throw (SALOME::SALOME_Exception); - SALOME_MED::FIELD_ptr getNeighbourhood (SALOME_MED::SUPPORT_ptr mySupport) - throw (SALOME::SALOME_Exception); - - - // Others - void addInStudy (SALOMEDS::Study_ptr myStudy, - SALOME_MED::MESH_ptr myIor) throw (SALOME::SALOME_Exception); - void addInStudy (SALOMEDS::Study_ptr myStudy, - SALOME_MED::MESH_ptr myIor, - const string & fileName) throw (SALOME::SALOME_Exception); - CORBA::Long addDriver (SALOME_MED::medDriverTypes driverType, - const char* fileName, const char* meshName) - throw (SALOME::SALOME_Exception); - void rmDriver (CORBA::Long i) throw (SALOME::SALOME_Exception); - void read (CORBA::Long i) throw (SALOME::SALOME_Exception); - void write (CORBA::Long i, const char* driverMeshName) - throw (SALOME::SALOME_Exception); - - // Cuisine interne - CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception); - ::MESH * constructConstMesh() const; -}; - -#endif /* _MED_MESH_I_HXX_ */ -- 2.39.2