mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-19 08:02:07 -06:00
Fixed visualization of G-code lines in G-code viewer (3D view).
Improved speed of parsing external G-code.
This commit is contained in:
parent
116fd0526b
commit
ac7674b85a
7 changed files with 163 additions and 73 deletions
|
@ -255,6 +255,19 @@ template<typename T> struct IsTriviallyCopyable { static constexpr bool value =
|
|||
template<typename T> struct IsTriviallyCopyable : public std::is_trivially_copyable<T> {};
|
||||
#endif
|
||||
|
||||
// A very lightweight ROII wrapper around C FILE.
|
||||
// The old C file API is much faster than C++ streams, thus they are recommended for processing large / huge files.
|
||||
struct FilePtr {
|
||||
FilePtr(FILE *f) : f(f) {}
|
||||
~FilePtr() { this->close(); }
|
||||
void close() {
|
||||
if (this->f) {
|
||||
::fclose(this->f);
|
||||
this->f = nullptr;
|
||||
}
|
||||
}
|
||||
FILE* f = nullptr;
|
||||
};
|
||||
|
||||
class ScopeGuard
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue