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
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
# 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
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
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)
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
# 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
"\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"
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