fougue / mayo

3D CAD viewer and converter based on Qt + OpenCascade
BSD 2-Clause "Simplified" License
1.34k stars 263 forks source link

"File transfer problem" Error when debug mode,but release has no problem #66

Closed dansirming closed 2 years ago

dansirming commented 3 years ago

dear expert: recently I encounter a problem! that is : some step files are opened by mayo under debug mode,pop up "File transfer problem" error prompt, but has no problem under release mode, I has positioned "src/io_occ/io_occ_caf.cpp/cafGenericReadTransfer/reader.Transfer", I am so sure that the step file is correct! the network is so bad, so step file can not upload ! can you help me ? thank you!

888.zip

dansirming commented 3 years ago

888.zip is my step file ,you can use it test,thank you !

dansirming commented 3 years ago

my environment :Qt 5.14.1, OpenCASCADE-7.5.0 Or OpenCASCADE-7.3.0

HuguesDelorme commented 3 years ago

Hello @dansirming Are you using latest version of develop branch ? I think the issue you reported is fixed with #65

HuguesDelorme commented 3 years ago

Loaded 888.STEP with Mayo built(debug) from develop branch : image

dansirming commented 3 years ago

I download "mayo-3717ef14de682ecc2f145057750d3099d3e19031",but still pop up "File transfer problem", can you tell me you use which version ? thank you very much !

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 下午5:33 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

Loaded 888.STEP with Mayo built from develop branch :

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

dansirming commented 3 years ago

I download "mayo-3717ef14de682ecc2f145057750d3099d3e19031",but still pop up "File transfer problem" under debug mode, can you tell me you use which version ? thank you very much! 2021-05-04_173656 ch !

dansirming commented 3 years ago

I download "mayo-3717ef14de682ecc2f145057750d3099d3e19031",but still pop up "File transfer problem" under debug mode,  but has no problem under release mode, can you tell me you use which version ? thank you very much! 2021-05-04_173656 ch !

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 下午5:33 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

Loaded 888.STEP with Mayo built from develop branch :

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

That seems latest version from the commit id you gave. Seems like you build Mayo with OpenCascade 7.3 ? Do you have the same issue with OpenCascade 7.5 ? This is the version I'm using(from OpenCascade's Download center)

dansirming commented 3 years ago

I Has tried many times! both OpenCascade 7.3 and OpenCascade 7.5 all pop up "File transfer problem" under debug mode

dansirming commented 3 years ago

from OpenCascade's Download center

I download it from OpenCascade's Download center and will try soon! thank you very much

HuguesDelorme commented 3 years ago

OpenCascade Download Center ; https://dev.opencascade.org/release

dansirming commented 3 years ago

I Has tried just now, from OpenCascade Download Center https://dev.opencascade.org/release,pop up "File transfer problem" under debug mode ,why has no problem under release mode?

2021-05-04_180829

dansirming commented 3 years ago

reader.Transfer return flase under debug mode! 2021-05-04_181237

dansirming commented 3 years ago

I Has tried just now, from OpenCascade Download Center https://dev.opencascade.org/release,pop up "File transfer problem" under debug mode ,why has no problem under release mode?

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 下午5:57 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

OpenCascade Download Center ; https://dev.opencascade.org/release

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

dansirming commented 3 years ago

reader.Transfer return flase under debug mode!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 下午5:57 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

OpenCascade Download Center ; https://dev.opencascade.org/release

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

dansirming commented 3 years ago

thank you for help me! Wish you all happiness, health and prosperity!!!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 下午5:57 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

OpenCascade Download Center ; https://dev.opencascade.org/release

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

Problem still exist with "official" OpenCascade binaries ? What happens if you try with Mayo v0.3 installer(see Releases page) ? Sorry that's not easy to help, as I didn't reproduce your issue on my side.

dansirming commented 3 years ago

