qt下使用opencascade源代码

本文介绍如何在Qt环境中解决OpenCASCADE源代码中使用的头文件不被识别的问题,通过Python脚本进行转换,将转换为"xxxx.hxx"。同时,作者寻求关于设置Qt识别格式的方法。
摘要由CSDN通过智能技术生成

使用PYTHON转换一下包含的文件格式,OCC默认使用的 <XXXX.hxx> qt不能识别,需要转换为 "xxxx.hxx"

有知道怎么设置识别的请告诉我 谢谢


以下是python代码,从occ文件夹获取文件到qt程序下的目录

#coding=utf-8

#get the file from occ
# copy the file and change its header include

import os
import os.path
import shutil
import re


def findStr(fml_s):
    match = re.search('(^#include\s+)<(.*\.(hxx|lxx))>', fml_s)
    if match:
        ms = match.group()
        fline = chStr(fml_s)
        headername=match.group(2)
        print('find' ,match.group(2))
        print('find in line',fline)
        return True, fml_s, headername
    else:
        return False, fml_s, ''

def chStr(fml_s):
    fml_s = re.sub('<','"occ_math/',fml_s)
    fml_s=re.sub('>','"',fml_s)
    return fml_s

def getPack(fml_s): #get a package name from file name /occ defined it
    match=re.match('[a-zA-Z0-9]+',fml_s)
    #print(match.group())
    return match.group()
def rmSuffix(fml_s):
    match=re.match('(.+)\.+',fml_s)
    print(match)
    return match.group(1)


class findSons:

    filename=''
    occPath= ''
    ffn=''
    ct=0

    def __init__(self,fml_sName,fml_soccPa
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值