File error reporting#3103
Conversation
mwestphal
left a comment
There was a problem hiding this comment.
Feel free to request a review whenever needed, top right :)
|
You are modifying libf3d public API! |
|
@Prospect138 need help moving forward ? |
b4e350c to
acc5d29
Compare
|
Looks ok to me. I agree with your suggestion of moving the enum to the |
mwestphal
left a comment
There was a problem hiding this comment.
on quick look, one change needed
mwestphal
left a comment
There was a problem hiding this comment.
starting to look good, let me know when you need a proper review by requesting a review top right.
| virtual scene& removeAllLights() = 0; | ||
|
|
||
| /** | ||
| * Return true if provided file in path uses a supported extension, exists and its content |
There was a problem hiding this comment.
please update the documentation
| #include <vtkImporter.h> | ||
| #include <vtkSmartPointer.h> | ||
|
|
||
|
|
There was a problem hiding this comment.
this should be in the header, no need for a cxx here.
| * @warning This file is used internally by the plugin SDK, it is not intended to be included | ||
| * directly by libf3d users. | ||
| */ | ||
| enum class file_availability; |
| " is not a file of a supported 3D scene file format, use force reader to force a " | ||
| "specific " | ||
| "reader"); |
There was a problem hiding this comment.
| " is not a file of a supported 3D scene file format, use force reader to force a " | |
| "specific " | |
| "reader"); | |
| " does not have an extension corresponding to a supported file format, use force reader to force a specific reader"); |
|
|
||
| const f3d::reader* reader = f3d::factory::instance()->getReader(buffer, size, forceReader); | ||
| const f3d::reader* reader = | ||
| f3d::factory::instance()->getReader(buffer, size, forceReader, skipContentCheck); |
There was a problem hiding this comment.
| f3d::factory::instance()->getReader(buffer, size, forceReader, skipContentCheck); | |
| f3d::factory::instance()->getReader(buffer, size, forceReader, this->Internals->Options.scene.skip_content_check); |
There was a problem hiding this comment.
but how can this ever work ? How is the reader selected when there is no extension and no content check ?
| .function( | ||
| "supports", | ||
| +[](f3d::scene& scene, const std::string& path) -> bool { return scene.supports(path); }) | ||
| +[](f3d::scene& scene, const std::string& path) -> bool { return scene.supports(std::filesystem(path)) == f3d::file_availability::SUPPORTED; }) |
There was a problem hiding this comment.
why would std::filesystem be needed ?
|
|
||
| ### `scene.skip_content_check` (_bool_, default: `false`) | ||
|
|
||
| Make attempt to read file without checking it's header. |
There was a problem hiding this comment.
| Make attempt to read file without checking it's header. | |
| Select reader to read file without checking its header content but only based on the file extension. |
|
|
||
| ### `--skip-content-check` (_bool_, default: `false`) | ||
|
|
||
| Make attempt to read file without checking it's header. |
There was a problem hiding this comment.
| Make attempt to read file without checking it's header. | |
| Select reader to read file without checking its header content, but only based on the file extension. |
| } | ||
| return false; | ||
| } | ||
| } // namespace f3d No newline at end of file |
|
@snoyer fyi |
Describe your changes
Add distinguish between a file of unsupported extension and a file of unsupported content on f3d load.
WIP
Issue ticket number and link if any
#3000
Checklist for finalizing the PR
.github/workflows/versions.json, I have updateddocker_timestampAI Disclosure
Continuous integration
Please write a comment to run CI, eg:
\ci fast.See here for more info.