with "official" OpenCascade binaries has no problem ,because binaries is compiled out under release mode by source code, but  with "official" OpenCascade "Mayo"  source code(as below picture) compiled out a binaries that  under debug mode ,the  issue  will reproduce ! you can download  "official" OpenCascade Mayo source code(as below picture)  and try to use 888.zip step file under debug mode ,then you can reproduce this issue,bless you good luck!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 晚上6:37 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

Problem still exist with "official" OpenCascade binaries ? What happens if you try with Mayo v0.3 installer(see Releases page) ? Sorry that's not easy to help, as I didn't reproduce your issue on my side.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

I tried with OpenCascade 7.5.0 built from source code in debug configuration: 3RDPARTY_DIR= BUILD_USE_PCH=ON BUILD_WITH_DEBUG=ON BUILD_LIBRARY_TYPE=Shared BUILD_YACCLEX=OFF USE_FFMPEG=OFF USE_FREEIMAGE=ON USE_GLES2=OFF USE_OPENVR=OFF USE_RAPIDJSON=ON USE_TBB=ON USE_VTK=OFF ...

I can open file 888.STEP without problems. Can you step into the call reader.Transfer() that returns false ? You should see what's wrong there

dansirming commented 3 years ago

“reader.Transfer()”  in the lib, I can't step into it!it just return false。  I do mayo project by Visual studio 2017 use Qt Vs Toos plug-in(Qt core is 5.14.1),  now I send my mayo project  to you,can you help me ? may be you can reproduce my issue on your side.thank you very much

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 晚上9:40 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

I tried with OpenCascade 7.5.0 built from source code in debug configuration: 3RDPARTY_DIR=<rootdir_of_official_occ7.5> BUILD_USE_PCH=ON BUILD_WITH_DEBUG=ON BUILD_LIBRARY_TYPE=Shared BUILD_YACCLEX=OFF USE_FFMPEG=OFF USE_FREEIMAGE=ON USE_GLES2=OFF USE_OPENVR=OFF USE_RAPIDJSON=ON USE_TBB=ON USE_VTK=OFF ...

I can open file 888.STEP without problems. Can you step into the call reader.Transfer() that return false ? You should see what's wrong there

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

dansirming commented 3 years ago

dear expert:      today , I  extract code from mayo project into myself project to satisfied my need , the  problems which I encountered last week has not appeared, I guess that some configs Which I maked are not correct before . thank you very much!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月4日(星期二) 晚上9:40 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

I tried with OpenCascade 7.5.0 built from source code in debug configuration: 3RDPARTY_DIR=<rootdir_of_official_occ7.5> BUILD_USE_PCH=ON BUILD_WITH_DEBUG=ON BUILD_LIBRARY_TYPE=Shared BUILD_YACCLEX=OFF USE_FFMPEG=OFF USE_FREEIMAGE=ON USE_GLES2=OFF USE_OPENVR=OFF USE_RAPIDJSON=ON USE_TBB=ON USE_VTK=OFF ...

I can open file 888.STEP without problems. Can you step into the call reader.Transfer() that return false ? You should see what's wrong there

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

arthurx70 commented 3 years ago

@dansirming,hello,can U tell me how to fix the problem, importing step file occur with transfer problem. did U compiled on win7 os? what configs U have changed?

dansirming commented 3 years ago

dear expert:      last week so busy that I has no time to send mail to you. so sorry !     last week  I  extracted code from mayo project into myself project to satisfied my need , the  problems which I encountered last week has not appeared。the max changes as follow:

//    -----------------------io_occ_step.cpp-------------------------- bool OccStepReader::readFile(const FilePath& filepath, TaskProgress* progress) {     MayoIO_CafGlobalScopedLock(cafLock);

// 以下两句代码不要,否则debug模式下,有的文件打开会报错,release版则不会

    OccStaticVariablesRollback rollback;     //this->changeStaticVariables(&rollback);     return Private::cafReadFile(m_reader, filepath, progress); }

//    -----------------------io_occ_step.cpp-------------------------- bool OccStepReader::transfer(DocumentPtr doc, TaskProgress* progress) {     MayoIO_CafGlobalScopedLock(cafLock);

// 以下两句代码不要,否则debug模式下,有的文件打开会报错,release版则不会

   OccStaticVariablesRollback rollback;    // this->changeStaticVariables(&rollback);     return Private::cafTransfer(m_reader, doc, progress); }

// --------------- my main widget class,   super3DShowWnd.cpp super3DShowWnd::super3DShowWnd(GuiApplication pGuiApp, QWidget parent) : QWidget(parent), m_guiApp(pGuiApp) { ui.setupUi(this);

    this-&gt;setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
    setAttribute(Qt::WA_AcceptTouchEvents);

    app-&gt;settings()-&gt;resetAll();
    app-&gt;settings()-&gt;load();

}

I canceled the red codes in the “io_occ_step.cpp” and  remove  "settings()->load()"  to the my main widget class ,  the  problems  has not appeared ! I tried to do that in mayo project, the  problems  has  still  appeared! my environment as follow:

vs 2017、Qt 5.14.1、qt-vsaddin-msvc2017-2.4.1-rev.12.vsix,OpenCASCADE-7.5.0-vc14-64   Or  OpenCASCADE-7.3.0-vc14-64

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月11日(星期二) 晚上10:31 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

@dansirming,hello,can U tell me how to fix the problem, importing step file occur with transfer problem. did U compiled on win7 os? what configs U have changed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

@dansirming One easy thing that's worth trying : edit settings in Mayo (menu Tools->Options) and restore default values for the "Import/STEP" section image

dansirming commented 3 years ago

I tried, but all the same!!!,the problem still  appear!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月17日(星期一) 下午4:52 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

@dansirming One easy thing that's worth trying : edit settings in Mayo (menu Tools->Options) and restore default values for the "Import/STEP" section

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

I've provided in develop branch a related fix(commit 5f71dd6) Let me know if it fixes your problem. Make sure, after compilation, to reset Import/STEP options to default values on first run(Tools->Options)

dansirming commented 3 years ago

today, I tried,the last question has fixed! thank you very much!  but when I use opencascade-7.5.0 to bulid mayo, some link errors as follows:

I has added all libraries which that  are located  “opencascade-7.5.0\win64\vc14\lib”   to mayo project,but all the same!  I remove the code  of "if OCC_VERSION_HEX >= OCC_VERSION_CHECK(7, 4, 0)" in "io_occ.cpp", the question  disappear and never show up, can you help me to fix the question? thank you very much!!!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年5月28日(星期五) 下午4:13 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

I've provided in develop branch a related fix(commit 5f71dd6) Let me know if it fixes your problem. Make sure, after compilation, to reset Import/STEP options to default values on first run(Tools->Options)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

@dansirming I can't see the link errors in your last comment.

dansirming commented 3 years ago

the link errors show in the pictures, can you help me ? thanks! ------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年6月6日(星期天) 晚上6:36 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

@dansirming I can't see the link errors in your last comment.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

@dansirming Link errors in the pictures ? But where are those pictures ?

dansirming commented 3 years ago

pictures that in the Email attachment!but I don't know why you can't see them! now I past link errrors as follow:

