Skip to content

Commit

Permalink
fixup! Implement saving/loading different formats in g2o_viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerKuemmerle committed Jul 27, 2024
1 parent 6485431 commit f87b212
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions g2o/core/io/io_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ enum class G2O_CORE_API Format {

G2O_CORE_API std::string_view to_string(g2o::io::Format format);

G2O_CORE_API struct FileFilter {
/**
* @brief FileFilter information for Open/Save Dialog
*
*/
struct G2O_CORE_API FileFilter {
FileFilter(std::string filter, Format format);
std::string filter;
Format format;
std::string filter; ///< filter string
Format format; ///< IO format
bool operator==(const FileFilter& other) const;
};

Expand Down
3 changes: 3 additions & 0 deletions unit_test/general/graph_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@ TEST(OptimizableGraphIO, FormatToString) {
g2o::io::Format::kBinary, g2o::io::Format::kJson, g2o::io::Format::kXML};
for (const auto& f : kAllFormats)
EXPECT_THAT(g2o::io::to_string(f), Not(IsEmpty()));

EXPECT_THAT(g2o::io::to_string(static_cast<g2o::io::Format>(1 << 31)),
IsEmpty());
}

0 comments on commit f87b212

Please sign in to comment.