Skip to content

Commit 7a34b74

Browse files
committed
fix(Input): warns about input consistency
1 parent c732361 commit 7a34b74

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

include/geode/mesh/io/input.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#pragma once
2525

26+
#include <geode/basic/logger.h>
27+
2628
#include <geode/mesh/common.h>
2729
#include <geode/mesh/io/io.h>
2830

@@ -34,7 +36,32 @@ namespace geode
3436
public:
3537
virtual Mesh read( const Args&... args ) = 0;
3638

39+
~Input()
40+
{
41+
if( inspect_required_ )
42+
{
43+
geode::Logger::warn(
44+
"[Input] The file loader notified INCONSISTENCIES in the "
45+
"given data file. In consequence, the loaded structure is "
46+
"likely BROKEN, and there is NO GUARENTEE that any further "
47+
"operation will work on it without repairing it first. We "
48+
"highly recommend inspecting the data to make sure these "
49+
"inconsistencies do not impact your following work. To do "
50+
"so, you can for example usethe Open-Source "
51+
"OpenGeode-Inspector or the online free tool: "
52+
"https://geode-solutions.com/tools/validitychecker" );
53+
}
54+
}
55+
3756
protected:
3857
Input( absl::string_view filename ) : IOFile( filename ) {}
58+
59+
void need_to_inspect_result()
60+
{
61+
inspect_required_ = true;
62+
}
63+
64+
private:
65+
bool inspect_required_{ false };
3966
};
4067
} // namespace geode

0 commit comments

Comments
 (0)