: 无法解析的外部符号 "public: cdecl Mayo::IO::OccGltfReader::OccGltfReader(void)" (??0OccGltfReader@IO@Mayo@@QEAA@XZ),该符号在函数 "class std::unique_ptr<class Mayo::IO::OccGltfReader,struct std::default_delete<class Mayo::IO::OccGltfReader> > cdecl std::make_unique<class Mayo::IO::OccGltfReader,0>(void)" (??$make_unique@VOccGltfReader@IO@Mayo@@$$V$0A@@std@@YA?AV?$unique_ptr@VOccGltfReader@IO@Mayo@@U?$default_delete@VOccGltfReader@IO@Mayo@@@std@@@0@XZ) 中被引用 1>io_occ.obj : error LNK2019: 无法解析的外部符号 "public: static class std::unique_ptr<class Mayo::PropertyGroup,struct std::default_delete<class Mayo::PropertyGroup> > cdecl Mayo::IO::OccGltfReader::createProperties(class Mayo::PropertyGroup *)" (?createProperties@OccGltfReader@IO@Mayo@@SA?AV?$unique_ptr@VPropertyGroup@Mayo@@U?$default_delete@VPropertyGroup@Mayo@@@std@@@std@@@.***@@Z),该符号在函数 "public: virtual class std::unique_ptr<class Mayo::PropertyGroup,struct std::default_delete<class Mayo::PropertyGroup> > cdecl Mayo::IO::OccFactoryReader::createProperties(struct Mayo::IO::Format const &,class Mayo::PropertyGroup *)const " (?createProperties@OccFactoryReader@IO@Mayo@@UEBA?AV?$unique_ptr@VPropertyGroup@Mayo@@U?$default_delete@VPropertyGroup@Mayo@@@std@@@std@@@.@@.@@Z) 中被引用 1>io_occ.obj : error LNK2019: 无法解析的外部符号 "public: cdecl Mayo::IO::OccObjReader::OccObjReader(void)" (??0OccObjReader@IO@Mayo@@QEAA@XZ),该符号在函数 "class std::unique_ptr<class Mayo::IO::OccObjReader,struct std::default_delete<class Mayo::IO::OccObjReader> > cdecl std::make_unique<class Mayo::IO::OccObjReader,0>(void)" (??$make_unique@VOccObjReader@IO@Mayo@@$$V$0A@@std@@YA?AV?$unique_ptr@VOccObjReader@IO@Mayo@@U?$default_delete@VOccObjReader@IO@Mayo@@@std@@@0@XZ) 中被引用 1>io_occ.obj : error LNK2019: 无法解析的外部符号 "public: static class std::unique_ptr<class Mayo::PropertyGroup,struct std::default_delete<class Mayo::PropertyGroup> > cdecl Mayo::IO::OccObjReader::createProperties(class Mayo::PropertyGroup *)" (?createProperties@OccObjReader@IO@Mayo@@SA?AV?$unique_ptr@VPropertyGroup@Mayo@@U?$default_delete@VPropertyGroup@Mayo@@@std@@@std@@@.***@@Z),该符号在函数 "public: virtual class std::unique_ptr<class Mayo::PropertyGroup,struct std::default_delete<class Mayo::PropertyGroup> > cdecl Mayo::IO::OccFactoryReader::createProperties(struct Mayo::IO::Format const &,class Mayo::PropertyGroup *)const " (?createProperties@OccFactoryReader@IO@Mayo@@UEBA?AV?$unique_ptr@VPropertyGroup@Mayo@@U?$default_delete@VPropertyGroup@Mayo@@@std@@@std@@@.@@.@@Z) 中被引用 1>io_occ.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool cdecl Mayo::IO::OccGltfWriter::transfer(class gsl::span<class Mayo::ApplicationItem const ,-1>,class Mayo::TaskProgress *)" (?transfer@OccGltfWriter@IO@Mayo@@UEAA_NV?$span@$$CBVApplicationItem@Mayo@@@.@@@.@@Z) 1>io_occ.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool cdecl Mayo::IO::OccGltfWriter::writeFile(class std::filesystem::path const &,class Mayo::TaskProgress *)" (?writeFile@OccGltfWriter@IO@Mayo@@@.@std@@@.@@Z) 1>io_occ.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl Mayo::IO::OccGltfWriter::applyProperties(class Mayo::PropertyGroup const *)" (?applyProperties@OccGltfWriter@IO@Mayo@@@.***@@Z)

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年6月7日(星期一) 下午2:49 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

@dansirming Link errors in the pictures ? But where are those pictures ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

Make sure your git working copy is clean(no pending change) and try to rebuild again ? The Windows/MSVC appveyor CI is fine so you shouldn't have any problem with building Mayo develop branch

