Skip to content

Commit

Permalink
added mview and mpview apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Botsch committed Oct 6, 2017
1 parent fa8b3bb commit 8ddf027
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
21 changes: 14 additions & 7 deletions src/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@ find_package(OpenGL REQUIRED)

if (EMSCRIPTEN)

add_executable(mview mview.cpp MeshProcessingViewer.cpp MeshProcessingViewer.h)
add_executable(mview mview.cpp data/shell.html)
target_link_libraries(mview pmp_gl pmp imgui)
set_target_properties(mview PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/obj/suzanne.obj@input.obj")
set_target_properties(mview PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/obj/bunny.off@input.off")

add_executable(subdiv subdiv.cpp)
add_executable(mpview mpview.cpp MeshProcessingViewer.cpp MeshProcessingViewer.h data/shell.html)
target_link_libraries(mpview pmp_gl pmp imgui)
set_target_properties(mpview PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/obj/bunny.off@input.off")

add_executable(subdiv subdiv.cpp data/shell.html)
target_link_libraries(subdiv pmp_gl pmp imgui)
set_target_properties(subdiv PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/obj/suzanne.obj@input.obj")

add_executable(remeshing remeshing.cpp)
add_executable(remeshing remeshing.cpp data/shell.html)
target_link_libraries(remeshing pmp_gl pmp imgui)
set_target_properties(remeshing PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-data/off/bunny.off@input.off")

else()

if(OpenGL_FOUND)
add_executable(mview mview.cpp MeshProcessingViewer.cpp MeshProcessingViewer.h data/shell.html)
add_executable(mview mview.cpp)
target_link_libraries(mview pmp_gl glew)

add_executable(eview eview.cpp EdgeSetProcessingViewer.cpp EdgeSetProcessingViewer.h data/shell.html)
add_executable(mpview mpview.cpp MeshProcessingViewer.cpp MeshProcessingViewer.h)
target_link_libraries(mpview pmp_gl glew)

add_executable(eview eview.cpp EdgeSetProcessingViewer.cpp EdgeSetProcessingViewer.h)
target_link_libraries(eview pmp_gl glew)

add_executable(pview pview.cpp PointSetProcessingViewer.cpp PointSetProcessingViewer.h data/shell.html)
add_executable(pview pview.cpp PointSetProcessingViewer.cpp PointSetProcessingViewer.h)
target_link_libraries(pview pmp_gl glew)
endif()

Expand Down
21 changes: 21 additions & 0 deletions src/apps/mpview.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//=============================================================================

#include "MeshProcessingViewer.h"

//=============================================================================

int main(int argc, char **argv)
{
MeshProcessingViewer window("MeshProcessingViewer", 800, 600);

if (argc == 2)
window.loadMesh(argv[1]);
#ifdef __EMSCRIPTEN__
else
window.loadMesh("input.off");
#endif

return window.run();
}

//=============================================================================
6 changes: 3 additions & 3 deletions src/apps/mview.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//=============================================================================

#include "MeshProcessingViewer.h"
#include <pmp/gl/MeshViewer.h>

//=============================================================================

int main(int argc, char **argv)
{
MeshProcessingViewer window("MeshProcessingViewer", 800, 600);
pmp::MeshViewer window("MeshViewer", 800, 600);

if (argc == 2)
window.loadMesh(argv[1]);
#ifdef __EMSCRIPTEN__
else
window.loadMesh("input.obj");
window.loadMesh("input.off");
#endif

return window.run();
Expand Down

0 comments on commit 8ddf027

Please sign in to comment.