]> SALOME platform Git repositories - tools/hxx2salome.git/commitdiff
Salome HOME
treatment of coupling fields and meshes types
authorcrouzet <crouzet>
Wed, 25 Nov 2009 10:11:06 +0000 (10:11 +0000)
committercrouzet <crouzet>
Wed, 25 Nov 2009 10:11:06 +0000 (10:11 +0000)
scripts/Makefile.am
scripts/cpp_compo_template.tgz
scripts/hxx2salome
scripts/parse3.awk

index e0665d596b373254099d10cf71ad5f22406ec3a0..5c51488a2b30b2ad14bb4e963cece320dba75351 100644 (file)
@@ -15,4 +15,4 @@ bin_SCRIPTS = hxx2salome \
              cpp_compo_template.tgz
 
 install-data-hook:
-       \cp -f ${srcdir}/template_src.tgz ${exec_prefix}/bin
+       \cp -f ${srcdir}/template_src.tgz ${srcdir}/template_coupling_src.tgz ${exec_prefix}/bin
index fa92fa43170f006c9a5b53166c77fec83ffd7cab..646b08eb02b1f6fc14f9b913a3458ec0f4dfba60 100644 (file)
Binary files a/scripts/cpp_compo_template.tgz and b/scripts/cpp_compo_template.tgz differ
index 88fb60aab538e9d942db6e2790a66fe44dfec639..13c50bee0934c95bf25b4434c33cde56111a6d55 100755 (executable)
@@ -189,11 +189,20 @@ generate_module_source()
     cat code_cxx >> hxx2salome_journal
     echo
 #
+# select archive for MEDMEM or MEDCoupling
+    grep MEDCoupling code_idl >& /dev/null
+    if [ $? -eq 0 ]
+    then
+       template_component_archive=${gene_dir}/template_coupling_src.tgz
+    else
+       template_component_archive=${gene_dir}/template_src.tgz
+    fi
+#
 #
 # -------------------  duplicates template module and insert generated code  ------------------------------
 #
     echo -e "\n-> Duplicate template module" | tee hxx2salome_journal
-    tar xvfz ${gene_dir}/template_src.tgz >> hxx2salome_journal
+    tar xvfz ${template_component_archive} >> hxx2salome_journal
     mv HXX2SALOME_GENERIC_CLASS_NAME_SRC ${CLASS_NAME}_SRC
     ${gene_dir}/renameSalomeModule -i HXX2SALOME_GENERIC_CLASS_NAME ${CLASS_NAME} ${CLASS_NAME}_SRC 
     ###>> hxx2salome_journal
@@ -254,7 +263,8 @@ generate_module_source()
     cd ${CLASS_NAME}_SRC/resources
     VER=`cat ${KERNEL_ROOT_DIR}/bin/salome/VERSION | awk ' { print $NF }'` # extract number of version 
     export PYTHONPATH=${PYTHONPATH}:${KERNEL_ROOT_DIR}/bin/salome  # to be sure IDLparser is in PYTHONPATH
-    ${idlparser} -Wbcatalog=${CLASS_NAME}Catalog.xml,icon=${CLASS_NAME}.png,version=${VER} -I${KERNEL_ROOT_DIR}/idl/salome -I${MED_ROOT_DIR}/idl/salome ../idl/${CLASS_NAME}_Gen.idl >& /dev/null | tee  hxx2salome_journal
+    #${idlparser} -Wbcatalog=${CLASS_NAME}Catalog.xml,icon=${CLASS_NAME}.png,version=${VER} -I${KERNEL_ROOT_DIR}/idl/salome -I${MED_ROOT_DIR}/idl/salome ../idl/${CLASS_NAME}_Gen.idl >& /dev/null | tee  hxx2salome_journal
+    ${idlparser} -Wbcatalog=${CLASS_NAME}Catalog.xml,icon=${CLASS_NAME}.png,version=${VER} -I${KERNEL_ROOT_DIR}/idl/salome -I${MED_ROOT_DIR}/idl/salome ../idl/${CLASS_NAME}_Gen.idl 
     if [ -f ${CLASS_NAME}Catalog.xml ]
     then
         sed -i "s?_Gen??g
@@ -490,8 +500,12 @@ fi
 #                                         only if KERNEL_ROOT_DIR and MED_ROOT_DIR are defined
 if [ "${SHELL_EXT}" == "sh" ] && [ ${ENVIRON_FILE} ] && [ -f ${ENVIRON_FILE} ]
 then
+   pwd
    echo -e "\n    Environment file with sh syntax specified => we source ${ENVIRON_FILE}"
-   source ${ENVIRON_FILE}
+   cat ${ENVIRON_FILE} | sed "s/ENV_FOR_LAUNCH=1/ENV_FOR_LAUNCH=0/g" > ${ENVIRON_FILE}.tmp
+   source ${ENVIRON_FILE}.tmp
+   #rm ${ENVIRON_FILE}.tmp
+   #source ${ENVIRON_FILE}
 else
    if [ ${KERNEL_ROOT_DIR} ] && [ -d ${KERNEL_ROOT_DIR} ] && [ ${MED_ROOT_DIR} ] && [ -d ${MED_ROOT_DIR} ]
    then
index 80f17f61e53030a28e981fd68e0b06c6a13ded1b..59d889412ddf357b45f811d913a54da1a3a7fd4b 100644 (file)
@@ -52,6 +52,7 @@ BEGIN {
   idl_arg_type["MEDMEM::FIELD<int>*&"]="out SALOME_MED::FIELDINT"
   idl_arg_type["const std::vector<int>&"]="in SALOME::vectorOfLong"
   idl_arg_type["std::vector<int>*&"]="out SALOME::vectorOfLong"
+  idl_arg_type["const ParaMEDMEM::MEDCouplingFieldDouble*"]="in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface"
 #
 #
 # mapping for returned types
@@ -84,6 +85,8 @@ BEGIN {
   idl_rtn_type["const MEDMEM::FIELD<int>&"]="SALOME_MED::FIELDINT"
   idl_rtn_type["std::vector<int>*"]="SALOME::vectorOfLong"
   idl_rtn_type["std::vector<std::string>"]="StrSeq"
+  idl_rtn_type["ParaMEDMEM::MEDCouplingUMesh*"]="SALOME_MED::MEDCouplingUMeshCorbaInterface"
+  idl_rtn_type["ParaMEDMEM::MEDCouplingFieldDouble*"]="SALOME_MED::MEDCouplingFieldDoubleCorbaInterface"
 #
 #
 # Corba mapping table (for argument's types and returned types)
@@ -127,6 +130,9 @@ BEGIN {
   idl_impl_hxx["SALOME_MED::FIELDINT"]="SALOME_MED::FIELDINT_ptr"
   idl_impl_hxx["SALOME::vectorOfLong"]="SALOME::vectorOfLong*"
   idl_impl_hxx["StrSeq"]=class_name"_ORB::StrSeq*"
+  idl_impl_hxx["in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface"]="SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr"
+  idl_impl_hxx["SALOME_MED::MEDCouplingUMeshCorbaInterface"]="SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr"
+  idl_impl_hxx["SALOME_MED::MEDCouplingFieldDoubleCorbaInterface"]="SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr"
 #
 #
 # table for c++ code generation : argument's processing
@@ -173,7 +179,7 @@ BEGIN {
 #  cpp_impl_a["const std::vector<int>&"]="\tlong _%s_size;\n\tint *_%s_value = ReceiverFactory::getValue(%s,_%s_size);\n"\
 #             "\tstd::vector<int> _%s(_%s_value,_%s_value+_%s_size);\n\tdelete [] _%s_value;"
   cpp_impl_a["std::vector<int>*&"]="\tstd::vector<int>* _%s;\n"
-
+  cpp_impl_a["const ParaMEDMEM::MEDCouplingFieldDouble*"]="\tParaMEDMEM::MEDCouplingFieldDouble* _%s=ParaMEDMEM::MEDCouplingFieldDoubleClient::New(%s);\n"
 #
 #
 # table for c++ code generation : returned value processing
@@ -253,7 +259,14 @@ BEGIN {
             "\t_rtn_ior->length(_rtn_cpp_length);\n"\
             "\tfor (int i=0; i<_rtn_cpp_length; ++i)\n"\
             "\t    (*_rtn_ior)[i] = _rtn_cpp[i].c_str();\n"
-            
+  cpp_impl_b["ParaMEDMEM::MEDCouplingFieldDouble*"]=\
+             "\tParaMEDMEM::MEDCouplingFieldDoubleServant * _rtn_field_i = new ParaMEDMEM::MEDCouplingFieldDoubleServant(_rtn_cpp);\n"\
+             "\t_rtn_cpp->decrRef();\n"\
+             "\tSALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr _rtn_ior = _rtn_field_i->_this();\n"
+  cpp_impl_b["ParaMEDMEM::MEDCouplingUMesh*"]=\
+             "\tParaMEDMEM::MEDCouplingUMeshServant * _rtn_mesh_i = new ParaMEDMEM::MEDCouplingUMeshServant(_rtn_cpp);\n"\
+             "\t_rtn_cpp->decrRef();\n"\
+             "\tSALOME_MED::MEDCouplingUMeshCorbaInterface_ptr _rtn_ior = _rtn_mesh_i->_this();\n"
 #  cpp_impl_b["std::vector<int>*"]=\
 #             "\tSALOME::SenderInt_ptr _rtn_ior = SenderFactory::buildSender(*this,&(*_rtn_cpp)[0],(*_rtn_cpp).size(),true);\n"
 
@@ -289,6 +302,7 @@ BEGIN {
   cpp_impl_c["const MEDMEM::MESH*"]="\t_%s->removeReference();\n"
   cpp_impl_c["const MEDMEM::SUPPORT&"]="\t_%s->removeReference();\n"
   cpp_impl_c["const MEDMEM::SUPPORT*"]="\t_%s->removeReference();\n"
+  cpp_impl_c["const ParaMEDMEM::MEDCouplingFieldDouble*"]="\t_%s->decrRef();\n"
 #
 #
 # record sep is ");\n" whith blanks all around, and optional "(" at the beginning