dansirming commented 3 years ago

I have clean many times,but the link error all the same! what is "The Windows/MSVC appveyor CI"? I I've never heard of it, can you help me to install it , thank you very much!   the link error that is in the "io_occ.cpp" ,  it seem that  can not find the libraries  about OccObjReader or about  OccGltfReader

std::unique_ptr<Reader> OccFactoryReader::create(const Format& format) const {     if (format == Format_STEP)         return std::make_unique<OccStepReader>();     if (format == Format_IGES)         return std::make_unique<OccIgesReader>();     if (format == Format_OCCBREP)         return std::make_unique<OccBRepReader>();     if (format == Format_STL)         return std::make_unique<OccStlReader>();

// the  following code will produce some link erros

if OCC_VERSION_HEX >= OCC_VERSION_CHECK(7, 4, 0)

    if (format == Format_GLTF)         return std::make_unique<OccGltfReader>();     if (format == Format_OBJ)         return std::make_unique<OccObjReader>();

endif

    return {}; } 

PtrPropertyGroup OccFactoryReader::createProperties(const Format& format, PropertyGroup* parentGroup) const {     if (format == Format_STEP)         return OccStepReader::createProperties(parentGroup);     if (format == Format_IGES)         return OccIgesReader::createProperties(parentGroup);

// the  following code will produce some link erros

if OCC_VERSION_HEX >= OCC_VERSION_CHECK(7, 4, 0)

    if (format == Format_GLTF)         return OccGltfReader::createProperties(parentGroup);     if (format == Format_OBJ)         return OccObjReader::createProperties(parentGroup);

endif

    return {}; }

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年6月8日(星期二) 晚上11:47 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

Make sure your git working copy is clean(no pending change) and try to rebuild again ? The Windows/MSVC appveyor CI is fine so you shouldn't have any problem with building Mayo develop branch

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

Hello @dansirming

Sorry for those build problems, though I'm not 100% sure they're caused by me! What I would like to be sure of is that you don't have any pending change on the Mayo source files that would provoke build errors. Again your git working copy should be "in sync" with the remote develop branch.

The Windows/MSVC appveyor CI is the Continuous Integration provided by appveyor for Mayo : each time some changes are pushed to develop branch then it triggers a remote build in appveyor(see last one) It's kind of automatic builds, I've configured a "release" build for OpenCascade 7.4.0 and 7.5.0

If the problem still persists then I can propose you to have a phone call next monday through eg Skype so you can screen share the issue.

dansirming commented 3 years ago

today, I have found  a new problem!  when I imported some steps into mayo ,but it is not in the center of view, it is situated in the left top corner. it is not perfect! it is difficult to use。the test step file in the  mail attachments。can you help me ?

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年6月12日(星期六) 晚上10:26 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

Hello @dansirming

Sorry for those build problems, though I'm not 100% sure they're caused by me! What I would like to be sure of is that you don't have any pending change on the Mayo source files that would provoke build errors. Again your git working copy should be "in sync" with the remote develop branch.

The Windows/MSVC appveyor CI is the Continuous Integration provided by appveyor for Mayo : each time some changes are pushed to develop branch then it triggers a remote build in appveyor(see last one) It's kind of automatic builds, I've configured a "release" build for OpenCascade 7.4.0 and 7.5.0

If the problem still persists then I can propose you to have a phone call next monday through eg Skype so you can screen share the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

HuguesDelorme commented 3 years ago

This is an unrelated problem, please create another issue for that and please provide the STEP file

dansirming commented 3 years ago

ok, thanks!

------------------ 原始邮件 ------------------ 发件人: "fougue/mayo" @.>; 发送时间: 2021年6月15日(星期二) 凌晨5:13 @.>; @.**@.>; 主题: Re: [fougue/mayo] "File transfer problem" Error when debug mode,but release has no problem (#66)

This is an unrelated problem, please create another issue for that and please provide the STEP file

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.