From bb15937edd9f5863039687e31c255ce91882b7c7 Mon Sep 17 00:00:00 2001 From: crouzet Date: Wed, 25 Nov 2009 10:11:06 +0000 Subject: [PATCH] treatment of coupling fields and meshes types --- scripts/Makefile.am | 2 +- scripts/cpp_compo_template.tgz | Bin 4432 -> 4445 bytes scripts/hxx2salome | 20 +++++++++++++++++--- scripts/parse3.awk | 18 ++++++++++++++++-- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e0665d5..5c51488 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -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 diff --git a/scripts/cpp_compo_template.tgz b/scripts/cpp_compo_template.tgz index fa92fa43170f006c9a5b53166c77fec83ffd7cab..646b08eb02b1f6fc14f9b913a3458ec0f4dfba60 100644 GIT binary patch delta 1353 zcmV-P1-AOoBHbbfABzY8Oz!uw2V)BmHdii|OJzVr{V!L}3jJ>vlXnZNfAP)Ni2s)| zX#eH2;{Au60G{~+&1+;^lt1-I$ExG;gLu!d+``8p{iB0*cEe12JZ4TrWZ^v;Is+BF zAuxXi{?jMfRLP2H#Z;AU`?6C*5({Q1e=KNC9w@k4uk*rUalBO2st4}|rOXl2M{MNB z=MWQOA@resS`0!QN3$nme-oG*YI5ujwMwSbAyakcxFopapagvdJyeOsr-8&Gg7TqJ ztv8mvt;kXFSsxNUU^J~Uv?O}!h}U%b#!*n&*@)n-Rg{Sku)>v#PWyeQdbZkvC(BV$ zUsq@-=vQI2>S5=mS~B$3;s{XU&x>GsF-w2ZAuxTn7GMEQ8Ixc=~(e`nuzZdFI8I@3(m;jbmGVH>ADrq3eg7CoQ@w={r;>q1ob!!fRL zKRACd=>ba~Pp(Zvi&nfJJX$vW;)%%W19Qck=M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H6N*{-i>8zR)|hZ8?-IU^|1Yh;C(GER|9|Ck`AGlIl#%}zi{ky) z-N5(je_`4gbBD{SA=t}squ3)g?4#Mi&@|L+F&jlQL`KAm@oDIY+ABKweFSZrk)u0Ooy z*|(ir)zPWWG=Ecd_-l!4*v6@k>9dHrMGq*!Ee)XIx)9aQ?OGgQ-X{TFnvOONB-&H@s?C;(WZX+VYyrskOc&JMe;j ziTnAD1b_9vyfrNEZYV*7oA%=9%?NyjQ)$=ywXmncD+Cl-VGXe5!j`_*IVx4WxN%D>Sf1BrjviU+b z`hWeOGREf$_zaxj|2u%)`hS<5zQN<=#Ikk6^^{e~v)sT6zX%$D82??s^7t>kRr%dzY&`#&4c`AP!07w;Kg;6x-*y9} zS_5UG*^B#UGLtkTXA>BS?>T_h05hWA?8HIDLhKnwRjQZ0_F45~1JN4iRj_uHdVk~H z<@>m0^Q`q|mq%W7+V#s?uh~8)7>%3KsDkv`?N$^00Dm;_> 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 diff --git a/scripts/parse3.awk b/scripts/parse3.awk index 80f17f6..59d8894 100644 --- a/scripts/parse3.awk +++ b/scripts/parse3.awk @@ -52,6 +52,7 @@ BEGIN { idl_arg_type["MEDMEM::FIELD*&"]="out SALOME_MED::FIELDINT" idl_arg_type["const std::vector&"]="in SALOME::vectorOfLong" idl_arg_type["std::vector*&"]="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&"]="SALOME_MED::FIELDINT" idl_rtn_type["std::vector*"]="SALOME::vectorOfLong" idl_rtn_type["std::vector"]="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&"]="\tlong _%s_size;\n\tint *_%s_value = ReceiverFactory::getValue(%s,_%s_size);\n"\ # "\tstd::vector _%s(_%s_value,_%s_value+_%s_size);\n\tdelete [] _%s_value;" cpp_impl_a["std::vector*&"]="\tstd::vector* _%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*"]=\ # "\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 -- 2.39.2