Skip to content
Snippets Groups Projects
Commit 42129543 authored by TOSCANO RAPHAEL's avatar TOSCANO RAPHAEL
Browse files

fix: type of files that can be supported

parent 5e05bea6
Branches
No related merge requests found
#include "morphist_viewer.hpp"
#include "nfd.hpp"
#include "sdf.hpp"
#include "marching_cubes.h"
#include <filesystem>
#include <imgui.h>
#include <pmp/surface_mesh.h>
#include <pmp/io/io.h>
......@@ -29,9 +29,7 @@ void MorphistViewer::keyboard(int key, int scancode, int action, int mods)
void MorphistViewer::process_imgui()
{
NFD::Guard nfdGuard;
NFD::UniquePath outPath;
nfdfilteritem_t filterItem[1] = {{"3D Objects", "obj"}};
ImGui::Spacing();
......@@ -46,7 +44,7 @@ void MorphistViewer::process_imgui()
nfdresult_t result = NFD::OpenDialog(outPath, filterItem, 1);
if (result == NFD_OKAY) {
pmp::read(this->mesh1, outPath.get());
this->mesh1_name = outPath.get();
this->mesh1_name = std::filesystem::path( outPath.get()).filename();
}
}
ImGui::Text("%s", this->mesh1_name.c_str());
......@@ -60,7 +58,7 @@ void MorphistViewer::process_imgui()
nfdresult_t result = NFD::OpenDialog(outPath, filterItem, 1);
if (result == NFD_OKAY) {
pmp::read(this->mesh2, outPath.get());
this->mesh2_name = outPath.get();
this->mesh2_name = std::filesystem::path( outPath.get()).filename();
}
}
ImGui::Text("%s", this->mesh2_name.c_str());
......
#pragma once
#include "nfd.hpp"
#include "sdf.hpp"
#include <pmp/visualization/mesh_viewer.h>
......@@ -26,6 +27,9 @@ protected:
void process_imgui() override;
private:
NFD::Guard nfdGuard;
NFD::UniquePath outPath;
nfdfilteritem_t const filterItem[1] = {{"3D Objects", "obj,off,stl"}};
bool is_baking = false;
bool is_mesh_baked = false;
bool is_morph_playing = false;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment